@must-b/must-b 1.63.0 → 1.64.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.
@@ -1,4 +1,4 @@
1
- function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Gm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Km={exports:{}},zo={},qm={exports:{}},ne={};/**
1
+ function z1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Gm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Km={exports:{}},zo={},qm={exports:{}},ne={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Wi=Symbol.for("react.element"),O1=Symbol.for("react.portal"),D1=Symbol.for("react.fragment"),I1=Symbol.for("react.strict_mode"),B1=Symbol.for("react.profiler"),F1=Symbol.for("react.provider"),V1=Symbol.for("react.context"),$1=Symbol.for("react.forward_ref"),U1=Symbol.for("react.suspense"),H1=Symbol.for("react.memo"),W1=Symbol.for("react.lazy"),Ph=Symbol.iterator;function G1(e){return e===null||typeof e!="object"?null:(e=Ph&&e[Ph]||e["@@iterator"],typeof e=="function"?e:null)}var Ym={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xm=Object.assign,Qm={};function Cr(e,t,n){this.props=e,this.context=t,this.refs=Qm,this.updater=n||Ym}Cr.prototype.isReactComponent={};Cr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jm(){}Jm.prototype=Cr.prototype;function Ru(e,t,n){this.props=e,this.context=t,this.refs=Qm,this.updater=n||Ym}var Lu=Ru.prototype=new Jm;Lu.constructor=Ru;Xm(Lu,Cr.prototype);Lu.isPureReactComponent=!0;var Ah=Array.isArray,Zm=Object.prototype.hasOwnProperty,Ou={current:null},e0={key:!0,ref:!0,__self:!0,__source:!0};function t0(e,t,n){var s,i={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)Zm.call(t,s)&&!e0.hasOwnProperty(s)&&(i[s]=t[s]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)i[s]===void 0&&(i[s]=l[s]);return{$$typeof:Wi,type:e,key:a,ref:o,props:i,_owner:Ou.current}}function K1(e,t){return{$$typeof:Wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Du(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wi}function q1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mh=/\/+/g;function ml(e,t){return typeof e=="object"&&e!==null&&e.key!=null?q1(""+e.key):t.toString(36)}function La(e,t,n,s,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Wi:case O1:o=!0}}if(o)return o=e,i=i(o),e=s===""?"."+ml(o,0):s,Ah(i)?(n="",e!=null&&(n=e.replace(Mh,"$&/")+"/"),La(i,t,n,"",function(u){return u})):i!=null&&(Du(i)&&(i=K1(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Mh,"$&/")+"/")+e)),t.push(i)),1;if(o=0,s=s===""?".":s+":",Ah(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+ml(a,l);o+=La(a,t,n,c,i)}else if(c=G1(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+ml(a,l++),o+=La(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function oa(e,t,n){if(e==null)return e;var s=[],i=0;return La(e,s,"","",function(a){return t.call(n,a,i++)}),s}function Y1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},Oa={transition:null},X1={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:Oa,ReactCurrentOwner:Ou};function n0(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:oa,forEach:function(e,t,n){oa(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oa(e,function(){t++}),t},toArray:function(e){return oa(e,function(t){return t})||[]},only:function(e){if(!Du(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Cr;ne.Fragment=D1;ne.Profiler=B1;ne.PureComponent=Ru;ne.StrictMode=I1;ne.Suspense=U1;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X1;ne.act=n0;ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Xm({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Ou.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Zm.call(t,c)&&!e0.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Wi,type:e.type,key:i,ref:a,props:s,_owner:o}};ne.createContext=function(e){return e={$$typeof:V1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:F1,_context:e},e.Consumer=e};ne.createElement=t0;ne.createFactory=function(e){var t=t0.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:$1,render:e}};ne.isValidElement=Du;ne.lazy=function(e){return{$$typeof:W1,_payload:{_status:-1,_result:e},_init:Y1}};ne.memo=function(e,t){return{$$typeof:H1,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Oa.transition;Oa.transition={};try{e()}finally{Oa.transition=t}};ne.unstable_act=n0;ne.useCallback=function(e,t){return rt.current.useCallback(e,t)};ne.useContext=function(e){return rt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return rt.current.useEffect(e,t)};ne.useId=function(){return rt.current.useId()};ne.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return rt.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ne.useRef=function(e){return rt.current.useRef(e)};ne.useState=function(e){return rt.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return rt.current.useTransition()};ne.version="18.3.1";qm.exports=ne;var f=qm.exports;const H=Gm(f),Q1=L1({__proto__:null,default:H},[f]);/**
9
+ */var Wi=Symbol.for("react.element"),R1=Symbol.for("react.portal"),L1=Symbol.for("react.fragment"),O1=Symbol.for("react.strict_mode"),D1=Symbol.for("react.profiler"),I1=Symbol.for("react.provider"),B1=Symbol.for("react.context"),F1=Symbol.for("react.forward_ref"),V1=Symbol.for("react.suspense"),$1=Symbol.for("react.memo"),U1=Symbol.for("react.lazy"),Ph=Symbol.iterator;function H1(e){return e===null||typeof e!="object"?null:(e=Ph&&e[Ph]||e["@@iterator"],typeof e=="function"?e:null)}var Ym={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xm=Object.assign,Qm={};function Cr(e,t,n){this.props=e,this.context=t,this.refs=Qm,this.updater=n||Ym}Cr.prototype.isReactComponent={};Cr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jm(){}Jm.prototype=Cr.prototype;function Ru(e,t,n){this.props=e,this.context=t,this.refs=Qm,this.updater=n||Ym}var Lu=Ru.prototype=new Jm;Lu.constructor=Ru;Xm(Lu,Cr.prototype);Lu.isPureReactComponent=!0;var Ah=Array.isArray,Zm=Object.prototype.hasOwnProperty,Ou={current:null},e0={key:!0,ref:!0,__self:!0,__source:!0};function t0(e,t,n){var s,i={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)Zm.call(t,s)&&!e0.hasOwnProperty(s)&&(i[s]=t[s]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)i[s]===void 0&&(i[s]=l[s]);return{$$typeof:Wi,type:e,key:a,ref:o,props:i,_owner:Ou.current}}function W1(e,t){return{$$typeof:Wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Du(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wi}function G1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mh=/\/+/g;function ml(e,t){return typeof e=="object"&&e!==null&&e.key!=null?G1(""+e.key):t.toString(36)}function La(e,t,n,s,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Wi:case R1:o=!0}}if(o)return o=e,i=i(o),e=s===""?"."+ml(o,0):s,Ah(i)?(n="",e!=null&&(n=e.replace(Mh,"$&/")+"/"),La(i,t,n,"",function(u){return u})):i!=null&&(Du(i)&&(i=W1(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Mh,"$&/")+"/")+e)),t.push(i)),1;if(o=0,s=s===""?".":s+":",Ah(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+ml(a,l);o+=La(a,t,n,c,i)}else if(c=H1(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+ml(a,l++),o+=La(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function oa(e,t,n){if(e==null)return e;var s=[],i=0;return La(e,s,"","",function(a){return t.call(n,a,i++)}),s}function K1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},Oa={transition:null},q1={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:Oa,ReactCurrentOwner:Ou};function n0(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:oa,forEach:function(e,t,n){oa(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oa(e,function(){t++}),t},toArray:function(e){return oa(e,function(t){return t})||[]},only:function(e){if(!Du(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Cr;ne.Fragment=L1;ne.Profiler=D1;ne.PureComponent=Ru;ne.StrictMode=O1;ne.Suspense=V1;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q1;ne.act=n0;ne.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Xm({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Ou.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Zm.call(t,c)&&!e0.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Wi,type:e.type,key:i,ref:a,props:s,_owner:o}};ne.createContext=function(e){return e={$$typeof:B1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:I1,_context:e},e.Consumer=e};ne.createElement=t0;ne.createFactory=function(e){var t=t0.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:F1,render:e}};ne.isValidElement=Du;ne.lazy=function(e){return{$$typeof:U1,_payload:{_status:-1,_result:e},_init:K1}};ne.memo=function(e,t){return{$$typeof:$1,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Oa.transition;Oa.transition={};try{e()}finally{Oa.transition=t}};ne.unstable_act=n0;ne.useCallback=function(e,t){return rt.current.useCallback(e,t)};ne.useContext=function(e){return rt.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ne.useEffect=function(e,t){return rt.current.useEffect(e,t)};ne.useId=function(){return rt.current.useId()};ne.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return rt.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ne.useRef=function(e){return rt.current.useRef(e)};ne.useState=function(e){return rt.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return rt.current.useTransition()};ne.version="18.3.1";qm.exports=ne;var f=qm.exports;const H=Gm(f),Y1=z1({__proto__:null,default:H},[f]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var J1=f,Z1=Symbol.for("react.element"),ev=Symbol.for("react.fragment"),tv=Object.prototype.hasOwnProperty,nv=J1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sv={key:!0,ref:!0,__self:!0,__source:!0};function s0(e,t,n){var s,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)tv.call(t,s)&&!sv.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)i[s]===void 0&&(i[s]=t[s]);return{$$typeof:Z1,type:e,key:a,ref:o,props:i,_owner:nv.current}}zo.Fragment=ev;zo.jsx=s0;zo.jsxs=s0;Km.exports=zo;var r=Km.exports,r0={exports:{}},bt={},i0={exports:{}},a0={};/**
17
+ */var X1=f,Q1=Symbol.for("react.element"),J1=Symbol.for("react.fragment"),Z1=Object.prototype.hasOwnProperty,ev=X1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tv={key:!0,ref:!0,__self:!0,__source:!0};function s0(e,t,n){var s,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Z1.call(t,s)&&!tv.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)i[s]===void 0&&(i[s]=t[s]);return{$$typeof:Q1,type:e,key:a,ref:o,props:i,_owner:ev.current}}zo.Fragment=J1;zo.jsx=s0;zo.jsxs=s0;Km.exports=zo;var r=Km.exports,r0={exports:{}},bt={},i0={exports:{}},a0={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(E,R){var B=E.length;E.push(R);e:for(;0<B;){var Z=B-1>>>1,K=E[Z];if(0<i(K,R))E[Z]=R,E[B]=K,B=Z;else break e}}function n(E){return E.length===0?null:E[0]}function s(E){if(E.length===0)return null;var R=E[0],B=E.pop();if(B!==R){E[0]=B;e:for(var Z=0,K=E.length,ie=K>>>1;Z<ie;){var te=2*(Z+1)-1,ce=E[te],fe=te+1,ae=E[fe];if(0>i(ce,B))fe<K&&0>i(ae,ce)?(E[Z]=ae,E[fe]=B,Z=fe):(E[Z]=ce,E[te]=B,Z=te);else if(fe<K&&0>i(ae,B))E[Z]=ae,E[fe]=B,Z=fe;else break e}}return R}function i(E,R){var B=E.sortIndex-R.sortIndex;return B!==0?B:E.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,v=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(E){for(var R=n(u);R!==null;){if(R.callback===null)s(u);else if(R.startTime<=E)s(u),R.sortIndex=R.expirationTime,t(c,R);else break;R=n(u)}}function C(E){if(w=!1,k(E),!v)if(n(c)!==null)v=!0,z(j);else{var R=n(u);R!==null&&V(C,R.startTime-E)}}function j(E,R){v=!1,w&&(w=!1,g(N),N=-1),m=!0;var B=h;try{for(k(R),p=n(c);p!==null&&(!(p.expirationTime>R)||E&&!T());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,h=p.priorityLevel;var K=Z(p.expirationTime<=R);R=e.unstable_now(),typeof K=="function"?p.callback=K:p===n(c)&&s(c),k(R)}else s(c);p=n(c)}if(p!==null)var ie=!0;else{var te=n(u);te!==null&&V(C,te.startTime-R),ie=!1}return ie}finally{p=null,h=B,m=!1}}var S=!1,y=null,N=-1,P=5,_=-1;function T(){return!(e.unstable_now()-_<P)}function O(){if(y!==null){var E=e.unstable_now();_=E;var R=!0;try{R=y(!0,E)}finally{R?F():(S=!1,y=null)}}else S=!1}var F;if(typeof x=="function")F=function(){x(O)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,M=D.port2;D.port1.onmessage=O,F=function(){M.postMessage(null)}}else F=function(){b(O,0)};function z(E){y=E,S||(S=!0,F())}function V(E,R){N=b(function(){E(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,z(j))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(E){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var B=h;h=R;try{return E()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,R){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var B=h;h=E;try{return R()}finally{h=B}},e.unstable_scheduleCallback=function(E,R,B){var Z=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?Z+B:Z):B=Z,E){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=B+K,E={id:d++,callback:R,priorityLevel:E,startTime:B,expirationTime:K,sortIndex:-1},B>Z?(E.sortIndex=B,t(u,E),n(c)===null&&E===n(u)&&(w?(g(N),N=-1):w=!0,V(C,B-Z))):(E.sortIndex=K,t(c,E),v||m||(v=!0,z(j))),E},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(E){var R=h;return function(){var B=h;h=R;try{return E.apply(this,arguments)}finally{h=B}}}})(a0);i0.exports=a0;var rv=i0.exports;/**
25
+ */(function(e){function t(T,R){var B=T.length;T.push(R);e:for(;0<B;){var Z=B-1>>>1,K=T[Z];if(0<i(K,R))T[Z]=R,T[B]=K,B=Z;else break e}}function n(T){return T.length===0?null:T[0]}function s(T){if(T.length===0)return null;var R=T[0],B=T.pop();if(B!==R){T[0]=B;e:for(var Z=0,K=T.length,re=K>>>1;Z<re;){var te=2*(Z+1)-1,ce=T[te],fe=te+1,ie=T[fe];if(0>i(ce,B))fe<K&&0>i(ie,ce)?(T[Z]=ie,T[fe]=B,Z=fe):(T[Z]=ce,T[te]=B,Z=te);else if(fe<K&&0>i(ie,B))T[Z]=ie,T[fe]=B,Z=fe;else break e}}return R}function i(T,R){var B=T.sortIndex-R.sortIndex;return B!==0?B:T.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,y=!1,w=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(T){for(var R=n(u);R!==null;){if(R.callback===null)s(u);else if(R.startTime<=T)s(u),R.sortIndex=R.expirationTime,t(c,R);else break;R=n(u)}}function j(T){if(w=!1,k(T),!y)if(n(c)!==null)y=!0,z(b);else{var R=n(u);R!==null&&V(j,R.startTime-T)}}function b(T,R){y=!1,w&&(w=!1,g(C),C=-1),m=!0;var B=h;try{for(k(R),p=n(c);p!==null&&(!(p.expirationTime>R)||T&&!P());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,h=p.priorityLevel;var K=Z(p.expirationTime<=R);R=e.unstable_now(),typeof K=="function"?p.callback=K:p===n(c)&&s(c),k(R)}else s(c);p=n(c)}if(p!==null)var re=!0;else{var te=n(u);te!==null&&V(j,te.startTime-R),re=!1}return re}finally{p=null,h=B,m=!1}}var S=!1,N=null,C=-1,_=5,E=-1;function P(){return!(e.unstable_now()-E<_)}function O(){if(N!==null){var T=e.unstable_now();E=T;var R=!0;try{R=N(!0,T)}finally{R?F():(S=!1,N=null)}}else S=!1}var F;if(typeof x=="function")F=function(){x(O)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,M=D.port2;D.port1.onmessage=O,F=function(){M.postMessage(null)}}else F=function(){v(O,0)};function z(T){N=T,S||(S=!0,F())}function V(T,R){C=v(function(){T(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,z(b))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var B=h;h=R;try{return T()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,R){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var B=h;h=T;try{return R()}finally{h=B}},e.unstable_scheduleCallback=function(T,R,B){var Z=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?Z+B:Z):B=Z,T){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=B+K,T={id:d++,callback:R,priorityLevel:T,startTime:B,expirationTime:K,sortIndex:-1},B>Z?(T.sortIndex=B,t(u,T),n(c)===null&&T===n(u)&&(w?(g(C),C=-1):w=!0,V(j,B-Z))):(T.sortIndex=K,t(c,T),y||m||(y=!0,z(b))),T},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(T){var R=h;return function(){var B=h;h=R;try{return T.apply(this,arguments)}finally{h=B}}}})(a0);i0.exports=a0;var nv=i0.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ function L1(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var iv=f,yt=rv;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var o0=new Set,yi={};function As(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(yi[e]=t,e=0;e<t.length;e++)o0.add(t[e])}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=Object.prototype.hasOwnProperty,av=/^[: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]*$/,zh={},Rh={};function ov(e){return hc.call(Rh,e)?!0:hc.call(zh,e)?!1:av.test(e)?Rh[e]=!0:(zh[e]=!0,!1)}function lv(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cv(e,t,n,s){if(t===null||typeof t>"u"||lv(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function it(e,t,n,s,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new it(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){He[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iu=/[\-:]([a-z])/g;function Bu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Iu,Bu);He[t]=new it(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Iu,Bu);He[t]=new it(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Iu,Bu);He[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fu(e,t,n,s){var i=He.hasOwnProperty(t)?He[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cv(t,n,i,s)&&(n=null),s||i===null?ov(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,s=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Cn=iv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,la=Symbol.for("react.element"),Ws=Symbol.for("react.portal"),Gs=Symbol.for("react.fragment"),Vu=Symbol.for("react.strict_mode"),pc=Symbol.for("react.profiler"),l0=Symbol.for("react.provider"),c0=Symbol.for("react.context"),$u=Symbol.for("react.forward_ref"),fc=Symbol.for("react.suspense"),mc=Symbol.for("react.suspense_list"),Uu=Symbol.for("react.memo"),zn=Symbol.for("react.lazy"),u0=Symbol.for("react.offscreen"),Lh=Symbol.iterator;function Dr(e){return e===null||typeof e!="object"?null:(e=Lh&&e[Lh]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,gl;function qr(e){if(gl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gl=t&&t[1]||""}return`
33
+ */var sv=f,yt=nv;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var o0=new Set,yi={};function As(e,t){fr(e,t),fr(e+"Capture",t)}function fr(e,t){for(yi[e]=t,e=0;e<t.length;e++)o0.add(t[e])}var vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=Object.prototype.hasOwnProperty,rv=/^[: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]*$/,zh={},Rh={};function iv(e){return hc.call(Rh,e)?!0:hc.call(zh,e)?!1:rv.test(e)?Rh[e]=!0:(zh[e]=!0,!1)}function av(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ov(e,t,n,s){if(t===null||typeof t>"u"||av(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function it(e,t,n,s,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new it(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ue[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ue[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ue[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iu=/[\-:]([a-z])/g;function Bu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Iu,Bu);Ue[t]=new it(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Iu,Bu);Ue[t]=new it(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Iu,Bu);Ue[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ue[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fu(e,t,n,s){var i=Ue.hasOwnProperty(t)?Ue[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ov(t,n,i,s)&&(n=null),s||i===null?iv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,s=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Cn=sv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,la=Symbol.for("react.element"),Ws=Symbol.for("react.portal"),Gs=Symbol.for("react.fragment"),Vu=Symbol.for("react.strict_mode"),pc=Symbol.for("react.profiler"),l0=Symbol.for("react.provider"),c0=Symbol.for("react.context"),$u=Symbol.for("react.forward_ref"),fc=Symbol.for("react.suspense"),mc=Symbol.for("react.suspense_list"),Uu=Symbol.for("react.memo"),zn=Symbol.for("react.lazy"),u0=Symbol.for("react.offscreen"),Lh=Symbol.iterator;function Dr(e){return e===null||typeof e!="object"?null:(e=Lh&&e[Lh]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,gl;function qr(e){if(gl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gl=t&&t[1]||""}return`
34
34
  `+gl+e}var xl=!1;function yl(e,t){if(!e||xl)return"";xl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
35
  `),a=s.stack.split(`
36
36
  `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=`
37
- `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{xl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qr(e):""}function uv(e){switch(e.tag){case 5:return qr(e.type);case 16:return qr("Lazy");case 13:return qr("Suspense");case 19:return qr("SuspenseList");case 0:case 2:case 15:return e=yl(e.type,!1),e;case 11:return e=yl(e.type.render,!1),e;case 1:return e=yl(e.type,!0),e;default:return""}}function gc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gs:return"Fragment";case Ws:return"Portal";case pc:return"Profiler";case Vu:return"StrictMode";case fc:return"Suspense";case mc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c0:return(e.displayName||"Context")+".Consumer";case l0:return(e._context.displayName||"Context")+".Provider";case $u:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uu:return t=e.displayName||null,t!==null?t:gc(e.type)||"Memo";case zn:t=e._payload,e=e._init;try{return gc(e(t))}catch{}}return null}function dv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gc(t);case 8:return t===Vu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function d0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hv(e){var t=d0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ca(e){e._valueTracker||(e._valueTracker=hv(e))}function h0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=d0(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function eo(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 xc(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Oh(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Xn(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function p0(e,t){t=t.checked,t!=null&&Fu(e,"checked",t,!1)}function yc(e,t){p0(e,t);var n=Xn(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vc(e,t.type,n):t.hasOwnProperty("defaultValue")&&vc(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vc(e,t,n){(t!=="number"||eo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yr=Array.isArray;function lr(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Xn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function bc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ih(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(Yr(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xn(n)}}function f0(e,t){var n=Xn(t.value),s=Xn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Bh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function m0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?m0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ua,g0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ua=ua||document.createElement("div"),ua.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ua.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var si={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pv=["Webkit","ms","Moz","O"];Object.keys(si).forEach(function(e){pv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),si[t]=si[e]})});function x0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||si.hasOwnProperty(e)&&si[e]?(""+t).trim():t+"px"}function y0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=x0(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var fv=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kc(e,t){if(t){if(fv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function jc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Nc=null;function Hu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sc=null,cr=null,ur=null;function Fh(e){if(e=qi(e)){if(typeof Sc!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Io(t),Sc(e.stateNode,e.type,t))}}function v0(e){cr?ur?ur.push(e):ur=[e]:cr=e}function b0(){if(cr){var e=cr,t=ur;if(ur=cr=null,Fh(e),t)for(e=0;e<t.length;e++)Fh(t[e])}}function w0(e,t){return e(t)}function k0(){}var vl=!1;function j0(e,t,n){if(vl)return e(t,n);vl=!0;try{return w0(e,t,n)}finally{vl=!1,(cr!==null||ur!==null)&&(k0(),b0())}}function bi(e,t){var n=e.stateNode;if(n===null)return null;var s=Io(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var Cc=!1;if(wn)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{Cc=!1}function mv(e,t,n,s,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ri=!1,to=null,no=!1,_c=null,gv={onError:function(e){ri=!0,to=e}};function xv(e,t,n,s,i,a,o,l,c){ri=!1,to=null,mv.apply(gv,arguments)}function yv(e,t,n,s,i,a,o,l,c){if(xv.apply(this,arguments),ri){if(ri){var u=to;ri=!1,to=null}else throw Error(I(198));no||(no=!0,_c=u)}}function Ms(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function N0(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 Vh(e){if(Ms(e)!==e)throw Error(I(188))}function vv(e){var t=e.alternate;if(!t){if(t=Ms(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Vh(i),e;if(a===s)return Vh(i),t;a=a.sibling}throw Error(I(188))}if(n.return!==s.return)n=i,s=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function S0(e){return e=vv(e),e!==null?C0(e):null}function C0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=C0(e);if(t!==null)return t;e=e.sibling}return null}var _0=yt.unstable_scheduleCallback,$h=yt.unstable_cancelCallback,bv=yt.unstable_shouldYield,wv=yt.unstable_requestPaint,Pe=yt.unstable_now,kv=yt.unstable_getCurrentPriorityLevel,Wu=yt.unstable_ImmediatePriority,E0=yt.unstable_UserBlockingPriority,so=yt.unstable_NormalPriority,jv=yt.unstable_LowPriority,T0=yt.unstable_IdlePriority,Ro=null,tn=null;function Nv(e){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Ro,e,void 0,(e.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:_v,Sv=Math.log,Cv=Math.LN2;function _v(e){return e>>>=0,e===0?32:31-(Sv(e)/Cv|0)|0}var da=64,ha=4194304;function Xr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ro(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?s=Xr(l):(a&=o,a!==0&&(s=Xr(a)))}else o=n&~i,o!==0?s=Xr(o):a!==0&&(s=Xr(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Ut(t),i=1<<n,s|=e[n],t&=~i;return s}function Ev(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tv(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ut(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=Ev(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Ec(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function P0(){var e=da;return da<<=1,!(da&4194240)&&(da=64),e}function bl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Gi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=n}function Pv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ut(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function Gu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ut(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var le=0;function A0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var M0,Ku,z0,R0,L0,Tc=!1,pa=[],Fn=null,Vn=null,$n=null,wi=new Map,ki=new Map,Ln=[],Av="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 submit".split(" ");function Uh(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(t.pointerId)}}function Br(e,t,n,s,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[i]},t!==null&&(t=qi(t),t!==null&&Ku(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Mv(e,t,n,s,i){switch(t){case"focusin":return Fn=Br(Fn,e,t,n,s,i),!0;case"dragenter":return Vn=Br(Vn,e,t,n,s,i),!0;case"mouseover":return $n=Br($n,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return wi.set(a,Br(wi.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,ki.set(a,Br(ki.get(a)||null,e,t,n,s,i)),!0}return!1}function O0(e){var t=xs(e.target);if(t!==null){var n=Ms(t);if(n!==null){if(t=n.tag,t===13){if(t=N0(n),t!==null){e.blockedOn=t,L0(e.priority,function(){z0(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 Da(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Nc=s,n.target.dispatchEvent(s),Nc=null}else return t=qi(n),t!==null&&Ku(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Da(e)&&n.delete(t)}function zv(){Tc=!1,Fn!==null&&Da(Fn)&&(Fn=null),Vn!==null&&Da(Vn)&&(Vn=null),$n!==null&&Da($n)&&($n=null),wi.forEach(Hh),ki.forEach(Hh)}function Fr(e,t){e.blockedOn===t&&(e.blockedOn=null,Tc||(Tc=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,zv)))}function ji(e){function t(i){return Fr(i,e)}if(0<pa.length){Fr(pa[0],e);for(var n=1;n<pa.length;n++){var s=pa[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Fn!==null&&Fr(Fn,e),Vn!==null&&Fr(Vn,e),$n!==null&&Fr($n,e),wi.forEach(t),ki.forEach(t),n=0;n<Ln.length;n++)s=Ln[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)O0(n),n.blockedOn===null&&Ln.shift()}var dr=Cn.ReactCurrentBatchConfig,io=!0;function Rv(e,t,n,s){var i=le,a=dr.transition;dr.transition=null;try{le=1,qu(e,t,n,s)}finally{le=i,dr.transition=a}}function Lv(e,t,n,s){var i=le,a=dr.transition;dr.transition=null;try{le=4,qu(e,t,n,s)}finally{le=i,dr.transition=a}}function qu(e,t,n,s){if(io){var i=Pc(e,t,n,s);if(i===null)Pl(e,t,s,ao,n),Uh(e,s);else if(Mv(i,e,t,n,s))s.stopPropagation();else if(Uh(e,s),t&4&&-1<Av.indexOf(e)){for(;i!==null;){var a=qi(i);if(a!==null&&M0(a),a=Pc(e,t,n,s),a===null&&Pl(e,t,s,ao,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else Pl(e,t,s,null,n)}}var ao=null;function Pc(e,t,n,s){if(ao=null,e=Hu(s),e=xs(e),e!==null)if(t=Ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=N0(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 ao=e,null}function D0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kv()){case Wu:return 1;case E0:return 4;case so:case jv:return 16;case T0:return 536870912;default:return 16}default:return 16}}var Dn=null,Yu=null,Ia=null;function I0(){if(Ia)return Ia;var e,t=Yu,n=t.length,s,i="value"in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===i[a-s];s++);return Ia=i.slice(e,1<s?1-s:void 0)}function Ba(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 fa(){return!0}function Wh(){return!1}function wt(e){function t(n,s,i,a,o){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?fa:Wh,this.isPropagationStopped=Wh,this}return Se(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=fa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fa)},persist:function(){},isPersistent:fa}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=wt(_r),Ki=Se({},_r,{view:0,detail:0}),Ov=wt(Ki),wl,kl,Vr,Lo=Se({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qu,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!==Vr&&(Vr&&e.type==="mousemove"?(wl=e.screenX-Vr.screenX,kl=e.screenY-Vr.screenY):kl=wl=0,Vr=e),wl)},movementY:function(e){return"movementY"in e?e.movementY:kl}}),Gh=wt(Lo),Dv=Se({},Lo,{dataTransfer:0}),Iv=wt(Dv),Bv=Se({},Ki,{relatedTarget:0}),jl=wt(Bv),Fv=Se({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Vv=wt(Fv),$v=Se({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Uv=wt($v),Hv=Se({},_r,{data:0}),Kh=wt(Hv),Wv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gv={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"},Kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kv[e])?!!t[e]:!1}function Qu(){return qv}var Yv=Se({},Ki,{key:function(e){if(e.key){var t=Wv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qu,charCode:function(e){return e.type==="keypress"?Ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xv=wt(Yv),Qv=Se({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qh=wt(Qv),Jv=Se({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qu}),Zv=wt(Jv),eb=Se({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),tb=wt(eb),nb=Se({},Lo,{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}),sb=wt(nb),rb=[9,13,27,32],Ju=wn&&"CompositionEvent"in window,ii=null;wn&&"documentMode"in document&&(ii=document.documentMode);var ib=wn&&"TextEvent"in window&&!ii,B0=wn&&(!Ju||ii&&8<ii&&11>=ii),Yh=" ",Xh=!1;function F0(e,t){switch(e){case"keyup":return rb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function ab(e,t){switch(e){case"compositionend":return V0(t);case"keypress":return t.which!==32?null:(Xh=!0,Yh);case"textInput":return e=t.data,e===Yh&&Xh?null:e;default:return null}}function ob(e,t){if(Ks)return e==="compositionend"||!Ju&&F0(e,t)?(e=I0(),Ia=Yu=Dn=null,Ks=!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 B0&&t.locale!=="ko"?null:t.data;default:return null}}var lb={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 Qh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lb[e.type]:t==="textarea"}function $0(e,t,n,s){v0(s),t=oo(t,"onChange"),0<t.length&&(n=new Xu("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ai=null,Ni=null;function cb(e){Z0(e,0)}function Oo(e){var t=Xs(e);if(h0(t))return e}function ub(e,t){if(e==="change")return t}var U0=!1;if(wn){var Nl;if(wn){var Sl="oninput"in document;if(!Sl){var Jh=document.createElement("div");Jh.setAttribute("oninput","return;"),Sl=typeof Jh.oninput=="function"}Nl=Sl}else Nl=!1;U0=Nl&&(!document.documentMode||9<document.documentMode)}function Zh(){ai&&(ai.detachEvent("onpropertychange",H0),Ni=ai=null)}function H0(e){if(e.propertyName==="value"&&Oo(Ni)){var t=[];$0(t,Ni,e,Hu(e)),j0(cb,t)}}function db(e,t,n){e==="focusin"?(Zh(),ai=t,Ni=n,ai.attachEvent("onpropertychange",H0)):e==="focusout"&&Zh()}function hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oo(Ni)}function pb(e,t){if(e==="click")return Oo(t)}function fb(e,t){if(e==="input"||e==="change")return Oo(t)}function mb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:mb;function Si(e,t){if(Wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!hc.call(t,i)||!Wt(e[i],t[i]))return!1}return!0}function ep(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tp(e,t){var n=ep(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ep(n)}}function W0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?W0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G0(){for(var e=window,t=eo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=eo(e.document)}return t}function Zu(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")}function gb(e){var t=G0(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&W0(n.ownerDocument.documentElement,n)){if(s!==null&&Zu(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(s.start,i);s=s.end===void 0?a:Math.min(s.end,i),!e.extend&&a>s&&(i=s,s=a,a=i),i=tp(n,a);var o=tp(n,s);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xb=wn&&"documentMode"in document&&11>=document.documentMode,qs=null,Ac=null,oi=null,Mc=!1;function np(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mc||qs==null||qs!==eo(s)||(s=qs,"selectionStart"in s&&Zu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),oi&&Si(oi,s)||(oi=s,s=oo(Ac,"onSelect"),0<s.length&&(t=new Xu("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=qs)))}function ma(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ys={animationend:ma("Animation","AnimationEnd"),animationiteration:ma("Animation","AnimationIteration"),animationstart:ma("Animation","AnimationStart"),transitionend:ma("Transition","TransitionEnd")},Cl={},K0={};wn&&(K0=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function Do(e){if(Cl[e])return Cl[e];if(!Ys[e])return e;var t=Ys[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in K0)return Cl[e]=t[n];return e}var q0=Do("animationend"),Y0=Do("animationiteration"),X0=Do("animationstart"),Q0=Do("transitionend"),J0=new Map,sp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ts(e,t){J0.set(e,t),As(t,[e])}for(var _l=0;_l<sp.length;_l++){var El=sp[_l],yb=El.toLowerCase(),vb=El[0].toUpperCase()+El.slice(1);ts(yb,"on"+vb)}ts(q0,"onAnimationEnd");ts(Y0,"onAnimationIteration");ts(X0,"onAnimationStart");ts("dblclick","onDoubleClick");ts("focusin","onFocus");ts("focusout","onBlur");ts(Q0,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));As("onBeforeInput",["compositionend","keypress","textInput","paste"]);As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qr="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(" "),bb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qr));function rp(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,yv(s,t,void 0,e),e.currentTarget=null}function Z0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;rp(i,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;rp(i,l,u),a=c}}}if(no)throw e=_c,no=!1,_c=null,e}function ge(e,t){var n=t[Dc];n===void 0&&(n=t[Dc]=new Set);var s=e+"__bubble";n.has(s)||(eg(t,e,2,!1),n.add(s))}function Tl(e,t,n){var s=0;t&&(s|=4),eg(n,e,s,t)}var ga="_reactListening"+Math.random().toString(36).slice(2);function Ci(e){if(!e[ga]){e[ga]=!0,o0.forEach(function(n){n!=="selectionchange"&&(bb.has(n)||Tl(n,!1,e),Tl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ga]||(t[ga]=!0,Tl("selectionchange",!1,t))}}function eg(e,t,n,s){switch(D0(t)){case 1:var i=Rv;break;case 4:i=Lv;break;default:i=qu}n=i.bind(null,t,n,e),i=void 0,!Cc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Pl(e,t,n,s,i){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=xs(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}j0(function(){var u=a,d=Hu(n),p=[];e:{var h=J0.get(e);if(h!==void 0){var m=Xu,v=e;switch(e){case"keypress":if(Ba(n)===0)break e;case"keydown":case"keyup":m=Xv;break;case"focusin":v="focus",m=jl;break;case"focusout":v="blur",m=jl;break;case"beforeblur":case"afterblur":m=jl;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":m=Gh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Zv;break;case q0:case Y0:case X0:m=Vv;break;case Q0:m=tb;break;case"scroll":m=Ov;break;case"wheel":m=sb;break;case"copy":case"cut":case"paste":m=Uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=qh}var w=(t&4)!==0,b=!w&&e==="scroll",g=w?h!==null?h+"Capture":null:h;w=[];for(var x=u,k;x!==null;){k=x;var C=k.stateNode;if(k.tag===5&&C!==null&&(k=C,g!==null&&(C=bi(x,g),C!=null&&w.push(_i(x,C,k)))),b)break;x=x.return}0<w.length&&(h=new m(h,v,null,n,d),p.push({event:h,listeners:w}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Nc&&(v=n.relatedTarget||n.fromElement)&&(xs(v)||v[kn]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=u,v=v?xs(v):null,v!==null&&(b=Ms(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(w=Gh,C="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(w=qh,C="onPointerLeave",g="onPointerEnter",x="pointer"),b=m==null?h:Xs(m),k=v==null?h:Xs(v),h=new w(C,x+"leave",m,n,d),h.target=b,h.relatedTarget=k,C=null,xs(d)===u&&(w=new w(g,x+"enter",v,n,d),w.target=k,w.relatedTarget=b,C=w),b=C,m&&v)t:{for(w=m,g=v,x=0,k=w;k;k=$s(k))x++;for(k=0,C=g;C;C=$s(C))k++;for(;0<x-k;)w=$s(w),x--;for(;0<k-x;)g=$s(g),k--;for(;x--;){if(w===g||g!==null&&w===g.alternate)break t;w=$s(w),g=$s(g)}w=null}else w=null;m!==null&&ip(p,h,m,w,!1),v!==null&&b!==null&&ip(p,b,v,w,!0)}}e:{if(h=u?Xs(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=ub;else if(Qh(h))if(U0)j=fb;else{j=hb;var S=db}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=pb);if(j&&(j=j(e,u))){$0(p,j,n,d);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&vc(h,"number",h.value)}switch(S=u?Xs(u):window,e){case"focusin":(Qh(S)||S.contentEditable==="true")&&(qs=S,Ac=u,oi=null);break;case"focusout":oi=Ac=qs=null;break;case"mousedown":Mc=!0;break;case"contextmenu":case"mouseup":case"dragend":Mc=!1,np(p,n,d);break;case"selectionchange":if(xb)break;case"keydown":case"keyup":np(p,n,d)}var y;if(Ju)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Ks?F0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(B0&&n.locale!=="ko"&&(Ks||N!=="onCompositionStart"?N==="onCompositionEnd"&&Ks&&(y=I0()):(Dn=d,Yu="value"in Dn?Dn.value:Dn.textContent,Ks=!0)),S=oo(u,N),0<S.length&&(N=new Kh(N,e,null,n,d),p.push({event:N,listeners:S}),y?N.data=y:(y=V0(n),y!==null&&(N.data=y)))),(y=ib?ab(e,n):ob(e,n))&&(u=oo(u,"onBeforeInput"),0<u.length&&(d=new Kh("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:u}),d.data=y))}Z0(p,t)})}function _i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oo(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=bi(e,n),a!=null&&s.unshift(_i(e,a,i)),a=bi(e,t),a!=null&&s.push(_i(e,a,i))),e=e.return}return s}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ip(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,i?(c=bi(n,a),c!=null&&o.unshift(_i(n,c,l))):i||(c=bi(n,a),c!=null&&o.push(_i(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var wb=/\r\n?/g,kb=/\u0000|\uFFFD/g;function ap(e){return(typeof e=="string"?e:""+e).replace(wb,`
38
- `).replace(kb,"")}function xa(e,t,n){if(t=ap(t),ap(e)!==t&&n)throw Error(I(425))}function lo(){}var zc=null,Rc=null;function Lc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oc=typeof setTimeout=="function"?setTimeout:void 0,jb=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,Nb=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(Sb)}:Oc;function Sb(e){setTimeout(function(){throw e})}function Al(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(s===0){e.removeChild(i),ji(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);ji(t)}function Un(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==="$?")break;if(t==="/$")return null}}return e}function lp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Er=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Er,Ei="__reactProps$"+Er,kn="__reactContainer$"+Er,Dc="__reactEvents$"+Er,Cb="__reactListeners$"+Er,_b="__reactHandles$"+Er;function xs(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lp(e);e!==null;){if(n=e[Zt])return n;e=lp(e)}return t}e=n,n=e.parentNode}return null}function qi(e){return e=e[Zt]||e[kn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Io(e){return e[Ei]||null}var Ic=[],Qs=-1;function ns(e){return{current:e}}function xe(e){0>Qs||(e.current=Ic[Qs],Ic[Qs]=null,Qs--)}function me(e,t){Qs++,Ic[Qs]=e.current,e.current=t}var Qn={},Qe=ns(Qn),ct=ns(!1),Ns=Qn;function mr(e,t){var n=e.type.contextTypes;if(!n)return Qn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ut(e){return e=e.childContextTypes,e!=null}function co(){xe(ct),xe(Qe)}function cp(e,t,n){if(Qe.current!==Qn)throw Error(I(168));me(Qe,t),me(ct,n)}function tg(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(I(108,dv(e)||"Unknown",i));return Se({},n,s)}function uo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,Ns=Qe.current,me(Qe,e),me(ct,ct.current),!0}function up(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=tg(e,t,Ns),s.__reactInternalMemoizedMergedChildContext=e,xe(ct),xe(Qe),me(Qe,e)):xe(ct),me(ct,n)}var fn=null,Bo=!1,Ml=!1;function ng(e){fn===null?fn=[e]:fn.push(e)}function Eb(e){Bo=!0,ng(e)}function ss(){if(!Ml&&fn!==null){Ml=!0;var e=0,t=le;try{var n=fn;for(le=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}fn=null,Bo=!1}catch(i){throw fn!==null&&(fn=fn.slice(e+1)),_0(Wu,ss),i}finally{le=t,Ml=!1}}return null}var Js=[],Zs=0,ho=null,po=0,St=[],Ct=0,Ss=null,gn=1,xn="";function hs(e,t){Js[Zs++]=po,Js[Zs++]=ho,ho=e,po=t}function sg(e,t,n){St[Ct++]=gn,St[Ct++]=xn,St[Ct++]=Ss,Ss=e;var s=gn;e=xn;var i=32-Ut(s)-1;s&=~(1<<i),n+=1;var a=32-Ut(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,gn=1<<32-Ut(t)+i|n<<i|s,xn=a+e}else gn=1<<a|n<<i|s,xn=e}function ed(e){e.return!==null&&(hs(e,1),sg(e,1,0))}function td(e){for(;e===ho;)ho=Js[--Zs],Js[Zs]=null,po=Js[--Zs],Js[Zs]=null;for(;e===Ss;)Ss=St[--Ct],St[Ct]=null,xn=St[--Ct],St[Ct]=null,gn=St[--Ct],St[Ct]=null}var gt=null,mt=null,be=!1,$t=null;function rg(e,t){var n=Et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function dp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,gt=e,mt=Un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gt=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ss!==null?{id:gn,overflow:xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gt=e,mt=null,!0):!1;default:return!1}}function Bc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fc(e){if(be){var t=mt;if(t){var n=t;if(!dp(e,t)){if(Bc(e))throw Error(I(418));t=Un(n.nextSibling);var s=gt;t&&dp(e,t)?rg(s,n):(e.flags=e.flags&-4097|2,be=!1,gt=e)}}else{if(Bc(e))throw Error(I(418));e.flags=e.flags&-4097|2,be=!1,gt=e}}}function hp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gt=e}function ya(e){if(e!==gt)return!1;if(!be)return hp(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lc(e.type,e.memoizedProps)),t&&(t=mt)){if(Bc(e))throw ig(),Error(I(418));for(;t;)rg(e,t),t=Un(t.nextSibling)}if(hp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mt=Un(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mt=null}}else mt=gt?Un(e.stateNode.nextSibling):null;return!0}function ig(){for(var e=mt;e;)e=Un(e.nextSibling)}function gr(){mt=gt=null,be=!1}function nd(e){$t===null?$t=[e]:$t.push(e)}var Tb=Cn.ReactCurrentBatchConfig;function $r(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var s=n.stateNode}if(!s)throw Error(I(147,e));var i=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function va(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function pp(e){var t=e._init;return t(e._payload)}function ag(e){function t(g,x){if(e){var k=g.deletions;k===null?(g.deletions=[x],g.flags|=16):k.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function s(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=Kn(g,x),g.index=0,g.sibling=null,g}function a(g,x,k){return g.index=k,e?(k=g.alternate,k!==null?(k=k.index,k<x?(g.flags|=2,x):k):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,k,C){return x===null||x.tag!==6?(x=Bl(k,g.mode,C),x.return=g,x):(x=i(x,k),x.return=g,x)}function c(g,x,k,C){var j=k.type;return j===Gs?d(g,x,k.props.children,C,k.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===zn&&pp(j)===x.type)?(C=i(x,k.props),C.ref=$r(g,x,k),C.return=g,C):(C=Ga(k.type,k.key,k.props,null,g.mode,C),C.ref=$r(g,x,k),C.return=g,C)}function u(g,x,k,C){return x===null||x.tag!==4||x.stateNode.containerInfo!==k.containerInfo||x.stateNode.implementation!==k.implementation?(x=Fl(k,g.mode,C),x.return=g,x):(x=i(x,k.children||[]),x.return=g,x)}function d(g,x,k,C,j){return x===null||x.tag!==7?(x=ks(k,g.mode,C,j),x.return=g,x):(x=i(x,k),x.return=g,x)}function p(g,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Bl(""+x,g.mode,k),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case la:return k=Ga(x.type,x.key,x.props,null,g.mode,k),k.ref=$r(g,null,x),k.return=g,k;case Ws:return x=Fl(x,g.mode,k),x.return=g,x;case zn:var C=x._init;return p(g,C(x._payload),k)}if(Yr(x)||Dr(x))return x=ks(x,g.mode,k,null),x.return=g,x;va(g,x)}return null}function h(g,x,k,C){var j=x!==null?x.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return j!==null?null:l(g,x,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case la:return k.key===j?c(g,x,k,C):null;case Ws:return k.key===j?u(g,x,k,C):null;case zn:return j=k._init,h(g,x,j(k._payload),C)}if(Yr(k)||Dr(k))return j!==null?null:d(g,x,k,C,null);va(g,k)}return null}function m(g,x,k,C,j){if(typeof C=="string"&&C!==""||typeof C=="number")return g=g.get(k)||null,l(x,g,""+C,j);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case la:return g=g.get(C.key===null?k:C.key)||null,c(x,g,C,j);case Ws:return g=g.get(C.key===null?k:C.key)||null,u(x,g,C,j);case zn:var S=C._init;return m(g,x,k,S(C._payload),j)}if(Yr(C)||Dr(C))return g=g.get(k)||null,d(x,g,C,j,null);va(x,C)}return null}function v(g,x,k,C){for(var j=null,S=null,y=x,N=x=0,P=null;y!==null&&N<k.length;N++){y.index>N?(P=y,y=null):P=y.sibling;var _=h(g,y,k[N],C);if(_===null){y===null&&(y=P);break}e&&y&&_.alternate===null&&t(g,y),x=a(_,x,N),S===null?j=_:S.sibling=_,S=_,y=P}if(N===k.length)return n(g,y),be&&hs(g,N),j;if(y===null){for(;N<k.length;N++)y=p(g,k[N],C),y!==null&&(x=a(y,x,N),S===null?j=y:S.sibling=y,S=y);return be&&hs(g,N),j}for(y=s(g,y);N<k.length;N++)P=m(y,g,N,k[N],C),P!==null&&(e&&P.alternate!==null&&y.delete(P.key===null?N:P.key),x=a(P,x,N),S===null?j=P:S.sibling=P,S=P);return e&&y.forEach(function(T){return t(g,T)}),be&&hs(g,N),j}function w(g,x,k,C){var j=Dr(k);if(typeof j!="function")throw Error(I(150));if(k=j.call(k),k==null)throw Error(I(151));for(var S=j=null,y=x,N=x=0,P=null,_=k.next();y!==null&&!_.done;N++,_=k.next()){y.index>N?(P=y,y=null):P=y.sibling;var T=h(g,y,_.value,C);if(T===null){y===null&&(y=P);break}e&&y&&T.alternate===null&&t(g,y),x=a(T,x,N),S===null?j=T:S.sibling=T,S=T,y=P}if(_.done)return n(g,y),be&&hs(g,N),j;if(y===null){for(;!_.done;N++,_=k.next())_=p(g,_.value,C),_!==null&&(x=a(_,x,N),S===null?j=_:S.sibling=_,S=_);return be&&hs(g,N),j}for(y=s(g,y);!_.done;N++,_=k.next())_=m(y,g,N,_.value,C),_!==null&&(e&&_.alternate!==null&&y.delete(_.key===null?N:_.key),x=a(_,x,N),S===null?j=_:S.sibling=_,S=_);return e&&y.forEach(function(O){return t(g,O)}),be&&hs(g,N),j}function b(g,x,k,C){if(typeof k=="object"&&k!==null&&k.type===Gs&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case la:e:{for(var j=k.key,S=x;S!==null;){if(S.key===j){if(j=k.type,j===Gs){if(S.tag===7){n(g,S.sibling),x=i(S,k.props.children),x.return=g,g=x;break e}}else if(S.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===zn&&pp(j)===S.type){n(g,S.sibling),x=i(S,k.props),x.ref=$r(g,S,k),x.return=g,g=x;break e}n(g,S);break}else t(g,S);S=S.sibling}k.type===Gs?(x=ks(k.props.children,g.mode,C,k.key),x.return=g,g=x):(C=Ga(k.type,k.key,k.props,null,g.mode,C),C.ref=$r(g,x,k),C.return=g,g=C)}return o(g);case Ws:e:{for(S=k.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===k.containerInfo&&x.stateNode.implementation===k.implementation){n(g,x.sibling),x=i(x,k.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=Fl(k,g.mode,C),x.return=g,g=x}return o(g);case zn:return S=k._init,b(g,x,S(k._payload),C)}if(Yr(k))return v(g,x,k,C);if(Dr(k))return w(g,x,k,C);va(g,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,k),x.return=g,g=x):(n(g,x),x=Bl(k,g.mode,C),x.return=g,g=x),o(g)):n(g,x)}return b}var xr=ag(!0),og=ag(!1),fo=ns(null),mo=null,er=null,sd=null;function rd(){sd=er=mo=null}function id(e){var t=fo.current;xe(fo),e._currentValue=t}function Vc(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function hr(e,t){mo=e,sd=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(mo===null)throw Error(I(308));er=e,mo.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var ys=null;function ad(e){ys===null?ys=[e]:ys.push(e)}function lg(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,ad(t)):(n.next=i.next,i.next=n),t.interleaved=n,jn(e,s)}function jn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Rn=!1;function od(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,oe&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,jn(e,n)}return i=s.interleaved,i===null?(t.next=t,ad(s)):(t.next=i.next,i.next=t),s.interleaved=t,jn(e,n)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}function fp(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function go(e,t,n,s){var i=e.updateQueue;Rn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,d=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((s&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,w=l;switch(h=t,m=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=Se({},p,h);break e;case 2:Rn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=p),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);_s|=o,e.lanes=o,e.memoizedState=p}}function mp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=n,typeof i!="function")throw Error(I(191,i));i.call(s)}}}var Yi={},nn=ns(Yi),Ti=ns(Yi),Pi=ns(Yi);function vs(e){if(e===Yi)throw Error(I(174));return e}function ld(e,t){switch(me(Pi,t),me(Ti,e),me(nn,Yi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wc(t,e)}xe(nn),me(nn,t)}function yr(){xe(nn),xe(Ti),xe(Pi)}function ug(e){vs(Pi.current);var t=vs(nn.current),n=wc(t,e.type);t!==n&&(me(Ti,e),me(nn,n))}function cd(e){Ti.current===e&&(xe(nn),xe(Ti))}var ke=ns(0);function xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 zl=[];function ud(){for(var e=0;e<zl.length;e++)zl[e]._workInProgressVersionPrimary=null;zl.length=0}var Va=Cn.ReactCurrentDispatcher,Rl=Cn.ReactCurrentBatchConfig,Cs=0,Ne=null,Le=null,Ie=null,yo=!1,li=!1,Ai=0,Pb=0;function We(){throw Error(I(321))}function dd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wt(e[n],t[n]))return!1;return!0}function hd(e,t,n,s,i,a){if(Cs=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Va.current=e===null||e.memoizedState===null?Rb:Lb,e=n(s,i),li){a=0;do{if(li=!1,Ai=0,25<=a)throw Error(I(301));a+=1,Ie=Le=null,t.updateQueue=null,Va.current=Ob,e=n(s,i)}while(li)}if(Va.current=vo,t=Le!==null&&Le.next!==null,Cs=0,Ie=Le=Ne=null,yo=!1,t)throw Error(I(300));return e}function pd(){var e=Ai!==0;return Ai=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function At(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Ie===null?Ne.memoizedState:Ie.next;if(t!==null)Ie=t,Le=e;else{if(e===null)throw Error(I(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Mi(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=At(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=Le,i=s.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}s.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Cs&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=d,_s|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,Wt(s,t.memoizedState)||(lt=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Ne.lanes|=a,_s|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ol(e){var t=At(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Wt(a,t.memoizedState)||(lt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function dg(){}function hg(e,t){var n=Ne,s=At(),i=t(),a=!Wt(s.memoizedState,i);if(a&&(s.memoizedState=i,lt=!0),s=s.queue,fd(mg.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,zi(9,fg.bind(null,n,s,i,t),void 0,null),Be===null)throw Error(I(349));Cs&30||pg(n,t,i)}return i}function pg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fg(e,t,n,s){t.value=n,t.getSnapshot=s,gg(t)&&xg(e)}function mg(e,t,n){return n(function(){gg(t)&&xg(e)})}function gg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wt(e,n)}catch{return!0}}function xg(e){var t=jn(e,1);t!==null&&Ht(t,e,1,-1)}function gp(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:e},t.queue=e,e=e.dispatch=zb.bind(null,Ne,e),[t.memoizedState,e]}function zi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function yg(){return At().memoizedState}function $a(e,t,n,s){var i=Jt();Ne.flags|=e,i.memoizedState=zi(1|t,n,void 0,s===void 0?null:s)}function Fo(e,t,n,s){var i=At();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&dd(s,o.deps)){i.memoizedState=zi(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=zi(1|t,n,a,s)}function xp(e,t){return $a(8390656,8,e,t)}function fd(e,t){return Fo(2048,8,e,t)}function vg(e,t){return Fo(4,2,e,t)}function bg(e,t){return Fo(4,4,e,t)}function wg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kg(e,t,n){return n=n!=null?n.concat([e]):null,Fo(4,4,wg.bind(null,t,e),n)}function md(){}function jg(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&dd(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Ng(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&dd(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Sg(e,t,n){return Cs&21?(Wt(n,t)||(n=P0(),Ne.lanes|=n,_s|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=n)}function Ab(e,t){var n=le;le=n!==0&&4>n?n:4,e(!0);var s=Rl.transition;Rl.transition={};try{e(!1),t()}finally{le=n,Rl.transition=s}}function Cg(){return At().memoizedState}function Mb(e,t,n){var s=Gn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},_g(e))Eg(t,n);else if(n=lg(e,t,n,s),n!==null){var i=nt();Ht(n,e,s,i),Tg(n,t,s)}}function zb(e,t,n){var s=Gn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(_g(e))Eg(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Wt(l,o)){var c=t.interleaved;c===null?(i.next=i,ad(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=lg(e,t,i,s),n!==null&&(i=nt(),Ht(n,e,s,i),Tg(n,t,s))}}function _g(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Eg(e,t){li=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tg(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}var vo={readContext:Pt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},Rb={readContext:Pt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:xp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$a(4194308,4,wg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $a(4194308,4,e,t)},useInsertionEffect:function(e,t){return $a(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Jt();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Mb.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:gp,useDebugValue:md,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=gp(!1),t=e[0];return e=Ab.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=Jt();if(be){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Be===null)throw Error(I(349));Cs&30||pg(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,xp(mg.bind(null,s,a,e),[e]),s.flags|=2048,zi(9,fg.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Be.identifierPrefix;if(be){var n=xn,s=gn;n=(s&~(1<<32-Ut(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ai++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Pb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Lb={readContext:Pt,useCallback:jg,useContext:Pt,useEffect:fd,useImperativeHandle:kg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Ng,useReducer:Ll,useRef:yg,useState:function(){return Ll(Mi)},useDebugValue:md,useDeferredValue:function(e){var t=At();return Sg(t,Le.memoizedState,e)},useTransition:function(){var e=Ll(Mi)[0],t=At().memoizedState;return[e,t]},useMutableSource:dg,useSyncExternalStore:hg,useId:Cg,unstable_isNewReconciler:!1},Ob={readContext:Pt,useCallback:jg,useContext:Pt,useEffect:fd,useImperativeHandle:kg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Ng,useReducer:Ol,useRef:yg,useState:function(){return Ol(Mi)},useDebugValue:md,useDeferredValue:function(e){var t=At();return Le===null?t.memoizedState=e:Sg(t,Le.memoizedState,e)},useTransition:function(){var e=Ol(Mi)[0],t=At().memoizedState;return[e,t]},useMutableSource:dg,useSyncExternalStore:hg,useId:Cg,unstable_isNewReconciler:!1};function Bt(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function $c(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vo={isMounted:function(e){return(e=e._reactInternals)?Ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=yn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Ht(t,e,i,s),Fa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=yn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Ht(t,e,i,s),Fa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),s=Gn(e),i=yn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,s),t!==null&&(Ht(t,e,s,n),Fa(t,e,s))}};function yp(e,t,n,s,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!Si(n,s)||!Si(i,a):!0}function Pg(e,t,n){var s=!1,i=Qn,a=t.contextType;return typeof a=="object"&&a!==null?a=Pt(a):(i=ut(t)?Ns:Qe.current,s=t.contextTypes,a=(s=s!=null)?mr(e,i):Qn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function vp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Vo.enqueueReplaceState(t,t.state,null)}function Uc(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},od(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Pt(a):(a=ut(t)?Ns:Qe.current,i.context=mr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&($c(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Vo.enqueueReplaceState(i,i.state,null),go(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var n="",s=t;do n+=uv(s),s=s.return;while(s);var i=n}catch(a){i=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{xl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qr(e):""}function lv(e){switch(e.tag){case 5:return qr(e.type);case 16:return qr("Lazy");case 13:return qr("Suspense");case 19:return qr("SuspenseList");case 0:case 2:case 15:return e=yl(e.type,!1),e;case 11:return e=yl(e.type.render,!1),e;case 1:return e=yl(e.type,!0),e;default:return""}}function gc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gs:return"Fragment";case Ws:return"Portal";case pc:return"Profiler";case Vu:return"StrictMode";case fc:return"Suspense";case mc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c0:return(e.displayName||"Context")+".Consumer";case l0:return(e._context.displayName||"Context")+".Provider";case $u:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uu:return t=e.displayName||null,t!==null?t:gc(e.type)||"Memo";case zn:t=e._payload,e=e._init;try{return gc(e(t))}catch{}}return null}function cv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gc(t);case 8:return t===Vu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function d0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uv(e){var t=d0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ca(e){e._valueTracker||(e._valueTracker=uv(e))}function h0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=d0(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function eo(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 xc(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Oh(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Xn(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function p0(e,t){t=t.checked,t!=null&&Fu(e,"checked",t,!1)}function yc(e,t){p0(e,t);var n=Xn(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vc(e,t.type,n):t.hasOwnProperty("defaultValue")&&vc(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vc(e,t,n){(t!=="number"||eo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yr=Array.isArray;function lr(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Xn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function bc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ih(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(Yr(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xn(n)}}function f0(e,t){var n=Xn(t.value),s=Xn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Bh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function m0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?m0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ua,g0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ua=ua||document.createElement("div"),ua.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ua.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var si={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},dv=["Webkit","ms","Moz","O"];Object.keys(si).forEach(function(e){dv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),si[t]=si[e]})});function x0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||si.hasOwnProperty(e)&&si[e]?(""+t).trim():t+"px"}function y0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,i=x0(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,i):e[n]=i}}var hv=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kc(e,t){if(t){if(hv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function jc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Nc=null;function Hu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sc=null,cr=null,ur=null;function Fh(e){if(e=qi(e)){if(typeof Sc!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Io(t),Sc(e.stateNode,e.type,t))}}function v0(e){cr?ur?ur.push(e):ur=[e]:cr=e}function b0(){if(cr){var e=cr,t=ur;if(ur=cr=null,Fh(e),t)for(e=0;e<t.length;e++)Fh(t[e])}}function w0(e,t){return e(t)}function k0(){}var vl=!1;function j0(e,t,n){if(vl)return e(t,n);vl=!0;try{return w0(e,t,n)}finally{vl=!1,(cr!==null||ur!==null)&&(k0(),b0())}}function bi(e,t){var n=e.stateNode;if(n===null)return null;var s=Io(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var Cc=!1;if(vn)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{Cc=!1}function pv(e,t,n,s,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ri=!1,to=null,no=!1,_c=null,fv={onError:function(e){ri=!0,to=e}};function mv(e,t,n,s,i,a,o,l,c){ri=!1,to=null,pv.apply(fv,arguments)}function gv(e,t,n,s,i,a,o,l,c){if(mv.apply(this,arguments),ri){if(ri){var u=to;ri=!1,to=null}else throw Error(I(198));no||(no=!0,_c=u)}}function Ms(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function N0(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 Vh(e){if(Ms(e)!==e)throw Error(I(188))}function xv(e){var t=e.alternate;if(!t){if(t=Ms(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Vh(i),e;if(a===s)return Vh(i),t;a=a.sibling}throw Error(I(188))}if(n.return!==s.return)n=i,s=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,s=a;break}if(l===s){o=!0,s=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=i;break}if(l===s){o=!0,s=a,n=i;break}l=l.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function S0(e){return e=xv(e),e!==null?C0(e):null}function C0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=C0(e);if(t!==null)return t;e=e.sibling}return null}var _0=yt.unstable_scheduleCallback,$h=yt.unstable_cancelCallback,yv=yt.unstable_shouldYield,vv=yt.unstable_requestPaint,Pe=yt.unstable_now,bv=yt.unstable_getCurrentPriorityLevel,Wu=yt.unstable_ImmediatePriority,E0=yt.unstable_UserBlockingPriority,so=yt.unstable_NormalPriority,wv=yt.unstable_LowPriority,T0=yt.unstable_IdlePriority,Ro=null,tn=null;function kv(e){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Ro,e,void 0,(e.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:Sv,jv=Math.log,Nv=Math.LN2;function Sv(e){return e>>>=0,e===0?32:31-(jv(e)/Nv|0)|0}var da=64,ha=4194304;function Xr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ro(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?s=Xr(l):(a&=o,a!==0&&(s=Xr(a)))}else o=n&~i,o!==0?s=Xr(o):a!==0&&(s=Xr(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Ut(t),i=1<<n,s|=e[n],t&=~i;return s}function Cv(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _v(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ut(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&s)&&(i[o]=Cv(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Ec(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function P0(){var e=da;return da<<=1,!(da&4194240)&&(da=64),e}function bl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Gi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=n}function Ev(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ut(n),a=1<<i;t[i]=0,s[i]=-1,e[i]=-1,n&=~a}}function Gu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ut(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}var le=0;function A0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var M0,Ku,z0,R0,L0,Tc=!1,pa=[],Fn=null,Vn=null,$n=null,wi=new Map,ki=new Map,Ln=[],Tv="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 submit".split(" ");function Uh(e,t){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(t.pointerId)}}function Br(e,t,n,s,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[i]},t!==null&&(t=qi(t),t!==null&&Ku(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pv(e,t,n,s,i){switch(t){case"focusin":return Fn=Br(Fn,e,t,n,s,i),!0;case"dragenter":return Vn=Br(Vn,e,t,n,s,i),!0;case"mouseover":return $n=Br($n,e,t,n,s,i),!0;case"pointerover":var a=i.pointerId;return wi.set(a,Br(wi.get(a)||null,e,t,n,s,i)),!0;case"gotpointercapture":return a=i.pointerId,ki.set(a,Br(ki.get(a)||null,e,t,n,s,i)),!0}return!1}function O0(e){var t=xs(e.target);if(t!==null){var n=Ms(t);if(n!==null){if(t=n.tag,t===13){if(t=N0(n),t!==null){e.blockedOn=t,L0(e.priority,function(){z0(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 Da(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Nc=s,n.target.dispatchEvent(s),Nc=null}else return t=qi(n),t!==null&&Ku(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Da(e)&&n.delete(t)}function Av(){Tc=!1,Fn!==null&&Da(Fn)&&(Fn=null),Vn!==null&&Da(Vn)&&(Vn=null),$n!==null&&Da($n)&&($n=null),wi.forEach(Hh),ki.forEach(Hh)}function Fr(e,t){e.blockedOn===t&&(e.blockedOn=null,Tc||(Tc=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,Av)))}function ji(e){function t(i){return Fr(i,e)}if(0<pa.length){Fr(pa[0],e);for(var n=1;n<pa.length;n++){var s=pa[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Fn!==null&&Fr(Fn,e),Vn!==null&&Fr(Vn,e),$n!==null&&Fr($n,e),wi.forEach(t),ki.forEach(t),n=0;n<Ln.length;n++)s=Ln[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)O0(n),n.blockedOn===null&&Ln.shift()}var dr=Cn.ReactCurrentBatchConfig,io=!0;function Mv(e,t,n,s){var i=le,a=dr.transition;dr.transition=null;try{le=1,qu(e,t,n,s)}finally{le=i,dr.transition=a}}function zv(e,t,n,s){var i=le,a=dr.transition;dr.transition=null;try{le=4,qu(e,t,n,s)}finally{le=i,dr.transition=a}}function qu(e,t,n,s){if(io){var i=Pc(e,t,n,s);if(i===null)Pl(e,t,s,ao,n),Uh(e,s);else if(Pv(i,e,t,n,s))s.stopPropagation();else if(Uh(e,s),t&4&&-1<Tv.indexOf(e)){for(;i!==null;){var a=qi(i);if(a!==null&&M0(a),a=Pc(e,t,n,s),a===null&&Pl(e,t,s,ao,n),a===i)break;i=a}i!==null&&s.stopPropagation()}else Pl(e,t,s,null,n)}}var ao=null;function Pc(e,t,n,s){if(ao=null,e=Hu(s),e=xs(e),e!==null)if(t=Ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=N0(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 ao=e,null}function D0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(bv()){case Wu:return 1;case E0:return 4;case so:case wv:return 16;case T0:return 536870912;default:return 16}default:return 16}}var Dn=null,Yu=null,Ia=null;function I0(){if(Ia)return Ia;var e,t=Yu,n=t.length,s,i="value"in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===i[a-s];s++);return Ia=i.slice(e,1<s?1-s:void 0)}function Ba(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 fa(){return!0}function Wh(){return!1}function wt(e){function t(n,s,i,a,o){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?fa:Wh,this.isPropagationStopped=Wh,this}return Se(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=fa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fa)},persist:function(){},isPersistent:fa}),t}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=wt(_r),Ki=Se({},_r,{view:0,detail:0}),Rv=wt(Ki),wl,kl,Vr,Lo=Se({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qu,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!==Vr&&(Vr&&e.type==="mousemove"?(wl=e.screenX-Vr.screenX,kl=e.screenY-Vr.screenY):kl=wl=0,Vr=e),wl)},movementY:function(e){return"movementY"in e?e.movementY:kl}}),Gh=wt(Lo),Lv=Se({},Lo,{dataTransfer:0}),Ov=wt(Lv),Dv=Se({},Ki,{relatedTarget:0}),jl=wt(Dv),Iv=Se({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=wt(Iv),Fv=Se({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vv=wt(Fv),$v=Se({},_r,{data:0}),Kh=wt($v),Uv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hv={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"},Wv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wv[e])?!!t[e]:!1}function Qu(){return Gv}var Kv=Se({},Ki,{key:function(e){if(e.key){var t=Uv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qu,charCode:function(e){return e.type==="keypress"?Ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qv=wt(Kv),Yv=Se({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qh=wt(Yv),Xv=Se({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qu}),Qv=wt(Xv),Jv=Se({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zv=wt(Jv),eb=Se({},Lo,{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}),tb=wt(eb),nb=[9,13,27,32],Ju=vn&&"CompositionEvent"in window,ii=null;vn&&"documentMode"in document&&(ii=document.documentMode);var sb=vn&&"TextEvent"in window&&!ii,B0=vn&&(!Ju||ii&&8<ii&&11>=ii),Yh=" ",Xh=!1;function F0(e,t){switch(e){case"keyup":return nb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function rb(e,t){switch(e){case"compositionend":return V0(t);case"keypress":return t.which!==32?null:(Xh=!0,Yh);case"textInput":return e=t.data,e===Yh&&Xh?null:e;default:return null}}function ib(e,t){if(Ks)return e==="compositionend"||!Ju&&F0(e,t)?(e=I0(),Ia=Yu=Dn=null,Ks=!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 B0&&t.locale!=="ko"?null:t.data;default:return null}}var ab={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 Qh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ab[e.type]:t==="textarea"}function $0(e,t,n,s){v0(s),t=oo(t,"onChange"),0<t.length&&(n=new Xu("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ai=null,Ni=null;function ob(e){Z0(e,0)}function Oo(e){var t=Xs(e);if(h0(t))return e}function lb(e,t){if(e==="change")return t}var U0=!1;if(vn){var Nl;if(vn){var Sl="oninput"in document;if(!Sl){var Jh=document.createElement("div");Jh.setAttribute("oninput","return;"),Sl=typeof Jh.oninput=="function"}Nl=Sl}else Nl=!1;U0=Nl&&(!document.documentMode||9<document.documentMode)}function Zh(){ai&&(ai.detachEvent("onpropertychange",H0),Ni=ai=null)}function H0(e){if(e.propertyName==="value"&&Oo(Ni)){var t=[];$0(t,Ni,e,Hu(e)),j0(ob,t)}}function cb(e,t,n){e==="focusin"?(Zh(),ai=t,Ni=n,ai.attachEvent("onpropertychange",H0)):e==="focusout"&&Zh()}function ub(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oo(Ni)}function db(e,t){if(e==="click")return Oo(t)}function hb(e,t){if(e==="input"||e==="change")return Oo(t)}function pb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:pb;function Si(e,t){if(Wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!hc.call(t,i)||!Wt(e[i],t[i]))return!1}return!0}function ep(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tp(e,t){var n=ep(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ep(n)}}function W0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?W0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G0(){for(var e=window,t=eo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=eo(e.document)}return t}function Zu(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")}function fb(e){var t=G0(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&W0(n.ownerDocument.documentElement,n)){if(s!==null&&Zu(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(s.start,i);s=s.end===void 0?a:Math.min(s.end,i),!e.extend&&a>s&&(i=s,s=a,a=i),i=tp(n,a);var o=tp(n,s);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mb=vn&&"documentMode"in document&&11>=document.documentMode,qs=null,Ac=null,oi=null,Mc=!1;function np(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mc||qs==null||qs!==eo(s)||(s=qs,"selectionStart"in s&&Zu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),oi&&Si(oi,s)||(oi=s,s=oo(Ac,"onSelect"),0<s.length&&(t=new Xu("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=qs)))}function ma(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ys={animationend:ma("Animation","AnimationEnd"),animationiteration:ma("Animation","AnimationIteration"),animationstart:ma("Animation","AnimationStart"),transitionend:ma("Transition","TransitionEnd")},Cl={},K0={};vn&&(K0=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function Do(e){if(Cl[e])return Cl[e];if(!Ys[e])return e;var t=Ys[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in K0)return Cl[e]=t[n];return e}var q0=Do("animationend"),Y0=Do("animationiteration"),X0=Do("animationstart"),Q0=Do("transitionend"),J0=new Map,sp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ts(e,t){J0.set(e,t),As(t,[e])}for(var _l=0;_l<sp.length;_l++){var El=sp[_l],gb=El.toLowerCase(),xb=El[0].toUpperCase()+El.slice(1);ts(gb,"on"+xb)}ts(q0,"onAnimationEnd");ts(Y0,"onAnimationIteration");ts(X0,"onAnimationStart");ts("dblclick","onDoubleClick");ts("focusin","onFocus");ts("focusout","onBlur");ts(Q0,"onTransitionEnd");fr("onMouseEnter",["mouseout","mouseover"]);fr("onMouseLeave",["mouseout","mouseover"]);fr("onPointerEnter",["pointerout","pointerover"]);fr("onPointerLeave",["pointerout","pointerover"]);As("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));As("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));As("onBeforeInput",["compositionend","keypress","textInput","paste"]);As("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));As("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));As("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qr="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(" "),yb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qr));function rp(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,gv(s,t,void 0,e),e.currentTarget=null}function Z0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;rp(i,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;rp(i,l,u),a=c}}}if(no)throw e=_c,no=!1,_c=null,e}function ge(e,t){var n=t[Dc];n===void 0&&(n=t[Dc]=new Set);var s=e+"__bubble";n.has(s)||(eg(t,e,2,!1),n.add(s))}function Tl(e,t,n){var s=0;t&&(s|=4),eg(n,e,s,t)}var ga="_reactListening"+Math.random().toString(36).slice(2);function Ci(e){if(!e[ga]){e[ga]=!0,o0.forEach(function(n){n!=="selectionchange"&&(yb.has(n)||Tl(n,!1,e),Tl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ga]||(t[ga]=!0,Tl("selectionchange",!1,t))}}function eg(e,t,n,s){switch(D0(t)){case 1:var i=Mv;break;case 4:i=zv;break;default:i=qu}n=i.bind(null,t,n,e),i=void 0,!Cc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Pl(e,t,n,s,i){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=xs(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}j0(function(){var u=a,d=Hu(n),p=[];e:{var h=J0.get(e);if(h!==void 0){var m=Xu,y=e;switch(e){case"keypress":if(Ba(n)===0)break e;case"keydown":case"keyup":m=qv;break;case"focusin":y="focus",m=jl;break;case"focusout":y="blur",m=jl;break;case"beforeblur":case"afterblur":m=jl;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":m=Gh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Ov;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Qv;break;case q0:case Y0:case X0:m=Bv;break;case Q0:m=Zv;break;case"scroll":m=Rv;break;case"wheel":m=tb;break;case"copy":case"cut":case"paste":m=Vv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=qh}var w=(t&4)!==0,v=!w&&e==="scroll",g=w?h!==null?h+"Capture":null:h;w=[];for(var x=u,k;x!==null;){k=x;var j=k.stateNode;if(k.tag===5&&j!==null&&(k=j,g!==null&&(j=bi(x,g),j!=null&&w.push(_i(x,j,k)))),v)break;x=x.return}0<w.length&&(h=new m(h,y,null,n,d),p.push({event:h,listeners:w}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Nc&&(y=n.relatedTarget||n.fromElement)&&(xs(y)||y[bn]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=u,y=y?xs(y):null,y!==null&&(v=Ms(y),y!==v||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(w=Gh,j="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(w=qh,j="onPointerLeave",g="onPointerEnter",x="pointer"),v=m==null?h:Xs(m),k=y==null?h:Xs(y),h=new w(j,x+"leave",m,n,d),h.target=v,h.relatedTarget=k,j=null,xs(d)===u&&(w=new w(g,x+"enter",y,n,d),w.target=k,w.relatedTarget=v,j=w),v=j,m&&y)t:{for(w=m,g=y,x=0,k=w;k;k=$s(k))x++;for(k=0,j=g;j;j=$s(j))k++;for(;0<x-k;)w=$s(w),x--;for(;0<k-x;)g=$s(g),k--;for(;x--;){if(w===g||g!==null&&w===g.alternate)break t;w=$s(w),g=$s(g)}w=null}else w=null;m!==null&&ip(p,h,m,w,!1),y!==null&&v!==null&&ip(p,v,y,w,!0)}}e:{if(h=u?Xs(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var b=lb;else if(Qh(h))if(U0)b=hb;else{b=ub;var S=cb}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(b=db);if(b&&(b=b(e,u))){$0(p,b,n,d);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&vc(h,"number",h.value)}switch(S=u?Xs(u):window,e){case"focusin":(Qh(S)||S.contentEditable==="true")&&(qs=S,Ac=u,oi=null);break;case"focusout":oi=Ac=qs=null;break;case"mousedown":Mc=!0;break;case"contextmenu":case"mouseup":case"dragend":Mc=!1,np(p,n,d);break;case"selectionchange":if(mb)break;case"keydown":case"keyup":np(p,n,d)}var N;if(Ju)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Ks?F0(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(B0&&n.locale!=="ko"&&(Ks||C!=="onCompositionStart"?C==="onCompositionEnd"&&Ks&&(N=I0()):(Dn=d,Yu="value"in Dn?Dn.value:Dn.textContent,Ks=!0)),S=oo(u,C),0<S.length&&(C=new Kh(C,e,null,n,d),p.push({event:C,listeners:S}),N?C.data=N:(N=V0(n),N!==null&&(C.data=N)))),(N=sb?rb(e,n):ib(e,n))&&(u=oo(u,"onBeforeInput"),0<u.length&&(d=new Kh("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:u}),d.data=N))}Z0(p,t)})}function _i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oo(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=bi(e,n),a!=null&&s.unshift(_i(e,a,i)),a=bi(e,t),a!=null&&s.push(_i(e,a,i))),e=e.return}return s}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ip(e,t,n,s,i){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,i?(c=bi(n,a),c!=null&&o.unshift(_i(n,c,l))):i||(c=bi(n,a),c!=null&&o.push(_i(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var vb=/\r\n?/g,bb=/\u0000|\uFFFD/g;function ap(e){return(typeof e=="string"?e:""+e).replace(vb,`
38
+ `).replace(bb,"")}function xa(e,t,n){if(t=ap(t),ap(e)!==t&&n)throw Error(I(425))}function lo(){}var zc=null,Rc=null;function Lc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oc=typeof setTimeout=="function"?setTimeout:void 0,wb=typeof clearTimeout=="function"?clearTimeout:void 0,op=typeof Promise=="function"?Promise:void 0,kb=typeof queueMicrotask=="function"?queueMicrotask:typeof op<"u"?function(e){return op.resolve(null).then(e).catch(jb)}:Oc;function jb(e){setTimeout(function(){throw e})}function Al(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(s===0){e.removeChild(i),ji(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=i}while(n);ji(t)}function Un(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==="$?")break;if(t==="/$")return null}}return e}function lp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Er=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Er,Ei="__reactProps$"+Er,bn="__reactContainer$"+Er,Dc="__reactEvents$"+Er,Nb="__reactListeners$"+Er,Sb="__reactHandles$"+Er;function xs(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[bn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lp(e);e!==null;){if(n=e[Zt])return n;e=lp(e)}return t}e=n,n=e.parentNode}return null}function qi(e){return e=e[Zt]||e[bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Io(e){return e[Ei]||null}var Ic=[],Qs=-1;function ns(e){return{current:e}}function xe(e){0>Qs||(e.current=Ic[Qs],Ic[Qs]=null,Qs--)}function me(e,t){Qs++,Ic[Qs]=e.current,e.current=t}var Qn={},Xe=ns(Qn),ct=ns(!1),Ns=Qn;function mr(e,t){var n=e.type.contextTypes;if(!n)return Qn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ut(e){return e=e.childContextTypes,e!=null}function co(){xe(ct),xe(Xe)}function cp(e,t,n){if(Xe.current!==Qn)throw Error(I(168));me(Xe,t),me(ct,n)}function tg(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(I(108,cv(e)||"Unknown",i));return Se({},n,s)}function uo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,Ns=Xe.current,me(Xe,e),me(ct,ct.current),!0}function up(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=tg(e,t,Ns),s.__reactInternalMemoizedMergedChildContext=e,xe(ct),xe(Xe),me(Xe,e)):xe(ct),me(ct,n)}var hn=null,Bo=!1,Ml=!1;function ng(e){hn===null?hn=[e]:hn.push(e)}function Cb(e){Bo=!0,ng(e)}function ss(){if(!Ml&&hn!==null){Ml=!0;var e=0,t=le;try{var n=hn;for(le=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}hn=null,Bo=!1}catch(i){throw hn!==null&&(hn=hn.slice(e+1)),_0(Wu,ss),i}finally{le=t,Ml=!1}}return null}var Js=[],Zs=0,ho=null,po=0,St=[],Ct=0,Ss=null,fn=1,mn="";function hs(e,t){Js[Zs++]=po,Js[Zs++]=ho,ho=e,po=t}function sg(e,t,n){St[Ct++]=fn,St[Ct++]=mn,St[Ct++]=Ss,Ss=e;var s=fn;e=mn;var i=32-Ut(s)-1;s&=~(1<<i),n+=1;var a=32-Ut(t)+i;if(30<a){var o=i-i%5;a=(s&(1<<o)-1).toString(32),s>>=o,i-=o,fn=1<<32-Ut(t)+i|n<<i|s,mn=a+e}else fn=1<<a|n<<i|s,mn=e}function ed(e){e.return!==null&&(hs(e,1),sg(e,1,0))}function td(e){for(;e===ho;)ho=Js[--Zs],Js[Zs]=null,po=Js[--Zs],Js[Zs]=null;for(;e===Ss;)Ss=St[--Ct],St[Ct]=null,mn=St[--Ct],St[Ct]=null,fn=St[--Ct],St[Ct]=null}var gt=null,mt=null,be=!1,$t=null;function rg(e,t){var n=Et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function dp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,gt=e,mt=Un(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gt=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ss!==null?{id:fn,overflow:mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gt=e,mt=null,!0):!1;default:return!1}}function Bc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fc(e){if(be){var t=mt;if(t){var n=t;if(!dp(e,t)){if(Bc(e))throw Error(I(418));t=Un(n.nextSibling);var s=gt;t&&dp(e,t)?rg(s,n):(e.flags=e.flags&-4097|2,be=!1,gt=e)}}else{if(Bc(e))throw Error(I(418));e.flags=e.flags&-4097|2,be=!1,gt=e}}}function hp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gt=e}function ya(e){if(e!==gt)return!1;if(!be)return hp(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lc(e.type,e.memoizedProps)),t&&(t=mt)){if(Bc(e))throw ig(),Error(I(418));for(;t;)rg(e,t),t=Un(t.nextSibling)}if(hp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mt=Un(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mt=null}}else mt=gt?Un(e.stateNode.nextSibling):null;return!0}function ig(){for(var e=mt;e;)e=Un(e.nextSibling)}function gr(){mt=gt=null,be=!1}function nd(e){$t===null?$t=[e]:$t.push(e)}var _b=Cn.ReactCurrentBatchConfig;function $r(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var s=n.stateNode}if(!s)throw Error(I(147,e));var i=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function va(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function pp(e){var t=e._init;return t(e._payload)}function ag(e){function t(g,x){if(e){var k=g.deletions;k===null?(g.deletions=[x],g.flags|=16):k.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function s(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=Kn(g,x),g.index=0,g.sibling=null,g}function a(g,x,k){return g.index=k,e?(k=g.alternate,k!==null?(k=k.index,k<x?(g.flags|=2,x):k):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,k,j){return x===null||x.tag!==6?(x=Bl(k,g.mode,j),x.return=g,x):(x=i(x,k),x.return=g,x)}function c(g,x,k,j){var b=k.type;return b===Gs?d(g,x,k.props.children,j,k.key):x!==null&&(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===zn&&pp(b)===x.type)?(j=i(x,k.props),j.ref=$r(g,x,k),j.return=g,j):(j=Ga(k.type,k.key,k.props,null,g.mode,j),j.ref=$r(g,x,k),j.return=g,j)}function u(g,x,k,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==k.containerInfo||x.stateNode.implementation!==k.implementation?(x=Fl(k,g.mode,j),x.return=g,x):(x=i(x,k.children||[]),x.return=g,x)}function d(g,x,k,j,b){return x===null||x.tag!==7?(x=ks(k,g.mode,j,b),x.return=g,x):(x=i(x,k),x.return=g,x)}function p(g,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Bl(""+x,g.mode,k),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case la:return k=Ga(x.type,x.key,x.props,null,g.mode,k),k.ref=$r(g,null,x),k.return=g,k;case Ws:return x=Fl(x,g.mode,k),x.return=g,x;case zn:var j=x._init;return p(g,j(x._payload),k)}if(Yr(x)||Dr(x))return x=ks(x,g.mode,k,null),x.return=g,x;va(g,x)}return null}function h(g,x,k,j){var b=x!==null?x.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return b!==null?null:l(g,x,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case la:return k.key===b?c(g,x,k,j):null;case Ws:return k.key===b?u(g,x,k,j):null;case zn:return b=k._init,h(g,x,b(k._payload),j)}if(Yr(k)||Dr(k))return b!==null?null:d(g,x,k,j,null);va(g,k)}return null}function m(g,x,k,j,b){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(k)||null,l(x,g,""+j,b);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case la:return g=g.get(j.key===null?k:j.key)||null,c(x,g,j,b);case Ws:return g=g.get(j.key===null?k:j.key)||null,u(x,g,j,b);case zn:var S=j._init;return m(g,x,k,S(j._payload),b)}if(Yr(j)||Dr(j))return g=g.get(k)||null,d(x,g,j,b,null);va(x,j)}return null}function y(g,x,k,j){for(var b=null,S=null,N=x,C=x=0,_=null;N!==null&&C<k.length;C++){N.index>C?(_=N,N=null):_=N.sibling;var E=h(g,N,k[C],j);if(E===null){N===null&&(N=_);break}e&&N&&E.alternate===null&&t(g,N),x=a(E,x,C),S===null?b=E:S.sibling=E,S=E,N=_}if(C===k.length)return n(g,N),be&&hs(g,C),b;if(N===null){for(;C<k.length;C++)N=p(g,k[C],j),N!==null&&(x=a(N,x,C),S===null?b=N:S.sibling=N,S=N);return be&&hs(g,C),b}for(N=s(g,N);C<k.length;C++)_=m(N,g,C,k[C],j),_!==null&&(e&&_.alternate!==null&&N.delete(_.key===null?C:_.key),x=a(_,x,C),S===null?b=_:S.sibling=_,S=_);return e&&N.forEach(function(P){return t(g,P)}),be&&hs(g,C),b}function w(g,x,k,j){var b=Dr(k);if(typeof b!="function")throw Error(I(150));if(k=b.call(k),k==null)throw Error(I(151));for(var S=b=null,N=x,C=x=0,_=null,E=k.next();N!==null&&!E.done;C++,E=k.next()){N.index>C?(_=N,N=null):_=N.sibling;var P=h(g,N,E.value,j);if(P===null){N===null&&(N=_);break}e&&N&&P.alternate===null&&t(g,N),x=a(P,x,C),S===null?b=P:S.sibling=P,S=P,N=_}if(E.done)return n(g,N),be&&hs(g,C),b;if(N===null){for(;!E.done;C++,E=k.next())E=p(g,E.value,j),E!==null&&(x=a(E,x,C),S===null?b=E:S.sibling=E,S=E);return be&&hs(g,C),b}for(N=s(g,N);!E.done;C++,E=k.next())E=m(N,g,C,E.value,j),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?C:E.key),x=a(E,x,C),S===null?b=E:S.sibling=E,S=E);return e&&N.forEach(function(O){return t(g,O)}),be&&hs(g,C),b}function v(g,x,k,j){if(typeof k=="object"&&k!==null&&k.type===Gs&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case la:e:{for(var b=k.key,S=x;S!==null;){if(S.key===b){if(b=k.type,b===Gs){if(S.tag===7){n(g,S.sibling),x=i(S,k.props.children),x.return=g,g=x;break e}}else if(S.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===zn&&pp(b)===S.type){n(g,S.sibling),x=i(S,k.props),x.ref=$r(g,S,k),x.return=g,g=x;break e}n(g,S);break}else t(g,S);S=S.sibling}k.type===Gs?(x=ks(k.props.children,g.mode,j,k.key),x.return=g,g=x):(j=Ga(k.type,k.key,k.props,null,g.mode,j),j.ref=$r(g,x,k),j.return=g,g=j)}return o(g);case Ws:e:{for(S=k.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===k.containerInfo&&x.stateNode.implementation===k.implementation){n(g,x.sibling),x=i(x,k.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=Fl(k,g.mode,j),x.return=g,g=x}return o(g);case zn:return S=k._init,v(g,x,S(k._payload),j)}if(Yr(k))return y(g,x,k,j);if(Dr(k))return w(g,x,k,j);va(g,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,k),x.return=g,g=x):(n(g,x),x=Bl(k,g.mode,j),x.return=g,g=x),o(g)):n(g,x)}return v}var xr=ag(!0),og=ag(!1),fo=ns(null),mo=null,er=null,sd=null;function rd(){sd=er=mo=null}function id(e){var t=fo.current;xe(fo),e._currentValue=t}function Vc(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function hr(e,t){mo=e,sd=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(mo===null)throw Error(I(308));er=e,mo.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var ys=null;function ad(e){ys===null?ys=[e]:ys.push(e)}function lg(e,t,n,s){var i=t.interleaved;return i===null?(n.next=n,ad(t)):(n.next=i.next,i.next=n),t.interleaved=n,wn(e,s)}function wn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Rn=!1;function od(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,ae&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,wn(e,n)}return i=s.interleaved,i===null?(t.next=t,ad(s)):(t.next=i.next,i.next=t),s.interleaved=t,wn(e,n)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}function fp(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function go(e,t,n,s){var i=e.updateQueue;Rn=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;o=0,d=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((s&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,w=l;switch(h=t,m=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){p=y.call(m,p,h);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,h=typeof y=="function"?y.call(m,p,h):y,h==null)break e;p=Se({},p,h);break e;case 2:Rn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=p),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);_s|=o,e.lanes=o,e.memoizedState=p}}function mp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=n,typeof i!="function")throw Error(I(191,i));i.call(s)}}}var Yi={},nn=ns(Yi),Ti=ns(Yi),Pi=ns(Yi);function vs(e){if(e===Yi)throw Error(I(174));return e}function ld(e,t){switch(me(Pi,t),me(Ti,e),me(nn,Yi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wc(t,e)}xe(nn),me(nn,t)}function yr(){xe(nn),xe(Ti),xe(Pi)}function ug(e){vs(Pi.current);var t=vs(nn.current),n=wc(t,e.type);t!==n&&(me(Ti,e),me(nn,n))}function cd(e){Ti.current===e&&(xe(nn),xe(Ti))}var ke=ns(0);function xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 zl=[];function ud(){for(var e=0;e<zl.length;e++)zl[e]._workInProgressVersionPrimary=null;zl.length=0}var Va=Cn.ReactCurrentDispatcher,Rl=Cn.ReactCurrentBatchConfig,Cs=0,Ne=null,Le=null,Ie=null,yo=!1,li=!1,Ai=0,Eb=0;function He(){throw Error(I(321))}function dd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wt(e[n],t[n]))return!1;return!0}function hd(e,t,n,s,i,a){if(Cs=a,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Va.current=e===null||e.memoizedState===null?Mb:zb,e=n(s,i),li){a=0;do{if(li=!1,Ai=0,25<=a)throw Error(I(301));a+=1,Ie=Le=null,t.updateQueue=null,Va.current=Rb,e=n(s,i)}while(li)}if(Va.current=vo,t=Le!==null&&Le.next!==null,Cs=0,Ie=Le=Ne=null,yo=!1,t)throw Error(I(300));return e}function pd(){var e=Ai!==0;return Ai=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function At(){if(Le===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Ie===null?Ne.memoizedState:Ie.next;if(t!==null)Ie=t,Le=e;else{if(e===null)throw Error(I(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},Ie===null?Ne.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Mi(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=At(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=Le,i=s.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}s.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Cs&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,o=s):c=c.next=p,Ne.lanes|=d,_s|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,Wt(s,t.memoizedState)||(lt=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Ne.lanes|=a,_s|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ol(e){var t=At(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Wt(a,t.memoizedState)||(lt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function dg(){}function hg(e,t){var n=Ne,s=At(),i=t(),a=!Wt(s.memoizedState,i);if(a&&(s.memoizedState=i,lt=!0),s=s.queue,fd(mg.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,zi(9,fg.bind(null,n,s,i,t),void 0,null),Be===null)throw Error(I(349));Cs&30||pg(n,t,i)}return i}function pg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fg(e,t,n,s){t.value=n,t.getSnapshot=s,gg(t)&&xg(e)}function mg(e,t,n){return n(function(){gg(t)&&xg(e)})}function gg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wt(e,n)}catch{return!0}}function xg(e){var t=wn(e,1);t!==null&&Ht(t,e,1,-1)}function gp(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:e},t.queue=e,e=e.dispatch=Ab.bind(null,Ne,e),[t.memoizedState,e]}function zi(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function yg(){return At().memoizedState}function $a(e,t,n,s){var i=Jt();Ne.flags|=e,i.memoizedState=zi(1|t,n,void 0,s===void 0?null:s)}function Fo(e,t,n,s){var i=At();s=s===void 0?null:s;var a=void 0;if(Le!==null){var o=Le.memoizedState;if(a=o.destroy,s!==null&&dd(s,o.deps)){i.memoizedState=zi(t,n,a,s);return}}Ne.flags|=e,i.memoizedState=zi(1|t,n,a,s)}function xp(e,t){return $a(8390656,8,e,t)}function fd(e,t){return Fo(2048,8,e,t)}function vg(e,t){return Fo(4,2,e,t)}function bg(e,t){return Fo(4,4,e,t)}function wg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kg(e,t,n){return n=n!=null?n.concat([e]):null,Fo(4,4,wg.bind(null,t,e),n)}function md(){}function jg(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&dd(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Ng(e,t){var n=At();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&dd(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Sg(e,t,n){return Cs&21?(Wt(n,t)||(n=P0(),Ne.lanes|=n,_s|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=n)}function Tb(e,t){var n=le;le=n!==0&&4>n?n:4,e(!0);var s=Rl.transition;Rl.transition={};try{e(!1),t()}finally{le=n,Rl.transition=s}}function Cg(){return At().memoizedState}function Pb(e,t,n){var s=Gn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},_g(e))Eg(t,n);else if(n=lg(e,t,n,s),n!==null){var i=nt();Ht(n,e,s,i),Tg(n,t,s)}}function Ab(e,t,n){var s=Gn(e),i={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(_g(e))Eg(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Wt(l,o)){var c=t.interleaved;c===null?(i.next=i,ad(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=lg(e,t,i,s),n!==null&&(i=nt(),Ht(n,e,s,i),Tg(n,t,s))}}function _g(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Eg(e,t){li=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tg(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gu(e,n)}}var vo={readContext:Pt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},Mb={readContext:Pt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:xp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$a(4194308,4,wg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $a(4194308,4,e,t)},useInsertionEffect:function(e,t){return $a(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Jt();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Pb.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:gp,useDebugValue:md,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=gp(!1),t=e[0];return e=Tb.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Ne,i=Jt();if(be){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Be===null)throw Error(I(349));Cs&30||pg(s,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,xp(mg.bind(null,s,a,e),[e]),s.flags|=2048,zi(9,fg.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Be.identifierPrefix;if(be){var n=mn,s=fn;n=(s&~(1<<32-Ut(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ai++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Eb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zb={readContext:Pt,useCallback:jg,useContext:Pt,useEffect:fd,useImperativeHandle:kg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Ng,useReducer:Ll,useRef:yg,useState:function(){return Ll(Mi)},useDebugValue:md,useDeferredValue:function(e){var t=At();return Sg(t,Le.memoizedState,e)},useTransition:function(){var e=Ll(Mi)[0],t=At().memoizedState;return[e,t]},useMutableSource:dg,useSyncExternalStore:hg,useId:Cg,unstable_isNewReconciler:!1},Rb={readContext:Pt,useCallback:jg,useContext:Pt,useEffect:fd,useImperativeHandle:kg,useInsertionEffect:vg,useLayoutEffect:bg,useMemo:Ng,useReducer:Ol,useRef:yg,useState:function(){return Ol(Mi)},useDebugValue:md,useDeferredValue:function(e){var t=At();return Le===null?t.memoizedState=e:Sg(t,Le.memoizedState,e)},useTransition:function(){var e=Ol(Mi)[0],t=At().memoizedState;return[e,t]},useMutableSource:dg,useSyncExternalStore:hg,useId:Cg,unstable_isNewReconciler:!1};function Bt(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function $c(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vo={isMounted:function(e){return(e=e._reactInternals)?Ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=gn(s,i);a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Ht(t,e,i,s),Fa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=nt(),i=Gn(e),a=gn(s,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Hn(e,a,i),t!==null&&(Ht(t,e,i,s),Fa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),s=Gn(e),i=gn(n,s);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,s),t!==null&&(Ht(t,e,s,n),Fa(t,e,s))}};function yp(e,t,n,s,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!Si(n,s)||!Si(i,a):!0}function Pg(e,t,n){var s=!1,i=Qn,a=t.contextType;return typeof a=="object"&&a!==null?a=Pt(a):(i=ut(t)?Ns:Xe.current,s=t.contextTypes,a=(s=s!=null)?mr(e,i):Qn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vo,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function vp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Vo.enqueueReplaceState(t,t.state,null)}function Uc(e,t,n,s){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},od(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Pt(a):(a=ut(t)?Ns:Xe.current,i.context=mr(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&($c(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Vo.enqueueReplaceState(i,i.state,null),go(e,n,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vr(e,t){try{var n="",s=t;do n+=lv(s),s=s.return;while(s);var i=n}catch(a){i=`
39
39
  Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Dl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Db=typeof WeakMap=="function"?WeakMap:Map;function Ag(e,t,n){n=yn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){wo||(wo=!0,eu=s),Hc(e,t)},n}function Mg(e,t,n){n=yn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;n.payload=function(){return s(i)},n.callback=function(){Hc(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Hc(e,t),typeof s!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function bp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Db;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(i.add(n),e=Qb.bind(null,e,t,n),t.then(e,e))}function wp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function kp(e,t,n,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yn(-1,1),t.tag=2,Hn(n,t,1))),n.lanes|=1),e)}var Ib=Cn.ReactCurrentOwner,lt=!1;function et(e,t,n,s){t.child=e===null?og(t,null,n,s):xr(t,e.child,n,s)}function jp(e,t,n,s,i){n=n.render;var a=t.ref;return hr(t,i),s=hd(e,t,n,s,a,i),n=pd(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(be&&n&&ed(t),t.flags|=1,et(e,t,s,i),t.child)}function Np(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!jd(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zg(e,t,a,s,i)):(e=Ga(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Si,n(o,s)&&e.ref===t.ref)return Nn(e,t,i)}return t.flags|=1,e=Kn(a,s),e.ref=t.ref,e.return=t,t.child=e}function zg(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Si(a,s)&&e.ref===t.ref)if(lt=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(lt=!0);else return t.lanes=e.lanes,Nn(e,t,i)}return Wc(e,t,n,s,i)}function Rg(e,t,n){var s=t.pendingProps,i=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(nr,ft),ft|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(nr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(nr,ft),ft|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(nr,ft),ft|=s;return et(e,t,i,n),t.child}function Lg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wc(e,t,n,s,i){var a=ut(n)?Ns:Qe.current;return a=mr(t,a),hr(t,i),n=hd(e,t,n,s,a,i),s=pd(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Nn(e,t,i)):(be&&s&&ed(t),t.flags|=1,et(e,t,n,i),t.child)}function Sp(e,t,n,s,i){if(ut(n)){var a=!0;uo(t)}else a=!1;if(hr(t,i),t.stateNode===null)Ua(e,t),Pg(t,n,s),Uc(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Pt(u):(u=ut(n)?Ns:Qe.current,u=mr(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&vp(t,o,s,u),Rn=!1;var h=t.memoizedState;o.state=h,go(t,s,o,i),c=t.memoizedState,l!==s||h!==c||ct.current||Rn?(typeof d=="function"&&($c(t,n,d,s),c=t.memoizedState),(l=Rn||yp(t,n,l,s,h,c,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,cg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Bt(t.type,l),o.props=u,p=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Pt(c):(c=ut(n)?Ns:Qe.current,c=mr(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||h!==c)&&vp(t,o,s,c),Rn=!1,h=t.memoizedState,o.state=h,go(t,s,o,i);var v=t.memoizedState;l!==p||h!==v||ct.current||Rn?(typeof m=="function"&&($c(t,n,m,s),v=t.memoizedState),(u=Rn||yp(t,n,u,s,h,v,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=v),o.props=s,o.state=v,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return Gc(e,t,n,s,a,i)}function Gc(e,t,n,s,i,a){Lg(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&up(t,n,!1),Nn(e,t,a);s=t.stateNode,Ib.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=xr(t,e.child,null,a),t.child=xr(t,null,l,a)):et(e,t,l,a),t.memoizedState=s.state,i&&up(t,n,!0),t.child}function Og(e){var t=e.stateNode;t.pendingContext?cp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cp(e,t.context,!1),ld(e,t.containerInfo)}function Cp(e,t,n,s,i){return gr(),nd(i),t.flags|=256,et(e,t,n,s),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function qc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dg(e,t,n){var s=t.pendingProps,i=ke.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),me(ke,i&1),e===null)return Fc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ho(o,s,0,null),e=ks(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=qc(n),t.memoizedState=Kc,e):gd(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Bb(e,t,o,s,l,i,n);if(a){a=s.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Kn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Kn(l,a):(a=ks(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?qc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Kc,s}return a=e.child,e=a.sibling,s=Kn(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function gd(e,t){return t=Ho({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ba(e,t,n,s){return s!==null&&nd(s),xr(t,e.child,null,n),e=gd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bb(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Dl(Error(I(422))),ba(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=Ho({mode:"visible",children:s.children},i,0,null),a=ks(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&xr(t,e.child,null,o),t.child.memoizedState=qc(o),t.memoizedState=Kc,a);if(!(t.mode&1))return ba(e,t,o,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(I(419)),s=Dl(a,s,void 0),ba(e,t,o,s)}if(l=(o&e.childLanes)!==0,lt||l){if(s=Be,s!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,jn(e,i),Ht(s,e,i,-1))}return kd(),s=Dl(Error(I(421))),ba(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Jb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mt=Un(i.nextSibling),gt=t,be=!0,$t=null,e!==null&&(St[Ct++]=gn,St[Ct++]=xn,St[Ct++]=Ss,gn=e.id,xn=e.overflow,Ss=t),t=gd(t,s.children),t.flags|=4096,t)}function _p(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vc(e.return,t,n)}function Il(e,t,n,s,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=i)}function Ig(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(et(e,t,s.children,n),s=ke.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)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}s&=1}if(me(ke,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&xo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Il(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&xo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Il(t,!0,n,null,a);break;case"together":Il(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ua(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_s|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fb(e,t,n){switch(t.tag){case 3:Og(t),gr();break;case 5:ug(t);break;case 1:ut(t.type)&&uo(t);break;case 4:ld(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(fo,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(me(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Dg(e,t,n):(me(ke,ke.current&1),e=Nn(e,t,n),e!==null?e.sibling:null);me(ke,ke.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Ig(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(ke,ke.current),s)break;return null;case 22:case 23:return t.lanes=0,Rg(e,t,n)}return Nn(e,t,n)}var Bg,Yc,Fg,Vg;Bg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yc=function(){};Fg=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,vs(nn.current);var a=null;switch(n){case"input":i=xc(e,i),s=xc(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=bc(e,i),s=bc(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=lo)}kc(n,s);var o;n=null;for(u in i)if(!s.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(yi.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=i!=null?i[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(yi.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Vg=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ur(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Vb(e,t,n){var s=t.pendingProps;switch(td(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return ut(t.type)&&co(),Ge(t),null;case 3:return s=t.stateNode,yr(),xe(ct),xe(Qe),ud(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ya(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$t!==null&&(su($t),$t=null))),Yc(e,t),Ge(t),null;case 5:cd(t);var i=vs(Pi.current);if(n=t.type,e!==null&&t.stateNode!=null)Fg(e,t,n,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(I(166));return Ge(t),null}if(e=vs(nn.current),ya(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[Zt]=t,s[Ei]=a,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",s),ge("close",s);break;case"iframe":case"object":case"embed":ge("load",s);break;case"video":case"audio":for(i=0;i<Qr.length;i++)ge(Qr[i],s);break;case"source":ge("error",s);break;case"img":case"image":case"link":ge("error",s),ge("load",s);break;case"details":ge("toggle",s);break;case"input":Oh(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Ih(s,a),ge("invalid",s)}kc(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&xa(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&xa(s.textContent,l,e),i=["children",""+l]):yi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":ca(s),Dh(s,a,!0);break;case"textarea":ca(s),Bh(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=lo)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=m0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[Zt]=t,e[Ei]=s,Bg(e,t,!1,!1),t.stateNode=e;e:{switch(o=jc(n,s),n){case"dialog":ge("cancel",e),ge("close",e),i=s;break;case"iframe":case"object":case"embed":ge("load",e),i=s;break;case"video":case"audio":for(i=0;i<Qr.length;i++)ge(Qr[i],e);i=s;break;case"source":ge("error",e),i=s;break;case"img":case"image":case"link":ge("error",e),ge("load",e),i=s;break;case"details":ge("toggle",e),i=s;break;case"input":Oh(e,s),i=xc(e,s),ge("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=Se({},s,{value:void 0}),ge("invalid",e);break;case"textarea":Ih(e,s),i=bc(e,s),ge("invalid",e);break;default:i=s}kc(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?y0(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&g0(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&vi(e,c):typeof c=="number"&&vi(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&Fu(e,a,c,o))}switch(n){case"input":ca(e),Dh(e,s,!1);break;case"textarea":ca(e),Bh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Xn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?lr(e,!!s.multiple,a,!1):s.defaultValue!=null&&lr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=lo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ge(t),null;case 6:if(e&&t.stateNode!=null)Vg(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=vs(Pi.current),vs(nn.current),ya(t)){if(s=t.stateNode,n=t.memoizedProps,s[Zt]=t,(a=s.nodeValue!==n)&&(e=gt,e!==null))switch(e.tag){case 3:xa(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xa(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Zt]=t,t.stateNode=s}return Ge(t),null;case 13:if(xe(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&mt!==null&&t.mode&1&&!(t.flags&128))ig(),gr(),t.flags|=98560,a=!1;else if(a=ya(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(I(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(I(317));a[Zt]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ge(t),a=!1}else $t!==null&&(su($t),$t=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Oe===0&&(Oe=3):kd())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return yr(),Yc(e,t),e===null&&Ci(t.stateNode.containerInfo),Ge(t),null;case 10:return id(t.type._context),Ge(t),null;case 17:return ut(t.type)&&co(),Ge(t),null;case 19:if(xe(ke),a=t.memoizedState,a===null)return Ge(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Ur(a,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xo(e),o!==null){for(t.flags|=128,Ur(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(ke,ke.current&1|2),t.child}e=e.sibling}a.tail!==null&&Pe()>br&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304)}else{if(!s)if(e=xo(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!be)return Ge(t),null}else 2*Pe()-a.renderingStartTime>br&&n!==1073741824&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pe(),t.sibling=null,n=ke.current,me(ke,s?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return wd(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?ft&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function $b(e,t){switch(td(t),t.tag){case 1:return ut(t.type)&&co(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yr(),xe(ct),xe(Qe),ud(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return cd(t),null;case 13:if(xe(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ke),null;case 4:return yr(),null;case 10:return id(t.type._context),null;case 22:case 23:return wd(),null;case 24:return null;default:return null}}var wa=!1,qe=!1,Ub=typeof WeakSet=="function"?WeakSet:Set,G=null;function tr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){_e(e,t,s)}else n.current=null}function Xc(e,t,n){try{n()}catch(s){_e(e,t,s)}}var Ep=!1;function Hb(e,t){if(zc=io,e=G0(),Zu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(l=o+i),p!==a||s!==0&&p.nodeType!==3||(c=o+s),p.nodeType===3&&(o+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++u===i&&(l=o),h===a&&++d===s&&(c=o),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},io=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,b=v.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?w:Bt(t.type,w),b);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(C){_e(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return v=Ep,Ep=!1,v}function ci(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Xc(t,n,a)}i=i.next}while(i!==s)}}function $o(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Qc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $g(e){var t=e.alternate;t!==null&&(e.alternate=null,$g(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[Ei],delete t[Dc],delete t[Cb],delete t[_b])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ug(e){return e.tag===5||e.tag===3||e.tag===4}function Tp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ug(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.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 Jc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lo));else if(s!==4&&(e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Zc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}var Fe=null,Ft=!1;function An(e,t,n){for(n=n.child;n!==null;)Hg(e,t,n),n=n.sibling}function Hg(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Ro,n)}catch{}switch(n.tag){case 5:qe||tr(n,t);case 6:var s=Fe,i=Ft;Fe=null,An(e,t,n),Fe=s,Ft=i,Fe!==null&&(Ft?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Ft?(e=Fe,n=n.stateNode,e.nodeType===8?Al(e.parentNode,n):e.nodeType===1&&Al(e,n),ji(e)):Al(Fe,n.stateNode));break;case 4:s=Fe,i=Ft,Fe=n.stateNode.containerInfo,Ft=!0,An(e,t,n),Fe=s,Ft=i;break;case 0:case 11:case 14:case 15:if(!qe&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Xc(n,t,o),i=i.next}while(i!==s)}An(e,t,n);break;case 1:if(!qe&&(tr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){_e(n,t,l)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(qe=(s=qe)||n.memoizedState!==null,An(e,t,n),qe=s):An(e,t,n);break;default:An(e,t,n)}}function Pp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ub),t.forEach(function(s){var i=Zb.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Ot(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Fe=l.stateNode,Ft=!1;break e;case 3:Fe=l.stateNode.containerInfo,Ft=!0;break e;case 4:Fe=l.stateNode.containerInfo,Ft=!0;break e}l=l.return}if(Fe===null)throw Error(I(160));Hg(a,o,i),Fe=null,Ft=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){_e(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Wg(t,e),t=t.sibling}function Wg(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Qt(e),s&4){try{ci(3,e,e.return),$o(3,e)}catch(w){_e(e,e.return,w)}try{ci(5,e,e.return)}catch(w){_e(e,e.return,w)}}break;case 1:Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return);break;case 5:if(Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return),e.flags&32){var i=e.stateNode;try{vi(i,"")}catch(w){_e(e,e.return,w)}}if(s&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&p0(i,a),jc(l,o);var u=jc(l,a);for(o=0;o<c.length;o+=2){var d=c[o],p=c[o+1];d==="style"?y0(i,p):d==="dangerouslySetInnerHTML"?g0(i,p):d==="children"?vi(i,p):Fu(i,d,p,u)}switch(l){case"input":yc(i,a);break;case"textarea":f0(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?lr(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?lr(i,!!a.multiple,a.defaultValue,!0):lr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ei]=a}catch(w){_e(e,e.return,w)}}break;case 6:if(Ot(t,e),Qt(e),s&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(w){_e(e,e.return,w)}}break;case 3:if(Ot(t,e),Qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ji(t.containerInfo)}catch(w){_e(e,e.return,w)}break;case 4:Ot(t,e),Qt(e);break;case 13:Ot(t,e),Qt(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(vd=Pe())),s&4&&Pp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(qe=(u=qe)||d,Ot(t,e),qe=u):Ot(t,e),Qt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(p=G=d;G!==null;){switch(h=G,m=h.child,h.tag){case 0:case 11:case 14:case 15:ci(4,h,h.return);break;case 1:tr(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){s=h,n=h.return;try{t=s,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){_e(s,n,w)}}break;case 5:tr(h,h.return);break;case 22:if(h.memoizedState!==null){Mp(p);continue}}m!==null?(m.return=h,G=m):Mp(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{i=p.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=p.stateNode,c=p.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=x0("display",o))}catch(w){_e(e,e.return,w)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(w){_e(e,e.return,w)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ot(t,e),Qt(e),s&4&&Pp(e);break;case 21:break;default:Ot(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ug(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(vi(i,""),s.flags&=-33);var a=Tp(e);Zc(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Tp(e);Jc(e,l,o);break;default:throw Error(I(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wb(e,t,n){G=e,Gg(e)}function Gg(e,t,n){for(var s=(e.mode&1)!==0;G!==null;){var i=G,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||wa;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||qe;l=wa;var u=qe;if(wa=o,(qe=c)&&!u)for(G=i;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?zp(i):c!==null?(c.return=o,G=c):zp(i);for(;a!==null;)G=a,Gg(a),a=a.sibling;G=i,wa=l,qe=u}Ap(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,G=a):Ap(e)}}function Ap(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:qe||$o(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!qe)if(n===null)s.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Bt(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&mp(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mp(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&ji(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}qe||t.flags&512&&Qc(t)}catch(h){_e(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function Mp(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function zp(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{$o(4,t)}catch(c){_e(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){_e(t,i,c)}}var a=t.return;try{Qc(t)}catch(c){_e(t,a,c)}break;case 5:var o=t.return;try{Qc(t)}catch(c){_e(t,o,c)}}}catch(c){_e(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var Gb=Math.ceil,bo=Cn.ReactCurrentDispatcher,xd=Cn.ReactCurrentOwner,Tt=Cn.ReactCurrentBatchConfig,oe=0,Be=null,Me=null,$e=0,ft=0,nr=ns(0),Oe=0,Ri=null,_s=0,Uo=0,yd=0,ui=null,ot=null,vd=0,br=1/0,pn=null,wo=!1,eu=null,Wn=null,ka=!1,In=null,ko=0,di=0,tu=null,Ha=-1,Wa=0;function nt(){return oe&6?Pe():Ha!==-1?Ha:Ha=Pe()}function Gn(e){return e.mode&1?oe&2&&$e!==0?$e&-$e:Tb.transition!==null?(Wa===0&&(Wa=P0()),Wa):(e=le,e!==0||(e=window.event,e=e===void 0?16:D0(e.type)),e):1}function Ht(e,t,n,s){if(50<di)throw di=0,tu=null,Error(I(185));Gi(e,n,s),(!(oe&2)||e!==Be)&&(e===Be&&(!(oe&2)&&(Uo|=n),Oe===4&&On(e,$e)),dt(e,s),n===1&&oe===0&&!(t.mode&1)&&(br=Pe()+500,Bo&&ss()))}function dt(e,t){var n=e.callbackNode;Tv(e,t);var s=ro(e,e===Be?$e:0);if(s===0)n!==null&&$h(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&$h(n),t===1)e.tag===0?Eb(Rp.bind(null,e)):ng(Rp.bind(null,e)),Nb(function(){!(oe&6)&&ss()}),n=null;else{switch(A0(s)){case 1:n=Wu;break;case 4:n=E0;break;case 16:n=so;break;case 536870912:n=T0;break;default:n=so}n=ex(n,Kg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Kg(e,t){if(Ha=-1,Wa=0,oe&6)throw Error(I(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var s=ro(e,e===Be?$e:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=jo(e,s);else{t=s;var i=oe;oe|=2;var a=Yg();(Be!==e||$e!==t)&&(pn=null,br=Pe()+500,ws(e,t));do try{Yb();break}catch(l){qg(e,l)}while(!0);rd(),bo.current=a,oe=i,Me!==null?t=0:(Be=null,$e=0,t=Oe)}if(t!==0){if(t===2&&(i=Ec(e),i!==0&&(s=i,t=nu(e,i))),t===1)throw n=Ri,ws(e,0),On(e,s),dt(e,Pe()),n;if(t===6)On(e,s);else{if(i=e.current.alternate,!(s&30)&&!Kb(i)&&(t=jo(e,s),t===2&&(a=Ec(e),a!==0&&(s=a,t=nu(e,a))),t===1))throw n=Ri,ws(e,0),On(e,s),dt(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:ps(e,ot,pn);break;case 3:if(On(e,s),(s&130023424)===s&&(t=vd+500-Pe(),10<t)){if(ro(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){nt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Oc(ps.bind(null,e,ot,pn),t);break}ps(e,ot,pn);break;case 4:if(On(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Ut(s);a=1<<o,o=t[o],o>i&&(i=o),s&=~a}if(s=i,s=Pe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Gb(s/1960))-s,10<s){e.timeoutHandle=Oc(ps.bind(null,e,ot,pn),s);break}ps(e,ot,pn);break;case 5:ps(e,ot,pn);break;default:throw Error(I(329))}}}return dt(e,Pe()),e.callbackNode===n?Kg.bind(null,e):null}function nu(e,t){var n=ui;return e.current.memoizedState.isDehydrated&&(ws(e,t).flags|=256),e=jo(e,t),e!==2&&(t=ot,ot=n,t!==null&&su(t)),e}function su(e){ot===null?ot=e:ot.push.apply(ot,e)}function Kb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var i=n[s],a=i.getSnapshot;i=i.value;try{if(!Wt(a(),i))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 On(e,t){for(t&=~yd,t&=~Uo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ut(t),s=1<<n;e[n]=-1,t&=~s}}function Rp(e){if(oe&6)throw Error(I(327));pr();var t=ro(e,0);if(!(t&1))return dt(e,Pe()),null;var n=jo(e,t);if(e.tag!==0&&n===2){var s=Ec(e);s!==0&&(t=s,n=nu(e,s))}if(n===1)throw n=Ri,ws(e,0),On(e,t),dt(e,Pe()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ps(e,ot,pn),dt(e,Pe()),null}function bd(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(br=Pe()+500,Bo&&ss())}}function Es(e){In!==null&&In.tag===0&&!(oe&6)&&pr();var t=oe;oe|=1;var n=Tt.transition,s=le;try{if(Tt.transition=null,le=1,e)return e()}finally{le=s,Tt.transition=n,oe=t,!(oe&6)&&ss()}}function wd(){ft=nr.current,xe(nr)}function ws(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jb(n)),Me!==null)for(n=Me.return;n!==null;){var s=n;switch(td(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&co();break;case 3:yr(),xe(ct),xe(Qe),ud();break;case 5:cd(s);break;case 4:yr();break;case 13:xe(ke);break;case 19:xe(ke);break;case 10:id(s.type._context);break;case 22:case 23:wd()}n=n.return}if(Be=e,Me=e=Kn(e.current,null),$e=ft=t,Oe=0,Ri=null,yd=Uo=_s=0,ot=ui=null,ys!==null){for(t=0;t<ys.length;t++)if(n=ys[t],s=n.interleaved,s!==null){n.interleaved=null;var i=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,s.next=o}n.pending=s}ys=null}return e}function qg(e,t){do{var n=Me;try{if(rd(),Va.current=vo,yo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}yo=!1}if(Cs=0,Ie=Le=Ne=null,li=!1,Ai=0,xd.current=null,n===null||n.return===null){Oe=1,Ri=t,Me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=$e,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=wp(o);if(m!==null){m.flags&=-257,kp(m,o,l,a,t),m.mode&1&&bp(a,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var w=new Set;w.add(c),t.updateQueue=w}else v.add(c);break e}else{if(!(t&1)){bp(a,u,t),kd();break e}c=Error(I(426))}}else if(be&&l.mode&1){var b=wp(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),kp(b,o,l,a,t),nd(vr(c,l));break e}}a=c=vr(c,l),Oe!==4&&(Oe=2),ui===null?ui=[a]:ui.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Ag(a,c,t);fp(a,g);break e;case 1:l=c;var x=a.type,k=a.stateNode;if(!(a.flags&128)&&(typeof x.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Wn===null||!Wn.has(k)))){a.flags|=65536,t&=-t,a.lanes|=t;var C=Mg(a,l,t);fp(a,C);break e}}a=a.return}while(a!==null)}Qg(n)}catch(j){t=j,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Yg(){var e=bo.current;return bo.current=vo,e===null?vo:e}function kd(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Be===null||!(_s&268435455)&&!(Uo&268435455)||On(Be,$e)}function jo(e,t){var n=oe;oe|=2;var s=Yg();(Be!==e||$e!==t)&&(pn=null,ws(e,t));do try{qb();break}catch(i){qg(e,i)}while(!0);if(rd(),oe=n,bo.current=s,Me!==null)throw Error(I(261));return Be=null,$e=0,Oe}function qb(){for(;Me!==null;)Xg(Me)}function Yb(){for(;Me!==null&&!bv();)Xg(Me)}function Xg(e){var t=Zg(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Qg(e):Me=t,xd.current=null}function Qg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$b(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,Me=null;return}}else if(n=Vb(n,t,ft),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Oe===0&&(Oe=5)}function ps(e,t,n){var s=le,i=Tt.transition;try{Tt.transition=null,le=1,Xb(e,t,n,s)}finally{Tt.transition=i,le=s}return null}function Xb(e,t,n,s){do pr();while(In!==null);if(oe&6)throw Error(I(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Pv(e,a),e===Be&&(Me=Be=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ka||(ka=!0,ex(so,function(){return pr(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Tt.transition,Tt.transition=null;var o=le;le=1;var l=oe;oe|=4,xd.current=null,Hb(e,n),Wg(n,e),gb(Rc),io=!!zc,Rc=zc=null,e.current=n,Wb(n),wv(),oe=l,le=o,Tt.transition=a}else e.current=n;if(ka&&(ka=!1,In=e,ko=i),a=e.pendingLanes,a===0&&(Wn=null),Nv(n.stateNode),dt(e,Pe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],s(i.value,{componentStack:i.stack,digest:i.digest});if(wo)throw wo=!1,e=eu,eu=null,e;return ko&1&&e.tag!==0&&pr(),a=e.pendingLanes,a&1?e===tu?di++:(di=0,tu=e):di=0,ss(),null}function pr(){if(In!==null){var e=A0(ko),t=Tt.transition,n=le;try{if(Tt.transition=null,le=16>e?16:e,In===null)var s=!1;else{if(e=In,In=null,ko=0,oe&6)throw Error(I(331));var i=oe;for(oe|=4,G=e.current;G!==null;){var a=G,o=a.child;if(G.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:ci(8,d,a)}var p=d.child;if(p!==null)p.return=d,G=p;else for(;G!==null;){d=G;var h=d.sibling,m=d.return;if($g(d),d===u){G=null;break}if(h!==null){h.return=m,G=h;break}G=m}}}var v=a.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}G=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,G=o;else e:for(;G!==null;){if(a=G,a.flags&2048)switch(a.tag){case 0:case 11:case 15:ci(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,G=g;break e}G=a.return}}var x=e.current;for(G=x;G!==null;){o=G;var k=o.child;if(o.subtreeFlags&2064&&k!==null)k.return=o,G=k;else e:for(o=x;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:$o(9,l)}}catch(j){_e(l,l.return,j)}if(l===o){G=null;break e}var C=l.sibling;if(C!==null){C.return=l.return,G=C;break e}G=l.return}}if(oe=i,ss(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Ro,e)}catch{}s=!0}return s}finally{le=n,Tt.transition=t}}return!1}function Lp(e,t,n){t=vr(n,t),t=Ag(e,t,1),e=Hn(e,t,1),t=nt(),e!==null&&(Gi(e,1,t),dt(e,t))}function _e(e,t,n){if(e.tag===3)Lp(e,e,n);else for(;t!==null;){if(t.tag===3){Lp(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Wn===null||!Wn.has(s))){e=vr(n,e),e=Mg(t,e,1),t=Hn(t,e,1),e=nt(),t!==null&&(Gi(t,1,e),dt(t,e));break}}t=t.return}}function Qb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&($e&n)===n&&(Oe===4||Oe===3&&($e&130023424)===$e&&500>Pe()-vd?ws(e,0):yd|=n),dt(e,t)}function Jg(e,t){t===0&&(e.mode&1?(t=ha,ha<<=1,!(ha&130023424)&&(ha=4194304)):t=1);var n=nt();e=jn(e,t),e!==null&&(Gi(e,t,n),dt(e,n))}function Jb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jg(e,n)}function Zb(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(t),Jg(e,n)}var Zg;Zg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,Fb(e,t,n);lt=!!(e.flags&131072)}else lt=!1,be&&t.flags&1048576&&sg(t,po,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Ua(e,t),e=t.pendingProps;var i=mr(t,Qe.current);hr(t,n),i=hd(null,t,s,e,i,n);var a=pd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(s)?(a=!0,uo(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,od(t),i.updater=Vo,t.stateNode=i,i._reactInternals=t,Uc(t,s,e,n),t=Gc(null,t,s,!0,a,n)):(t.tag=0,be&&a&&ed(t),et(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Ua(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=tw(s),e=Bt(s,e),i){case 0:t=Wc(null,t,s,e,n);break e;case 1:t=Sp(null,t,s,e,n);break e;case 11:t=jp(null,t,s,e,n);break e;case 14:t=Np(null,t,s,Bt(s.type,e),n);break e}throw Error(I(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Wc(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Sp(e,t,s,i,n);case 3:e:{if(Og(t),e===null)throw Error(I(387));s=t.pendingProps,a=t.memoizedState,i=a.element,cg(e,t),go(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=vr(Error(I(423)),t),t=Cp(e,t,s,n,i);break e}else if(s!==i){i=vr(Error(I(424)),t),t=Cp(e,t,s,n,i);break e}else for(mt=Un(t.stateNode.containerInfo.firstChild),gt=t,be=!0,$t=null,n=og(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),s===i){t=Nn(e,t,n);break e}et(e,t,s,n)}t=t.child}return t;case 5:return ug(t),e===null&&Fc(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Lc(s,i)?o=null:a!==null&&Lc(s,a)&&(t.flags|=32),Lg(e,t),et(e,t,o,n),t.child;case 6:return e===null&&Fc(t),null;case 13:return Dg(e,t,n);case 4:return ld(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=xr(t,null,s,n):et(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),jp(e,t,s,i,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,me(fo,s._currentValue),s._currentValue=o,a!==null)if(Wt(a.value,o)){if(a.children===i.children&&!ct.current){t=Nn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=yn(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Vc(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(I(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Vc(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,hr(t,n),i=Pt(i),s=s(i),t.flags|=1,et(e,t,s,n),t.child;case 14:return s=t.type,i=Bt(s,t.pendingProps),i=Bt(s.type,i),Np(e,t,s,i,n);case 15:return zg(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Ua(e,t),t.tag=1,ut(s)?(e=!0,uo(t)):e=!1,hr(t,n),Pg(t,s,i),Uc(t,s,i,n),Gc(null,t,s,!0,e,n);case 19:return Ig(e,t,n);case 22:return Rg(e,t,n)}throw Error(I(156,t.tag))};function ex(e,t){return _0(e,t)}function ew(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,s){return new ew(e,t,n,s)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tw(e){if(typeof e=="function")return jd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$u)return 11;if(e===Uu)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Et(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&14680064,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}function Ga(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")jd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gs:return ks(n.children,i,a,t);case Vu:o=8,i|=8;break;case pc:return e=Et(12,n,t,i|2),e.elementType=pc,e.lanes=a,e;case fc:return e=Et(13,n,t,i),e.elementType=fc,e.lanes=a,e;case mc:return e=Et(19,n,t,i),e.elementType=mc,e.lanes=a,e;case u0:return Ho(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l0:o=10;break e;case c0:o=9;break e;case $u:o=11;break e;case Uu:o=14;break e;case zn:o=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Et(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function ks(e,t,n,s){return e=Et(7,e,s,t),e.lanes=n,e}function Ho(e,t,n,s){return e=Et(22,e,s,t),e.elementType=u0,e.lanes=n,e.stateNode={isHidden:!1},e}function Bl(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Fl(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nw(e,t,n,s,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bl(0),this.expirationTimes=bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Nd(e,t,n,s,i,a,o,l,c){return e=new nw(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},od(a),e}function sw(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function tx(e){if(!e)return Qn;e=e._reactInternals;e:{if(Ms(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ut(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(ut(n))return tg(e,n,t)}return t}function nx(e,t,n,s,i,a,o,l,c){return e=Nd(n,s,!0,e,i,a,o,l,c),e.context=tx(null),n=e.current,s=nt(),i=Gn(n),a=yn(s,i),a.callback=t??null,Hn(n,a,i),e.current.lanes=i,Gi(e,i,s),dt(e,s),e}function Wo(e,t,n,s){var i=t.current,a=nt(),o=Gn(i);return n=tx(n),t.context===null?t.context=n:t.pendingContext=n,t=yn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Hn(i,t,o),e!==null&&(Ht(e,i,o,a),Fa(e,i,o)),o}function No(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sd(e,t){Op(e,t),(e=e.alternate)&&Op(e,t)}function rw(){return null}var sx=typeof reportError=="function"?reportError:function(e){console.error(e)};function Cd(e){this._internalRoot=e}Go.prototype.render=Cd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));Wo(e,t,null,null)};Go.prototype.unmount=Cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){Wo(null,e,null,null)}),t[kn]=null}};function Go(e){this._internalRoot=e}Go.prototype.unstable_scheduleHydration=function(e){if(e){var t=R0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&O0(e)}};function _d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ko(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dp(){}function iw(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var u=No(o);a.call(u)}}var o=nx(t,s,e,0,null,!1,!1,"",Dp);return e._reactRootContainer=o,e[kn]=o.current,Ci(e.nodeType===8?e.parentNode:e),Es(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var u=No(c);l.call(u)}}var c=Nd(e,0,!1,null,null,!1,!1,"",Dp);return e._reactRootContainer=c,e[kn]=c.current,Ci(e.nodeType===8?e.parentNode:e),Es(function(){Wo(t,c,n,s)}),c}function qo(e,t,n,s,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=No(o);l.call(c)}}Wo(t,o,e,i)}else o=iw(n,t,e,i,s);return No(o)}M0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xr(t.pendingLanes);n!==0&&(Gu(t,n|1),dt(t,Pe()),!(oe&6)&&(br=Pe()+500,ss()))}break;case 13:Es(function(){var s=jn(e,1);if(s!==null){var i=nt();Ht(s,e,1,i)}}),Sd(e,1)}};Ku=function(e){if(e.tag===13){var t=jn(e,134217728);if(t!==null){var n=nt();Ht(t,e,134217728,n)}Sd(e,134217728)}};z0=function(e){if(e.tag===13){var t=Gn(e),n=jn(e,t);if(n!==null){var s=nt();Ht(n,e,t,s)}Sd(e,t)}};R0=function(){return le};L0=function(e,t){var n=le;try{return le=e,t()}finally{le=n}};Sc=function(e,t,n){switch(t){case"input":if(yc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=Io(s);if(!i)throw Error(I(90));h0(s),yc(s,i)}}}break;case"textarea":f0(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};w0=bd;k0=Es;var aw={usingClientEntryPoint:!1,Events:[qi,Xs,Io,v0,b0,bd]},Hr={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ow={bundleType:Hr.bundleType,version:Hr.version,rendererPackageName:Hr.rendererPackageName,rendererConfig:Hr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S0(e),e===null?null:e.stateNode},findFiberByHostInstance:Hr.findFiberByHostInstance||rw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ja.isDisabled&&ja.supportsFiber)try{Ro=ja.inject(ow),tn=ja}catch{}}bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aw;bt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_d(t))throw Error(I(200));return sw(e,t,null,n)};bt.createRoot=function(e,t){if(!_d(e))throw Error(I(299));var n=!1,s="",i=sx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Nd(e,1,!1,null,null,n,!1,s,i),e[kn]=t.current,Ci(e.nodeType===8?e.parentNode:e),new Cd(t)};bt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=S0(t),e=e===null?null:e.stateNode,e};bt.flushSync=function(e){return Es(e)};bt.hydrate=function(e,t,n){if(!Ko(t))throw Error(I(200));return qo(null,e,t,!0,n)};bt.hydrateRoot=function(e,t,n){if(!_d(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=sx;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=nx(t,null,e,1,n??null,i,!1,a,o),e[kn]=t.current,Ci(e),s)for(e=0;e<s.length;e++)n=s[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Go(t)};bt.render=function(e,t,n){if(!Ko(t))throw Error(I(200));return qo(null,e,t,!1,n)};bt.unmountComponentAtNode=function(e){if(!Ko(e))throw Error(I(40));return e._reactRootContainer?(Es(function(){qo(null,null,e,!1,function(){e._reactRootContainer=null,e[kn]=null})}),!0):!1};bt.unstable_batchedUpdates=bd;bt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Ko(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return qo(e,t,n,!1,s)};bt.version="18.3.1-next-f1338f8080-20240426";function rx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rx)}catch(e){console.error(e)}}rx(),r0.exports=bt;var ix=r0.exports;const lw=Gm(ix);var ax,Ip=ix;ax=Ip.createRoot,Ip.hydrateRoot;/**
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Dl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Lb=typeof WeakMap=="function"?WeakMap:Map;function Ag(e,t,n){n=gn(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){wo||(wo=!0,eu=s),Hc(e,t)},n}function Mg(e,t,n){n=gn(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;n.payload=function(){return s(i)},n.callback=function(){Hc(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Hc(e,t),typeof s!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function bp(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Lb;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(i.add(n),e=Yb.bind(null,e,t,n),t.then(e,e))}function wp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function kp(e,t,n,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=gn(-1,1),t.tag=2,Hn(n,t,1))),n.lanes|=1),e)}var Ob=Cn.ReactCurrentOwner,lt=!1;function et(e,t,n,s){t.child=e===null?og(t,null,n,s):xr(t,e.child,n,s)}function jp(e,t,n,s,i){n=n.render;var a=t.ref;return hr(t,i),s=hd(e,t,n,s,a,i),n=pd(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,kn(e,t,i)):(be&&n&&ed(t),t.flags|=1,et(e,t,s,i),t.child)}function Np(e,t,n,s,i){if(e===null){var a=n.type;return typeof a=="function"&&!jd(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zg(e,t,a,s,i)):(e=Ga(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:Si,n(o,s)&&e.ref===t.ref)return kn(e,t,i)}return t.flags|=1,e=Kn(a,s),e.ref=t.ref,e.return=t,t.child=e}function zg(e,t,n,s,i){if(e!==null){var a=e.memoizedProps;if(Si(a,s)&&e.ref===t.ref)if(lt=!1,t.pendingProps=s=a,(e.lanes&i)!==0)e.flags&131072&&(lt=!0);else return t.lanes=e.lanes,kn(e,t,i)}return Wc(e,t,n,s,i)}function Rg(e,t,n){var s=t.pendingProps,i=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(nr,ft),ft|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(nr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,me(nr,ft),ft|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,me(nr,ft),ft|=s;return et(e,t,i,n),t.child}function Lg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wc(e,t,n,s,i){var a=ut(n)?Ns:Xe.current;return a=mr(t,a),hr(t,i),n=hd(e,t,n,s,a,i),s=pd(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,kn(e,t,i)):(be&&s&&ed(t),t.flags|=1,et(e,t,n,i),t.child)}function Sp(e,t,n,s,i){if(ut(n)){var a=!0;uo(t)}else a=!1;if(hr(t,i),t.stateNode===null)Ua(e,t),Pg(t,n,s),Uc(t,n,s,i),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Pt(u):(u=ut(n)?Ns:Xe.current,u=mr(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&vp(t,o,s,u),Rn=!1;var h=t.memoizedState;o.state=h,go(t,s,o,i),c=t.memoizedState,l!==s||h!==c||ct.current||Rn?(typeof d=="function"&&($c(t,n,d,s),c=t.memoizedState),(l=Rn||yp(t,n,l,s,h,c,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,cg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Bt(t.type,l),o.props=u,p=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Pt(c):(c=ut(n)?Ns:Xe.current,c=mr(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||h!==c)&&vp(t,o,s,c),Rn=!1,h=t.memoizedState,o.state=h,go(t,s,o,i);var y=t.memoizedState;l!==p||h!==y||ct.current||Rn?(typeof m=="function"&&($c(t,n,m,s),y=t.memoizedState),(u=Rn||yp(t,n,u,s,h,y,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=y),o.props=s,o.state=y,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return Gc(e,t,n,s,a,i)}function Gc(e,t,n,s,i,a){Lg(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return i&&up(t,n,!1),kn(e,t,a);s=t.stateNode,Ob.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=xr(t,e.child,null,a),t.child=xr(t,null,l,a)):et(e,t,l,a),t.memoizedState=s.state,i&&up(t,n,!0),t.child}function Og(e){var t=e.stateNode;t.pendingContext?cp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cp(e,t.context,!1),ld(e,t.containerInfo)}function Cp(e,t,n,s,i){return gr(),nd(i),t.flags|=256,et(e,t,n,s),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function qc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dg(e,t,n){var s=t.pendingProps,i=ke.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),me(ke,i&1),e===null)return Fc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ho(o,s,0,null),e=ks(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=qc(n),t.memoizedState=Kc,e):gd(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Db(e,t,o,s,l,i,n);if(a){a=s.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Kn(i,c),s.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Kn(l,a):(a=ks(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?qc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Kc,s}return a=e.child,e=a.sibling,s=Kn(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function gd(e,t){return t=Ho({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ba(e,t,n,s){return s!==null&&nd(s),xr(t,e.child,null,n),e=gd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Db(e,t,n,s,i,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Dl(Error(I(422))),ba(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,i=t.mode,s=Ho({mode:"visible",children:s.children},i,0,null),a=ks(a,i,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&xr(t,e.child,null,o),t.child.memoizedState=qc(o),t.memoizedState=Kc,a);if(!(t.mode&1))return ba(e,t,o,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(I(419)),s=Dl(a,s,void 0),ba(e,t,o,s)}if(l=(o&e.childLanes)!==0,lt||l){if(s=Be,s!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,wn(e,i),Ht(s,e,i,-1))}return kd(),s=Dl(Error(I(421))),ba(e,t,o,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Xb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mt=Un(i.nextSibling),gt=t,be=!0,$t=null,e!==null&&(St[Ct++]=fn,St[Ct++]=mn,St[Ct++]=Ss,fn=e.id,mn=e.overflow,Ss=t),t=gd(t,s.children),t.flags|=4096,t)}function _p(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vc(e.return,t,n)}function Il(e,t,n,s,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=i)}function Ig(e,t,n){var s=t.pendingProps,i=s.revealOrder,a=s.tail;if(et(e,t,s.children,n),s=ke.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)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}s&=1}if(me(ke,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&xo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Il(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&xo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Il(t,!0,n,null,a);break;case"together":Il(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ua(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function kn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_s|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ib(e,t,n){switch(t.tag){case 3:Og(t),gr();break;case 5:ug(t);break;case 1:ut(t.type)&&uo(t);break;case 4:ld(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;me(fo,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(me(ke,ke.current&1),t.flags|=128,null):n&t.child.childLanes?Dg(e,t,n):(me(ke,ke.current&1),e=kn(e,t,n),e!==null?e.sibling:null);me(ke,ke.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Ig(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(ke,ke.current),s)break;return null;case 22:case 23:return t.lanes=0,Rg(e,t,n)}return kn(e,t,n)}var Bg,Yc,Fg,Vg;Bg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yc=function(){};Fg=function(e,t,n,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,vs(nn.current);var a=null;switch(n){case"input":i=xc(e,i),s=xc(e,s),a=[];break;case"select":i=Se({},i,{value:void 0}),s=Se({},s,{value:void 0}),a=[];break;case"textarea":i=bc(e,i),s=bc(e,s),a=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=lo)}kc(n,s);var o;n=null;for(u in i)if(!s.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(yi.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=i!=null?i[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(yi.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ge("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Vg=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ur(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Bb(e,t,n){var s=t.pendingProps;switch(td(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return ut(t.type)&&co(),We(t),null;case 3:return s=t.stateNode,yr(),xe(ct),xe(Xe),ud(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ya(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$t!==null&&(su($t),$t=null))),Yc(e,t),We(t),null;case 5:cd(t);var i=vs(Pi.current);if(n=t.type,e!==null&&t.stateNode!=null)Fg(e,t,n,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(I(166));return We(t),null}if(e=vs(nn.current),ya(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[Zt]=t,s[Ei]=a,e=(t.mode&1)!==0,n){case"dialog":ge("cancel",s),ge("close",s);break;case"iframe":case"object":case"embed":ge("load",s);break;case"video":case"audio":for(i=0;i<Qr.length;i++)ge(Qr[i],s);break;case"source":ge("error",s);break;case"img":case"image":case"link":ge("error",s),ge("load",s);break;case"details":ge("toggle",s);break;case"input":Oh(s,a),ge("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},ge("invalid",s);break;case"textarea":Ih(s,a),ge("invalid",s)}kc(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&xa(s.textContent,l,e),i=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&xa(s.textContent,l,e),i=["children",""+l]):yi.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",s)}switch(n){case"input":ca(s),Dh(s,a,!0);break;case"textarea":ca(s),Bh(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=lo)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=m0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[Zt]=t,e[Ei]=s,Bg(e,t,!1,!1),t.stateNode=e;e:{switch(o=jc(n,s),n){case"dialog":ge("cancel",e),ge("close",e),i=s;break;case"iframe":case"object":case"embed":ge("load",e),i=s;break;case"video":case"audio":for(i=0;i<Qr.length;i++)ge(Qr[i],e);i=s;break;case"source":ge("error",e),i=s;break;case"img":case"image":case"link":ge("error",e),ge("load",e),i=s;break;case"details":ge("toggle",e),i=s;break;case"input":Oh(e,s),i=xc(e,s),ge("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=Se({},s,{value:void 0}),ge("invalid",e);break;case"textarea":Ih(e,s),i=bc(e,s),ge("invalid",e);break;default:i=s}kc(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?y0(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&g0(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&vi(e,c):typeof c=="number"&&vi(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yi.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ge("scroll",e):c!=null&&Fu(e,a,c,o))}switch(n){case"input":ca(e),Dh(e,s,!1);break;case"textarea":ca(e),Bh(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Xn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?lr(e,!!s.multiple,a,!1):s.defaultValue!=null&&lr(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=lo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return We(t),null;case 6:if(e&&t.stateNode!=null)Vg(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=vs(Pi.current),vs(nn.current),ya(t)){if(s=t.stateNode,n=t.memoizedProps,s[Zt]=t,(a=s.nodeValue!==n)&&(e=gt,e!==null))switch(e.tag){case 3:xa(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&xa(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Zt]=t,t.stateNode=s}return We(t),null;case 13:if(xe(ke),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&mt!==null&&t.mode&1&&!(t.flags&128))ig(),gr(),t.flags|=98560,a=!1;else if(a=ya(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(I(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(I(317));a[Zt]=t}else gr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),a=!1}else $t!==null&&(su($t),$t=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Oe===0&&(Oe=3):kd())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return yr(),Yc(e,t),e===null&&Ci(t.stateNode.containerInfo),We(t),null;case 10:return id(t.type._context),We(t),null;case 17:return ut(t.type)&&co(),We(t),null;case 19:if(xe(ke),a=t.memoizedState,a===null)return We(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Ur(a,!1);else{if(Oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xo(e),o!==null){for(t.flags|=128,Ur(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return me(ke,ke.current&1|2),t.child}e=e.sibling}a.tail!==null&&Pe()>br&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304)}else{if(!s)if(e=xo(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ur(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!be)return We(t),null}else 2*Pe()-a.renderingStartTime>br&&n!==1073741824&&(t.flags|=128,s=!0,Ur(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pe(),t.sibling=null,n=ke.current,me(ke,s?n&1|2:n&1),t):(We(t),null);case 22:case 23:return wd(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?ft&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function Fb(e,t){switch(td(t),t.tag){case 1:return ut(t.type)&&co(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yr(),xe(ct),xe(Xe),ud(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return cd(t),null;case 13:if(xe(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));gr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ke),null;case 4:return yr(),null;case 10:return id(t.type._context),null;case 22:case 23:return wd(),null;case 24:return null;default:return null}}var wa=!1,Ke=!1,Vb=typeof WeakSet=="function"?WeakSet:Set,G=null;function tr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){_e(e,t,s)}else n.current=null}function Xc(e,t,n){try{n()}catch(s){_e(e,t,s)}}var Ep=!1;function $b(e,t){if(zc=io,e=G0(),Zu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==n||i!==0&&p.nodeType!==3||(l=o+i),p!==a||s!==0&&p.nodeType!==3||(c=o+s),p.nodeType===3&&(o+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===n&&++u===i&&(l=o),h===a&&++d===s&&(c=o),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},io=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,v=y.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?w:Bt(t.type,w),v);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(j){_e(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return y=Ep,Ep=!1,y}function ci(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Xc(t,n,a)}i=i.next}while(i!==s)}}function $o(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Qc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $g(e){var t=e.alternate;t!==null&&(e.alternate=null,$g(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[Ei],delete t[Dc],delete t[Nb],delete t[Sb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ug(e){return e.tag===5||e.tag===3||e.tag===4}function Tp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ug(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.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 Jc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lo));else if(s!==4&&(e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Zc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}var Fe=null,Ft=!1;function An(e,t,n){for(n=n.child;n!==null;)Hg(e,t,n),n=n.sibling}function Hg(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Ro,n)}catch{}switch(n.tag){case 5:Ke||tr(n,t);case 6:var s=Fe,i=Ft;Fe=null,An(e,t,n),Fe=s,Ft=i,Fe!==null&&(Ft?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Ft?(e=Fe,n=n.stateNode,e.nodeType===8?Al(e.parentNode,n):e.nodeType===1&&Al(e,n),ji(e)):Al(Fe,n.stateNode));break;case 4:s=Fe,i=Ft,Fe=n.stateNode.containerInfo,Ft=!0,An(e,t,n),Fe=s,Ft=i;break;case 0:case 11:case 14:case 15:if(!Ke&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Xc(n,t,o),i=i.next}while(i!==s)}An(e,t,n);break;case 1:if(!Ke&&(tr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){_e(n,t,l)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(Ke=(s=Ke)||n.memoizedState!==null,An(e,t,n),Ke=s):An(e,t,n);break;default:An(e,t,n)}}function Pp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Vb),t.forEach(function(s){var i=Qb.bind(null,e,s);n.has(s)||(n.add(s),s.then(i,i))})}}function Ot(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Fe=l.stateNode,Ft=!1;break e;case 3:Fe=l.stateNode.containerInfo,Ft=!0;break e;case 4:Fe=l.stateNode.containerInfo,Ft=!0;break e}l=l.return}if(Fe===null)throw Error(I(160));Hg(a,o,i),Fe=null,Ft=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){_e(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Wg(t,e),t=t.sibling}function Wg(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Qt(e),s&4){try{ci(3,e,e.return),$o(3,e)}catch(w){_e(e,e.return,w)}try{ci(5,e,e.return)}catch(w){_e(e,e.return,w)}}break;case 1:Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return);break;case 5:if(Ot(t,e),Qt(e),s&512&&n!==null&&tr(n,n.return),e.flags&32){var i=e.stateNode;try{vi(i,"")}catch(w){_e(e,e.return,w)}}if(s&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&p0(i,a),jc(l,o);var u=jc(l,a);for(o=0;o<c.length;o+=2){var d=c[o],p=c[o+1];d==="style"?y0(i,p):d==="dangerouslySetInnerHTML"?g0(i,p):d==="children"?vi(i,p):Fu(i,d,p,u)}switch(l){case"input":yc(i,a);break;case"textarea":f0(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?lr(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?lr(i,!!a.multiple,a.defaultValue,!0):lr(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ei]=a}catch(w){_e(e,e.return,w)}}break;case 6:if(Ot(t,e),Qt(e),s&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(w){_e(e,e.return,w)}}break;case 3:if(Ot(t,e),Qt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ji(t.containerInfo)}catch(w){_e(e,e.return,w)}break;case 4:Ot(t,e),Qt(e);break;case 13:Ot(t,e),Qt(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(vd=Pe())),s&4&&Pp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ke=(u=Ke)||d,Ot(t,e),Ke=u):Ot(t,e),Qt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(p=G=d;G!==null;){switch(h=G,m=h.child,h.tag){case 0:case 11:case 14:case 15:ci(4,h,h.return);break;case 1:tr(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){s=h,n=h.return;try{t=s,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){_e(s,n,w)}}break;case 5:tr(h,h.return);break;case 22:if(h.memoizedState!==null){Mp(p);continue}}m!==null?(m.return=h,G=m):Mp(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{i=p.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=p.stateNode,c=p.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=x0("display",o))}catch(w){_e(e,e.return,w)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(w){_e(e,e.return,w)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ot(t,e),Qt(e),s&4&&Pp(e);break;case 21:break;default:Ot(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ug(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(vi(i,""),s.flags&=-33);var a=Tp(e);Zc(e,a,i);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Tp(e);Jc(e,l,o);break;default:throw Error(I(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ub(e,t,n){G=e,Gg(e)}function Gg(e,t,n){for(var s=(e.mode&1)!==0;G!==null;){var i=G,a=i.child;if(i.tag===22&&s){var o=i.memoizedState!==null||wa;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Ke;l=wa;var u=Ke;if(wa=o,(Ke=c)&&!u)for(G=i;G!==null;)o=G,c=o.child,o.tag===22&&o.memoizedState!==null?zp(i):c!==null?(c.return=o,G=c):zp(i);for(;a!==null;)G=a,Gg(a),a=a.sibling;G=i,wa=l,Ke=u}Ap(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,G=a):Ap(e)}}function Ap(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ke||$o(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ke)if(n===null)s.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Bt(t.type,n.memoizedProps);s.componentDidUpdate(i,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&mp(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mp(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&ji(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}Ke||t.flags&512&&Qc(t)}catch(h){_e(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function Mp(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function zp(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{$o(4,t)}catch(c){_e(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(c){_e(t,i,c)}}var a=t.return;try{Qc(t)}catch(c){_e(t,a,c)}break;case 5:var o=t.return;try{Qc(t)}catch(c){_e(t,o,c)}}}catch(c){_e(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var Hb=Math.ceil,bo=Cn.ReactCurrentDispatcher,xd=Cn.ReactCurrentOwner,Tt=Cn.ReactCurrentBatchConfig,ae=0,Be=null,Me=null,$e=0,ft=0,nr=ns(0),Oe=0,Ri=null,_s=0,Uo=0,yd=0,ui=null,ot=null,vd=0,br=1/0,dn=null,wo=!1,eu=null,Wn=null,ka=!1,In=null,ko=0,di=0,tu=null,Ha=-1,Wa=0;function nt(){return ae&6?Pe():Ha!==-1?Ha:Ha=Pe()}function Gn(e){return e.mode&1?ae&2&&$e!==0?$e&-$e:_b.transition!==null?(Wa===0&&(Wa=P0()),Wa):(e=le,e!==0||(e=window.event,e=e===void 0?16:D0(e.type)),e):1}function Ht(e,t,n,s){if(50<di)throw di=0,tu=null,Error(I(185));Gi(e,n,s),(!(ae&2)||e!==Be)&&(e===Be&&(!(ae&2)&&(Uo|=n),Oe===4&&On(e,$e)),dt(e,s),n===1&&ae===0&&!(t.mode&1)&&(br=Pe()+500,Bo&&ss()))}function dt(e,t){var n=e.callbackNode;_v(e,t);var s=ro(e,e===Be?$e:0);if(s===0)n!==null&&$h(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&$h(n),t===1)e.tag===0?Cb(Rp.bind(null,e)):ng(Rp.bind(null,e)),kb(function(){!(ae&6)&&ss()}),n=null;else{switch(A0(s)){case 1:n=Wu;break;case 4:n=E0;break;case 16:n=so;break;case 536870912:n=T0;break;default:n=so}n=ex(n,Kg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Kg(e,t){if(Ha=-1,Wa=0,ae&6)throw Error(I(327));var n=e.callbackNode;if(pr()&&e.callbackNode!==n)return null;var s=ro(e,e===Be?$e:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=jo(e,s);else{t=s;var i=ae;ae|=2;var a=Yg();(Be!==e||$e!==t)&&(dn=null,br=Pe()+500,ws(e,t));do try{Kb();break}catch(l){qg(e,l)}while(!0);rd(),bo.current=a,ae=i,Me!==null?t=0:(Be=null,$e=0,t=Oe)}if(t!==0){if(t===2&&(i=Ec(e),i!==0&&(s=i,t=nu(e,i))),t===1)throw n=Ri,ws(e,0),On(e,s),dt(e,Pe()),n;if(t===6)On(e,s);else{if(i=e.current.alternate,!(s&30)&&!Wb(i)&&(t=jo(e,s),t===2&&(a=Ec(e),a!==0&&(s=a,t=nu(e,a))),t===1))throw n=Ri,ws(e,0),On(e,s),dt(e,Pe()),n;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:ps(e,ot,dn);break;case 3:if(On(e,s),(s&130023424)===s&&(t=vd+500-Pe(),10<t)){if(ro(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){nt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Oc(ps.bind(null,e,ot,dn),t);break}ps(e,ot,dn);break;case 4:if(On(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var o=31-Ut(s);a=1<<o,o=t[o],o>i&&(i=o),s&=~a}if(s=i,s=Pe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Hb(s/1960))-s,10<s){e.timeoutHandle=Oc(ps.bind(null,e,ot,dn),s);break}ps(e,ot,dn);break;case 5:ps(e,ot,dn);break;default:throw Error(I(329))}}}return dt(e,Pe()),e.callbackNode===n?Kg.bind(null,e):null}function nu(e,t){var n=ui;return e.current.memoizedState.isDehydrated&&(ws(e,t).flags|=256),e=jo(e,t),e!==2&&(t=ot,ot=n,t!==null&&su(t)),e}function su(e){ot===null?ot=e:ot.push.apply(ot,e)}function Wb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var i=n[s],a=i.getSnapshot;i=i.value;try{if(!Wt(a(),i))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 On(e,t){for(t&=~yd,t&=~Uo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ut(t),s=1<<n;e[n]=-1,t&=~s}}function Rp(e){if(ae&6)throw Error(I(327));pr();var t=ro(e,0);if(!(t&1))return dt(e,Pe()),null;var n=jo(e,t);if(e.tag!==0&&n===2){var s=Ec(e);s!==0&&(t=s,n=nu(e,s))}if(n===1)throw n=Ri,ws(e,0),On(e,t),dt(e,Pe()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ps(e,ot,dn),dt(e,Pe()),null}function bd(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(br=Pe()+500,Bo&&ss())}}function Es(e){In!==null&&In.tag===0&&!(ae&6)&&pr();var t=ae;ae|=1;var n=Tt.transition,s=le;try{if(Tt.transition=null,le=1,e)return e()}finally{le=s,Tt.transition=n,ae=t,!(ae&6)&&ss()}}function wd(){ft=nr.current,xe(nr)}function ws(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,wb(n)),Me!==null)for(n=Me.return;n!==null;){var s=n;switch(td(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&co();break;case 3:yr(),xe(ct),xe(Xe),ud();break;case 5:cd(s);break;case 4:yr();break;case 13:xe(ke);break;case 19:xe(ke);break;case 10:id(s.type._context);break;case 22:case 23:wd()}n=n.return}if(Be=e,Me=e=Kn(e.current,null),$e=ft=t,Oe=0,Ri=null,yd=Uo=_s=0,ot=ui=null,ys!==null){for(t=0;t<ys.length;t++)if(n=ys[t],s=n.interleaved,s!==null){n.interleaved=null;var i=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,s.next=o}n.pending=s}ys=null}return e}function qg(e,t){do{var n=Me;try{if(rd(),Va.current=vo,yo){for(var s=Ne.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}yo=!1}if(Cs=0,Ie=Le=Ne=null,li=!1,Ai=0,xd.current=null,n===null||n.return===null){Oe=1,Ri=t,Me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=$e,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=wp(o);if(m!==null){m.flags&=-257,kp(m,o,l,a,t),m.mode&1&&bp(a,u,t),t=m,c=u;var y=t.updateQueue;if(y===null){var w=new Set;w.add(c),t.updateQueue=w}else y.add(c);break e}else{if(!(t&1)){bp(a,u,t),kd();break e}c=Error(I(426))}}else if(be&&l.mode&1){var v=wp(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),kp(v,o,l,a,t),nd(vr(c,l));break e}}a=c=vr(c,l),Oe!==4&&(Oe=2),ui===null?ui=[a]:ui.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Ag(a,c,t);fp(a,g);break e;case 1:l=c;var x=a.type,k=a.stateNode;if(!(a.flags&128)&&(typeof x.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Wn===null||!Wn.has(k)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Mg(a,l,t);fp(a,j);break e}}a=a.return}while(a!==null)}Qg(n)}catch(b){t=b,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Yg(){var e=bo.current;return bo.current=vo,e===null?vo:e}function kd(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Be===null||!(_s&268435455)&&!(Uo&268435455)||On(Be,$e)}function jo(e,t){var n=ae;ae|=2;var s=Yg();(Be!==e||$e!==t)&&(dn=null,ws(e,t));do try{Gb();break}catch(i){qg(e,i)}while(!0);if(rd(),ae=n,bo.current=s,Me!==null)throw Error(I(261));return Be=null,$e=0,Oe}function Gb(){for(;Me!==null;)Xg(Me)}function Kb(){for(;Me!==null&&!yv();)Xg(Me)}function Xg(e){var t=Zg(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Qg(e):Me=t,xd.current=null}function Qg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Fb(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,Me=null;return}}else if(n=Bb(n,t,ft),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Oe===0&&(Oe=5)}function ps(e,t,n){var s=le,i=Tt.transition;try{Tt.transition=null,le=1,qb(e,t,n,s)}finally{Tt.transition=i,le=s}return null}function qb(e,t,n,s){do pr();while(In!==null);if(ae&6)throw Error(I(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Ev(e,a),e===Be&&(Me=Be=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ka||(ka=!0,ex(so,function(){return pr(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Tt.transition,Tt.transition=null;var o=le;le=1;var l=ae;ae|=4,xd.current=null,$b(e,n),Wg(n,e),fb(Rc),io=!!zc,Rc=zc=null,e.current=n,Ub(n),vv(),ae=l,le=o,Tt.transition=a}else e.current=n;if(ka&&(ka=!1,In=e,ko=i),a=e.pendingLanes,a===0&&(Wn=null),kv(n.stateNode),dt(e,Pe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],s(i.value,{componentStack:i.stack,digest:i.digest});if(wo)throw wo=!1,e=eu,eu=null,e;return ko&1&&e.tag!==0&&pr(),a=e.pendingLanes,a&1?e===tu?di++:(di=0,tu=e):di=0,ss(),null}function pr(){if(In!==null){var e=A0(ko),t=Tt.transition,n=le;try{if(Tt.transition=null,le=16>e?16:e,In===null)var s=!1;else{if(e=In,In=null,ko=0,ae&6)throw Error(I(331));var i=ae;for(ae|=4,G=e.current;G!==null;){var a=G,o=a.child;if(G.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:ci(8,d,a)}var p=d.child;if(p!==null)p.return=d,G=p;else for(;G!==null;){d=G;var h=d.sibling,m=d.return;if($g(d),d===u){G=null;break}if(h!==null){h.return=m,G=h;break}G=m}}}var y=a.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var v=w.sibling;w.sibling=null,w=v}while(w!==null)}}G=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,G=o;else e:for(;G!==null;){if(a=G,a.flags&2048)switch(a.tag){case 0:case 11:case 15:ci(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,G=g;break e}G=a.return}}var x=e.current;for(G=x;G!==null;){o=G;var k=o.child;if(o.subtreeFlags&2064&&k!==null)k.return=o,G=k;else e:for(o=x;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:$o(9,l)}}catch(b){_e(l,l.return,b)}if(l===o){G=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,G=j;break e}G=l.return}}if(ae=i,ss(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Ro,e)}catch{}s=!0}return s}finally{le=n,Tt.transition=t}}return!1}function Lp(e,t,n){t=vr(n,t),t=Ag(e,t,1),e=Hn(e,t,1),t=nt(),e!==null&&(Gi(e,1,t),dt(e,t))}function _e(e,t,n){if(e.tag===3)Lp(e,e,n);else for(;t!==null;){if(t.tag===3){Lp(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Wn===null||!Wn.has(s))){e=vr(n,e),e=Mg(t,e,1),t=Hn(t,e,1),e=nt(),t!==null&&(Gi(t,1,e),dt(t,e));break}}t=t.return}}function Yb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&($e&n)===n&&(Oe===4||Oe===3&&($e&130023424)===$e&&500>Pe()-vd?ws(e,0):yd|=n),dt(e,t)}function Jg(e,t){t===0&&(e.mode&1?(t=ha,ha<<=1,!(ha&130023424)&&(ha=4194304)):t=1);var n=nt();e=wn(e,t),e!==null&&(Gi(e,t,n),dt(e,n))}function Xb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jg(e,n)}function Qb(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(t),Jg(e,n)}var Zg;Zg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,Ib(e,t,n);lt=!!(e.flags&131072)}else lt=!1,be&&t.flags&1048576&&sg(t,po,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Ua(e,t),e=t.pendingProps;var i=mr(t,Xe.current);hr(t,n),i=hd(null,t,s,e,i,n);var a=pd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(s)?(a=!0,uo(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,od(t),i.updater=Vo,t.stateNode=i,i._reactInternals=t,Uc(t,s,e,n),t=Gc(null,t,s,!0,a,n)):(t.tag=0,be&&a&&ed(t),et(null,t,i,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Ua(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=Zb(s),e=Bt(s,e),i){case 0:t=Wc(null,t,s,e,n);break e;case 1:t=Sp(null,t,s,e,n);break e;case 11:t=jp(null,t,s,e,n);break e;case 14:t=Np(null,t,s,Bt(s.type,e),n);break e}throw Error(I(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Wc(e,t,s,i,n);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Sp(e,t,s,i,n);case 3:e:{if(Og(t),e===null)throw Error(I(387));s=t.pendingProps,a=t.memoizedState,i=a.element,cg(e,t),go(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=vr(Error(I(423)),t),t=Cp(e,t,s,n,i);break e}else if(s!==i){i=vr(Error(I(424)),t),t=Cp(e,t,s,n,i);break e}else for(mt=Un(t.stateNode.containerInfo.firstChild),gt=t,be=!0,$t=null,n=og(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gr(),s===i){t=kn(e,t,n);break e}et(e,t,s,n)}t=t.child}return t;case 5:return ug(t),e===null&&Fc(t),s=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Lc(s,i)?o=null:a!==null&&Lc(s,a)&&(t.flags|=32),Lg(e,t),et(e,t,o,n),t.child;case 6:return e===null&&Fc(t),null;case 13:return Dg(e,t,n);case 4:return ld(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=xr(t,null,s,n):et(e,t,s,n),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),jp(e,t,s,i,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,me(fo,s._currentValue),s._currentValue=o,a!==null)if(Wt(a.value,o)){if(a.children===i.children&&!ct.current){t=kn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=gn(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Vc(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(I(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Vc(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,hr(t,n),i=Pt(i),s=s(i),t.flags|=1,et(e,t,s,n),t.child;case 14:return s=t.type,i=Bt(s,t.pendingProps),i=Bt(s.type,i),Np(e,t,s,i,n);case 15:return zg(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:Bt(s,i),Ua(e,t),t.tag=1,ut(s)?(e=!0,uo(t)):e=!1,hr(t,n),Pg(t,s,i),Uc(t,s,i,n),Gc(null,t,s,!0,e,n);case 19:return Ig(e,t,n);case 22:return Rg(e,t,n)}throw Error(I(156,t.tag))};function ex(e,t){return _0(e,t)}function Jb(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,s){return new Jb(e,t,n,s)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zb(e){if(typeof e=="function")return jd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$u)return 11;if(e===Uu)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Et(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&14680064,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}function Ga(e,t,n,s,i,a){var o=2;if(s=e,typeof e=="function")jd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gs:return ks(n.children,i,a,t);case Vu:o=8,i|=8;break;case pc:return e=Et(12,n,t,i|2),e.elementType=pc,e.lanes=a,e;case fc:return e=Et(13,n,t,i),e.elementType=fc,e.lanes=a,e;case mc:return e=Et(19,n,t,i),e.elementType=mc,e.lanes=a,e;case u0:return Ho(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l0:o=10;break e;case c0:o=9;break e;case $u:o=11;break e;case Uu:o=14;break e;case zn:o=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Et(o,n,t,i),t.elementType=e,t.type=s,t.lanes=a,t}function ks(e,t,n,s){return e=Et(7,e,s,t),e.lanes=n,e}function Ho(e,t,n,s){return e=Et(22,e,s,t),e.elementType=u0,e.lanes=n,e.stateNode={isHidden:!1},e}function Bl(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Fl(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ew(e,t,n,s,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bl(0),this.expirationTimes=bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bl(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Nd(e,t,n,s,i,a,o,l,c){return e=new ew(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},od(a),e}function tw(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function tx(e){if(!e)return Qn;e=e._reactInternals;e:{if(Ms(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ut(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(ut(n))return tg(e,n,t)}return t}function nx(e,t,n,s,i,a,o,l,c){return e=Nd(n,s,!0,e,i,a,o,l,c),e.context=tx(null),n=e.current,s=nt(),i=Gn(n),a=gn(s,i),a.callback=t??null,Hn(n,a,i),e.current.lanes=i,Gi(e,i,s),dt(e,s),e}function Wo(e,t,n,s){var i=t.current,a=nt(),o=Gn(i);return n=tx(n),t.context===null?t.context=n:t.pendingContext=n,t=gn(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Hn(i,t,o),e!==null&&(Ht(e,i,o,a),Fa(e,i,o)),o}function No(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sd(e,t){Op(e,t),(e=e.alternate)&&Op(e,t)}function nw(){return null}var sx=typeof reportError=="function"?reportError:function(e){console.error(e)};function Cd(e){this._internalRoot=e}Go.prototype.render=Cd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));Wo(e,t,null,null)};Go.prototype.unmount=Cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Es(function(){Wo(null,e,null,null)}),t[bn]=null}};function Go(e){this._internalRoot=e}Go.prototype.unstable_scheduleHydration=function(e){if(e){var t=R0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ln.length&&t!==0&&t<Ln[n].priority;n++);Ln.splice(n,0,e),n===0&&O0(e)}};function _d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ko(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dp(){}function sw(e,t,n,s,i){if(i){if(typeof s=="function"){var a=s;s=function(){var u=No(o);a.call(u)}}var o=nx(t,s,e,0,null,!1,!1,"",Dp);return e._reactRootContainer=o,e[bn]=o.current,Ci(e.nodeType===8?e.parentNode:e),Es(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var l=s;s=function(){var u=No(c);l.call(u)}}var c=Nd(e,0,!1,null,null,!1,!1,"",Dp);return e._reactRootContainer=c,e[bn]=c.current,Ci(e.nodeType===8?e.parentNode:e),Es(function(){Wo(t,c,n,s)}),c}function qo(e,t,n,s,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=No(o);l.call(c)}}Wo(t,o,e,i)}else o=sw(n,t,e,i,s);return No(o)}M0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xr(t.pendingLanes);n!==0&&(Gu(t,n|1),dt(t,Pe()),!(ae&6)&&(br=Pe()+500,ss()))}break;case 13:Es(function(){var s=wn(e,1);if(s!==null){var i=nt();Ht(s,e,1,i)}}),Sd(e,1)}};Ku=function(e){if(e.tag===13){var t=wn(e,134217728);if(t!==null){var n=nt();Ht(t,e,134217728,n)}Sd(e,134217728)}};z0=function(e){if(e.tag===13){var t=Gn(e),n=wn(e,t);if(n!==null){var s=nt();Ht(n,e,t,s)}Sd(e,t)}};R0=function(){return le};L0=function(e,t){var n=le;try{return le=e,t()}finally{le=n}};Sc=function(e,t,n){switch(t){case"input":if(yc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=Io(s);if(!i)throw Error(I(90));h0(s),yc(s,i)}}}break;case"textarea":f0(e,n);break;case"select":t=n.value,t!=null&&lr(e,!!n.multiple,t,!1)}};w0=bd;k0=Es;var rw={usingClientEntryPoint:!1,Events:[qi,Xs,Io,v0,b0,bd]},Hr={findFiberByHostInstance:xs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iw={bundleType:Hr.bundleType,version:Hr.version,rendererPackageName:Hr.rendererPackageName,rendererConfig:Hr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S0(e),e===null?null:e.stateNode},findFiberByHostInstance:Hr.findFiberByHostInstance||nw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ja.isDisabled&&ja.supportsFiber)try{Ro=ja.inject(iw),tn=ja}catch{}}bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rw;bt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_d(t))throw Error(I(200));return tw(e,t,null,n)};bt.createRoot=function(e,t){if(!_d(e))throw Error(I(299));var n=!1,s="",i=sx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Nd(e,1,!1,null,null,n,!1,s,i),e[bn]=t.current,Ci(e.nodeType===8?e.parentNode:e),new Cd(t)};bt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=S0(t),e=e===null?null:e.stateNode,e};bt.flushSync=function(e){return Es(e)};bt.hydrate=function(e,t,n){if(!Ko(t))throw Error(I(200));return qo(null,e,t,!0,n)};bt.hydrateRoot=function(e,t,n){if(!_d(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,i=!1,a="",o=sx;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=nx(t,null,e,1,n??null,i,!1,a,o),e[bn]=t.current,Ci(e),s)for(e=0;e<s.length;e++)n=s[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Go(t)};bt.render=function(e,t,n){if(!Ko(t))throw Error(I(200));return qo(null,e,t,!1,n)};bt.unmountComponentAtNode=function(e){if(!Ko(e))throw Error(I(40));return e._reactRootContainer?(Es(function(){qo(null,null,e,!1,function(){e._reactRootContainer=null,e[bn]=null})}),!0):!1};bt.unstable_batchedUpdates=bd;bt.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Ko(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return qo(e,t,n,!1,s)};bt.version="18.3.1-next-f1338f8080-20240426";function rx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rx)}catch(e){console.error(e)}}rx(),r0.exports=bt;var ix=r0.exports;const aw=Gm(ix);var ax,Ip=ix;ax=Ip.createRoot,Ip.hydrateRoot;/**
41
41
  * @remix-run/router v1.23.2
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,7 +46,7 @@ Error generating stack: `+a.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */function Li(){return Li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Li.apply(this,arguments)}var Bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bn||(Bn={}));const Bp="popstate";function cw(e){e===void 0&&(e={});function t(s,i){let{pathname:a,search:o,hash:l}=s.location;return ru("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(s,i){return typeof i=="string"?i:So(i)}return dw(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ed(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function uw(){return Math.random().toString(36).substr(2,8)}function Fp(e,t){return{usr:e.state,key:e.key,idx:t}}function ru(e,t,n,s){return n===void 0&&(n=null),Li({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tr(t):t,{state:n,key:t&&t.key||s||uw()})}function So(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Tr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function dw(e,t,n,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:a=!1}=s,o=i.history,l=Bn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Li({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function p(){l=Bn.Pop;let b=d(),g=b==null?null:b-u;u=b,c&&c({action:l,location:w.location,delta:g})}function h(b,g){l=Bn.Push;let x=ru(w.location,b,g);u=d()+1;let k=Fp(x,u),C=w.createHref(x);try{o.pushState(k,"",C)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(C)}a&&c&&c({action:l,location:w.location,delta:1})}function m(b,g){l=Bn.Replace;let x=ru(w.location,b,g);u=d();let k=Fp(x,u),C=w.createHref(x);o.replaceState(k,"",C),a&&c&&c({action:l,location:w.location,delta:0})}function v(b){let g=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof b=="string"?b:So(b);return x=x.replace(/ $/,"%20"),Ae(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let w={get action(){return l},get location(){return e(i,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Bp,p),c=b,()=>{i.removeEventListener(Bp,p),c=null}},createHref(b){return t(i,b)},createURL:v,encodeLocation(b){let g=v(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(b){return o.go(b)}};return w}var Vp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Vp||(Vp={}));function hw(e,t,n){return n===void 0&&(n="/"),pw(e,t,n)}function pw(e,t,n,s){let i=typeof t=="string"?Tr(t):t,a=Td(i.pathname||"/",n);if(a==null)return null;let o=ox(e);fw(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Cw(a);l=jw(o[c],u)}return l}function ox(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Ae(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=qn([s,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ae(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ox(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:ww(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of lx(a.path))i(a,o,c)}),t}function lx(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return i?[a,""]:[a];let o=lx(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function fw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kw(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const mw=/^:[\w-]+$/,gw=3,xw=2,yw=1,vw=10,bw=-2,$p=e=>e==="*";function ww(e,t){let n=e.split("/"),s=n.length;return n.some($p)&&(s+=bw),t&&(s+=xw),n.filter(i=>!$p(i)).reduce((i,a)=>i+(mw.test(a)?gw:a===""?yw:vw),s)}function kw(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function jw(e,t,n){let{routesMeta:s}=e,i={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,d=a==="/"?t:t.slice(a.length)||"/",p=Nw({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:qn([a,p.pathname]),pathnameBase:Aw(qn([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=qn([a,p.pathnameBase]))}return o}function Nw(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Sw(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:s.reduce((u,d,p)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let w=l[p]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const v=l[p];return m&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Sw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ed(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function Cw(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ed(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Td(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const _w=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ew=e=>_w.test(e);function Tw(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?Tr(e):e,a;if(n)if(Ew(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Ed(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Up(n.substring(1),"/"):a=Up(n,t)}else a=t;return{pathname:a,search:Mw(s),hash:zw(i)}}function Up(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vl(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Pw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Pd(e,t){let n=Pw(e);return t?n.map((s,i)=>i===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Ad(e,t,n,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=Tr(e):(i=Li({},e),Ae(!i.pathname||!i.pathname.includes("?"),Vl("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),Vl("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),Vl("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let p=t.length-1;if(!s&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),p-=1;i.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=Tw(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const qn=e=>e.join("/").replace(/\/\/+/g,"/"),Aw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Mw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Rw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cx=["post","put","patch","delete"];new Set(cx);const Lw=["get",...cx];new Set(Lw);/**
49
+ */function Li(){return Li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Li.apply(this,arguments)}var Bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bn||(Bn={}));const Bp="popstate";function ow(e){e===void 0&&(e={});function t(s,i){let{pathname:a,search:o,hash:l}=s.location;return ru("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(s,i){return typeof i=="string"?i:So(i)}return cw(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ed(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function lw(){return Math.random().toString(36).substr(2,8)}function Fp(e,t){return{usr:e.state,key:e.key,idx:t}}function ru(e,t,n,s){return n===void 0&&(n=null),Li({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tr(t):t,{state:n,key:t&&t.key||s||lw()})}function So(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Tr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function cw(e,t,n,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:a=!1}=s,o=i.history,l=Bn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Li({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function p(){l=Bn.Pop;let v=d(),g=v==null?null:v-u;u=v,c&&c({action:l,location:w.location,delta:g})}function h(v,g){l=Bn.Push;let x=ru(w.location,v,g);u=d()+1;let k=Fp(x,u),j=w.createHref(x);try{o.pushState(k,"",j)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(j)}a&&c&&c({action:l,location:w.location,delta:1})}function m(v,g){l=Bn.Replace;let x=ru(w.location,v,g);u=d();let k=Fp(x,u),j=w.createHref(x);o.replaceState(k,"",j),a&&c&&c({action:l,location:w.location,delta:0})}function y(v){let g=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof v=="string"?v:So(v);return x=x.replace(/ $/,"%20"),Ae(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let w={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Bp,p),c=v,()=>{i.removeEventListener(Bp,p),c=null}},createHref(v){return t(i,v)},createURL:y,encodeLocation(v){let g=y(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(v){return o.go(v)}};return w}var Vp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Vp||(Vp={}));function uw(e,t,n){return n===void 0&&(n="/"),dw(e,t,n)}function dw(e,t,n,s){let i=typeof t=="string"?Tr(t):t,a=Td(i.pathname||"/",n);if(a==null)return null;let o=ox(e);hw(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Nw(a);l=ww(o[c],u)}return l}function ox(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Ae(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=qn([s,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ae(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ox(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:vw(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of lx(a.path))i(a,o,c)}),t}function lx(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return i?[a,""]:[a];let o=lx(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function hw(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bw(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const pw=/^:[\w-]+$/,fw=3,mw=2,gw=1,xw=10,yw=-2,$p=e=>e==="*";function vw(e,t){let n=e.split("/"),s=n.length;return n.some($p)&&(s+=yw),t&&(s+=mw),n.filter(i=>!$p(i)).reduce((i,a)=>i+(pw.test(a)?fw:a===""?gw:xw),s)}function bw(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function ww(e,t,n){let{routesMeta:s}=e,i={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,d=a==="/"?t:t.slice(a.length)||"/",p=kw({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!p)return null;Object.assign(i,p.params),o.push({params:i,pathname:qn([a,p.pathname]),pathnameBase:Tw(qn([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=qn([a,p.pathnameBase]))}return o}function kw(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=jw(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:s.reduce((u,d,p)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let w=l[p]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const y=l[p];return m&&!y?u[h]=void 0:u[h]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function jw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ed(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function Nw(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ed(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Td(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const Sw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cw=e=>Sw.test(e);function _w(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?Tr(e):e,a;if(n)if(Cw(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Ed(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Up(n.substring(1),"/"):a=Up(n,t)}else a=t;return{pathname:a,search:Pw(s),hash:Aw(i)}}function Up(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vl(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ew(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Pd(e,t){let n=Ew(e);return t?n.map((s,i)=>i===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Ad(e,t,n,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=Tr(e):(i=Li({},e),Ae(!i.pathname||!i.pathname.includes("?"),Vl("?","pathname","search",i)),Ae(!i.pathname||!i.pathname.includes("#"),Vl("#","pathname","hash",i)),Ae(!i.search||!i.search.includes("#"),Vl("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let p=t.length-1;if(!s&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),p-=1;i.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=_w(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const qn=e=>e.join("/").replace(/\/\/+/g,"/"),Tw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Pw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Aw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Mw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cx=["post","put","patch","delete"];new Set(cx);const zw=["get",...cx];new Set(zw);/**
50
50
  * React Router v6.30.3
51
51
  *
52
52
  * Copyright (c) Remix Software Inc.
@@ -55,7 +55,7 @@ Error generating stack: `+a.message+`
55
55
  * LICENSE.md file in the root directory of this source tree.
56
56
  *
57
57
  * @license MIT
58
- */function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Oi.apply(this,arguments)}const Md=f.createContext(null),Ow=f.createContext(null),rs=f.createContext(null),Yo=f.createContext(null),_n=f.createContext({outlet:null,matches:[],isDataRoute:!1}),ux=f.createContext(null);function Dw(e,t){let{relative:n}=t===void 0?{}:t;Pr()||Ae(!1);let{basename:s,navigator:i}=f.useContext(rs),{hash:a,pathname:o,search:l}=hx(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:qn([s,o])),i.createHref({pathname:c,search:l,hash:a})}function Pr(){return f.useContext(Yo)!=null}function is(){return Pr()||Ae(!1),f.useContext(Yo).location}function dx(e){f.useContext(rs).static||f.useLayoutEffect(e)}function hn(){let{isDataRoute:e}=f.useContext(_n);return e?Jw():Iw()}function Iw(){Pr()||Ae(!1);let e=f.useContext(Md),{basename:t,future:n,navigator:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Pd(i,n.v7_relativeSplatPath)),l=f.useRef(!1);return dx(()=>{l.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let p=Ad(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:qn([t,p.pathname])),(d.replace?s.replace:s.push)(p,d.state,d)},[t,s,o,a,e])}const Bw=f.createContext(null);function Fw(e){let t=f.useContext(_n).outlet;return t&&f.createElement(Bw.Provider,{value:e},t)}function hx(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Pd(i,s.v7_relativeSplatPath));return f.useMemo(()=>Ad(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Vw(e,t){return $w(e,t)}function $w(e,t,n,s){Pr()||Ae(!1);let{navigator:i}=f.useContext(rs),{matches:a}=f.useContext(_n),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=is(),d;if(t){var p;let b=typeof t=="string"?Tr(t):t;c==="/"||(p=b.pathname)!=null&&p.startsWith(c)||Ae(!1),d=b}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let v=hw(e,{pathname:m}),w=Kw(v&&v.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:qn([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:qn([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),a,n,s);return t&&w?f.createElement(Yo.Provider,{value:{location:Oi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Bn.Pop}},w):w}function Uw(){let e=Qw(),t=Rw(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,null)}const Hw=f.createElement(Uw,null);class Ww extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(_n.Provider,{value:this.props.routeContext},f.createElement(ux.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gw(e){let{routeContext:t,match:n,children:s}=e,i=f.useContext(Md);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(_n.Provider,{value:t},s)}function Kw(e,t,n,s){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Ae(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=d),p.route.id){let{loaderData:h,errors:m}=n,v=p.route.loader&&h[p.route.id]===void 0&&(!m||m[p.route.id]===void 0);if(p.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,p,h)=>{let m,v=!1,w=null,b=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,w=p.route.errorElement||Hw,c&&(u<0&&h===0?(Zw("route-fallback"),v=!0,b=null):u===h&&(v=!0,b=p.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,h+1)),x=()=>{let k;return m?k=w:v?k=b:p.route.Component?k=f.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=d,f.createElement(Gw,{match:p,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:k})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?f.createElement(Ww,{location:n.location,revalidation:n.revalidation,component:w,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var px=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(px||{}),fx=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fx||{});function qw(e){let t=f.useContext(Md);return t||Ae(!1),t}function Yw(e){let t=f.useContext(Ow);return t||Ae(!1),t}function Xw(e){let t=f.useContext(_n);return t||Ae(!1),t}function mx(e){let t=Xw(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Qw(){var e;let t=f.useContext(ux),n=Yw(),s=mx();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Jw(){let{router:e}=qw(px.UseNavigateStable),t=mx(fx.UseNavigateStable),n=f.useRef(!1);return dx(()=>{n.current=!0}),f.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oi({fromRouteId:t},a)))},[e,t])}const Hp={};function Zw(e,t,n){Hp[e]||(Hp[e]=!0)}function e2(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Wp(e){let{to:t,replace:n,state:s,relative:i}=e;Pr()||Ae(!1);let{future:a,static:o}=f.useContext(rs),{matches:l}=f.useContext(_n),{pathname:c}=is(),u=hn(),d=Ad(t,Pd(l,a.v7_relativeSplatPath),c,i==="path"),p=JSON.stringify(d);return f.useEffect(()=>u(JSON.parse(p),{replace:n,state:s,relative:i}),[u,p,i,n,s]),null}function t2(e){return Fw(e.context)}function we(e){Ae(!1)}function n2(e){let{basename:t="/",children:n=null,location:s,navigationType:i=Bn.Pop,navigator:a,static:o=!1,future:l}=e;Pr()&&Ae(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:a,static:o,future:Oi({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=Tr(s));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:v="default"}=s,w=f.useMemo(()=>{let b=Td(d,c);return b==null?null:{location:{pathname:b,search:p,hash:h,state:m,key:v},navigationType:i}},[c,d,p,h,m,v,i]);return w==null?null:f.createElement(rs.Provider,{value:u},f.createElement(Yo.Provider,{children:n,value:w}))}function s2(e){let{children:t,location:n}=e;return Vw(iu(t),n)}new Promise(()=>{});function iu(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(s,i)=>{if(!f.isValidElement(s))return;let a=[...t,i];if(s.type===f.Fragment){n.push.apply(n,iu(s.props.children,a));return}s.type!==we&&Ae(!1),!s.props.index||!s.props.children||Ae(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=iu(s.props.children,a)),n.push(o)}),n}/**
58
+ */function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Oi.apply(this,arguments)}const Md=f.createContext(null),Rw=f.createContext(null),rs=f.createContext(null),Yo=f.createContext(null),_n=f.createContext({outlet:null,matches:[],isDataRoute:!1}),ux=f.createContext(null);function Lw(e,t){let{relative:n}=t===void 0?{}:t;Pr()||Ae(!1);let{basename:s,navigator:i}=f.useContext(rs),{hash:a,pathname:o,search:l}=hx(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:qn([s,o])),i.createHref({pathname:c,search:l,hash:a})}function Pr(){return f.useContext(Yo)!=null}function is(){return Pr()||Ae(!1),f.useContext(Yo).location}function dx(e){f.useContext(rs).static||f.useLayoutEffect(e)}function un(){let{isDataRoute:e}=f.useContext(_n);return e?Xw():Ow()}function Ow(){Pr()||Ae(!1);let e=f.useContext(Md),{basename:t,future:n,navigator:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Pd(i,n.v7_relativeSplatPath)),l=f.useRef(!1);return dx(()=>{l.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let p=Ad(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:qn([t,p.pathname])),(d.replace?s.replace:s.push)(p,d.state,d)},[t,s,o,a,e])}const Dw=f.createContext(null);function Iw(e){let t=f.useContext(_n).outlet;return t&&f.createElement(Dw.Provider,{value:e},t)}function hx(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=f.useContext(rs),{matches:i}=f.useContext(_n),{pathname:a}=is(),o=JSON.stringify(Pd(i,s.v7_relativeSplatPath));return f.useMemo(()=>Ad(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Bw(e,t){return Fw(e,t)}function Fw(e,t,n,s){Pr()||Ae(!1);let{navigator:i}=f.useContext(rs),{matches:a}=f.useContext(_n),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=is(),d;if(t){var p;let v=typeof t=="string"?Tr(t):t;c==="/"||(p=v.pathname)!=null&&p.startsWith(c)||Ae(!1),d=v}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let y=uw(e,{pathname:m}),w=Ww(y&&y.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:qn([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:qn([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,s);return t&&w?f.createElement(Yo.Provider,{value:{location:Oi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Bn.Pop}},w):w}function Vw(){let e=Yw(),t=Mw(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,null)}const $w=f.createElement(Vw,null);class Uw extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(_n.Provider,{value:this.props.routeContext},f.createElement(ux.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Hw(e){let{routeContext:t,match:n,children:s}=e,i=f.useContext(Md);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(_n.Provider,{value:t},s)}function Ww(e,t,n,s){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Ae(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=d),p.route.id){let{loaderData:h,errors:m}=n,y=p.route.loader&&h[p.route.id]===void 0&&(!m||m[p.route.id]===void 0);if(p.route.lazy||y){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,p,h)=>{let m,y=!1,w=null,v=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,w=p.route.errorElement||$w,c&&(u<0&&h===0?(Qw("route-fallback"),y=!0,v=null):u===h&&(y=!0,v=p.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,h+1)),x=()=>{let k;return m?k=w:y?k=v:p.route.Component?k=f.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=d,f.createElement(Hw,{match:p,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:k})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?f.createElement(Uw,{location:n.location,revalidation:n.revalidation,component:w,error:m,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var px=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(px||{}),fx=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fx||{});function Gw(e){let t=f.useContext(Md);return t||Ae(!1),t}function Kw(e){let t=f.useContext(Rw);return t||Ae(!1),t}function qw(e){let t=f.useContext(_n);return t||Ae(!1),t}function mx(e){let t=qw(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Yw(){var e;let t=f.useContext(ux),n=Kw(),s=mx();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Xw(){let{router:e}=Gw(px.UseNavigateStable),t=mx(fx.UseNavigateStable),n=f.useRef(!1);return dx(()=>{n.current=!0}),f.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oi({fromRouteId:t},a)))},[e,t])}const Hp={};function Qw(e,t,n){Hp[e]||(Hp[e]=!0)}function Jw(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Wp(e){let{to:t,replace:n,state:s,relative:i}=e;Pr()||Ae(!1);let{future:a,static:o}=f.useContext(rs),{matches:l}=f.useContext(_n),{pathname:c}=is(),u=un(),d=Ad(t,Pd(l,a.v7_relativeSplatPath),c,i==="path"),p=JSON.stringify(d);return f.useEffect(()=>u(JSON.parse(p),{replace:n,state:s,relative:i}),[u,p,i,n,s]),null}function Zw(e){return Iw(e.context)}function we(e){Ae(!1)}function e2(e){let{basename:t="/",children:n=null,location:s,navigationType:i=Bn.Pop,navigator:a,static:o=!1,future:l}=e;Pr()&&Ae(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:a,static:o,future:Oi({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=Tr(s));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:y="default"}=s,w=f.useMemo(()=>{let v=Td(d,c);return v==null?null:{location:{pathname:v,search:p,hash:h,state:m,key:y},navigationType:i}},[c,d,p,h,m,y,i]);return w==null?null:f.createElement(rs.Provider,{value:u},f.createElement(Yo.Provider,{children:n,value:w}))}function t2(e){let{children:t,location:n}=e;return Bw(iu(t),n)}new Promise(()=>{});function iu(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(s,i)=>{if(!f.isValidElement(s))return;let a=[...t,i];if(s.type===f.Fragment){n.push.apply(n,iu(s.props.children,a));return}s.type!==we&&Ae(!1),!s.props.index||!s.props.children||Ae(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=iu(s.props.children,a)),n.push(o)}),n}/**
59
59
  * React Router DOM v6.30.3
60
60
  *
61
61
  * Copyright (c) Remix Software Inc.
@@ -64,8 +64,8 @@ Error generating stack: `+a.message+`
64
64
  * LICENSE.md file in the root directory of this source tree.
65
65
  *
66
66
  * @license MIT
67
- */function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},au.apply(this,arguments)}function r2(e,t){if(e==null)return{};var n={},s=Object.keys(e),i,a;for(a=0;a<s.length;a++)i=s[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function i2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a2(e,t){return e.button===0&&(!t||t==="_self")&&!i2(e)}function ou(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(i=>[n,i]):[[n,s]])},[]))}function o2(e,t){let n=ou(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const l2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],c2="6";try{window.__reactRouterVersion=c2}catch{}const u2="startTransition",Gp=Q1[u2];function d2(e){let{basename:t,children:n,future:s,window:i}=e,a=f.useRef();a.current==null&&(a.current=cw({window:i,v5Compat:!0}));let o=a.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},d=f.useCallback(p=>{u&&Gp?Gp(()=>c(p)):c(p)},[c,u]);return f.useLayoutEffect(()=>o.listen(d),[o,d]),f.useEffect(()=>e2(s),[s]),f.createElement(n2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const h2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",p2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=f.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p}=t,h=r2(t,l2),{basename:m}=f.useContext(rs),v,w=!1;if(typeof u=="string"&&p2.test(u)&&(v=u,h2))try{let k=new URL(window.location.href),C=u.startsWith("//")?new URL(k.protocol+u):new URL(u),j=Td(C.pathname,m);C.origin===k.origin&&j!=null?u=j+C.search+C.hash:w=!0}catch{}let b=Dw(u,{relative:i}),g=f2(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p});function x(k){s&&s(k),k.defaultPrevented||g(k)}return f.createElement("a",au({},h,{href:v||b,onClick:w||a?s:x,ref:n,target:c}))});var Kp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kp||(Kp={}));var qp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qp||(qp={}));function f2(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=hn(),u=is(),d=hx(e,{relative:o});return f.useCallback(p=>{if(a2(p,n)){p.preventDefault();let h=s!==void 0?s:So(u)===So(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,s,i,n,e,a,o,l])}function m2(e){let t=f.useRef(ou(e)),n=f.useRef(!1),s=is(),i=f.useMemo(()=>o2(s.search,n.current?null:t.current),[s.search]),a=hn(),o=f.useCallback((l,c)=>{const u=ou(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var g2=e=>{switch(e){case"success":return v2;case"info":return w2;case"warning":return b2;case"error":return k2;default:return null}},x2=Array(12).fill(0),y2=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},x2.map((n,s)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),v2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),b2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),w2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),k2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),j2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),N2=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},lu=1,S2=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:lu++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=n!==void 0,a,o=s.then(async c=>{if(a=["resolve",c],H.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(_2(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||lu++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},at=new S2,C2=(e,t)=>{let n=(t==null?void 0:t.id)||lu++;return at.addToast({title:e,...t,id:n}),n},_2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",E2=C2,T2=()=>at.toasts,P2=()=>at.getActiveToasts(),pe=Object.assign(E2,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading},{getHistory:T2,getToasts:P2});function A2(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}A2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
68
- `);function Na(e){return e.label!==void 0}var M2=3,z2="32px",R2="16px",Yp=4e3,L2=356,O2=14,D2=20,I2=200;function Dt(...e){return e.filter(Boolean).join(" ")}function B2(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var F2=e=>{var t,n,s,i,a,o,l,c,u,d,p;let{invert:h,toast:m,unstyled:v,interacting:w,setHeights:b,visibleToasts:g,heights:x,index:k,toasts:C,expanded:j,removeToast:S,defaultRichColors:y,closeButton:N,style:P,cancelButtonStyle:_,actionButtonStyle:T,className:O="",descriptionClassName:F="",duration:D,position:M,gap:z,loadingIcon:V,expandByDefault:E,classNames:R,icons:B,closeButtonAriaLabel:Z="Close toast",pauseWhenPageIsHidden:K}=e,[ie,te]=H.useState(null),[ce,fe]=H.useState(null),[ae,Je]=H.useState(!1),[kt,W]=H.useState(!1),[Y,Mt]=H.useState(!1),[Lr,Ds]=H.useState(!1),[Ze,Is]=H.useState(!1),[dl,Bs]=H.useState(0),[hl,ra]=H.useState(0),ls=H.useRef(m.duration||D||Yp),Or=H.useRef(null),Xt=H.useRef(null),A=k===0,Q=k+1<=g,X=m.type,Ee=m.dismissible!==!1,De=m.className||"",ia=m.descriptionClassName||"",aa=H.useMemo(()=>x.findIndex(J=>J.toastId===m.id)||0,[x,m.id]),P1=H.useMemo(()=>{var J;return(J=m.closeButton)!=null?J:N},[m.closeButton,N]),Ch=H.useMemo(()=>m.duration||D||Yp,[m.duration,D]),pl=H.useRef(0),Fs=H.useRef(0),_h=H.useRef(0),Vs=H.useRef(null),[A1,M1]=M.split("-"),Eh=H.useMemo(()=>x.reduce((J,ue,ve)=>ve>=aa?J:J+ue.height,0),[x,aa]),Th=N2(),z1=m.invert||h,fl=X==="loading";Fs.current=H.useMemo(()=>aa*z+Eh,[aa,Eh]),H.useEffect(()=>{ls.current=Ch},[Ch]),H.useEffect(()=>{Je(!0)},[]),H.useEffect(()=>{let J=Xt.current;if(J){let ue=J.getBoundingClientRect().height;return ra(ue),b(ve=>[{toastId:m.id,height:ue,position:m.position},...ve]),()=>b(ve=>ve.filter(zt=>zt.toastId!==m.id))}},[b,m.id]),H.useLayoutEffect(()=>{if(!ae)return;let J=Xt.current,ue=J.style.height;J.style.height="auto";let ve=J.getBoundingClientRect().height;J.style.height=ue,ra(ve),b(zt=>zt.find(Rt=>Rt.toastId===m.id)?zt.map(Rt=>Rt.toastId===m.id?{...Rt,height:ve}:Rt):[{toastId:m.id,height:ve,position:m.position},...zt])},[ae,m.title,m.description,b,m.id]);let En=H.useCallback(()=>{W(!0),Bs(Fs.current),b(J=>J.filter(ue=>ue.toastId!==m.id)),setTimeout(()=>{S(m)},I2)},[m,S,b,Fs]);H.useEffect(()=>{if(m.promise&&X==="loading"||m.duration===1/0||m.type==="loading")return;let J;return j||w||K&&Th?(()=>{if(_h.current<pl.current){let ue=new Date().getTime()-pl.current;ls.current=ls.current-ue}_h.current=new Date().getTime()})():ls.current!==1/0&&(pl.current=new Date().getTime(),J=setTimeout(()=>{var ue;(ue=m.onAutoClose)==null||ue.call(m,m),En()},ls.current)),()=>clearTimeout(J)},[j,w,m,X,K,Th,En]),H.useEffect(()=>{m.delete&&En()},[En,m.delete]);function R1(){var J,ue,ve;return B!=null&&B.loading?H.createElement("div",{className:Dt(R==null?void 0:R.loader,(J=m==null?void 0:m.classNames)==null?void 0:J.loader,"sonner-loader"),"data-visible":X==="loading"},B.loading):V?H.createElement("div",{className:Dt(R==null?void 0:R.loader,(ue=m==null?void 0:m.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":X==="loading"},V):H.createElement(y2,{className:Dt(R==null?void 0:R.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader),visible:X==="loading"})}return H.createElement("li",{tabIndex:0,ref:Xt,className:Dt(O,De,R==null?void 0:R.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[X],(n=m==null?void 0:m.classNames)==null?void 0:n[X]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:y,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":ae,"data-promise":!!m.promise,"data-swiped":Ze,"data-removed":kt,"data-visible":Q,"data-y-position":A1,"data-x-position":M1,"data-index":k,"data-front":A,"data-swiping":Y,"data-dismissible":Ee,"data-type":X,"data-invert":z1,"data-swipe-out":Lr,"data-swipe-direction":ce,"data-expanded":!!(j||E&&ae),style:{"--index":k,"--toasts-before":k,"--z-index":C.length-k,"--offset":`${kt?dl:Fs.current}px`,"--initial-height":E?"auto":`${hl}px`,...P,...m.style},onDragEnd:()=>{Mt(!1),te(null),Vs.current=null},onPointerDown:J=>{fl||!Ee||(Or.current=new Date,Bs(Fs.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(Mt(!0),Vs.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ue,ve,zt;if(Lr||!Ee)return;Vs.current=null;let Rt=Number(((J=Xt.current)==null?void 0:J.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((ue=Xt.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cs=new Date().getTime()-((ve=Or.current)==null?void 0:ve.getTime()),Lt=ie==="x"?Rt:Tn,Pn=Math.abs(Lt)/cs;if(Math.abs(Lt)>=D2||Pn>.11){Bs(Fs.current),(zt=m.onDismiss)==null||zt.call(m,m),fe(ie==="x"?Rt>0?"right":"left":Tn>0?"down":"up"),En(),Ds(!0),Is(!1);return}Mt(!1),te(null)},onPointerMove:J=>{var ue,ve,zt,Rt;if(!Vs.current||!Ee||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Tn=J.clientY-Vs.current.y,cs=J.clientX-Vs.current.x,Lt=(ve=e.swipeDirections)!=null?ve:B2(M);!ie&&(Math.abs(cs)>1||Math.abs(Tn)>1)&&te(Math.abs(cs)>Math.abs(Tn)?"x":"y");let Pn={x:0,y:0};ie==="y"?(Lt.includes("top")||Lt.includes("bottom"))&&(Lt.includes("top")&&Tn<0||Lt.includes("bottom")&&Tn>0)&&(Pn.y=Tn):ie==="x"&&(Lt.includes("left")||Lt.includes("right"))&&(Lt.includes("left")&&cs<0||Lt.includes("right")&&cs>0)&&(Pn.x=cs),(Math.abs(Pn.x)>0||Math.abs(Pn.y)>0)&&Is(!0),(zt=Xt.current)==null||zt.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(Rt=Xt.current)==null||Rt.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},P1&&!m.jsx?H.createElement("button",{"aria-label":Z,"data-disabled":fl,"data-close-button":!0,onClick:fl||!Ee?()=>{}:()=>{var J;En(),(J=m.onDismiss)==null||J.call(m,m)},className:Dt(R==null?void 0:R.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=B==null?void 0:B.close)!=null?a:j2):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:H.createElement(H.Fragment,null,X||m.icon||m.promise?H.createElement("div",{"data-icon":"",className:Dt(R==null?void 0:R.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||R1():null,m.type!=="loading"?m.icon||(B==null?void 0:B[X])||g2(X):null):null,H.createElement("div",{"data-content":"",className:Dt(R==null?void 0:R.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},H.createElement("div",{"data-title":"",className:Dt(R==null?void 0:R.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?H.createElement("div",{"data-description":"",className:Dt(F,ia,R==null?void 0:R.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Na(m.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||_,onClick:J=>{var ue,ve;Na(m.cancel)&&Ee&&((ve=(ue=m.cancel).onClick)==null||ve.call(ue,J),En())},className:Dt(R==null?void 0:R.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Na(m.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:J=>{var ue,ve;Na(m.action)&&((ve=(ue=m.action).onClick)==null||ve.call(ue,J),!J.defaultPrevented&&En())},className:Dt(R==null?void 0:R.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function Xp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function V2(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?R2:z2;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}var $2=f.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:p,duration:h,style:m,visibleToasts:v=M2,toastOptions:w,dir:b=Xp(),gap:g=O2,loadingIcon:x,icons:k,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:j}=e,[S,y]=H.useState([]),N=H.useMemo(()=>Array.from(new Set([s].concat(S.filter(K=>K.position).map(K=>K.position)))),[S,s]),[P,_]=H.useState([]),[T,O]=H.useState(!1),[F,D]=H.useState(!1),[M,z]=H.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=H.useRef(null),E=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=H.useRef(null),B=H.useRef(!1),Z=H.useCallback(K=>{y(ie=>{var te;return(te=ie.find(ce=>ce.id===K.id))!=null&&te.delete||at.dismiss(K.id),ie.filter(({id:ce})=>ce!==K.id)})},[]);return H.useEffect(()=>at.subscribe(K=>{if(K.dismiss){y(ie=>ie.map(te=>te.id===K.id?{...te,delete:!0}:te));return}setTimeout(()=>{lw.flushSync(()=>{y(ie=>{let te=ie.findIndex(ce=>ce.id===K.id);return te!==-1?[...ie.slice(0,te),{...ie[te],...K},...ie.slice(te+1)]:[K,...ie]})})})}),[]),H.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:ie})=>{z(ie?"dark":"light")})}catch{K.addListener(({matches:te})=>{try{z(te?"dark":"light")}catch(ce){console.error(ce)}})}},[d]),H.useEffect(()=>{S.length<=1&&O(!1)},[S]),H.useEffect(()=>{let K=ie=>{var te,ce;i.every(fe=>ie[fe]||ie.code===fe)&&(O(!0),(te=V.current)==null||te.focus()),ie.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),H.useEffect(()=>{if(V.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,B.current=!1)}},[V.current]),H.createElement("section",{ref:t,"aria-label":`${C} ${E}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((K,ie)=>{var te;let[ce,fe]=K.split("-");return S.length?H.createElement("ol",{key:K,dir:b==="auto"?Xp():b,tabIndex:-1,ref:V,className:l,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":ce,"data-lifted":T&&S.length>1&&!a,"data-x-position":fe,style:{"--front-toast-height":`${((te=P[0])==null?void 0:te.height)||0}px`,"--width":`${L2}px`,"--gap":`${g}px`,...m,...V2(c,u)},onBlur:ae=>{B.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(B.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||B.current||(B.current=!0,R.current=ae.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{F||O(!1)},onDragEnd:()=>O(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(ae=>!ae.position&&ie===0||ae.position===K).map((ae,Je)=>{var kt,W;return H.createElement(F2,{key:ae.id,icons:k,index:Je,toast:ae,defaultRichColors:p,duration:(kt=w==null?void 0:w.duration)!=null?kt:h,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:n,visibleToasts:v,closeButton:(W=w==null?void 0:w.closeButton)!=null?W:o,interacting:F,position:K,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,removeToast:Z,toasts:S.filter(Y=>Y.position==ae.position),heights:P.filter(Y=>Y.position==ae.position),setHeights:_,expandByDefault:a,gap:g,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const zd=f.createContext({});function Xo(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qo=f.createContext(null),Di=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class U2 extends f.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function H2({children:e,isPresent:t}){const n=f.useId(),s=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=f.useContext(Di);return f.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
67
+ */function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},au.apply(this,arguments)}function n2(e,t){if(e==null)return{};var n={},s=Object.keys(e),i,a;for(a=0;a<s.length;a++)i=s[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function s2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function r2(e,t){return e.button===0&&(!t||t==="_self")&&!s2(e)}function ou(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(i=>[n,i]):[[n,s]])},[]))}function i2(e,t){let n=ou(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const a2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],o2="6";try{window.__reactRouterVersion=o2}catch{}const l2="startTransition",Gp=Y1[l2];function c2(e){let{basename:t,children:n,future:s,window:i}=e,a=f.useRef();a.current==null&&(a.current=ow({window:i,v5Compat:!0}));let o=a.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},d=f.useCallback(p=>{u&&Gp?Gp(()=>c(p)):c(p)},[c,u]);return f.useLayoutEffect(()=>o.listen(d),[o,d]),f.useEffect(()=>Jw(s),[s]),f.createElement(e2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const u2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=f.forwardRef(function(t,n){let{onClick:s,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p}=t,h=n2(t,a2),{basename:m}=f.useContext(rs),y,w=!1;if(typeof u=="string"&&d2.test(u)&&(y=u,u2))try{let k=new URL(window.location.href),j=u.startsWith("//")?new URL(k.protocol+u):new URL(u),b=Td(j.pathname,m);j.origin===k.origin&&b!=null?u=b+j.search+j.hash:w=!0}catch{}let v=Lw(u,{relative:i}),g=h2(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:p});function x(k){s&&s(k),k.defaultPrevented||g(k)}return f.createElement("a",au({},h,{href:y||v,onClick:w||a?s:x,ref:n,target:c}))});var Kp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kp||(Kp={}));var qp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qp||(qp={}));function h2(e,t){let{target:n,replace:s,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=un(),u=is(),d=hx(e,{relative:o});return f.useCallback(p=>{if(r2(p,n)){p.preventDefault();let h=s!==void 0?s:So(u)===So(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,s,i,n,e,a,o,l])}function p2(e){let t=f.useRef(ou(e)),n=f.useRef(!1),s=is(),i=f.useMemo(()=>i2(s.search,n.current?null:t.current),[s.search]),a=un(),o=f.useCallback((l,c)=>{const u=ou(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var f2=e=>{switch(e){case"success":return x2;case"info":return v2;case"warning":return y2;case"error":return b2;default:return null}},m2=Array(12).fill(0),g2=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},m2.map((n,s)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),x2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),y2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),v2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),b2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),w2=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k2=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},lu=1,j2=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:lu++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:o,title:n}):l):this.addToast({title:n,...s,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),i=n!==void 0,a,o=s.then(async c=>{if(a=["resolve",c],H.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(S2(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||lu++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},at=new j2,N2=(e,t)=>{let n=(t==null?void 0:t.id)||lu++;return at.addToast({title:e,...t,id:n}),n},S2=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",C2=N2,_2=()=>at.toasts,E2=()=>at.getActiveToasts(),he=Object.assign(C2,{success:at.success,info:at.info,warning:at.warning,error:at.error,custom:at.custom,message:at.message,promise:at.promise,dismiss:at.dismiss,loading:at.loading},{getHistory:_2,getToasts:E2});function T2(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}T2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
68
+ `);function Na(e){return e.label!==void 0}var P2=3,A2="32px",M2="16px",Yp=4e3,z2=356,R2=14,L2=20,O2=200;function Dt(...e){return e.filter(Boolean).join(" ")}function D2(e){let[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}var I2=e=>{var t,n,s,i,a,o,l,c,u,d,p;let{invert:h,toast:m,unstyled:y,interacting:w,setHeights:v,visibleToasts:g,heights:x,index:k,toasts:j,expanded:b,removeToast:S,defaultRichColors:N,closeButton:C,style:_,cancelButtonStyle:E,actionButtonStyle:P,className:O="",descriptionClassName:F="",duration:D,position:M,gap:z,loadingIcon:V,expandByDefault:T,classNames:R,icons:B,closeButtonAriaLabel:Z="Close toast",pauseWhenPageIsHidden:K}=e,[re,te]=H.useState(null),[ce,fe]=H.useState(null),[ie,Je]=H.useState(!1),[kt,W]=H.useState(!1),[Y,Mt]=H.useState(!1),[Lr,Ds]=H.useState(!1),[Ze,Is]=H.useState(!1),[dl,Bs]=H.useState(0),[hl,ra]=H.useState(0),ls=H.useRef(m.duration||D||Yp),Or=H.useRef(null),Xt=H.useRef(null),A=k===0,Q=k+1<=g,X=m.type,Ee=m.dismissible!==!1,De=m.className||"",ia=m.descriptionClassName||"",aa=H.useMemo(()=>x.findIndex(J=>J.toastId===m.id)||0,[x,m.id]),E1=H.useMemo(()=>{var J;return(J=m.closeButton)!=null?J:C},[m.closeButton,C]),Ch=H.useMemo(()=>m.duration||D||Yp,[m.duration,D]),pl=H.useRef(0),Fs=H.useRef(0),_h=H.useRef(0),Vs=H.useRef(null),[T1,P1]=M.split("-"),Eh=H.useMemo(()=>x.reduce((J,ue,ve)=>ve>=aa?J:J+ue.height,0),[x,aa]),Th=k2(),A1=m.invert||h,fl=X==="loading";Fs.current=H.useMemo(()=>aa*z+Eh,[aa,Eh]),H.useEffect(()=>{ls.current=Ch},[Ch]),H.useEffect(()=>{Je(!0)},[]),H.useEffect(()=>{let J=Xt.current;if(J){let ue=J.getBoundingClientRect().height;return ra(ue),v(ve=>[{toastId:m.id,height:ue,position:m.position},...ve]),()=>v(ve=>ve.filter(zt=>zt.toastId!==m.id))}},[v,m.id]),H.useLayoutEffect(()=>{if(!ie)return;let J=Xt.current,ue=J.style.height;J.style.height="auto";let ve=J.getBoundingClientRect().height;J.style.height=ue,ra(ve),v(zt=>zt.find(Rt=>Rt.toastId===m.id)?zt.map(Rt=>Rt.toastId===m.id?{...Rt,height:ve}:Rt):[{toastId:m.id,height:ve,position:m.position},...zt])},[ie,m.title,m.description,v,m.id]);let En=H.useCallback(()=>{W(!0),Bs(Fs.current),v(J=>J.filter(ue=>ue.toastId!==m.id)),setTimeout(()=>{S(m)},O2)},[m,S,v,Fs]);H.useEffect(()=>{if(m.promise&&X==="loading"||m.duration===1/0||m.type==="loading")return;let J;return b||w||K&&Th?(()=>{if(_h.current<pl.current){let ue=new Date().getTime()-pl.current;ls.current=ls.current-ue}_h.current=new Date().getTime()})():ls.current!==1/0&&(pl.current=new Date().getTime(),J=setTimeout(()=>{var ue;(ue=m.onAutoClose)==null||ue.call(m,m),En()},ls.current)),()=>clearTimeout(J)},[b,w,m,X,K,Th,En]),H.useEffect(()=>{m.delete&&En()},[En,m.delete]);function M1(){var J,ue,ve;return B!=null&&B.loading?H.createElement("div",{className:Dt(R==null?void 0:R.loader,(J=m==null?void 0:m.classNames)==null?void 0:J.loader,"sonner-loader"),"data-visible":X==="loading"},B.loading):V?H.createElement("div",{className:Dt(R==null?void 0:R.loader,(ue=m==null?void 0:m.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":X==="loading"},V):H.createElement(g2,{className:Dt(R==null?void 0:R.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader),visible:X==="loading"})}return H.createElement("li",{tabIndex:0,ref:Xt,className:Dt(O,De,R==null?void 0:R.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[X],(n=m==null?void 0:m.classNames)==null?void 0:n[X]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:N,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":ie,"data-promise":!!m.promise,"data-swiped":Ze,"data-removed":kt,"data-visible":Q,"data-y-position":T1,"data-x-position":P1,"data-index":k,"data-front":A,"data-swiping":Y,"data-dismissible":Ee,"data-type":X,"data-invert":A1,"data-swipe-out":Lr,"data-swipe-direction":ce,"data-expanded":!!(b||T&&ie),style:{"--index":k,"--toasts-before":k,"--z-index":j.length-k,"--offset":`${kt?dl:Fs.current}px`,"--initial-height":T?"auto":`${hl}px`,..._,...m.style},onDragEnd:()=>{Mt(!1),te(null),Vs.current=null},onPointerDown:J=>{fl||!Ee||(Or.current=new Date,Bs(Fs.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(Mt(!0),Vs.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ue,ve,zt;if(Lr||!Ee)return;Vs.current=null;let Rt=Number(((J=Xt.current)==null?void 0:J.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((ue=Xt.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cs=new Date().getTime()-((ve=Or.current)==null?void 0:ve.getTime()),Lt=re==="x"?Rt:Tn,Pn=Math.abs(Lt)/cs;if(Math.abs(Lt)>=L2||Pn>.11){Bs(Fs.current),(zt=m.onDismiss)==null||zt.call(m,m),fe(re==="x"?Rt>0?"right":"left":Tn>0?"down":"up"),En(),Ds(!0),Is(!1);return}Mt(!1),te(null)},onPointerMove:J=>{var ue,ve,zt,Rt;if(!Vs.current||!Ee||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Tn=J.clientY-Vs.current.y,cs=J.clientX-Vs.current.x,Lt=(ve=e.swipeDirections)!=null?ve:D2(M);!re&&(Math.abs(cs)>1||Math.abs(Tn)>1)&&te(Math.abs(cs)>Math.abs(Tn)?"x":"y");let Pn={x:0,y:0};re==="y"?(Lt.includes("top")||Lt.includes("bottom"))&&(Lt.includes("top")&&Tn<0||Lt.includes("bottom")&&Tn>0)&&(Pn.y=Tn):re==="x"&&(Lt.includes("left")||Lt.includes("right"))&&(Lt.includes("left")&&cs<0||Lt.includes("right")&&cs>0)&&(Pn.x=cs),(Math.abs(Pn.x)>0||Math.abs(Pn.y)>0)&&Is(!0),(zt=Xt.current)==null||zt.style.setProperty("--swipe-amount-x",`${Pn.x}px`),(Rt=Xt.current)==null||Rt.style.setProperty("--swipe-amount-y",`${Pn.y}px`)}},E1&&!m.jsx?H.createElement("button",{"aria-label":Z,"data-disabled":fl,"data-close-button":!0,onClick:fl||!Ee?()=>{}:()=>{var J;En(),(J=m.onDismiss)==null||J.call(m,m)},className:Dt(R==null?void 0:R.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(a=B==null?void 0:B.close)!=null?a:w2):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:H.createElement(H.Fragment,null,X||m.icon||m.promise?H.createElement("div",{"data-icon":"",className:Dt(R==null?void 0:R.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||M1():null,m.type!=="loading"?m.icon||(B==null?void 0:B[X])||f2(X):null):null,H.createElement("div",{"data-content":"",className:Dt(R==null?void 0:R.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},H.createElement("div",{"data-title":"",className:Dt(R==null?void 0:R.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?H.createElement("div",{"data-description":"",className:Dt(F,ia,R==null?void 0:R.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Na(m.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||E,onClick:J=>{var ue,ve;Na(m.cancel)&&Ee&&((ve=(ue=m.cancel).onClick)==null||ve.call(ue,J),En())},className:Dt(R==null?void 0:R.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Na(m.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:J=>{var ue,ve;Na(m.action)&&((ve=(ue=m.action).onClick)==null||ve.call(ue,J),!J.defaultPrevented&&En())},className:Dt(R==null?void 0:R.actionButton,(p=m==null?void 0:m.classNames)==null?void 0:p.actionButton)},m.action.label):null))};function Xp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function B2(e,t){let n={};return[e,t].forEach((s,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?M2:A2;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):c(l)}),n}var F2=f.forwardRef(function(e,t){let{invert:n,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:p,duration:h,style:m,visibleToasts:y=P2,toastOptions:w,dir:v=Xp(),gap:g=R2,loadingIcon:x,icons:k,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:b}=e,[S,N]=H.useState([]),C=H.useMemo(()=>Array.from(new Set([s].concat(S.filter(K=>K.position).map(K=>K.position)))),[S,s]),[_,E]=H.useState([]),[P,O]=H.useState(!1),[F,D]=H.useState(!1),[M,z]=H.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=H.useRef(null),T=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=H.useRef(null),B=H.useRef(!1),Z=H.useCallback(K=>{N(re=>{var te;return(te=re.find(ce=>ce.id===K.id))!=null&&te.delete||at.dismiss(K.id),re.filter(({id:ce})=>ce!==K.id)})},[]);return H.useEffect(()=>at.subscribe(K=>{if(K.dismiss){N(re=>re.map(te=>te.id===K.id?{...te,delete:!0}:te));return}setTimeout(()=>{aw.flushSync(()=>{N(re=>{let te=re.findIndex(ce=>ce.id===K.id);return te!==-1?[...re.slice(0,te),{...re[te],...K},...re.slice(te+1)]:[K,...re]})})})}),[]),H.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:re})=>{z(re?"dark":"light")})}catch{K.addListener(({matches:te})=>{try{z(te?"dark":"light")}catch(ce){console.error(ce)}})}},[d]),H.useEffect(()=>{S.length<=1&&O(!1)},[S]),H.useEffect(()=>{let K=re=>{var te,ce;i.every(fe=>re[fe]||re.code===fe)&&(O(!0),(te=V.current)==null||te.focus()),re.code==="Escape"&&(document.activeElement===V.current||(ce=V.current)!=null&&ce.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[i]),H.useEffect(()=>{if(V.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,B.current=!1)}},[V.current]),H.createElement("section",{ref:t,"aria-label":`${j} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((K,re)=>{var te;let[ce,fe]=K.split("-");return S.length?H.createElement("ol",{key:K,dir:v==="auto"?Xp():v,tabIndex:-1,ref:V,className:l,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":ce,"data-lifted":P&&S.length>1&&!a,"data-x-position":fe,style:{"--front-toast-height":`${((te=_[0])==null?void 0:te.height)||0}px`,"--width":`${z2}px`,"--gap":`${g}px`,...m,...B2(c,u)},onBlur:ie=>{B.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(B.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||B.current||(B.current=!0,R.current=ie.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{F||O(!1)},onDragEnd:()=>O(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(ie=>!ie.position&&re===0||ie.position===K).map((ie,Je)=>{var kt,W;return H.createElement(I2,{key:ie.id,icons:k,index:Je,toast:ie,defaultRichColors:p,duration:(kt=w==null?void 0:w.duration)!=null?kt:h,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:n,visibleToasts:y,closeButton:(W=w==null?void 0:w.closeButton)!=null?W:o,interacting:F,position:K,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,removeToast:Z,toasts:S.filter(Y=>Y.position==ie.position),heights:_.filter(Y=>Y.position==ie.position),setHeights:E,expandByDefault:a,gap:g,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:b,swipeDirections:e.swipeDirections})})):null}))});const zd=f.createContext({});function Xo(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qo=f.createContext(null),Di=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class V2 extends f.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function $2({children:e,isPresent:t}){const n=f.useId(),s=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=f.useContext(Di);return f.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=i.current;if(t||!s.current||!o||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
69
69
  [data-motion-pop-id="${n}"] {
70
70
  position: absolute !important;
71
71
  width: ${o}px !important;
@@ -73,32 +73,32 @@ Error generating stack: `+a.message+`
73
73
  top: ${c}px !important;
74
74
  left: ${u}px !important;
75
75
  }
76
- `),()=>{document.head.removeChild(d)}},[t]),r.jsx(U2,{isPresent:t,childRef:s,sizeRef:i,children:f.cloneElement(e,{ref:s})})}const W2=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=Xo(G2),c=f.useId(),u=f.useCallback(p=>{l.set(p,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),d=f.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),u]:[n,u]);return f.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx(H2,{isPresent:n,children:e})),r.jsx(Qo.Provider,{value:d,children:e})};function G2(){return new Map}function gx(e=!0){const t=f.useContext(Qo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=f.useId();f.useEffect(()=>{e&&i(a)},[e]);const o=f.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const Sa=e=>e.key||"";function Qp(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Rd=typeof window<"u",xx=Rd?f.useLayoutEffect:f.useEffect,ee=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=gx(o),u=f.useMemo(()=>Qp(e),[e]),d=o&&!l?[]:u.map(Sa),p=f.useRef(!0),h=f.useRef(u),m=Xo(()=>new Map),[v,w]=f.useState(u),[b,g]=f.useState(u);xx(()=>{p.current=!1,h.current=u;for(let C=0;C<b.length;C++){const j=Sa(b[C]);d.includes(j)?m.delete(j):m.get(j)!==!0&&m.set(j,!1)}},[b,d.length,d.join("-")]);const x=[];if(u!==v){let C=[...u];for(let j=0;j<b.length;j++){const S=b[j],y=Sa(S);d.includes(y)||(C.splice(j,0,S),x.push(S))}a==="wait"&&x.length&&(C=x),g(Qp(C)),w(u);return}const{forceRender:k}=f.useContext(zd);return r.jsx(r.Fragment,{children:b.map(C=>{const j=Sa(C),S=o&&!l?!1:u===b||d.includes(j),y=()=>{if(m.has(j))m.set(j,!0);else return;let N=!0;m.forEach(P=>{P||(N=!1)}),N&&(k==null||k(),g(h.current),o&&(c==null||c()),s&&s())};return r.jsx(W2,{isPresent:S,initial:!p.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:S?void 0:y,children:C},j)})})},xt=e=>e;let yx=xt;function Ld(e){let t;return()=>(t===void 0&&(t=e()),t)}const wr=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},vn=e=>e*1e3,bn=e=>e/1e3,K2={useManualTiming:!1};function q2(e){let t=new Set,n=new Set,s=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,p=!1)=>{const m=p&&s?t:n;return d&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Ca=["read","resolveKeyframes","update","preRender","render","postRender"],Y2=40;function vx(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ca.reduce((g,x)=>(g[x]=q2(a),g),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:p,postRender:h}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Y2),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},v=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ca.reduce((g,x)=>{const k=o[x];return g[x]=(C,j=!1,S=!1)=>(n||v(),k.schedule(C,j,S)),g},{}),cancel:g=>{for(let x=0;x<Ca.length;x++)o[Ca[x]].cancel(g)},state:i,steps:o}}const{schedule:ye,cancel:Jn,state:Ve,steps:$l}=vx(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0),bx=f.createContext({strict:!1}),Jp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kr={};for(const e in Jp)kr[e]={isEnabled:t=>Jp[e].some(n=>!!t[n])};function X2(e){for(const t in e)kr[t]={...kr[t],...e[t]}}const Q2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Co(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Q2.has(e)}let wx=e=>!Co(e);function kx(e){e&&(wx=t=>t.startsWith("on")?!Co(t):e(t))}try{kx(require("@emotion/is-prop-valid").default)}catch{}function J2(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(wx(i)||n===!0&&Co(i)||!t&&!Co(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function Z2({children:e,isValidProp:t,...n}){t&&kx(t),n={...f.useContext(Di),...n},n.isStatic=Xo(()=>n.isStatic);const s=f.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Di.Provider,{value:s,children:e})}function ek(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Jo=f.createContext({});function Ii(e){return typeof e=="string"||Array.isArray(e)}function Zo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Od=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dd=["initial",...Od];function el(e){return Zo(e.animate)||Dd.some(t=>Ii(e[t]))}function jx(e){return!!(el(e)||e.variants)}function tk(e,t){if(el(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Ii(n)?n:void 0,animate:Ii(s)?s:void 0}}return e.inherit!==!1?t:{}}function nk(e){const{initial:t,animate:n}=tk(e,f.useContext(Jo));return f.useMemo(()=>({initial:t,animate:n}),[Zp(t),Zp(n)])}function Zp(e){return Array.isArray(e)?e.join(" "):e}const sk=Symbol.for("motionComponentSymbol");function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function rk(e,t,n){return f.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):sr(n)&&(n.current=s))},[t])}const Id=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ik="framerAppearId",Nx="data-"+Id(ik),{schedule:Bd}=vx(queueMicrotask,!1),Sx=f.createContext({});function ak(e,t,n,s,i){var a,o;const{visualElement:l}=f.useContext(Jo),c=f.useContext(bx),u=f.useContext(Qo),d=f.useContext(Di).reducedMotion,p=f.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=p.current,m=f.useContext(Sx);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&ok(p.current,n,i,m);const v=f.useRef(!1);f.useInsertionEffect(()=>{h&&v.current&&h.update(n,u)});const w=n[Nx],b=f.useRef(!!w&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,w))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,w)));return xx(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Bd.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,w)}),b.current=!1))}),h}function ok(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Cx(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&sr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function Cx(e){if(e)return e.options.allowProjection!==!1?e.projection:Cx(e.parent)}function lk({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&X2(e);function l(u,d){let p;const h={...f.useContext(Di),...u,layoutId:ck(u)},{isStatic:m}=h,v=nk(u),w=s(u,m);if(!m&&Rd){uk();const b=dk(h);p=b.MeasureLayout,v.visualElement=ak(i,w,h,t,b.ProjectionNode)}return r.jsxs(Jo.Provider,{value:v,children:[p&&v.visualElement?r.jsx(p,{visualElement:v.visualElement,...h}):null,n(i,u,rk(w,v.visualElement,d),w,m,v.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const c=f.forwardRef(l);return c[sk]=i,c}function ck({layoutId:e}){const t=f.useContext(zd).id;return t&&e!==void 0?t+"-"+e:e}function uk(e,t){f.useContext(bx).strict}function dk(e){const{drag:t,layout:n}=kr;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const hk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Fd(e){return typeof e!="string"||e.includes("-")?!1:!!(hk.indexOf(e)>-1||/[A-Z]/u.test(e))}function ef(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Vd(e,t,n,s){if(typeof t=="function"){const[i,a]=ef(s);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=ef(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const cu=e=>Array.isArray(e),pk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),fk=e=>cu(e)?e[e.length-1]||0:e,Ye=e=>!!(e&&e.getVelocity);function Ka(e){const t=Ye(e)?e.get():e;return pk(t)?t.toValue():t}function mk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:gk(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const _x=e=>(t,n)=>{const s=f.useContext(Jo),i=f.useContext(Qo),a=()=>mk(e,t,s,i);return n?a():Xo(a)};function gk(e,t,n,s){const i={},a=s(e,{});for(const h in a)i[h]=Ka(a[h]);let{initial:o,animate:l}=e;const c=el(e),u=jx(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!Zo(p)){const h=Array.isArray(p)?p:[p];for(let m=0;m<h.length;m++){const v=Vd(e,h[m]);if(v){const{transitionEnd:w,transition:b,...g}=v;for(const x in g){let k=g[x];if(Array.isArray(k)){const C=d?k.length-1:0;k=k[C]}k!==null&&(i[x]=k)}for(const x in w)i[x]=w[x]}}}return i}const Ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Ar),Ex=e=>t=>typeof t=="string"&&t.startsWith(e),Tx=Ex("--"),xk=Ex("var(--"),$d=e=>xk(e)?yk.test(e.split("/*")[0].trim()):!1,yk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Px=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Sn=(e,t,n)=>n>t?t:n<e?e:n,Mr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Bi={...Mr,transform:e=>Sn(0,1,e)},_a={...Mr,default:1},Xi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mn=Xi("deg"),sn=Xi("%"),q=Xi("px"),vk=Xi("vh"),bk=Xi("vw"),tf={...sn,parse:e=>sn.parse(e)/100,transform:e=>sn.transform(e*100)},wk={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,radius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,backgroundPositionX:q,backgroundPositionY:q},kk={rotate:Mn,rotateX:Mn,rotateY:Mn,rotateZ:Mn,scale:_a,scaleX:_a,scaleY:_a,scaleZ:_a,skew:Mn,skewX:Mn,skewY:Mn,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Bi,originX:tf,originY:tf,originZ:q},nf={...Mr,transform:Math.round},Ud={...wk,...kk,zIndex:nf,size:q,fillOpacity:Bi,strokeOpacity:Bi,numOctaves:nf},jk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Nk=Ar.length;function Sk(e,t,n){let s="",i=!0;for(let a=0;a<Nk;a++){const o=Ar[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Px(l,Ud[o]);if(!c){i=!1;const d=jk[o]||o;s+=`${d}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Hd(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(zs.has(c)){o=!0;continue}else if(Tx(c)){i[c]=u;continue}else{const d=Px(u,Ud[c]);c.startsWith("origin")?(l=!0,a[c]=d):s[c]=d}}if(t.transform||(o||n?s.transform=Sk(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;s.transformOrigin=`${c} ${u} ${d}`}}const Ck={offset:"stroke-dashoffset",array:"stroke-dasharray"},_k={offset:"strokeDashoffset",array:"strokeDasharray"};function Ek(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?Ck:_k;e[a.offset]=q.transform(-s);const o=q.transform(t),l=q.transform(n);e[a.array]=`${o} ${l}`}function sf(e,t,n){return typeof e=="string"?e:q.transform(t+n*e)}function Tk(e,t,n){const s=sf(t,e.x,e.width),i=sf(n,e.y,e.height);return`${s} ${i}`}function Wd(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u},d,p){if(Hd(e,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=Tk(v,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),o!==void 0&&Ek(h,o,l,c,!1)}const Gd=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ax=()=>({...Gd(),attrs:{}}),Kd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Mx(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const a in n)e.style.setProperty(a,n[a])}const zx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Rx(e,t,n,s){Mx(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(zx.has(i)?i:Id(i),t.attrs[i])}const _o={};function Pk(e){Object.assign(_o,e)}function Lx(e,{layout:t,layoutId:n}){return zs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!_o[e]||e==="opacity")}function qd(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(Ye(i[o])||t.style&&Ye(t.style[o])||Lx(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function Ox(e,t,n){const s=qd(e,t,n);for(const i in e)if(Ye(e[i])||Ye(t[i])){const a=Ar.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function Ak(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const rf=["x","y","width","height","cx","cy","r"],Mk={useVisualState:_x({scrapeMotionValuesFromProps:Ox,createRenderState:Ax,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const l in i)if(zs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<rf.length;l++){const c=rf[l];e[c]!==t[c]&&(o=!0)}o&&ye.read(()=>{Ak(n,s),ye.render(()=>{Wd(s,i,Kd(n.tagName),e.transformTemplate),Rx(n,s)})})}})},zk={useVisualState:_x({scrapeMotionValuesFromProps:qd,createRenderState:Gd})};function Dx(e,t,n){for(const s in t)!Ye(t[s])&&!Lx(s,n)&&(e[s]=t[s])}function Rk({transformTemplate:e},t){return f.useMemo(()=>{const n=Gd();return Hd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lk(e,t){const n=e.style||{},s={};return Dx(s,n,e),Object.assign(s,Rk(e,t)),s}function Ok(e,t){const n={},s=Lk(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function Dk(e,t,n,s){const i=f.useMemo(()=>{const a=Ax();return Wd(a,t,Kd(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Dx(a,e.style,e),i.style={...a,...i.style}}return i}function Ik(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=(Fd(n)?Dk:Ok)(s,a,o,n),u=J2(s,typeof n=="string",e),d=n!==f.Fragment?{...u,...c,ref:i}:{},{children:p}=s,h=f.useMemo(()=>Ye(p)?p.get():p,[p]);return f.createElement(n,{...d,children:h})}}function Bk(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Fd(s)?Mk:zk,preloadedFeatures:e,useRender:Ik(i),createVisualElement:t,Component:s};return lk(o)}}function Ix(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function tl(e,t,n){const s=e.getProps();return Vd(s,t,n!==void 0?n:s.custom,e)}const Fk=Ld(()=>window.ScrollTimeline!==void 0);class Vk{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>{if(Fk()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class $k extends Vk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Yd(e,t){return e?e[t]||e.default||e:void 0}const uu=2e4;function Bx(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<uu;)t+=n,s=e.next(t);return t>=uu?1/0:t}function Xd(e){return typeof e=="function"}function af(e,t){e.timeline=t,e.onfinish=null}const Qd=e=>Array.isArray(e)&&typeof e[0]=="number",Uk={linearEasing:void 0};function Hk(e,t){const n=Ld(e);return()=>{var s;return(s=Uk[t])!==null&&s!==void 0?s:n()}}const Eo=Hk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fx=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(wr(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Vx(e){return!!(typeof e=="function"&&Eo()||!e||typeof e=="string"&&(e in du||Eo())||Qd(e)||Array.isArray(e)&&e.every(Vx))}const Jr=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,du={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jr([0,.65,.55,1]),circOut:Jr([.55,0,1,.45]),backIn:Jr([.31,.01,.66,-.59]),backOut:Jr([.33,1.53,.69,.99])};function $x(e,t){if(e)return typeof e=="function"&&Eo()?Fx(e,t):Qd(e)?Jr(e):Array.isArray(e)?e.map(n=>$x(n,t)||du.easeOut):du[e]}const It={x:!1,y:!1};function Ux(){return It.x||It.y}function Wk(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function Hx(e,t){const n=Wk(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function of(e){return t=>{t.pointerType==="touch"||Ux()||e(t)}}function Gk(e,t,n={}){const[s,i,a]=Hx(e,n),o=of(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=of(p=>{u(p),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const Wx=(e,t)=>t?e===t?!0:Wx(e,t.parentElement):!1,Jd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Kk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qk(e){return Kk.has(e.tagName)||e.tabIndex!==-1}const Zr=new WeakSet;function lf(e){return t=>{t.key==="Enter"&&e(t)}}function Ul(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Yk=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=lf(()=>{if(Zr.has(n))return;Ul(n,"down");const i=lf(()=>{Ul(n,"up")}),a=()=>Ul(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cf(e){return Jd(e)&&!Ux()}function Xk(e,t,n={}){const[s,i,a]=Hx(e,n),o=l=>{const c=l.currentTarget;if(!cf(l)||Zr.has(c))return;Zr.add(c);const u=t(l),d=(m,v)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",h),!(!cf(m)||!Zr.has(c))&&(Zr.delete(c),typeof u=="function"&&u(m,{success:v}))},p=m=>{d(m,n.useGlobalTarget||Wx(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!qk(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",u=>Yk(u,i),i)}),a}function Qk(e){return e==="x"||e==="y"?It[e]?null:(It[e]=!0,()=>{It[e]=!1}):It.x||It.y?null:(It.x=It.y=!0,()=>{It.x=It.y=!1})}const Gx=new Set(["width","height","top","left","right","bottom",...Ar]);let qa;function Jk(){qa=void 0}const rn={now:()=>(qa===void 0&&rn.set(Ve.isProcessing||K2.useManualTiming?Ve.timestamp:performance.now()),qa),set:e=>{qa=e,queueMicrotask(Jk)}};function Zd(e,t){e.indexOf(t)===-1&&e.push(t)}function eh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class th{constructor(){this.subscriptions=[]}add(t){return Zd(this.subscriptions,t),()=>eh(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Kx(e,t){return t?e*(1e3/t):0}const uf=30,Zk=e=>!isNaN(parseFloat(e));class e5{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=rn.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=rn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zk(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new th);const s=this.events[t].add(n);return t==="change"?()=>{s(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uf)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uf);return Kx(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Fi(e,t){return new e5(e,t)}function t5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Fi(n))}function n5(e,t){const n=tl(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=fk(a[o]);t5(e,o,l)}}function s5(e){return!!(Ye(e)&&e.add)}function hu(e,t){const n=e.getValue("willChange");if(s5(n))return n.add(t)}function qx(e){return e.props[Nx]}const Yx=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,r5=1e-7,i5=12;function a5(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=Yx(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>r5&&++l<i5);return o}function Qi(e,t,n,s){if(e===t&&n===s)return xt;const i=a=>a5(a,0,1,e,n);return a=>a===0||a===1?a:Yx(i(a),t,s)}const Xx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qx=e=>t=>1-e(1-t),Jx=Qi(.33,1.53,.69,.99),nh=Qx(Jx),Zx=Xx(nh),ey=e=>(e*=2)<1?.5*nh(e):.5*(2-Math.pow(2,-10*(e-1))),sh=e=>1-Math.sin(Math.acos(e)),ty=Qx(sh),ny=Xx(sh),sy=e=>/^0[^.\s]+$/u.test(e);function o5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sy(e):!0}const pi=e=>Math.round(e*1e5)/1e5,rh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function l5(e){return e==null}const c5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ih=(e,t)=>n=>!!(typeof n=="string"&&c5.test(n)&&n.startsWith(e)||t&&!l5(n)&&Object.prototype.hasOwnProperty.call(n,t)),ry=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(rh);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},u5=e=>Sn(0,255,e),Hl={...Mr,transform:e=>Math.round(u5(e))},bs={test:ih("rgb","red"),parse:ry("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Hl.transform(e)+", "+Hl.transform(t)+", "+Hl.transform(n)+", "+pi(Bi.transform(s))+")"};function d5(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const pu={test:ih("#"),parse:d5,transform:bs.transform},rr={test:ih("hsl","hue"),parse:ry("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+sn.transform(pi(t))+", "+sn.transform(pi(n))+", "+pi(Bi.transform(s))+")"},Ke={test:e=>bs.test(e)||pu.test(e)||rr.test(e),parse:e=>bs.test(e)?bs.parse(e):rr.test(e)?rr.parse(e):pu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bs.transform(e):rr.transform(e)},h5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function p5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rh))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(h5))===null||n===void 0?void 0:n.length)||0)>0}const iy="number",ay="color",f5="var",m5="var(",df="${}",g5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vi(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(g5,c=>(Ke.test(c)?(s.color.push(a),i.push(ay),n.push(Ke.parse(c))):c.startsWith(m5)?(s.var.push(a),i.push(f5),n.push(c)):(s.number.push(a),i.push(iy),n.push(parseFloat(c))),++a,df)).split(df);return{values:n,split:l,indexes:s,types:i}}function oy(e){return Vi(e).values}function ly(e){const{split:t,types:n}=Vi(e),s=t.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=t[o],i[o]!==void 0){const l=n[o];l===iy?a+=pi(i[o]):l===ay?a+=Ke.transform(i[o]):a+=i[o]}return a}}const x5=e=>typeof e=="number"?0:e;function y5(e){const t=oy(e);return ly(e)(t.map(x5))}const Zn={test:p5,parse:oy,createTransformer:ly,getAnimatableNone:y5},v5=new Set(["brightness","contrast","saturate","opacity"]);function b5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(rh)||[];if(!s)return e;const i=n.replace(s,"");let a=v5.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const w5=/\b([a-z-]*)\(.*?\)/gu,fu={...Zn,getAnimatableNone:e=>{const t=e.match(w5);return t?t.map(b5).join(" "):e}},k5={...Ud,color:Ke,backgroundColor:Ke,outlineColor:Ke,fill:Ke,stroke:Ke,borderColor:Ke,borderTopColor:Ke,borderRightColor:Ke,borderBottomColor:Ke,borderLeftColor:Ke,filter:fu,WebkitFilter:fu},ah=e=>k5[e];function cy(e,t){let n=ah(e);return n!==fu&&(n=Zn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const j5=new Set(["auto","none","0"]);function N5(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!j5.has(a)&&Vi(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=cy(n,i)}const hf=e=>e===Mr||e===q,pf=(e,t)=>parseFloat(e.split(", ")[t]),ff=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return pf(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?pf(a[1],e):0}},S5=new Set(["x","y","z"]),C5=Ar.filter(e=>!S5.has(e));function _5(e){const t=[];return C5.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const jr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ff(4,13),y:ff(5,14)};jr.translateX=jr.x;jr.translateY=jr.y;const js=new Set;let mu=!1,gu=!1;function uy(){if(gu){const e=Array.from(js).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=_5(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var l;(l=s.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}gu=!1,mu=!1,js.forEach(e=>e.complete()),js.clear()}function dy(){js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gu=!0)})}function E5(){dy(),uy()}class oh{constructor(t,n,s,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(js.add(this),mu||(mu=!0,ye.read(dy),ye.resolveKeyframes(uy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const c=s.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),js.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,js.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const hy=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),T5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function P5(e){const t=T5.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function py(e,t,n=1){const[s,i]=P5(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return hy(o)?parseFloat(o):o}return $d(i)?py(i,t,n+1):i}const fy=e=>t=>t.test(e),A5={test:e=>e==="auto",parse:e=>e},my=[Mr,q,sn,Mn,bk,vk,A5],mf=e=>my.find(fy(e));class gy extends oh{constructor(t,n,s,i,a){super(t,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),$d(u))){const d=py(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Gx.has(s)||t.length!==2)return;const[i,a]=t,o=mf(i),l=mf(a);if(o!==l)if(hf(o)&&hf(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)o5(t[i])&&s.push(i);s.length&&N5(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=jr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(s);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=jr[s](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const gf=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zn.test(e)||e==="0")&&!e.startsWith("url("));function M5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function z5(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=gf(i,t),l=gf(a,t);return!o||!l?!1:M5(e)||(n==="spring"||Xd(n))&&s}const R5=e=>e!==null;function nl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(R5),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const L5=40;class xy{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=rn.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>L5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&E5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=rn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!z5(t,s,i,a))if(o)this.options.duration=0;else{c&&c(nl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const je=(e,t,n)=>e+(t-e)*n;function Wl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function O5({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Wl(c,l,e+1/3),a=Wl(c,l,e),o=Wl(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function To(e,t){return n=>n>0?t:e}const Gl=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},D5=[pu,bs,rr],I5=e=>D5.find(t=>t.test(e));function xf(e){const t=I5(e);if(!t)return!1;let n=t.parse(e);return t===rr&&(n=O5(n)),n}const yf=(e,t)=>{const n=xf(e),s=xf(t);if(!n||!s)return To(e,t);const i={...n};return a=>(i.red=Gl(n.red,s.red,a),i.green=Gl(n.green,s.green,a),i.blue=Gl(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),bs.transform(i))},B5=(e,t)=>n=>t(e(n)),Ji=(...e)=>e.reduce(B5),xu=new Set(["none","hidden"]);function F5(e,t){return xu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function V5(e,t){return n=>je(e,t,n)}function lh(e){return typeof e=="number"?V5:typeof e=="string"?$d(e)?To:Ke.test(e)?yf:H5:Array.isArray(e)?yy:typeof e=="object"?Ke.test(e)?yf:$5:To}function yy(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>lh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function $5(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=lh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function U5(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;s[a]=c,i[o]++}return s}const H5=(e,t)=>{const n=Zn.createTransformer(t),s=Vi(e),i=Vi(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?xu.has(e)&&!i.values.length||xu.has(t)&&!s.values.length?F5(e,t):Ji(yy(U5(s,i),i.values),n):To(e,t)};function vy(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):lh(e)(e,t)}const W5=5;function by(e,t,n){const s=Math.max(t-W5,0);return Kx(n-e(s),t-s)}const Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Kl=.001;function G5({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=Sn(Ce.minDamping,Ce.maxDamping,o),e=Sn(Ce.minDuration,Ce.maxDuration,bn(e)),o<1?(i=u=>{const d=u*o,p=d*e,h=d-n,m=yu(u,o),v=Math.exp(-p);return Kl-h/m*v},a=u=>{const p=u*o*e,h=p*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-p),w=yu(Math.pow(u,2),o);return(-i(u)+Kl>0?-1:1)*((h-m)*v)/w}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-Kl+d*p},a=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const l=5/e,c=q5(i,a,l);if(e=vn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const K5=12;function q5(e,t,n){let s=n;for(let i=1;i<K5;i++)s=s-e(s)/t(s);return s}function yu(e,t){return e*Math.sqrt(1-t*t)}const Y5=["duration","bounce"],X5=["stiffness","damping","mass"];function vf(e,t){return t.some(n=>e[n]!==void 0)}function Q5(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!vf(e,X5)&&vf(e,Y5))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*Sn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=G5(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function wy(e=Ce.visualDuration,t=Ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:p,velocity:h,isResolvedFromDuration:m}=Q5({...n,velocity:-bn(n.velocity||0)}),v=h||0,w=u/(2*Math.sqrt(c*d)),b=o-a,g=bn(Math.sqrt(c/d)),x=Math.abs(b)<5;s||(s=x?Ce.restSpeed.granular:Ce.restSpeed.default),i||(i=x?Ce.restDelta.granular:Ce.restDelta.default);let k;if(w<1){const j=yu(g,w);k=S=>{const y=Math.exp(-w*g*S);return o-y*((v+w*g*b)/j*Math.sin(j*S)+b*Math.cos(j*S))}}else if(w===1)k=j=>o-Math.exp(-g*j)*(b+(v+g*b)*j);else{const j=g*Math.sqrt(w*w-1);k=S=>{const y=Math.exp(-w*g*S),N=Math.min(j*S,300);return o-y*((v+w*g*b)*Math.sinh(N)+j*b*Math.cosh(N))/j}}const C={calculatedDuration:m&&p||null,next:j=>{const S=k(j);if(m)l.done=j>=p;else{let y=0;w<1&&(y=j===0?vn(v):by(k,j,S));const N=Math.abs(y)<=s,P=Math.abs(o-S)<=i;l.done=N&&P}return l.value=l.done?o:S,l},toString:()=>{const j=Math.min(Bx(C),uu),S=Fx(y=>C.next(j*y).value,j,30);return j+"ms "+S}};return C}function bf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=e[0],h={done:!1,value:p},m=N=>l!==void 0&&N<l||c!==void 0&&N>c,v=N=>l===void 0?c:c===void 0||Math.abs(l-N)<Math.abs(c-N)?l:c;let w=n*t;const b=p+w,g=o===void 0?b:o(b);g!==b&&(w=g-p);const x=N=>-w*Math.exp(-N/s),k=N=>g+x(N),C=N=>{const P=x(N),_=k(N);h.done=Math.abs(P)<=u,h.value=h.done?g:_};let j,S;const y=N=>{m(h.value)&&(j=N,S=wy({keyframes:[h.value,v(h.value)],velocity:by(k,N,h.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return y(0),{calculatedDuration:null,next:N=>{let P=!1;return!S&&j===void 0&&(P=!0,C(N),y(N)),j!==void 0&&N>=j?S.next(N-j):(!P&&C(N),h)}}}const J5=Qi(.42,0,1,1),Z5=Qi(0,0,.58,1),ky=Qi(.42,0,.58,1),ej=e=>Array.isArray(e)&&typeof e[0]!="number",tj={linear:xt,easeIn:J5,easeInOut:ky,easeOut:Z5,circIn:sh,circInOut:ny,circOut:ty,backIn:nh,backInOut:Zx,backOut:Jx,anticipate:ey},wf=e=>{if(Qd(e)){yx(e.length===4);const[t,n,s,i]=e;return Qi(t,n,s,i)}else if(typeof e=="string")return tj[e];return e};function nj(e,t,n){const s=[],i=n||vy,a=e.length-1;for(let o=0;o<a;o++){let l=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||xt:t;l=Ji(c,l)}s.push(l)}return s}function sj(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(yx(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=nj(t,s,i),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(d<e[p+1]);p++);const h=wr(e[p],e[p+1],d);return l[p](h)};return n?d=>u(Sn(e[0],e[a-1],d)):u}function rj(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=wr(0,t,s);e.push(je(n,1,i))}}function ij(e){const t=[0];return rj(t,e.length-1),t}function aj(e,t){return e.map(n=>n*t)}function oj(e,t){return e.map(()=>t||ky).splice(0,e.length-1)}function Po({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=ej(s)?s.map(wf):wf(s),a={done:!1,value:t[0]},o=aj(n&&n.length===t.length?n:ij(t),e),l=sj(o,t,{ease:Array.isArray(i)?i:oj(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const lj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ye.update(t,!0),stop:()=>Jn(t),now:()=>Ve.isProcessing?Ve.timestamp:rn.now()}},cj={decay:bf,inertia:bf,tween:Po,keyframes:Po,spring:wy},uj=e=>e/100;class ch extends xy{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||oh,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,l=Xd(n)?n:cj[n]||Po;let c,u;l!==Po&&typeof t[0]!="number"&&(c=Ji(uj,vy(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Bx(d));const{calculatedDuration:p}=d,h=p+i,m=h*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:h,repeat:m,repeatType:v,repeatDelay:w,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let k=this.currentTime,C=a;if(m){const N=Math.min(this.currentTime,d)/p;let P=Math.floor(N),_=N%1;!_&&N>=1&&(_=1),_===1&&P--,P=Math.min(P,m+1),!!(P%2)&&(v==="reverse"?(_=1-_,w&&(_-=w/p)):v==="mirror"&&(C=o)),k=Sn(0,1,_)*p}const j=x?{done:!1,value:c[0]}:C.next(k);l&&(j.value=l(j.value));let{done:S}=j;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return y&&i!==void 0&&(j.value=nl(c,this.options,i)),b&&b(j.value),y&&this.finish(),j}get duration(){const{resolved:t}=this;return t?bn(t.calculatedDuration):0}get time(){return bn(this.currentTime)}set time(t){t=vn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=bn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=lj,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const dj=new Set(["opacity","clipPath","filter","transform"]);function hj(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=$x(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const pj=Ld(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ao=10,fj=2e4;function mj(e){return Xd(e.type)||e.type==="spring"||!Vx(e.ease)}function gj(e,t){const n=new ch({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let a=0;for(;!s.done&&a<fj;)s=n.sample(a),i.push(s.value),a+=Ao;return{times:void 0,keyframes:i,duration:a-Ao,ease:"linear"}}const jy={anticipate:ey,backInOut:Zx,circInOut:ny};function xj(e){return e in jy}class kf extends xy{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new gy(a,(o,l)=>this.onKeyframesResolved(o,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:a,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Eo()&&xj(a)&&(a=jy[a]),mj(this.options)){const{onComplete:p,onUpdate:h,motionValue:m,element:v,...w}=this.options,b=gj(t,w);t=b.keyframes,t.length===1&&(t[1]=t[0]),s=b.duration,i=b.times,a=b.ease,o="keyframes"}const d=hj(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(af(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;l.set(nl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return bn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return bn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=vn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return xt;const{animation:s}=n;af(s,t)}return xt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:p,element:h,...m}=this.options,v=new ch({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),w=vn(this.time);u.setWithVelocity(v.sample(w-Ao).value,v.sample(w).value,Ao)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:a,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return pj()&&s&&dj.has(s)&&!c&&!u&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const yj={type:"spring",stiffness:500,damping:25,restSpeed:10},vj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),bj={type:"keyframes",duration:.8},wj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kj=(e,{keyframes:t})=>t.length>2?bj:zs.has(e)?e.startsWith("scale")?vj(t[1]):yj:wj;function jj({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uh=(e,t,n,s={},i,a)=>o=>{const l=Yd(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-vn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};jj(l)||(d={...d,...kj(e,d)}),d.duration&&(d.duration=vn(d.duration)),d.repeatDelay&&(d.repeatDelay=vn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const h=nl(d.keyframes,l);if(h!==void 0)return ye.update(()=>{d.onUpdate(h),d.onComplete()}),new $k([])}return!a&&kf.supports(d)?new kf(d):new ch(d)};function Nj({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Ny(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const h=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||d&&Nj(d,p))continue;const v={delay:n,...Yd(o||{},p)};let w=!1;if(window.MotionHandoffAnimation){const g=qx(e);if(g){const x=window.MotionHandoffAnimation(g,p,ye);x!==null&&(v.startTime=x,w=!0)}}hu(e,p),h.start(uh(p,h,m,e.shouldReduceMotion&&Gx.has(p)?{type:!1}:v,e,w));const b=h.animation;b&&u.push(b)}return l&&Promise.all(u).then(()=>{ye.update(()=>{l&&n5(e,l)})}),u}function vu(e,t,n={}){var s;const i=tl(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(Ny(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:h}=a;return Sj(e,t,d+u,p,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function Sj(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(Cj).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(vu(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Cj(e,t){return e.sortNodePosition(t)}function _j(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>vu(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=vu(e,t,n);else{const i=typeof t=="function"?tl(e,t,n.custom):t;s=Promise.all(Ny(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Ej=Dd.length;function Sy(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sy(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ej;n++){const s=Dd[n],i=e.props[s];(Ii(i)||i===!1)&&(t[s]=i)}return t}const Tj=[...Od].reverse(),Pj=Od.length;function Aj(e){return t=>Promise.all(t.map(({animation:n,options:s})=>_j(e,n,s)))}function Mj(e){let t=Aj(e),n=jf(),s=!0;const i=c=>(u,d)=>{var p;const h=tl(e,d,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:v,...w}=h;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=Sy(e.parent)||{},p=[],h=new Set;let m={},v=1/0;for(let b=0;b<Pj;b++){const g=Tj[b],x=n[g],k=u[g]!==void 0?u[g]:d[g],C=Ii(k),j=g===c?x.isActive:null;j===!1&&(v=b);let S=k===d[g]&&k!==u[g]&&C;if(S&&s&&e.manuallyAnimateOnMount&&(S=!1),x.protectedKeys={...m},!x.isActive&&j===null||!k&&!x.prevProp||Zo(k)||typeof k=="boolean")continue;const y=zj(x.prevProp,k);let N=y||g===c&&x.isActive&&!S&&C||b>v&&C,P=!1;const _=Array.isArray(k)?k:[k];let T=_.reduce(i(g),{});j===!1&&(T={});const{prevResolvedValues:O={}}=x,F={...O,...T},D=V=>{N=!0,h.has(V)&&(P=!0,h.delete(V)),x.needsAnimating[V]=!0;const E=e.getValue(V);E&&(E.liveStyle=!1)};for(const V in F){const E=T[V],R=O[V];if(m.hasOwnProperty(V))continue;let B=!1;cu(E)&&cu(R)?B=!Ix(E,R):B=E!==R,B?E!=null?D(V):h.add(V):E!==void 0&&h.has(V)?D(V):x.protectedKeys[V]=!0}x.prevProp=k,x.prevResolvedValues=T,x.isActive&&(m={...m,...T}),s&&e.blockInitialAnimation&&(N=!1),N&&(!(S&&y)||P)&&p.push(..._.map(V=>({animation:V,options:{type:g}})))}if(h.size){const b={};h.forEach(g=>{const x=e.getBaseTarget(g),k=e.getValue(g);k&&(k.liveStyle=!0),b[g]=x??null}),p.push({animation:b})}let w=!!p.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),s=!1,w?t(p):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const p=o(c);for(const h in n)n[h].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=jf(),s=!0}}}function zj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ix(t,e):!1}function us(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jf(){return{animate:us(!0),whileInView:us(),whileHover:us(),whileTap:us(),whileDrag:us(),whileFocus:us(),exit:us()}}class as{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Rj extends as{constructor(t){super(t),t.animationState||(t.animationState=Mj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Lj=0;class Oj extends as{constructor(){super(...arguments),this.id=Lj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Dj={animation:{Feature:Rj},exit:{Feature:Oj}};function $i(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Zi(e){return{point:{x:e.pageX,y:e.pageY}}}const Ij=e=>t=>Jd(t)&&e(t,Zi(t));function fi(e,t,n,s){return $i(e,t,Ij(n),s)}const Nf=(e,t)=>Math.abs(e-t);function Bj(e,t){const n=Nf(e.x,t.x),s=Nf(e.y,t.y);return Math.sqrt(n**2+s**2)}class Cy{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Yl(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=Bj(p.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:v}=p,{timestamp:w}=Ve;this.history.push({...v,timestamp:w});const{onStart:b,onMove:g}=this.handlers;h||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=ql(h,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Yl(p.type==="pointercancel"?this.lastMoveEventInfo:ql(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,b),v&&v(p,b)},!Jd(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=Zi(t),l=ql(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Ve;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Yl(l,this.history)),this.removeListeners=Ji(fi(this.contextWindow,"pointermove",this.handlePointerMove),fi(this.contextWindow,"pointerup",this.handlePointerUp),fi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jn(this.updatePoint)}}function ql(e,t){return t?{point:t(e.point)}:e}function Sf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yl({point:e},t){return{point:e,delta:Sf(e,_y(t)),offset:Sf(e,Fj(t)),velocity:Vj(t,.1)}}function Fj(e){return e[0]}function _y(e){return e[e.length-1]}function Vj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=_y(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>vn(t)));)n--;if(!s)return{x:0,y:0};const a=bn(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const Ey=1e-4,$j=1-Ey,Uj=1+Ey,Ty=.01,Hj=0-Ty,Wj=0+Ty;function vt(e){return e.max-e.min}function Gj(e,t,n){return Math.abs(e-t)<=n}function Cf(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=$j&&e.scale<=Uj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Hj&&e.translate<=Wj||isNaN(e.translate))&&(e.translate=0)}function mi(e,t,n,s){Cf(e.x,t.x,n.x,s?s.originX:void 0),Cf(e.y,t.y,n.y,s?s.originY:void 0)}function _f(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function Kj(e,t,n){_f(e.x,t.x,n.x),_f(e.y,t.y,n.y)}function Ef(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function gi(e,t,n){Ef(e.x,t.x,n.x),Ef(e.y,t.y,n.y)}function qj(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?je(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?je(n,e,s.max):Math.min(e,n)),e}function Tf(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Yj(e,{top:t,left:n,bottom:s,right:i}){return{x:Tf(e.x,n,i),y:Tf(e.y,t,s)}}function Pf(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function Xj(e,t){return{x:Pf(e.x,t.x),y:Pf(e.y,t.y)}}function Qj(e,t){let n=.5;const s=vt(e),i=vt(t);return i>s?n=wr(t.min,t.max-s,e.min):s>i&&(n=wr(e.min,e.max-i,t.min)),Sn(0,1,n)}function Jj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const bu=.35;function Zj(e=bu){return e===!1?e=0:e===!0&&(e=bu),{x:Af(e,"left","right"),y:Af(e,"top","bottom")}}function Af(e,t,n){return{min:Mf(e,t),max:Mf(e,n)}}function Mf(e,t){return typeof e=="number"?e:e[t]||0}const zf=()=>({translate:0,scale:1,origin:0,originPoint:0}),ir=()=>({x:zf(),y:zf()}),Rf=()=>({min:0,max:0}),Te=()=>({x:Rf(),y:Rf()});function Nt(e){return[e("x"),e("y")]}function Py({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function eN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Xl(e){return e===void 0||e===1}function wu({scale:e,scaleX:t,scaleY:n}){return!Xl(e)||!Xl(t)||!Xl(n)}function fs(e){return wu(e)||Ay(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ay(e){return Lf(e.x)||Lf(e.y)}function Lf(e){return e&&e!=="0%"}function Mo(e,t,n){const s=e-n,i=t*s;return n+i}function Of(e,t,n,s,i){return i!==void 0&&(e=Mo(e,i,s)),Mo(e,n,s)+t}function ku(e,t=0,n=1,s,i){e.min=Of(e.min,t,n,s,i),e.max=Of(e.max,t,n,s,i)}function My(e,{x:t,y:n}){ku(e.x,t.translate,t.scale,t.originPoint),ku(e.y,n.translate,n.scale,n.originPoint)}const Df=.999999999999,If=1.0000000000001;function nN(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&or(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,My(e,o)),s&&fs(a.latestValues)&&or(e,a.latestValues))}t.x<If&&t.x>Df&&(t.x=1),t.y<If&&t.y>Df&&(t.y=1)}function ar(e,t){e.min=e.min+t,e.max=e.max+t}function Bf(e,t,n,s,i=.5){const a=je(e.min,e.max,i);ku(e,t,n,a,s)}function or(e,t){Bf(e.x,t.x,t.scaleX,t.scale,t.originX),Bf(e.y,t.y,t.scaleY,t.scale,t.originY)}function zy(e,t){return Py(tN(e.getBoundingClientRect(),t))}function sN(e,t,n){const s=zy(e,n),{scroll:i}=t;return i&&(ar(s.x,i.offset.x),ar(s.y,i.offset.y)),s}const Ry=({current:e})=>e?e.ownerDocument.defaultView:null,rN=new WeakMap;class iN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Zi(d).point)},a=(d,p)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qk(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nt(b=>{let g=this.getAxisMotionValue(b).get()||0;if(sn.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const k=x.layout.layoutBox[b];k&&(g=vt(k)*(parseFloat(g)/100))}}this.originPoint[b]=g}),v&&ye.postRender(()=>v(d,p)),hu(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(d,p)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:w}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=p;if(m&&this.currentDirection===null){this.currentDirection=aN(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,b),this.updateAxis("y",p.point,b),this.visualElement.render(),w&&w(d,p)},l=(d,p)=>this.stop(d,p),c=()=>Nt(d=>{var p;return this.getAnimationState(d)==="paused"&&((p=this.getAxisMotionValue(d).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Cy(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ry(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!Ea(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=qj(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&sr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Yj(i.layoutBox,n):this.constraints=!1,this.elastic=Zj(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Jj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=sN(s,i.root,this.visualElement.getTransformPagePoint());let o=Xj(i.layout.layoutBox,a);if(n){const l=n(eN(o));this.hasMutatedConstraints=!!l,l&&(o=Py(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Nt(d=>{if(!Ea(d,n,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,v={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return hu(this.visualElement,t),s.start(uh(t,s,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Nt(n=>{const{drag:s}=this.getProps();if(!Ea(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];a.set(t[n]-je(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!sr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=Qj({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Nt(o=>{if(!Ea(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(je(c,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;rN.set(this.visualElement,this);const t=this.visualElement.current,n=fi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();sr(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ye.read(s);const o=$i(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Nt(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=c[d].translate,p.set(p.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=bu,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Ea(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oN extends as{constructor(t){super(t),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new iN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ff=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class lN extends as{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(t){this.session=new Cy(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ry(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ff(t),onStart:Ff(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ye.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=fi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ya={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Vf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=Vf(e,t.target.x),s=Vf(e,t.target.y);return`${n}% ${s}%`}},cN={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=Zn.parse(e);if(i.length>5)return s;const a=Zn.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=c;const u=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class uN extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;Pk(dN),a&&(n.group&&n.group.add(a),s&&s.register&&i&&s.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Ya.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:a}=this.props,o=s.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ye.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Bd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ly(e){const[t,n]=gx(),s=f.useContext(zd);return r.jsx(uN,{...e,layoutGroup:s,switchLayoutGroup:f.useContext(Sx),isPresent:t,safeToRemove:n})}const dN={borderRadius:{...Wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:cN};function hN(e,t,n){const s=Ye(e)?e:Fi(e);return s.start(uh("",s,t,n)),s.animation}function pN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const fN=(e,t)=>e.depth-t.depth;class mN{constructor(){this.children=[],this.isDirty=!1}add(t){Zd(this.children,t),this.isDirty=!0}remove(t){eh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fN),this.isDirty=!1,this.children.forEach(t)}}function gN(e,t){const n=rn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(Jn(s),e(a-t))};return ye.read(s,!0),()=>Jn(s)}const Oy=["TopLeft","TopRight","BottomLeft","BottomRight"],xN=Oy.length,$f=e=>typeof e=="string"?parseFloat(e):e,Uf=e=>typeof e=="number"||q.test(e);function yN(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,vN(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,bN(s))):a&&(e.opacity=je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<xN;o++){const l=`border${Oy[o]}Radius`;let c=Hf(t,l),u=Hf(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Uf(c)===Uf(u)?(e[l]=Math.max(je($f(c),$f(u),s),0),(sn.test(u)||sn.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Hf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vN=Dy(0,.5,ty),bN=Dy(.5,.95,xt);function Dy(e,t,n){return s=>s<e?0:s>t?1:n(wr(e,t,s))}function Wf(e,t){e.min=t.min,e.max=t.max}function jt(e,t){Wf(e.x,t.x),Wf(e.y,t.y)}function Gf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kf(e,t,n,s,i){return e-=t,e=Mo(e,1/n,s),i!==void 0&&(e=Mo(e,1/i,s)),e}function wN(e,t=0,n=1,s=.5,i,a=e,o=e){if(sn.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=je(a.min,a.max,s);e===a&&(l-=t),e.min=Kf(e.min,t,n,l,i),e.max=Kf(e.max,t,n,l,i)}function qf(e,t,[n,s,i],a,o){wN(e,t[n],t[s],t[i],t.scale,a,o)}const kN=["x","scaleX","originX"],jN=["y","scaleY","originY"];function Yf(e,t,n,s){qf(e.x,t,kN,n?n.x:void 0,s?s.x:void 0),qf(e.y,t,jN,n?n.y:void 0,s?s.y:void 0)}function Xf(e){return e.translate===0&&e.scale===1}function Iy(e){return Xf(e.x)&&Xf(e.y)}function Qf(e,t){return e.min===t.min&&e.max===t.max}function NN(e,t){return Qf(e.x,t.x)&&Qf(e.y,t.y)}function Jf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function By(e,t){return Jf(e.x,t.x)&&Jf(e.y,t.y)}function Zf(e){return vt(e.x)/vt(e.y)}function em(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class SN{constructor(){this.members=[]}add(t){Zd(this.members,t),t.scheduleRender()}remove(t){if(eh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){s=a;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function CN(e,t,n){let s="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:h,skewX:m,skewY:v}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),p&&(s+=`rotateX(${p}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),v&&(s+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const ms={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ei=typeof window<"u"&&window.MotionDebug!==void 0,Ql=["","X","Y","Z"],_N={visibility:"hidden"},tm=1e3;let EN=0;function Jl(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function Fy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=qx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Fy(s)}function Vy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=EN++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ei&&(ms.totalNodes=ms.resolvedTargetDeltas=ms.recalculatedProjection=0),this.nodes.forEach(AN),this.nodes.forEach(ON),this.nodes.forEach(DN),this.nodes.forEach(MN),ei&&window.MotionDebug.record(ms)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new mN)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new th),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pN(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let p;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=gN(h,250),Ya.hasAnimatedSinceResize&&(Ya.hasAnimatedSinceResize=!1,this.nodes.forEach(sm))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||$N,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!By(this.targetLayout,v)||m,k=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||k||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,k);const C={...Yd(w,"layout"),onPlay:b,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else h||sm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(IN),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nm);return}this.isUpdating||this.nodes.forEach(RN),this.isUpdating=!1,this.nodes.forEach(LN),this.nodes.forEach(TN),this.nodes.forEach(PN),this.clearAllSnapshots();const l=rn.now();Ve.delta=Sn(0,1e3/60,l-Ve.timestamp),Ve.timestamp=l,Ve.isProcessing=!0,$l.update.process(Ve),$l.preRender.process(Ve),$l.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zN),this.sharedNodes.forEach(BN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Iy(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(l||fs(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),UN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Te();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(HN))){const{scroll:d}=this.root;d&&(ar(c.x,d.offset.x),ar(c.y,d.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(jt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:h}=d;d!==this.root&&p&&h.layoutScroll&&(p.wasRoot&&jt(c,o),ar(c.x,p.offset.x),ar(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();jt(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&or(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),fs(d.latestValues)&&or(c,d.latestValues)}return fs(this.latestValues)&&or(c,this.latestValues),c}removeTransform(o){const l=Te();jt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!fs(u.latestValues))continue;wu(u.latestValues)&&u.updateSnapshot();const d=Te(),p=u.measurePageBox();jt(d,p),Yf(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return fs(this.latestValues)&&Yf(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:h}=this.options;if(!(!this.layout||!(p||h))){if(this.resolvedRelativeTargetAt=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Kj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jt(this.target,this.layout.layoutBox),My(this.target,this.targetDelta)):jt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.target,m.target),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ei&&ms.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||wu(this.parent.latestValues)||Ay(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(u=!1),u)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;jt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;nN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Te());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gf(this.prevProjectionDelta.x,this.projectionDelta.x),Gf(this.prevProjectionDelta.y,this.projectionDelta.y)),mi(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!em(this.projectionDelta.x,this.prevProjectionDelta.x)||!em(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),ei&&ms.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ir(),this.projectionDelta=ir(),this.projectionDeltaWithTransform=ir()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=ir();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=Te(),m=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=m!==v,b=this.getStack(),g=!b||b.members.length<=1,x=!!(w&&!g&&this.options.crossfade===!0&&!this.path.some(VN));this.animationProgress=0;let k;this.mixTargetDelta=C=>{const j=C/1e3;rm(p.x,o.x,j),rm(p.y,o.y,j),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FN(this.relativeTarget,this.relativeTargetOrigin,h,j),k&&NN(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Te()),jt(k,this.relativeTarget)),w&&(this.animationValues=d,yN(d,u,this.latestValues,j,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Ya.hasAnimatedSinceResize=!0,this.currentAnimation=hN(0,tm,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&$y(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Te();const p=vt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const h=vt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}jt(l,c),or(l,d),mi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new SN),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Jl("z",o,u,this.animationValues);for(let d=0;d<Ql.length;d++)Jl(`rotate${Ql[d]}`,o,u,this.animationValues),Jl(`skew${Ql[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _N;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Ka(o==null?void 0:o.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Ka(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}const h=p.animationValues||p.latestValues;this.applyTransformsToTarget(),u.transform=CN(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,p.animationValues?u.opacity=p===this?(c=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=p===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in _o){if(h[w]===void 0)continue;const{correct:b,applyTo:g}=_o[w],x=u.transform==="none"?h[w]:b(h[w],p);if(g){const k=g.length;for(let C=0;C<k;C++)u[g[C]]=x}else u[w]=x}return this.options.layoutId&&(u.pointerEvents=p===this?Ka(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(nm),this.root.sharedNodes.clear()}}}function TN(e){e.updateLayout()}function PN(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(h);h.min=s[p].min,h.max=h.min+m}):$y(a,n.layoutBox,s)&&Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(s[p]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=ir();mi(l,s,n.layoutBox);const c=ir();o?mi(c,e.applyTransform(i,!0),n.measuredBox):mi(c,s,n.layoutBox);const u=!Iy(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:h,layout:m}=p;if(h&&m){const v=Te();gi(v,n.layoutBox,h.layoutBox);const w=Te();gi(w,s,m.layoutBox),By(v,w)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function AN(e){ei&&ms.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function MN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zN(e){e.clearSnapshot()}function nm(e){e.clearMeasurements()}function RN(e){e.isLayoutDirty=!1}function LN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ON(e){e.resolveTargetDelta()}function DN(e){e.calcProjection()}function IN(e){e.resetSkewAndRotation()}function BN(e){e.removeLeadSnapshot()}function rm(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function im(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function FN(e,t,n,s){im(e.x,t.x,n.x,s),im(e.y,t.y,n.y,s)}function VN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $N={duration:.45,ease:[.4,0,.1,1]},am=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),om=am("applewebkit/")&&!am("chrome/")?Math.round:xt;function lm(e){e.min=om(e.min),e.max=om(e.max)}function UN(e){lm(e.x),lm(e.y)}function $y(e,t,n){return e==="position"||e==="preserve-aspect"&&!Gj(Zf(t),Zf(n),.2)}function HN(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const WN=Vy({attachResizeListener:(e,t)=>$i(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zl={current:void 0},Uy=Vy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zl.current){const e=new WN({});e.mount(window),e.setOptions({layoutScroll:!0}),Zl.current=e}return Zl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),GN={pan:{Feature:lN},drag:{Feature:oN,ProjectionNode:Uy,MeasureLayout:Ly}};function cm(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=s[i];a&&ye.postRender(()=>a(t,Zi(t)))}class KN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Gk(t,n=>(cm(this.node,n,"Start"),s=>cm(this.node,s,"End"))))}unmount(){}}class qN extends as{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ji($i(this.node.current,"focus",()=>this.onFocus()),$i(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function um(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=s[i];a&&ye.postRender(()=>a(t,Zi(t)))}class YN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Xk(t,n=>(um(this.node,n,"Start"),(s,{success:i})=>um(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ju=new WeakMap,ec=new WeakMap,XN=e=>{const t=ju.get(e.target);t&&t(e)},QN=e=>{e.forEach(XN)};function JN({root:e,...t}){const n=e||document;ec.has(n)||ec.set(n,{});const s=ec.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(QN,{root:e,...t})),s[i]}function ZN(e,t,n){const s=JN(t);return ju.set(e,n),s.observe(e),()=>{ju.delete(e),s.unobserve(e)}}const eS={some:0,all:1};class tS extends as{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:eS[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),h=u?d:p;h&&h(c)};return ZN(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(nS(t,n))&&this.startObserver()}unmount(){}}function nS({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sS={inView:{Feature:tS},tap:{Feature:YN},focus:{Feature:qN},hover:{Feature:KN}},rS={layout:{ProjectionNode:Uy,MeasureLayout:Ly}},Nu={current:null},Hy={current:!1};function iS(){if(Hy.current=!0,!!Rd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nu.current=e.matches;e.addListener(t),t()}else Nu.current=!1}const aS=[...my,Ke,Zn],oS=e=>aS.find(fy(e)),dm=new WeakMap;function lS(e,t,n){for(const s in t){const i=t[s],a=n[s];if(Ye(i))e.addValue(s,i);else if(Ye(a))e.addValue(s,Fi(i,{owner:e}));else if(a!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,Fi(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const hm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class cS{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=rn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=el(n),this.isVariantNode=jx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];c[m]!==void 0&&Ye(v)&&v.set(c[m],!1)}}mount(t){this.current=t,dm.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Hy.current||iS(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Nu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dm.delete(this.current),this.projection&&this.projection.unmount(),Jn(this.notifyUpdate),Jn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=zs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ye.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in kr){const n=kr[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<hm.length;s++){const i=hm[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=lS(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Fi(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(hy(i)||sy(i))?i=parseFloat(i):!oS(i)&&Zn.test(n)&&(i=cy(t,n)),this.setBaseTarget(t,Ye(i)?i.get():i)),Ye(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Vd(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ye(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new th),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Wy extends cS{constructor(){super(...arguments),this.KeyframeResolver=gy}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function uS(e){return window.getComputedStyle(e)}class dS extends Wy{constructor(){super(...arguments),this.type="html",this.renderInstance=Mx}readValueFromInstance(t,n){if(zs.has(n)){const s=ah(n);return s&&s.default||0}else{const s=uS(t),i=(Tx(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zy(t,n)}build(t,n,s){Hd(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return qd(t,n,s)}}class hS extends Wy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zs.has(n)){const s=ah(n);return s&&s.default||0}return n=zx.has(n)?n:Id(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ox(t,n,s)}build(t,n,s){Wd(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Rx(t,n,s,i)}mount(t){this.isSVGTag=Kd(t.tagName),super.mount(t)}}const pS=(e,t)=>Fd(e)?new hS(t):new dS(t,{allowProjection:e!==f.Fragment}),fS=Bk({...Dj,...sS,...GN,...rS},pS),$=ek(fS);/**
76
+ `),()=>{document.head.removeChild(d)}},[t]),r.jsx(V2,{isPresent:t,childRef:s,sizeRef:i,children:f.cloneElement(e,{ref:s})})}const U2=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:a,mode:o})=>{const l=Xo(H2),c=f.useId(),u=f.useCallback(p=>{l.set(p,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),d=f.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:p=>(l.set(p,!1),()=>l.delete(p))}),a?[Math.random(),u]:[n,u]);return f.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=r.jsx($2,{isPresent:n,children:e})),r.jsx(Qo.Provider,{value:d,children:e})};function H2(){return new Map}function gx(e=!0){const t=f.useContext(Qo);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,a=f.useId();f.useEffect(()=>{e&&i(a)},[e]);const o=f.useCallback(()=>e&&s&&s(a),[a,s,e]);return!n&&s?[!1,o]:[!0]}const Sa=e=>e.key||"";function Qp(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Rd=typeof window<"u",xx=Rd?f.useLayoutEffect:f.useEffect,ee=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[l,c]=gx(o),u=f.useMemo(()=>Qp(e),[e]),d=o&&!l?[]:u.map(Sa),p=f.useRef(!0),h=f.useRef(u),m=Xo(()=>new Map),[y,w]=f.useState(u),[v,g]=f.useState(u);xx(()=>{p.current=!1,h.current=u;for(let j=0;j<v.length;j++){const b=Sa(v[j]);d.includes(b)?m.delete(b):m.get(b)!==!0&&m.set(b,!1)}},[v,d.length,d.join("-")]);const x=[];if(u!==y){let j=[...u];for(let b=0;b<v.length;b++){const S=v[b],N=Sa(S);d.includes(N)||(j.splice(b,0,S),x.push(S))}a==="wait"&&x.length&&(j=x),g(Qp(j)),w(u);return}const{forceRender:k}=f.useContext(zd);return r.jsx(r.Fragment,{children:v.map(j=>{const b=Sa(j),S=o&&!l?!1:u===v||d.includes(b),N=()=>{if(m.has(b))m.set(b,!0);else return;let C=!0;m.forEach(_=>{_||(C=!1)}),C&&(k==null||k(),g(h.current),o&&(c==null||c()),s&&s())};return r.jsx(U2,{isPresent:S,initial:!p.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:S?void 0:N,children:j},b)})})},xt=e=>e;let yx=xt;function Ld(e){let t;return()=>(t===void 0&&(t=e()),t)}const wr=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},xn=e=>e*1e3,yn=e=>e/1e3,W2={useManualTiming:!1};function G2(e){let t=new Set,n=new Set,s=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,p=!1)=>{const m=p&&s?t:n;return d&&a.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Ca=["read","resolveKeyframes","update","preRender","render","postRender"],K2=40;function vx(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ca.reduce((g,x)=>(g[x]=G2(a),g),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:p,postRender:h}=o,m=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,K2),1),i.timestamp=g,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},y=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:Ca.reduce((g,x)=>{const k=o[x];return g[x]=(j,b=!1,S=!1)=>(n||y(),k.schedule(j,b,S)),g},{}),cancel:g=>{for(let x=0;x<Ca.length;x++)o[Ca[x]].cancel(g)},state:i,steps:o}}const{schedule:ye,cancel:Jn,state:Ve,steps:$l}=vx(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0),bx=f.createContext({strict:!1}),Jp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kr={};for(const e in Jp)kr[e]={isEnabled:t=>Jp[e].some(n=>!!t[n])};function q2(e){for(const t in e)kr[t]={...kr[t],...e[t]}}const Y2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Co(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Y2.has(e)}let wx=e=>!Co(e);function kx(e){e&&(wx=t=>t.startsWith("on")?!Co(t):e(t))}try{kx(require("@emotion/is-prop-valid").default)}catch{}function X2(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(wx(i)||n===!0&&Co(i)||!t&&!Co(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function Q2({children:e,isValidProp:t,...n}){t&&kx(t),n={...f.useContext(Di),...n},n.isStatic=Xo(()=>n.isStatic);const s=f.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return r.jsx(Di.Provider,{value:s,children:e})}function J2(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Jo=f.createContext({});function Ii(e){return typeof e=="string"||Array.isArray(e)}function Zo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Od=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dd=["initial",...Od];function el(e){return Zo(e.animate)||Dd.some(t=>Ii(e[t]))}function jx(e){return!!(el(e)||e.variants)}function Z2(e,t){if(el(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Ii(n)?n:void 0,animate:Ii(s)?s:void 0}}return e.inherit!==!1?t:{}}function ek(e){const{initial:t,animate:n}=Z2(e,f.useContext(Jo));return f.useMemo(()=>({initial:t,animate:n}),[Zp(t),Zp(n)])}function Zp(e){return Array.isArray(e)?e.join(" "):e}const tk=Symbol.for("motionComponentSymbol");function sr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nk(e,t,n){return f.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):sr(n)&&(n.current=s))},[t])}const Id=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),sk="framerAppearId",Nx="data-"+Id(sk),{schedule:Bd}=vx(queueMicrotask,!1),Sx=f.createContext({});function rk(e,t,n,s,i){var a,o;const{visualElement:l}=f.useContext(Jo),c=f.useContext(bx),u=f.useContext(Qo),d=f.useContext(Di).reducedMotion,p=f.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=p.current,m=f.useContext(Sx);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&ik(p.current,n,i,m);const y=f.useRef(!1);f.useInsertionEffect(()=>{h&&y.current&&h.update(n,u)});const w=n[Nx],v=f.useRef(!!w&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,w))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,w)));return xx(()=>{h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Bd.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,w)}),v.current=!1))}),h}function ik(e,t,n,s){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Cx(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&sr(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function Cx(e){if(e)return e.options.allowProjection!==!1?e.projection:Cx(e.parent)}function ak({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var a,o;e&&q2(e);function l(u,d){let p;const h={...f.useContext(Di),...u,layoutId:ok(u)},{isStatic:m}=h,y=ek(u),w=s(u,m);if(!m&&Rd){lk();const v=ck(h);p=v.MeasureLayout,y.visualElement=rk(i,w,h,t,v.ProjectionNode)}return r.jsxs(Jo.Provider,{value:y,children:[p&&y.visualElement?r.jsx(p,{visualElement:y.visualElement,...h}):null,n(i,u,nk(w,y.visualElement,d),w,m,y.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const c=f.forwardRef(l);return c[tk]=i,c}function ok({layoutId:e}){const t=f.useContext(zd).id;return t&&e!==void 0?t+"-"+e:e}function lk(e,t){f.useContext(bx).strict}function ck(e){const{drag:t,layout:n}=kr;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const uk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Fd(e){return typeof e!="string"||e.includes("-")?!1:!!(uk.indexOf(e)>-1||/[A-Z]/u.test(e))}function ef(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Vd(e,t,n,s){if(typeof t=="function"){const[i,a]=ef(s);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=ef(s);t=t(n!==void 0?n:e.custom,i,a)}return t}const cu=e=>Array.isArray(e),dk=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),hk=e=>cu(e)?e[e.length-1]||0:e,qe=e=>!!(e&&e.getVelocity);function Ka(e){const t=qe(e)?e.get():e;return dk(t)?t.toValue():t}function pk({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,a){const o={latestValues:fk(s,i,a,e),renderState:t()};return n&&(o.onMount=l=>n({props:s,current:l,...o}),o.onUpdate=l=>n(l)),o}const _x=e=>(t,n)=>{const s=f.useContext(Jo),i=f.useContext(Qo),a=()=>pk(e,t,s,i);return n?a():Xo(a)};function fk(e,t,n,s){const i={},a=s(e,{});for(const h in a)i[h]=Ka(a[h]);let{initial:o,animate:l}=e;const c=el(e),u=jx(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!Zo(p)){const h=Array.isArray(p)?p:[p];for(let m=0;m<h.length;m++){const y=Vd(e,h[m]);if(y){const{transitionEnd:w,transition:v,...g}=y;for(const x in g){let k=g[x];if(Array.isArray(k)){const j=d?k.length-1:0;k=k[j]}k!==null&&(i[x]=k)}for(const x in w)i[x]=w[x]}}}return i}const Ar=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Ar),Ex=e=>t=>typeof t=="string"&&t.startsWith(e),Tx=Ex("--"),mk=Ex("var(--"),$d=e=>mk(e)?gk.test(e.split("/*")[0].trim()):!1,gk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Px=(e,t)=>t&&typeof e=="number"?t.transform(e):e,jn=(e,t,n)=>n>t?t:n<e?e:n,Mr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Bi={...Mr,transform:e=>jn(0,1,e)},_a={...Mr,default:1},Xi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mn=Xi("deg"),sn=Xi("%"),q=Xi("px"),xk=Xi("vh"),yk=Xi("vw"),tf={...sn,parse:e=>sn.parse(e)/100,transform:e=>sn.transform(e*100)},vk={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,radius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,backgroundPositionX:q,backgroundPositionY:q},bk={rotate:Mn,rotateX:Mn,rotateY:Mn,rotateZ:Mn,scale:_a,scaleX:_a,scaleY:_a,scaleZ:_a,skew:Mn,skewX:Mn,skewY:Mn,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Bi,originX:tf,originY:tf,originZ:q},nf={...Mr,transform:Math.round},Ud={...vk,...bk,zIndex:nf,size:q,fillOpacity:Bi,strokeOpacity:Bi,numOctaves:nf},wk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kk=Ar.length;function jk(e,t,n){let s="",i=!0;for(let a=0;a<kk;a++){const o=Ar[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Px(l,Ud[o]);if(!c){i=!1;const d=wk[o]||o;s+=`${d}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Hd(e,t,n){const{style:s,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(zs.has(c)){o=!0;continue}else if(Tx(c)){i[c]=u;continue}else{const d=Px(u,Ud[c]);c.startsWith("origin")?(l=!0,a[c]=d):s[c]=d}}if(t.transform||(o||n?s.transform=jk(t,e.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;s.transformOrigin=`${c} ${u} ${d}`}}const Nk={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sk={offset:"strokeDashoffset",array:"strokeDasharray"};function Ck(e,t,n=1,s=0,i=!0){e.pathLength=1;const a=i?Nk:Sk;e[a.offset]=q.transform(-s);const o=q.transform(t),l=q.transform(n);e[a.array]=`${o} ${l}`}function sf(e,t,n){return typeof e=="string"?e:q.transform(t+n*e)}function _k(e,t,n){const s=sf(t,e.x,e.width),i=sf(n,e.y,e.height);return`${s} ${i}`}function Wd(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:a,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...u},d,p){if(Hd(e,u,p),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=_k(y,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),o!==void 0&&Ck(h,o,l,c,!1)}const Gd=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ax=()=>({...Gd(),attrs:{}}),Kd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Mx(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const a in n)e.style.setProperty(a,n[a])}const zx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Rx(e,t,n,s){Mx(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(zx.has(i)?i:Id(i),t.attrs[i])}const _o={};function Ek(e){Object.assign(_o,e)}function Lx(e,{layout:t,layoutId:n}){return zs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!_o[e]||e==="opacity")}function qd(e,t,n){var s;const{style:i}=e,a={};for(const o in i)(qe(i[o])||t.style&&qe(t.style[o])||Lx(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function Ox(e,t,n){const s=qd(e,t,n);for(const i in e)if(qe(e[i])||qe(t[i])){const a=Ar.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=e[i]}return s}function Tk(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const rf=["x","y","width","height","cx","cy","r"],Pk={useVisualState:_x({scrapeMotionValuesFromProps:Ox,createRenderState:Ax,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const l in i)if(zs.has(l)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let l=0;l<rf.length;l++){const c=rf[l];e[c]!==t[c]&&(o=!0)}o&&ye.read(()=>{Tk(n,s),ye.render(()=>{Wd(s,i,Kd(n.tagName),e.transformTemplate),Rx(n,s)})})}})},Ak={useVisualState:_x({scrapeMotionValuesFromProps:qd,createRenderState:Gd})};function Dx(e,t,n){for(const s in t)!qe(t[s])&&!Lx(s,n)&&(e[s]=t[s])}function Mk({transformTemplate:e},t){return f.useMemo(()=>{const n=Gd();return Hd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zk(e,t){const n=e.style||{},s={};return Dx(s,n,e),Object.assign(s,Mk(e,t)),s}function Rk(e,t){const n={},s=zk(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function Lk(e,t,n,s){const i=f.useMemo(()=>{const a=Ax();return Wd(a,t,Kd(s),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Dx(a,e.style,e),i.style={...a,...i.style}}return i}function Ok(e=!1){return(n,s,i,{latestValues:a},o)=>{const c=(Fd(n)?Lk:Rk)(s,a,o,n),u=X2(s,typeof n=="string",e),d=n!==f.Fragment?{...u,...c,ref:i}:{},{children:p}=s,h=f.useMemo(()=>qe(p)?p.get():p,[p]);return f.createElement(n,{...d,children:h})}}function Dk(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Fd(s)?Pk:Ak,preloadedFeatures:e,useRender:Ok(i),createVisualElement:t,Component:s};return ak(o)}}function Ix(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function tl(e,t,n){const s=e.getProps();return Vd(s,t,n!==void 0?n:s.custom,e)}const Ik=Ld(()=>window.ScrollTimeline!==void 0);class Bk{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>{if(Ik()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Fk extends Bk{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Yd(e,t){return e?e[t]||e.default||e:void 0}const uu=2e4;function Bx(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<uu;)t+=n,s=e.next(t);return t>=uu?1/0:t}function Xd(e){return typeof e=="function"}function af(e,t){e.timeline=t,e.onfinish=null}const Qd=e=>Array.isArray(e)&&typeof e[0]=="number",Vk={linearEasing:void 0};function $k(e,t){const n=Ld(e);return()=>{var s;return(s=Vk[t])!==null&&s!==void 0?s:n()}}const Eo=$k(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fx=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)s+=e(wr(0,i-1,a))+", ";return`linear(${s.substring(0,s.length-2)})`};function Vx(e){return!!(typeof e=="function"&&Eo()||!e||typeof e=="string"&&(e in du||Eo())||Qd(e)||Array.isArray(e)&&e.every(Vx))}const Jr=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,du={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jr([0,.65,.55,1]),circOut:Jr([.55,0,1,.45]),backIn:Jr([.31,.01,.66,-.59]),backOut:Jr([.33,1.53,.69,.99])};function $x(e,t){if(e)return typeof e=="function"&&Eo()?Fx(e,t):Qd(e)?Jr(e):Array.isArray(e)?e.map(n=>$x(n,t)||du.easeOut):du[e]}const It={x:!1,y:!1};function Ux(){return It.x||It.y}function Uk(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function Hx(e,t){const n=Uk(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function of(e){return t=>{t.pointerType==="touch"||Ux()||e(t)}}function Hk(e,t,n={}){const[s,i,a]=Hx(e,n),o=of(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=of(p=>{u(p),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",o,i)}),a}const Wx=(e,t)=>t?e===t?!0:Wx(e,t.parentElement):!1,Jd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Wk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Gk(e){return Wk.has(e.tagName)||e.tabIndex!==-1}const Zr=new WeakSet;function lf(e){return t=>{t.key==="Enter"&&e(t)}}function Ul(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Kk=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=lf(()=>{if(Zr.has(n))return;Ul(n,"down");const i=lf(()=>{Ul(n,"up")}),a=()=>Ul(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cf(e){return Jd(e)&&!Ux()}function qk(e,t,n={}){const[s,i,a]=Hx(e,n),o=l=>{const c=l.currentTarget;if(!cf(l)||Zr.has(c))return;Zr.add(c);const u=t(l),d=(m,y)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",h),!(!cf(m)||!Zr.has(c))&&(Zr.delete(c),typeof u=="function"&&u(m,{success:y}))},p=m=>{d(m,n.useGlobalTarget||Wx(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!Gk(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),l.addEventListener("focus",u=>Kk(u,i),i)}),a}function Yk(e){return e==="x"||e==="y"?It[e]?null:(It[e]=!0,()=>{It[e]=!1}):It.x||It.y?null:(It.x=It.y=!0,()=>{It.x=It.y=!1})}const Gx=new Set(["width","height","top","left","right","bottom",...Ar]);let qa;function Xk(){qa=void 0}const rn={now:()=>(qa===void 0&&rn.set(Ve.isProcessing||W2.useManualTiming?Ve.timestamp:performance.now()),qa),set:e=>{qa=e,queueMicrotask(Xk)}};function Zd(e,t){e.indexOf(t)===-1&&e.push(t)}function eh(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class th{constructor(){this.subscriptions=[]}add(t){return Zd(this.subscriptions,t),()=>eh(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Kx(e,t){return t?e*(1e3/t):0}const uf=30,Qk=e=>!isNaN(parseFloat(e));class Jk{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const a=rn.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=rn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Qk(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new th);const s=this.events[t].add(n);return t==="change"?()=>{s(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uf)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uf);return Kx(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Fi(e,t){return new Jk(e,t)}function Zk(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Fi(n))}function e5(e,t){const n=tl(e,t);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const l=hk(a[o]);Zk(e,o,l)}}function t5(e){return!!(qe(e)&&e.add)}function hu(e,t){const n=e.getValue("willChange");if(t5(n))return n.add(t)}function qx(e){return e.props[Nx]}const Yx=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,n5=1e-7,s5=12;function r5(e,t,n,s,i){let a,o,l=0;do o=t+(n-t)/2,a=Yx(o,s,i)-e,a>0?n=o:t=o;while(Math.abs(a)>n5&&++l<s5);return o}function Qi(e,t,n,s){if(e===t&&n===s)return xt;const i=a=>r5(a,0,1,e,n);return a=>a===0||a===1?a:Yx(i(a),t,s)}const Xx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qx=e=>t=>1-e(1-t),Jx=Qi(.33,1.53,.69,.99),nh=Qx(Jx),Zx=Xx(nh),ey=e=>(e*=2)<1?.5*nh(e):.5*(2-Math.pow(2,-10*(e-1))),sh=e=>1-Math.sin(Math.acos(e)),ty=Qx(sh),ny=Xx(sh),sy=e=>/^0[^.\s]+$/u.test(e);function i5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sy(e):!0}const pi=e=>Math.round(e*1e5)/1e5,rh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function a5(e){return e==null}const o5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ih=(e,t)=>n=>!!(typeof n=="string"&&o5.test(n)&&n.startsWith(e)||t&&!a5(n)&&Object.prototype.hasOwnProperty.call(n,t)),ry=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,l]=s.match(rh);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},l5=e=>jn(0,255,e),Hl={...Mr,transform:e=>Math.round(l5(e))},bs={test:ih("rgb","red"),parse:ry("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Hl.transform(e)+", "+Hl.transform(t)+", "+Hl.transform(n)+", "+pi(Bi.transform(s))+")"};function c5(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const pu={test:ih("#"),parse:c5,transform:bs.transform},rr={test:ih("hsl","hue"),parse:ry("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+sn.transform(pi(t))+", "+sn.transform(pi(n))+", "+pi(Bi.transform(s))+")"},Ge={test:e=>bs.test(e)||pu.test(e)||rr.test(e),parse:e=>bs.test(e)?bs.parse(e):rr.test(e)?rr.parse(e):pu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bs.transform(e):rr.transform(e)},u5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rh))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(u5))===null||n===void 0?void 0:n.length)||0)>0}const iy="number",ay="color",h5="var",p5="var(",df="${}",f5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vi(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(f5,c=>(Ge.test(c)?(s.color.push(a),i.push(ay),n.push(Ge.parse(c))):c.startsWith(p5)?(s.var.push(a),i.push(h5),n.push(c)):(s.number.push(a),i.push(iy),n.push(parseFloat(c))),++a,df)).split(df);return{values:n,split:l,indexes:s,types:i}}function oy(e){return Vi(e).values}function ly(e){const{split:t,types:n}=Vi(e),s=t.length;return i=>{let a="";for(let o=0;o<s;o++)if(a+=t[o],i[o]!==void 0){const l=n[o];l===iy?a+=pi(i[o]):l===ay?a+=Ge.transform(i[o]):a+=i[o]}return a}}const m5=e=>typeof e=="number"?0:e;function g5(e){const t=oy(e);return ly(e)(t.map(m5))}const Zn={test:d5,parse:oy,createTransformer:ly,getAnimatableNone:g5},x5=new Set(["brightness","contrast","saturate","opacity"]);function y5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(rh)||[];if(!s)return e;const i=n.replace(s,"");let a=x5.has(t)?1:0;return s!==n&&(a*=100),t+"("+a+i+")"}const v5=/\b([a-z-]*)\(.*?\)/gu,fu={...Zn,getAnimatableNone:e=>{const t=e.match(v5);return t?t.map(y5).join(" "):e}},b5={...Ud,color:Ge,backgroundColor:Ge,outlineColor:Ge,fill:Ge,stroke:Ge,borderColor:Ge,borderTopColor:Ge,borderRightColor:Ge,borderBottomColor:Ge,borderLeftColor:Ge,filter:fu,WebkitFilter:fu},ah=e=>b5[e];function cy(e,t){let n=ah(e);return n!==fu&&(n=Zn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const w5=new Set(["auto","none","0"]);function k5(e,t,n){let s=0,i;for(;s<e.length&&!i;){const a=e[s];typeof a=="string"&&!w5.has(a)&&Vi(a).values.length&&(i=e[s]),s++}if(i&&n)for(const a of t)e[a]=cy(n,i)}const hf=e=>e===Mr||e===q,pf=(e,t)=>parseFloat(e.split(", ")[t]),ff=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return pf(i[1],t);{const a=s.match(/^matrix\((.+)\)$/u);return a?pf(a[1],e):0}},j5=new Set(["x","y","z"]),N5=Ar.filter(e=>!j5.has(e));function S5(e){const t=[];return N5.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const jr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ff(4,13),y:ff(5,14)};jr.translateX=jr.x;jr.translateY=jr.y;const js=new Set;let mu=!1,gu=!1;function uy(){if(gu){const e=Array.from(js).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=S5(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var l;(l=s.getValue(a))===null||l===void 0||l.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}gu=!1,mu=!1,js.forEach(e=>e.complete()),js.clear()}function dy(){js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gu=!0)})}function C5(){dy(),uy()}class oh{constructor(t,n,s,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(js.add(this),mu||(mu=!0,ye.read(dy),ye.resolveKeyframes(uy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const c=s.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),js.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,js.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const hy=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function E5(e){const t=_5.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function py(e,t,n=1){const[s,i]=E5(e);if(!s)return;const a=window.getComputedStyle(t).getPropertyValue(s);if(a){const o=a.trim();return hy(o)?parseFloat(o):o}return $d(i)?py(i,t,n+1):i}const fy=e=>t=>t.test(e),T5={test:e=>e==="auto",parse:e=>e},my=[Mr,q,sn,Mn,yk,xk,T5],mf=e=>my.find(fy(e));class gy extends oh{constructor(t,n,s,i,a){super(t,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),$d(u))){const d=py(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Gx.has(s)||t.length!==2)return;const[i,a]=t,o=mf(i),l=mf(a);if(o!==l)if(hf(o)&&hf(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)i5(t[i])&&s.push(i);s.length&&k5(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=jr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(s);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=jr[s](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const gf=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Zn.test(e)||e==="0")&&!e.startsWith("url("));function P5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function A5(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=gf(i,t),l=gf(a,t);return!o||!l?!1:P5(e)||(n==="spring"||Xd(n))&&s}const M5=e=>e!==null;function nl(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(M5),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const z5=40;class xy{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=rn.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>z5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&C5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=rn.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:a,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!A5(t,s,i,a))if(o)this.options.duration=0;else{c&&c(nl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const je=(e,t,n)=>e+(t-e)*n;function Wl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function R5({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Wl(c,l,e+1/3),a=Wl(c,l,e),o=Wl(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function To(e,t){return n=>n>0?t:e}const Gl=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},L5=[pu,bs,rr],O5=e=>L5.find(t=>t.test(e));function xf(e){const t=O5(e);if(!t)return!1;let n=t.parse(e);return t===rr&&(n=R5(n)),n}const yf=(e,t)=>{const n=xf(e),s=xf(t);if(!n||!s)return To(e,t);const i={...n};return a=>(i.red=Gl(n.red,s.red,a),i.green=Gl(n.green,s.green,a),i.blue=Gl(n.blue,s.blue,a),i.alpha=je(n.alpha,s.alpha,a),bs.transform(i))},D5=(e,t)=>n=>t(e(n)),Ji=(...e)=>e.reduce(D5),xu=new Set(["none","hidden"]);function I5(e,t){return xu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function B5(e,t){return n=>je(e,t,n)}function lh(e){return typeof e=="number"?B5:typeof e=="string"?$d(e)?To:Ge.test(e)?yf:$5:Array.isArray(e)?yy:typeof e=="object"?Ge.test(e)?yf:F5:To}function yy(e,t){const n=[...e],s=n.length,i=e.map((a,o)=>lh(a)(a,t[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function F5(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=lh(e[i])(e[i],t[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function V5(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],l=e.indexes[o][i[o]],c=(n=e.values[l])!==null&&n!==void 0?n:0;s[a]=c,i[o]++}return s}const $5=(e,t)=>{const n=Zn.createTransformer(t),s=Vi(e),i=Vi(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?xu.has(e)&&!i.values.length||xu.has(t)&&!s.values.length?I5(e,t):Ji(yy(V5(s,i),i.values),n):To(e,t)};function vy(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):lh(e)(e,t)}const U5=5;function by(e,t,n){const s=Math.max(t-U5,0);return Kx(n-e(s),t-s)}const Ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Kl=.001;function H5({duration:e=Ce.duration,bounce:t=Ce.bounce,velocity:n=Ce.velocity,mass:s=Ce.mass}){let i,a,o=1-t;o=jn(Ce.minDamping,Ce.maxDamping,o),e=jn(Ce.minDuration,Ce.maxDuration,yn(e)),o<1?(i=u=>{const d=u*o,p=d*e,h=d-n,m=yu(u,o),y=Math.exp(-p);return Kl-h/m*y},a=u=>{const p=u*o*e,h=p*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,y=Math.exp(-p),w=yu(Math.pow(u,2),o);return(-i(u)+Kl>0?-1:1)*((h-m)*y)/w}):(i=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-Kl+d*p},a=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const l=5/e,c=G5(i,a,l);if(e=xn(e),isNaN(c))return{stiffness:Ce.stiffness,damping:Ce.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const W5=12;function G5(e,t,n){let s=n;for(let i=1;i<W5;i++)s=s-e(s)/t(s);return s}function yu(e,t){return e*Math.sqrt(1-t*t)}const K5=["duration","bounce"],q5=["stiffness","damping","mass"];function vf(e,t){return t.some(n=>e[n]!==void 0)}function Y5(e){let t={velocity:Ce.velocity,stiffness:Ce.stiffness,damping:Ce.damping,mass:Ce.mass,isResolvedFromDuration:!1,...e};if(!vf(e,q5)&&vf(e,K5))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*jn(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ce.mass,stiffness:i,damping:a}}else{const n=H5(e);t={...t,...n,mass:Ce.mass},t.isResolvedFromDuration=!0}return t}function wy(e=Ce.visualDuration,t=Ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:p,velocity:h,isResolvedFromDuration:m}=Y5({...n,velocity:-yn(n.velocity||0)}),y=h||0,w=u/(2*Math.sqrt(c*d)),v=o-a,g=yn(Math.sqrt(c/d)),x=Math.abs(v)<5;s||(s=x?Ce.restSpeed.granular:Ce.restSpeed.default),i||(i=x?Ce.restDelta.granular:Ce.restDelta.default);let k;if(w<1){const b=yu(g,w);k=S=>{const N=Math.exp(-w*g*S);return o-N*((y+w*g*v)/b*Math.sin(b*S)+v*Math.cos(b*S))}}else if(w===1)k=b=>o-Math.exp(-g*b)*(v+(y+g*v)*b);else{const b=g*Math.sqrt(w*w-1);k=S=>{const N=Math.exp(-w*g*S),C=Math.min(b*S,300);return o-N*((y+w*g*v)*Math.sinh(C)+b*v*Math.cosh(C))/b}}const j={calculatedDuration:m&&p||null,next:b=>{const S=k(b);if(m)l.done=b>=p;else{let N=0;w<1&&(N=b===0?xn(y):by(k,b,S));const C=Math.abs(N)<=s,_=Math.abs(o-S)<=i;l.done=C&&_}return l.value=l.done?o:S,l},toString:()=>{const b=Math.min(Bx(j),uu),S=Fx(N=>j.next(b*N).value,b,30);return b+"ms "+S}};return j}function bf({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=e[0],h={done:!1,value:p},m=C=>l!==void 0&&C<l||c!==void 0&&C>c,y=C=>l===void 0?c:c===void 0||Math.abs(l-C)<Math.abs(c-C)?l:c;let w=n*t;const v=p+w,g=o===void 0?v:o(v);g!==v&&(w=g-p);const x=C=>-w*Math.exp(-C/s),k=C=>g+x(C),j=C=>{const _=x(C),E=k(C);h.done=Math.abs(_)<=u,h.value=h.done?g:E};let b,S;const N=C=>{m(h.value)&&(b=C,S=wy({keyframes:[h.value,y(h.value)],velocity:by(k,C,h.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:C=>{let _=!1;return!S&&b===void 0&&(_=!0,j(C),N(C)),b!==void 0&&C>=b?S.next(C-b):(!_&&j(C),h)}}}const X5=Qi(.42,0,1,1),Q5=Qi(0,0,.58,1),ky=Qi(.42,0,.58,1),J5=e=>Array.isArray(e)&&typeof e[0]!="number",Z5={linear:xt,easeIn:X5,easeInOut:ky,easeOut:Q5,circIn:sh,circInOut:ny,circOut:ty,backIn:nh,backInOut:Zx,backOut:Jx,anticipate:ey},wf=e=>{if(Qd(e)){yx(e.length===4);const[t,n,s,i]=e;return Qi(t,n,s,i)}else if(typeof e=="string")return Z5[e];return e};function ej(e,t,n){const s=[],i=n||vy,a=e.length-1;for(let o=0;o<a;o++){let l=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||xt:t;l=Ji(c,l)}s.push(l)}return s}function tj(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const a=e.length;if(yx(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=ej(t,s,i),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(d<e[p+1]);p++);const h=wr(e[p],e[p+1],d);return l[p](h)};return n?d=>u(jn(e[0],e[a-1],d)):u}function nj(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=wr(0,t,s);e.push(je(n,1,i))}}function sj(e){const t=[0];return nj(t,e.length-1),t}function rj(e,t){return e.map(n=>n*t)}function ij(e,t){return e.map(()=>t||ky).splice(0,e.length-1)}function Po({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=J5(s)?s.map(wf):wf(s),a={done:!1,value:t[0]},o=rj(n&&n.length===t.length?n:sj(t),e),l=tj(o,t,{ease:Array.isArray(i)?i:ij(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const aj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ye.update(t,!0),stop:()=>Jn(t),now:()=>Ve.isProcessing?Ve.timestamp:rn.now()}},oj={decay:bf,inertia:bf,tween:Po,keyframes:Po,spring:wy},lj=e=>e/100;class ch extends xy{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||oh,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(a,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,l=Xd(n)?n:oj[n]||Po;let c,u;l!==Po&&typeof t[0]!="number"&&(c=Ji(lj,vy(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});a==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Bx(d));const{calculatedDuration:p}=d,h=p+i,m=h*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:p}=s;if(this.startTime===null)return a.next(0);const{delay:h,repeat:m,repeatType:y,repeatDelay:w,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let k=this.currentTime,j=a;if(m){const C=Math.min(this.currentTime,d)/p;let _=Math.floor(C),E=C%1;!E&&C>=1&&(E=1),E===1&&_--,_=Math.min(_,m+1),!!(_%2)&&(y==="reverse"?(E=1-E,w&&(E-=w/p)):y==="mirror"&&(j=o)),k=jn(0,1,E)*p}const b=x?{done:!1,value:c[0]}:j.next(k);l&&(b.value=l(b.value));let{done:S}=b;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return N&&i!==void 0&&(b.value=nl(c,this.options,i)),v&&v(b.value),N&&this.finish(),b}get duration(){const{resolved:t}=this;return t?yn(t.calculatedDuration):0}get time(){return yn(this.currentTime)}set time(t){t=xn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=yn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=aj,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const cj=new Set(["opacity","clipPath","filter","transform"]);function uj(e,t,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=$x(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const dj=Ld(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ao=10,hj=2e4;function pj(e){return Xd(e.type)||e.type==="spring"||!Vx(e.ease)}function fj(e,t){const n=new ch({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let a=0;for(;!s.done&&a<hj;)s=n.sample(a),i.push(s.value),a+=Ao;return{times:void 0,keyframes:i,duration:a-Ao,ease:"linear"}}const jy={anticipate:ey,backInOut:Zx,circInOut:ny};function mj(e){return e in jy}class kf extends xy{constructor(t){super(t);const{name:n,motionValue:s,element:i,keyframes:a}=this.options;this.resolver=new gy(a,(o,l)=>this.onKeyframesResolved(o,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:a,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof a=="string"&&Eo()&&mj(a)&&(a=jy[a]),pj(this.options)){const{onComplete:p,onUpdate:h,motionValue:m,element:y,...w}=this.options,v=fj(t,w);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,a=v.ease,o="keyframes"}const d=uj(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(af(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;l.set(nl(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return yn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return yn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=xn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return xt;const{animation:s}=n;af(s,t)}return xt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:a,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:p,element:h,...m}=this.options,y=new ch({...m,keyframes:s,duration:i,type:a,ease:o,times:l,isGenerator:!0}),w=xn(this.time);u.setWithVelocity(y.sample(w-Ao).value,y.sample(w).value,Ao)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:a,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return dj()&&s&&cj.has(s)&&!c&&!u&&!i&&a!=="mirror"&&o!==0&&l!=="inertia"}}const gj={type:"spring",stiffness:500,damping:25,restSpeed:10},xj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yj={type:"keyframes",duration:.8},vj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bj=(e,{keyframes:t})=>t.length>2?yj:zs.has(e)?e.startsWith("scale")?xj(t[1]):gj:vj;function wj({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uh=(e,t,n,s={},i,a)=>o=>{const l=Yd(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-xn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};wj(l)||(d={...d,...bj(e,d)}),d.duration&&(d.duration=xn(d.duration)),d.repeatDelay&&(d.repeatDelay=xn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(p=!0)),p&&!a&&t.get()!==void 0){const h=nl(d.keyframes,l);if(h!==void 0)return ye.update(()=>{d.onUpdate(h),d.onComplete()}),new Fk([])}return!a&&kf.supports(d)?new kf(d):new ch(d)};function kj({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Ny(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(o=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const h=e.getValue(p,(a=e.latestValues[p])!==null&&a!==void 0?a:null),m=c[p];if(m===void 0||d&&kj(d,p))continue;const y={delay:n,...Yd(o||{},p)};let w=!1;if(window.MotionHandoffAnimation){const g=qx(e);if(g){const x=window.MotionHandoffAnimation(g,p,ye);x!==null&&(y.startTime=x,w=!0)}}hu(e,p),h.start(uh(p,h,m,e.shouldReduceMotion&&Gx.has(p)?{type:!1}:y,e,w));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{ye.update(()=>{l&&e5(e,l)})}),u}function vu(e,t,n={}){var s;const i=tl(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(Ny(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:h}=a;return jj(e,t,d+u,p,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function jj(e,t,n=0,s=0,i=1,a){const o=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(Nj).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(vu(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Nj(e,t){return e.sortNodePosition(t)}function Sj(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(a=>vu(e,a,n));s=Promise.all(i)}else if(typeof t=="string")s=vu(e,t,n);else{const i=typeof t=="function"?tl(e,t,n.custom):t;s=Promise.all(Ny(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Cj=Dd.length;function Sy(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sy(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Cj;n++){const s=Dd[n],i=e.props[s];(Ii(i)||i===!1)&&(t[s]=i)}return t}const _j=[...Od].reverse(),Ej=Od.length;function Tj(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Sj(e,n,s)))}function Pj(e){let t=Tj(e),n=jf(),s=!0;const i=c=>(u,d)=>{var p;const h=tl(e,d,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...w}=h;u={...u,...w,...y}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=Sy(e.parent)||{},p=[],h=new Set;let m={},y=1/0;for(let v=0;v<Ej;v++){const g=_j[v],x=n[g],k=u[g]!==void 0?u[g]:d[g],j=Ii(k),b=g===c?x.isActive:null;b===!1&&(y=v);let S=k===d[g]&&k!==u[g]&&j;if(S&&s&&e.manuallyAnimateOnMount&&(S=!1),x.protectedKeys={...m},!x.isActive&&b===null||!k&&!x.prevProp||Zo(k)||typeof k=="boolean")continue;const N=Aj(x.prevProp,k);let C=N||g===c&&x.isActive&&!S&&j||v>y&&j,_=!1;const E=Array.isArray(k)?k:[k];let P=E.reduce(i(g),{});b===!1&&(P={});const{prevResolvedValues:O={}}=x,F={...O,...P},D=V=>{C=!0,h.has(V)&&(_=!0,h.delete(V)),x.needsAnimating[V]=!0;const T=e.getValue(V);T&&(T.liveStyle=!1)};for(const V in F){const T=P[V],R=O[V];if(m.hasOwnProperty(V))continue;let B=!1;cu(T)&&cu(R)?B=!Ix(T,R):B=T!==R,B?T!=null?D(V):h.add(V):T!==void 0&&h.has(V)?D(V):x.protectedKeys[V]=!0}x.prevProp=k,x.prevResolvedValues=P,x.isActive&&(m={...m,...P}),s&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&N)||_)&&p.push(...E.map(V=>({animation:V,options:{type:g}})))}if(h.size){const v={};h.forEach(g=>{const x=e.getBaseTarget(g),k=e.getValue(g);k&&(k.liveStyle=!0),v[g]=x??null}),p.push({animation:v})}let w=!!p.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),s=!1,w?t(p):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const p=o(c);for(const h in n)n[h].protectedKeys={};return p}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=jf(),s=!0}}}function Aj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ix(t,e):!1}function us(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jf(){return{animate:us(!0),whileInView:us(),whileHover:us(),whileTap:us(),whileDrag:us(),whileFocus:us(),exit:us()}}class as{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Mj extends as{constructor(t){super(t),t.animationState||(t.animationState=Pj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let zj=0;class Rj extends as{constructor(){super(...arguments),this.id=zj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Lj={animation:{Feature:Mj},exit:{Feature:Rj}};function $i(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Zi(e){return{point:{x:e.pageX,y:e.pageY}}}const Oj=e=>t=>Jd(t)&&e(t,Zi(t));function fi(e,t,n,s){return $i(e,t,Oj(n),s)}const Nf=(e,t)=>Math.abs(e-t);function Dj(e,t){const n=Nf(e.x,t.x),s=Nf(e.y,t.y);return Math.sqrt(n**2+s**2)}class Cy{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Yl(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=Dj(p.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:y}=p,{timestamp:w}=Ve;this.history.push({...y,timestamp:w});const{onStart:v,onMove:g}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=ql(h,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Yl(p.type==="pointercancel"?this.lastMoveEventInfo:ql(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(p,v),y&&y(p,v)},!Jd(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=Zi(t),l=ql(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Ve;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Yl(l,this.history)),this.removeListeners=Ji(fi(this.contextWindow,"pointermove",this.handlePointerMove),fi(this.contextWindow,"pointerup",this.handlePointerUp),fi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Jn(this.updatePoint)}}function ql(e,t){return t?{point:t(e.point)}:e}function Sf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yl({point:e},t){return{point:e,delta:Sf(e,_y(t)),offset:Sf(e,Ij(t)),velocity:Bj(t,.1)}}function Ij(e){return e[0]}function _y(e){return e[e.length-1]}function Bj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=_y(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>xn(t)));)n--;if(!s)return{x:0,y:0};const a=yn(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const Ey=1e-4,Fj=1-Ey,Vj=1+Ey,Ty=.01,$j=0-Ty,Uj=0+Ty;function vt(e){return e.max-e.min}function Hj(e,t,n){return Math.abs(e-t)<=n}function Cf(e,t,n,s=.5){e.origin=s,e.originPoint=je(t.min,t.max,e.origin),e.scale=vt(n)/vt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fj&&e.scale<=Vj||isNaN(e.scale))&&(e.scale=1),(e.translate>=$j&&e.translate<=Uj||isNaN(e.translate))&&(e.translate=0)}function mi(e,t,n,s){Cf(e.x,t.x,n.x,s?s.originX:void 0),Cf(e.y,t.y,n.y,s?s.originY:void 0)}function _f(e,t,n){e.min=n.min+t.min,e.max=e.min+vt(t)}function Wj(e,t,n){_f(e.x,t.x,n.x),_f(e.y,t.y,n.y)}function Ef(e,t,n){e.min=t.min-n.min,e.max=e.min+vt(t)}function gi(e,t,n){Ef(e.x,t.x,n.x),Ef(e.y,t.y,n.y)}function Gj(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?je(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?je(n,e,s.max):Math.min(e,n)),e}function Tf(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Kj(e,{top:t,left:n,bottom:s,right:i}){return{x:Tf(e.x,n,i),y:Tf(e.y,t,s)}}function Pf(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function qj(e,t){return{x:Pf(e.x,t.x),y:Pf(e.y,t.y)}}function Yj(e,t){let n=.5;const s=vt(e),i=vt(t);return i>s?n=wr(t.min,t.max-s,e.min):s>i&&(n=wr(e.min,e.max-i,t.min)),jn(0,1,n)}function Xj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const bu=.35;function Qj(e=bu){return e===!1?e=0:e===!0&&(e=bu),{x:Af(e,"left","right"),y:Af(e,"top","bottom")}}function Af(e,t,n){return{min:Mf(e,t),max:Mf(e,n)}}function Mf(e,t){return typeof e=="number"?e:e[t]||0}const zf=()=>({translate:0,scale:1,origin:0,originPoint:0}),ir=()=>({x:zf(),y:zf()}),Rf=()=>({min:0,max:0}),Te=()=>({x:Rf(),y:Rf()});function Nt(e){return[e("x"),e("y")]}function Py({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Jj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Zj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Xl(e){return e===void 0||e===1}function wu({scale:e,scaleX:t,scaleY:n}){return!Xl(e)||!Xl(t)||!Xl(n)}function fs(e){return wu(e)||Ay(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ay(e){return Lf(e.x)||Lf(e.y)}function Lf(e){return e&&e!=="0%"}function Mo(e,t,n){const s=e-n,i=t*s;return n+i}function Of(e,t,n,s,i){return i!==void 0&&(e=Mo(e,i,s)),Mo(e,n,s)+t}function ku(e,t=0,n=1,s,i){e.min=Of(e.min,t,n,s,i),e.max=Of(e.max,t,n,s,i)}function My(e,{x:t,y:n}){ku(e.x,t.translate,t.scale,t.originPoint),ku(e.y,n.translate,n.scale,n.originPoint)}const Df=.999999999999,If=1.0000000000001;function eN(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&or(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,My(e,o)),s&&fs(a.latestValues)&&or(e,a.latestValues))}t.x<If&&t.x>Df&&(t.x=1),t.y<If&&t.y>Df&&(t.y=1)}function ar(e,t){e.min=e.min+t,e.max=e.max+t}function Bf(e,t,n,s,i=.5){const a=je(e.min,e.max,i);ku(e,t,n,a,s)}function or(e,t){Bf(e.x,t.x,t.scaleX,t.scale,t.originX),Bf(e.y,t.y,t.scaleY,t.scale,t.originY)}function zy(e,t){return Py(Zj(e.getBoundingClientRect(),t))}function tN(e,t,n){const s=zy(e,n),{scroll:i}=t;return i&&(ar(s.x,i.offset.x),ar(s.y,i.offset.y)),s}const Ry=({current:e})=>e?e.ownerDocument.defaultView:null,nN=new WeakMap;class sN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Zi(d).point)},a=(d,p)=>{const{drag:h,dragPropagation:m,onDragStart:y}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yk(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nt(v=>{let g=this.getAxisMotionValue(v).get()||0;if(sn.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const k=x.layout.layoutBox[v];k&&(g=vt(k)*(parseFloat(g)/100))}}this.originPoint[v]=g}),y&&ye.postRender(()=>y(d,p)),hu(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(d,p)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(m&&this.currentDirection===null){this.currentDirection=rN(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),w&&w(d,p)},l=(d,p)=>this.stop(d,p),c=()=>Nt(d=>{var p;return this.getAnimationState(d)==="paused"&&((p=this.getAxisMotionValue(d).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Cy(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ry(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ye.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!Ea(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(o=Gj(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&sr(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Kj(i.layoutBox,n):this.constraints=!1,this.elastic=Qj(s),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Nt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Xj(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sr(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=tN(s,i.root,this.visualElement.getTransformPagePoint());let o=qj(i.layout.layoutBox,a);if(n){const l=n(Jj(o));this.hasMutatedConstraints=!!l,l&&(o=Py(l))}return o}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Nt(d=>{if(!Ea(d,n,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return hu(this.visualElement,t),s.start(uh(t,s,0,n,this.visualElement,!1))}stopAnimation(){Nt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Nt(n=>{const{drag:s}=this.getProps();if(!Ea(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];a.set(t[n]-je(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!sr(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Nt(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=Yj({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Nt(o=>{if(!Ea(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(je(c,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;nN.set(this.visualElement,this);const t=this.visualElement.current,n=fi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();sr(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ye.read(s);const o=$i(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Nt(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=c[d].translate,p.set(p.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=bu,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function Ea(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function rN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class iN extends as{constructor(t){super(t),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new sN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ff=e=>(t,n)=>{e&&ye.postRender(()=>e(t,n))};class aN extends as{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(t){this.session=new Cy(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ry(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ff(t),onStart:Ff(n),onMove:s,onEnd:(a,o)=>{delete this.session,i&&ye.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=fi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ya={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Vf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=Vf(e,t.target.x),s=Vf(e,t.target.y);return`${n}% ${s}%`}},oN={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=Zn.parse(e);if(i.length>5)return s;const a=Zn.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=c;const u=je(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class lN extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:a}=t;Ek(cN),a&&(n.group&&n.group.add(a),s&&s.register&&i&&s.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Ya.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:a}=this.props,o=s.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ye.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Bd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ly(e){const[t,n]=gx(),s=f.useContext(zd);return r.jsx(lN,{...e,layoutGroup:s,switchLayoutGroup:f.useContext(Sx),isPresent:t,safeToRemove:n})}const cN={borderRadius:{...Wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wr,borderTopRightRadius:Wr,borderBottomLeftRadius:Wr,borderBottomRightRadius:Wr,boxShadow:oN};function uN(e,t,n){const s=qe(e)?e:Fi(e);return s.start(uh("",s,t,n)),s.animation}function dN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const hN=(e,t)=>e.depth-t.depth;class pN{constructor(){this.children=[],this.isDirty=!1}add(t){Zd(this.children,t),this.isDirty=!0}remove(t){eh(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hN),this.isDirty=!1,this.children.forEach(t)}}function fN(e,t){const n=rn.now(),s=({timestamp:i})=>{const a=i-n;a>=t&&(Jn(s),e(a-t))};return ye.read(s,!0),()=>Jn(s)}const Oy=["TopLeft","TopRight","BottomLeft","BottomRight"],mN=Oy.length,$f=e=>typeof e=="string"?parseFloat(e):e,Uf=e=>typeof e=="number"||q.test(e);function gN(e,t,n,s,i,a){i?(e.opacity=je(0,n.opacity!==void 0?n.opacity:1,xN(s)),e.opacityExit=je(t.opacity!==void 0?t.opacity:1,0,yN(s))):a&&(e.opacity=je(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<mN;o++){const l=`border${Oy[o]}Radius`;let c=Hf(t,l),u=Hf(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Uf(c)===Uf(u)?(e[l]=Math.max(je($f(c),$f(u),s),0),(sn.test(u)||sn.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,s))}function Hf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const xN=Dy(0,.5,ty),yN=Dy(.5,.95,xt);function Dy(e,t,n){return s=>s<e?0:s>t?1:n(wr(e,t,s))}function Wf(e,t){e.min=t.min,e.max=t.max}function jt(e,t){Wf(e.x,t.x),Wf(e.y,t.y)}function Gf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kf(e,t,n,s,i){return e-=t,e=Mo(e,1/n,s),i!==void 0&&(e=Mo(e,1/i,s)),e}function vN(e,t=0,n=1,s=.5,i,a=e,o=e){if(sn.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=je(a.min,a.max,s);e===a&&(l-=t),e.min=Kf(e.min,t,n,l,i),e.max=Kf(e.max,t,n,l,i)}function qf(e,t,[n,s,i],a,o){vN(e,t[n],t[s],t[i],t.scale,a,o)}const bN=["x","scaleX","originX"],wN=["y","scaleY","originY"];function Yf(e,t,n,s){qf(e.x,t,bN,n?n.x:void 0,s?s.x:void 0),qf(e.y,t,wN,n?n.y:void 0,s?s.y:void 0)}function Xf(e){return e.translate===0&&e.scale===1}function Iy(e){return Xf(e.x)&&Xf(e.y)}function Qf(e,t){return e.min===t.min&&e.max===t.max}function kN(e,t){return Qf(e.x,t.x)&&Qf(e.y,t.y)}function Jf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function By(e,t){return Jf(e.x,t.x)&&Jf(e.y,t.y)}function Zf(e){return vt(e.x)/vt(e.y)}function em(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class jN{constructor(){this.members=[]}add(t){Zd(this.members,t),t.scheduleRender()}remove(t){if(eh(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){s=a;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function NN(e,t,n){let s="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:h,skewX:m,skewY:y}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),p&&(s+=`rotateX(${p}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),y&&(s+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const ms={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ei=typeof window<"u"&&window.MotionDebug!==void 0,Ql=["","X","Y","Z"],SN={visibility:"hidden"},tm=1e3;let CN=0;function Jl(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function Fy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=qx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||a))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Fy(s)}function Vy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=CN++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ei&&(ms.totalNodes=ms.resolvedTargetDeltas=ms.recalculatedProjection=0),this.nodes.forEach(TN),this.nodes.forEach(RN),this.nodes.forEach(LN),this.nodes.forEach(PN),ei&&window.MotionDebug.record(ms)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new pN)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new th),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=dN(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let p;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=fN(h,250),Ya.hasAnimatedSinceResize&&(Ya.hasAnimatedSinceResize=!1,this.nodes.forEach(sm))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||FN,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=d.getProps(),x=!this.targetLayout||!By(this.targetLayout,y)||m,k=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||k||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,k);const j={...Yd(w,"layout"),onPlay:v,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j)}else h||sm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Jn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ON),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Fy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nm);return}this.isUpdating||this.nodes.forEach(MN),this.isUpdating=!1,this.nodes.forEach(zN),this.nodes.forEach(_N),this.nodes.forEach(EN),this.clearAllSnapshots();const l=rn.now();Ve.delta=jn(0,1e3/60,l-Ve.timestamp),Ve.timestamp=l,Ve.isProcessing=!0,$l.update.process(Ve),$l.preRender.process(Ve),$l.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AN),this.sharedNodes.forEach(DN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Iy(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(l||fs(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),VN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Te();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some($N))){const{scroll:d}=this.root;d&&(ar(c.x,d.offset.x),ar(c.y,d.offset.y))}return c}removeElementScroll(o){var l;const c=Te();if(jt(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:h}=d;d!==this.root&&p&&h.layoutScroll&&(p.wasRoot&&jt(c,o),ar(c.x,p.offset.x),ar(c.y,p.offset.y))}return c}applyTransform(o,l=!1){const c=Te();jt(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&or(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),fs(d.latestValues)&&or(c,d.latestValues)}return fs(this.latestValues)&&or(c,this.latestValues),c}removeTransform(o){const l=Te();jt(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!fs(u.latestValues))continue;wu(u.latestValues)&&u.updateSnapshot();const d=Te(),p=u.measurePageBox();jt(d,p),Yf(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return fs(this.latestValues)&&Yf(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:h}=this.options;if(!(!this.layout||!(p||h))){if(this.resolvedRelativeTargetAt=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Wj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jt(this.target,this.layout.layoutBox),My(this.target,this.targetDelta)):jt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.target,m.target),jt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ei&&ms.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||wu(this.parent.latestValues)||Ay(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(u=!1),u)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;jt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;eN(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Te());const{target:y}=l;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gf(this.prevProjectionDelta.x,this.projectionDelta.x),Gf(this.prevProjectionDelta.y,this.projectionDelta.y)),mi(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!em(this.projectionDelta.x,this.prevProjectionDelta.x)||!em(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),ei&&ms.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ir(),this.projectionDelta=ir(),this.projectionDeltaWithTransform=ir()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=ir();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=Te(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,v=this.getStack(),g=!v||v.members.length<=1,x=!!(w&&!g&&this.options.crossfade===!0&&!this.path.some(BN));this.animationProgress=0;let k;this.mixTargetDelta=j=>{const b=j/1e3;rm(p.x,o.x,b),rm(p.y,o.y,b),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),IN(this.relativeTarget,this.relativeTargetOrigin,h,b),k&&kN(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Te()),jt(k,this.relativeTarget)),w&&(this.animationValues=d,gN(d,u,this.latestValues,b,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Jn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{Ya.hasAnimatedSinceResize=!0,this.currentAnimation=uN(0,tm,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&$y(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Te();const p=vt(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const h=vt(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}jt(l,c),or(l,d),mi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new jN),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Jl("z",o,u,this.animationValues);for(let d=0;d<Ql.length;d++)Jl(`rotate${Ql[d]}`,o,u,this.animationValues),Jl(`skew${Ql[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return SN;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Ka(o==null?void 0:o.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Ka(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}const h=p.animationValues||p.latestValues;this.applyTransformsToTarget(),u.transform=NN(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:m,y}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,p.animationValues?u.opacity=p===this?(c=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=p===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in _o){if(h[w]===void 0)continue;const{correct:v,applyTo:g}=_o[w],x=u.transform==="none"?h[w]:v(h[w],p);if(g){const k=g.length;for(let j=0;j<k;j++)u[g[j]]=x}else u[w]=x}return this.options.layoutId&&(u.pointerEvents=p===this?Ka(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(nm),this.root.sharedNodes.clear()}}}function _N(e){e.updateLayout()}function EN(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(h);h.min=s[p].min,h.max=h.min+m}):$y(a,n.layoutBox,s)&&Nt(p=>{const h=o?n.measuredBox[p]:n.layoutBox[p],m=vt(s[p]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=ir();mi(l,s,n.layoutBox);const c=ir();o?mi(c,e.applyTransform(i,!0),n.measuredBox):mi(c,s,n.layoutBox);const u=!Iy(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:h,layout:m}=p;if(h&&m){const y=Te();gi(y,n.layoutBox,h.layoutBox);const w=Te();gi(w,s,m.layoutBox),By(y,w)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function TN(e){ei&&ms.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function PN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AN(e){e.clearSnapshot()}function nm(e){e.clearMeasurements()}function MN(e){e.isLayoutDirty=!1}function zN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function RN(e){e.resolveTargetDelta()}function LN(e){e.calcProjection()}function ON(e){e.resetSkewAndRotation()}function DN(e){e.removeLeadSnapshot()}function rm(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function im(e,t,n,s){e.min=je(t.min,n.min,s),e.max=je(t.max,n.max,s)}function IN(e,t,n,s){im(e.x,t.x,n.x,s),im(e.y,t.y,n.y,s)}function BN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const FN={duration:.45,ease:[.4,0,.1,1]},am=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),om=am("applewebkit/")&&!am("chrome/")?Math.round:xt;function lm(e){e.min=om(e.min),e.max=om(e.max)}function VN(e){lm(e.x),lm(e.y)}function $y(e,t,n){return e==="position"||e==="preserve-aspect"&&!Hj(Zf(t),Zf(n),.2)}function $N(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const UN=Vy({attachResizeListener:(e,t)=>$i(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zl={current:void 0},Uy=Vy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zl.current){const e=new UN({});e.mount(window),e.setOptions({layoutScroll:!0}),Zl.current=e}return Zl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),HN={pan:{Feature:aN},drag:{Feature:iN,ProjectionNode:Uy,MeasureLayout:Ly}};function cm(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=s[i];a&&ye.postRender(()=>a(t,Zi(t)))}class WN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=Hk(t,n=>(cm(this.node,n,"Start"),s=>cm(this.node,s,"End"))))}unmount(){}}class GN extends as{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ji($i(this.node.current,"focus",()=>this.onFocus()),$i(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function um(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=s[i];a&&ye.postRender(()=>a(t,Zi(t)))}class KN extends as{mount(){const{current:t}=this.node;t&&(this.unmount=qk(t,n=>(um(this.node,n,"Start"),(s,{success:i})=>um(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ju=new WeakMap,ec=new WeakMap,qN=e=>{const t=ju.get(e.target);t&&t(e)},YN=e=>{e.forEach(qN)};function XN({root:e,...t}){const n=e||document;ec.has(n)||ec.set(n,{});const s=ec.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(YN,{root:e,...t})),s[i]}function QN(e,t,n){const s=XN(t);return ju.set(e,n),s.observe(e),()=>{ju.delete(e),s.unobserve(e)}}const JN={some:0,all:1};class ZN extends as{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:JN[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),h=u?d:p;h&&h(c)};return QN(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eS(t,n))&&this.startObserver()}unmount(){}}function eS({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tS={inView:{Feature:ZN},tap:{Feature:KN},focus:{Feature:GN},hover:{Feature:WN}},nS={layout:{ProjectionNode:Uy,MeasureLayout:Ly}},Nu={current:null},Hy={current:!1};function sS(){if(Hy.current=!0,!!Rd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nu.current=e.matches;e.addListener(t),t()}else Nu.current=!1}const rS=[...my,Ge,Zn],iS=e=>rS.find(fy(e)),dm=new WeakMap;function aS(e,t,n){for(const s in t){const i=t[s],a=n[s];if(qe(i))e.addValue(s,i);else if(qe(a))e.addValue(s,Fi(i,{owner:e}));else if(a!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,Fi(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const hm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class oS{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=rn.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=el(n),this.isVariantNode=jx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const y=h[m];c[m]!==void 0&&qe(y)&&y.set(c[m],!1)}}mount(t){this.current=t,dm.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Hy.current||sS(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Nu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dm.delete(this.current),this.projection&&this.projection.unmount(),Jn(this.notifyUpdate),Jn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=zs.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ye.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in kr){const n=kr[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<hm.length;s++){const i=hm[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=aS(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Fi(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(hy(i)||sy(i))?i=parseFloat(i):!iS(i)&&Zn.test(n)&&(i=cy(t,n)),this.setBaseTarget(t,qe(i)?i.get():i)),qe(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Vd(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!qe(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new th),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Wy extends oS{constructor(){super(...arguments),this.KeyframeResolver=gy}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;qe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function lS(e){return window.getComputedStyle(e)}class cS extends Wy{constructor(){super(...arguments),this.type="html",this.renderInstance=Mx}readValueFromInstance(t,n){if(zs.has(n)){const s=ah(n);return s&&s.default||0}else{const s=lS(t),i=(Tx(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zy(t,n)}build(t,n,s){Hd(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return qd(t,n,s)}}class uS extends Wy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zs.has(n)){const s=ah(n);return s&&s.default||0}return n=zx.has(n)?n:Id(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ox(t,n,s)}build(t,n,s){Wd(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){Rx(t,n,s,i)}mount(t){this.isSVGTag=Kd(t.tagName),super.mount(t)}}const dS=(e,t)=>Fd(e)?new uS(t):new cS(t,{allowProjection:e!==f.Fragment}),hS=Dk({...Lj,...tS,...HN,...nS},dS),$=J2(hS);/**
77
77
  * @license lucide-react v0.462.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const mS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
81
+ */const pS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
82
82
  * @license lucide-react v0.462.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */var gS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
+ */var fS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
87
87
  * @license lucide-react v0.462.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const xS=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...gS,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Gy("lucide",i),...l},[...o.map(([u,d])=>f.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
91
+ */const mS=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...fS,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Gy("lucide",i),...l},[...o.map(([u,d])=>f.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
92
92
  * @license lucide-react v0.462.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const L=(e,t)=>{const n=f.forwardRef(({className:s,...i},a)=>f.createElement(xS,{ref:a,iconNode:t,className:Gy(`lucide-${mS(e)}`,s),...i}));return n.displayName=`${e}`,n};/**
96
+ */const L=(e,t)=>{const n=f.forwardRef(({className:s,...i},a)=>f.createElement(mS,{ref:a,iconNode:t,className:Gy(`lucide-${pS(e)}`,s),...i}));return n.displayName=`${e}`,n};/**
97
97
  * @license lucide-react v0.462.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const yS=L("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
101
+ */const gS=L("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
102
102
  * @license lucide-react v0.462.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
@@ -108,27 +108,27 @@ Error generating stack: `+a.message+`
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const vS=L("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
111
+ */const xS=L("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
112
112
  * @license lucide-react v0.462.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const bS=L("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
116
+ */const yS=L("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
117
117
  * @license lucide-react v0.462.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const wS=L("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
121
+ */const vS=L("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
122
122
  * @license lucide-react v0.462.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const kS=L("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/**
126
+ */const bS=L("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/**
127
127
  * @license lucide-react v0.462.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
- */const jS=L("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/**
131
+ */const wS=L("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/**
132
132
  * @license lucide-react v0.462.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
@@ -158,7 +158,7 @@ Error generating stack: `+a.message+`
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const NS=L("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
161
+ */const kS=L("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
162
162
  * @license lucide-react v0.462.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
@@ -183,7 +183,7 @@ Error generating stack: `+a.message+`
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const ln=L("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
186
+ */const on=L("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
187
187
  * @license lucide-react v0.462.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
@@ -193,12 +193,12 @@ Error generating stack: `+a.message+`
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const an=L("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
196
+ */const Nn=L("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
197
197
  * @license lucide-react v0.462.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const Ue=L("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
201
+ */const Qe=L("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
202
202
  * @license lucide-react v0.462.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
@@ -213,7 +213,7 @@ Error generating stack: `+a.message+`
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const SS=L("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
216
+ */const jS=L("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
217
217
  * @license lucide-react v0.462.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
@@ -223,7 +223,7 @@ Error generating stack: `+a.message+`
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const cn=L("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
226
+ */const ln=L("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
227
227
  * @license lucide-react v0.462.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
@@ -233,7 +233,7 @@ Error generating stack: `+a.message+`
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const un=L("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
236
+ */const Sn=L("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
237
237
  * @license lucide-react v0.462.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
@@ -243,7 +243,7 @@ Error generating stack: `+a.message+`
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const CS=L("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
246
+ */const NS=L("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
247
247
  * @license lucide-react v0.462.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
@@ -258,7 +258,7 @@ Error generating stack: `+a.message+`
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const _S=L("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
261
+ */const SS=L("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
262
262
  * @license lucide-react v0.462.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
@@ -278,7 +278,7 @@ Error generating stack: `+a.message+`
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const mn=L("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
281
+ */const pn=L("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
282
282
  * @license lucide-react v0.462.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
@@ -288,7 +288,7 @@ Error generating stack: `+a.message+`
288
288
  *
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
- */const ES=L("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
291
+ */const CS=L("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
292
292
  * @license lucide-react v0.462.0 - ISC
293
293
  *
294
294
  * This source code is licensed under the ISC license.
@@ -303,7 +303,7 @@ Error generating stack: `+a.message+`
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const TS=L("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
306
+ */const _S=L("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
307
307
  * @license lucide-react v0.462.0 - ISC
308
308
  *
309
309
  * This source code is licensed under the ISC license.
@@ -313,7 +313,7 @@ Error generating stack: `+a.message+`
313
313
  *
314
314
  * This source code is licensed under the ISC license.
315
315
  * See the LICENSE file in the root directory of this source tree.
316
- */const PS=L("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
316
+ */const ES=L("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
317
317
  * @license lucide-react v0.462.0 - ISC
318
318
  *
319
319
  * This source code is licensed under the ISC license.
@@ -323,22 +323,22 @@ Error generating stack: `+a.message+`
323
323
  *
324
324
  * This source code is licensed under the ISC license.
325
325
  * See the LICENSE file in the root directory of this source tree.
326
- */const AS=L("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
326
+ */const TS=L("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
327
327
  * @license lucide-react v0.462.0 - ISC
328
328
  *
329
329
  * This source code is licensed under the ISC license.
330
330
  * See the LICENSE file in the root directory of this source tree.
331
- */const t1=L("Github",[["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",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
331
+ */const PS=L("Github",[["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",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
332
332
  * @license lucide-react v0.462.0 - ISC
333
333
  *
334
334
  * This source code is licensed under the ISC license.
335
335
  * See the LICENSE file in the root directory of this source tree.
336
- */const Xe=L("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
336
+ */const Ye=L("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
337
337
  * @license lucide-react v0.462.0 - ISC
338
338
  *
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
- */const MS=L("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
341
+ */const AS=L("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
342
342
  * @license lucide-react v0.462.0 - ISC
343
343
  *
344
344
  * This source code is licensed under the ISC license.
@@ -348,32 +348,32 @@ Error generating stack: `+a.message+`
348
348
  *
349
349
  * This source code is licensed under the ISC license.
350
350
  * See the LICENSE file in the root directory of this source tree.
351
- */const n1=L("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
351
+ */const t1=L("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
352
352
  * @license lucide-react v0.462.0 - ISC
353
353
  *
354
354
  * This source code is licensed under the ISC license.
355
355
  * See the LICENSE file in the root directory of this source tree.
356
- */const zS=L("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
356
+ */const MS=L("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
357
357
  * @license lucide-react v0.462.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
- */const RS=L("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
361
+ */const zS=L("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
362
362
  * @license lucide-react v0.462.0 - ISC
363
363
  *
364
364
  * This source code is licensed under the ISC license.
365
365
  * See the LICENSE file in the root directory of this source tree.
366
- */const LS=L("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
366
+ */const RS=L("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
367
367
  * @license lucide-react v0.462.0 - ISC
368
368
  *
369
369
  * This source code is licensed under the ISC license.
370
370
  * See the LICENSE file in the root directory of this source tree.
371
- */const OS=L("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
371
+ */const LS=L("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
372
372
  * @license lucide-react v0.462.0 - ISC
373
373
  *
374
374
  * This source code is licensed under the ISC license.
375
375
  * See the LICENSE file in the root directory of this source tree.
376
- */const s1=L("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
376
+ */const n1=L("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
377
377
  * @license lucide-react v0.462.0 - ISC
378
378
  *
379
379
  * This source code is licensed under the ISC license.
@@ -388,12 +388,12 @@ Error generating stack: `+a.message+`
388
388
  *
389
389
  * This source code is licensed under the ISC license.
390
390
  * See the LICENSE file in the root directory of this source tree.
391
- */const re=L("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
391
+ */const oe=L("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
392
392
  * @license lucide-react v0.462.0 - ISC
393
393
  *
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
- */const DS=L("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
396
+ */const OS=L("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
397
397
  * @license lucide-react v0.462.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
@@ -403,32 +403,32 @@ Error generating stack: `+a.message+`
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
- */const IS=L("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
406
+ */const DS=L("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
407
407
  * @license lucide-react v0.462.0 - ISC
408
408
  *
409
409
  * This source code is licensed under the ISC license.
410
410
  * See the LICENSE file in the root directory of this source tree.
411
- */const BS=L("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
411
+ */const IS=L("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
412
412
  * @license lucide-react v0.462.0 - ISC
413
413
  *
414
414
  * This source code is licensed under the ISC license.
415
415
  * See the LICENSE file in the root directory of this source tree.
416
- */const FS=L("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
416
+ */const BS=L("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
417
417
  * @license lucide-react v0.462.0 - ISC
418
418
  *
419
419
  * This source code is licensed under the ISC license.
420
420
  * See the LICENSE file in the root directory of this source tree.
421
- */const r1=L("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
421
+ */const s1=L("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
422
422
  * @license lucide-react v0.462.0 - ISC
423
423
  *
424
424
  * This source code is licensed under the ISC license.
425
425
  * See the LICENSE file in the root directory of this source tree.
426
- */const VS=L("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
426
+ */const FS=L("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
427
427
  * @license lucide-react v0.462.0 - ISC
428
428
  *
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
- */const i1=L("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
431
+ */const VS=L("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
432
432
  * @license lucide-react v0.462.0 - ISC
433
433
  *
434
434
  * This source code is licensed under the ISC license.
@@ -468,7 +468,7 @@ Error generating stack: `+a.message+`
468
468
  *
469
469
  * This source code is licensed under the ISC license.
470
470
  * See the LICENSE file in the root directory of this source tree.
471
- */const a1=L("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);/**
471
+ */const r1=L("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]);/**
472
472
  * @license lucide-react v0.462.0 - ISC
473
473
  *
474
474
  * This source code is licensed under the ISC license.
@@ -483,7 +483,7 @@ Error generating stack: `+a.message+`
483
483
  *
484
484
  * This source code is licensed under the ISC license.
485
485
  * See the LICENSE file in the root directory of this source tree.
486
- */const o1=L("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
486
+ */const i1=L("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
487
487
  * @license lucide-react v0.462.0 - ISC
488
488
  *
489
489
  * This source code is licensed under the ISC license.
@@ -518,12 +518,12 @@ Error generating stack: `+a.message+`
518
518
  *
519
519
  * This source code is licensed under the ISC license.
520
520
  * See the LICENSE file in the root directory of this source tree.
521
- */const de=L("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
521
+ */const pe=L("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
522
522
  * @license lucide-react v0.462.0 - ISC
523
523
  *
524
524
  * This source code is licensed under the ISC license.
525
525
  * See the LICENSE file in the root directory of this source tree.
526
- */const l1=L("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
526
+ */const a1=L("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
527
527
  * @license lucide-react v0.462.0 - ISC
528
528
  *
529
529
  * This source code is licensed under the ISC license.
@@ -593,7 +593,7 @@ Error generating stack: `+a.message+`
593
593
  *
594
594
  * This source code is licensed under the ISC license.
595
595
  * See the LICENSE file in the root directory of this source tree.
596
- */const c1=L("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
596
+ */const o1=L("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
597
597
  * @license lucide-react v0.462.0 - ISC
598
598
  *
599
599
  * This source code is licensed under the ISC license.
@@ -618,17 +618,12 @@ Error generating stack: `+a.message+`
618
618
  *
619
619
  * This source code is licensed under the ISC license.
620
620
  * See the LICENSE file in the root directory of this source tree.
621
- */const n4=L("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
622
- * @license lucide-react v0.462.0 - ISC
623
- *
624
- * This source code is licensed under the ISC license.
625
- * See the LICENSE file in the root directory of this source tree.
626
621
  */const es=L("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
627
622
  * @license lucide-react v0.462.0 - ISC
628
623
  *
629
624
  * This source code is licensed under the ISC license.
630
625
  * See the LICENSE file in the root directory of this source tree.
631
- */const u1=L("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
626
+ */const l1=L("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
632
627
  * @license lucide-react v0.462.0 - ISC
633
628
  *
634
629
  * This source code is licensed under the ISC license.
@@ -638,12 +633,7 @@ Error generating stack: `+a.message+`
638
633
  *
639
634
  * This source code is licensed under the ISC license.
640
635
  * See the LICENSE file in the root directory of this source tree.
641
- */const s4=L("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
642
- * @license lucide-react v0.462.0 - ISC
643
- *
644
- * This source code is licensed under the ISC license.
645
- * See the LICENSE file in the root directory of this source tree.
646
- */const r4=L("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
636
+ */const n4=L("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
647
637
  * @license lucide-react v0.462.0 - ISC
648
638
  *
649
639
  * This source code is licensed under the ISC license.
@@ -653,12 +643,12 @@ Error generating stack: `+a.message+`
653
643
  *
654
644
  * This source code is licensed under the ISC license.
655
645
  * See the LICENSE file in the root directory of this source tree.
656
- */const i4=L("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
646
+ */const s4=L("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
657
647
  * @license lucide-react v0.462.0 - ISC
658
648
  *
659
649
  * This source code is licensed under the ISC license.
660
650
  * See the LICENSE file in the root directory of this source tree.
661
- */const a4=L("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
651
+ */const r4=L("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
662
652
  * @license lucide-react v0.462.0 - ISC
663
653
  *
664
654
  * This source code is licensed under the ISC license.
@@ -673,14 +663,14 @@ Error generating stack: `+a.message+`
673
663
  *
674
664
  * This source code is licensed under the ISC license.
675
665
  * See the LICENSE file in the root directory of this source tree.
676
- */const Re=L("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),d1={welcome:{tagline:"Your AI Brain",title:"Must-b",sleeping:"Sleeping...",waking:"Waking up...",awake:"Awakening...",wakeBtn:"Wake Must-b",wakeHint:"Tap to continue",reconfigure:"Reconfigure",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"New Chat",recentChats:"Recent Chats",primary:"Primary",personalization:"Personalization",platform:"Platform",system:"System",automations:"My Automations",activeWorkflows:"Active Workflows",products:"Skills & Plugins",clients:"Client Management",integrations:"Integrations",logs:"Logs & Activity",settings:"Settings",logout:"Logout",poweredBy:"Powered by",deleteChat:"Delete Chat?",deleteConfirm:"This action cannot be undone.",cancel:"Cancel",delete:"Delete"},rightPanel:{agentRole:"Agent Role",hardware:"Hardware Score",model:"Active Model",connected:"Gateway Connected",rank:{master:"Master",planner:"Planner",worker:"Worker"}},workflow:{title:"Active Workflow",idle:"Idle — awaiting task",goal:"Goal",steps:{browse:"Opening browser",write:"Writing file",think:"Thinking",exec:"Executing command"}},dashboard:{placeholder:"Send a message to Must-b...",thinking:"Must-b is thinking..."},layout:{chats:"Chats",system:"System",openChats:"Open chat history",openSystem:"Open system panel",closePanel:"Close panel"},chat:{inputPlaceholder:"Ask Must-b anything…",listening:"Listening…",thoughtProcess:"Thought Process",saveAsSkill:"Save as Skill",skillSaved:"Skill saved to your library!",saving:"Saving…",retry:"Retry",save:"Save",guidance:"Guidance",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation",settingsAck:"Got it, settings updated permanently.",professionAck:"I've completed the necessary research on your profession and noted it in my mind (must-b.md). I'm now ready as your **{profession}** assistant."},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",skills:"Skills",plugins:"Plugins",mind:"Must-b Mind"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I'm listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Files",browser:"Browser",skills:"Skills",memory:"Memory",plugins:"Plugins",workflows:"Workflows",settings:"Settings",system:"System",close:"Close",cat_webTools:"Web Tools",cat_fileMedia:"File & Media",cat_aiAgents:"AI & Agents",cat_systemTools:"System Tools",skill_webSearch:"Web Search",skill_webFetch:"Web Fetch",skill_browserControl:"Browser Control",skill_pdfReader:"PDF Reader",skill_imageAnalysis:"Image Analysis",skill_imageGeneration:"Image Generation",skill_tts:"Text-to-Speech",skill_spawnAgent:"Spawn Sub-Agent",skill_agentSessions:"Agent Sessions",skill_canvas:"Canvas",skill_git:"Git Operations",skill_gateway:"Gateway",skill_fileManager:"File Manager",skill_cron:"Cron Scheduler",skill_messages:"Messages",desc_webSearch:"Real-time web search (multi-provider)",desc_webFetch:"Fetch any URL as clean text",desc_browserControl:"Full Playwright browser automation",desc_pdfReader:"Extract & analyse PDF documents",desc_imageAnalysis:"Describe and analyse images",desc_imageGeneration:"Create AI-generated images",desc_tts:"Convert text to natural speech",desc_spawnAgent:"Launch a new autonomous agent session",desc_agentSessions:"List and manage active sessions",desc_canvas:"Visual drawing & whiteboard workspace",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Inter-system & A2A communication",desc_fileManager:"Read, write & manage files",desc_cron:"Schedule recurring tasks",desc_messages:"Send & receive inter-agent messages",cat_knowledgeBase:"Knowledge Base",cat_personalOrg:"Personal Organisation",mem_browse:"Browse Memories",mem_search:"Search Memory",mem_add:"Add Memory",mem_contacts:"Contacts",mem_calendar:"Calendar",desc_memBrowse:"View all stored knowledge entries",desc_memSearch:"Semantic search across your KB",desc_memAdd:"Store new facts and knowledge",desc_contacts:"Manage people and organisations",desc_calendar:"Schedule and manage events",cat_pluginManager:"Plugin Manager",cat_developer:"Developer",plug_marketplace:"Marketplace",plug_installed:"Installed",plug_mcp:"MCP Servers",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"CLI Commands",desc_marketplace:"Discover plugins on ClawHub",desc_installed:"Manage and configure installed plugins",desc_mcp:"Model Context Protocol integrations",desc_bundleMcp:"Package & deploy MCP tool bundles",desc_cliCmds:"Custom slash command registration",cat_automation:"Automation",cat_advanced:"Advanced",wf_automations:"Automations",wf_scheduled:"Scheduled Tasks",wf_commands:"Commands",wf_nodes:"Nodes Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Build and run automated workflows",desc_scheduled:"Manage all cron schedules",desc_commands:"Custom slash commands",desc_nodes:"Visual node-graph pipelines",desc_multiAgent:"Orchestrate agent collaboration"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",moreModels:"More Models / API Settings",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},alerts:{cpu_high:"High CPU usage — LLM load is saturating the system.",ram_high:"High memory usage — performance may degrade.",ram_critical:"Memory critical — system lockup risk."},recommendations:{cpu_high:"Close background processes or switch to a smaller model.",ram_high:"Consider switching to a lighter model.",ram_critical:"Switch to an 8B or 14B model immediately."}},panels:{memory:{title:"Memory Insights",indexLabel:"Index:",clearIndex:"Clear Index",searchPlaceholder:"Search your memory…",searchHint:"Semantic similarity search — press Enter or click",emptyTitle:"Search your AI memory",emptyNoResults:"No memories found",emptyHint:"Type a phrase to find semantically similar skills, conversations, and workspace files.",emptyNoResultsHint:"Try a different phrase or index more content using the controls above.",refreshStats:"Refresh stats",indexControls:"Index controls",vectors:"vectors",skills:"skills",files:"files",indexed:"Indexed",indexCleared:"Index cleared",opFailed:"Operation failed",reqError:"Request error"},plugins:{title:"Plugin Architect",newPlugin:"New Plugin",buildTitle:"Build New Plugin",namePlaceholder:"Plugin name (e.g. weather-monitor)",goalPlaceholder:"Goal (e.g. poll OpenWeather API every 5 min)",contextPlaceholder:"Optional context / notes",generatePlugin:"Generate Plugin",emptyTitle:"No plugins installed",emptyHint:'Click "New Plugin" to generate your first plugin.',installed:"installed",running:"RUNNING",stop:"Stop",run:"Run",opFailed:"Operation failed",reqError:"Request error",buildFailed:"Build failed",refresh:"Refresh"},skills:{title:"Skill Library",loading:"Loading skills…",emptyTitle:"No skills saved yet",emptyHint:"Complete a workflow in the Chat tab, then click",saveAsSkill:"Save as Skill",emptyHint2:"to build your library.",runningStatus:"Running skill…",completedStatus:"Skill completed",failedStatus:"Skill run failed",never:"Never",deleteConfirm:"Delete?",yes:"Yes",no:"No",runBtn:"Run",runningBtn:"Running…",doneBtn:"Done",lastRun:"last run"},settings:{title:"Settings",hardwareScore:"Hardware Score",searchPlaceholder:"Search providers…",allProviders:"All",apiKey:"API Key",baseUrl:"Base URL",model:"Model",testConnection:"Test Connection",save:"Save",testOk:"Connection successful",testFail:"Connection failed",saved:"Saved",saving:"Saving…",testing:"Testing…",apiKeyWarning:"API key required — update your key to continue."}}},o4={welcome:{tagline:"Yapay Zeka Beyniniz",title:"Must-b",sleeping:"Uyuyor...",waking:"Uyandırılıyor...",awake:"Uyanıyor...",wakeBtn:"Must-b'yi Uyandır",wakeHint:"Devam etmek için uyandır",reconfigure:"Yeniden Yapılandır",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Yeni Sohbet",recentChats:"Son Sohbetler",primary:"Birincil",personalization:"Kişiselleştirme",platform:"Platform",system:"Sistem",automations:"Otomasyonlarım",activeWorkflows:"Aktif İş Akışları",products:"Araçlar & Eklentiler",clients:"Müşteri Yönetimi",integrations:"Entegrasyonlar",logs:"Kayıtlar & Aktivite",settings:"Ayarlar",logout:"Çıkış",poweredBy:"Altyapısı:",deleteChat:"Sohbet Silinsin mi?",deleteConfirm:"Bu işlem geri alınamaz.",cancel:"İptal",delete:"Sil"},rightPanel:{agentRole:"Ajan Rolü",hardware:"Donanım Puanı",model:"Aktif Model",connected:"Gateway Bağlı",rank:{master:"Usta",planner:"Planlayıcı",worker:"İşçi"}},workflow:{title:"Aktif İş Akışı",idle:"Boşta — görev bekleniyor",goal:"Hedef",steps:{browse:"Tarayıcı açılıyor",write:"Dosya yazılıyor",think:"Düşünülüyor",exec:"Komut çalıştırılıyor"}},dashboard:{placeholder:"Must-b'ye bir mesaj gönderin...",thinking:"Must-b düşünüyor..."},layout:{chats:"Sohbetler",system:"Sistem",openChats:"Sohbet geçmişini aç",openSystem:"Sistem panelini aç",closePanel:"Paneli kapat"},chat:{inputPlaceholder:"Must-b'ye her şeyi sorun…",listening:"Dinleniyor…",thoughtProcess:"Düşünce Süreci",saveAsSkill:"Beceri Olarak Kaydet",skillSaved:"Beceri kütüphanenize kaydedildi!",saving:"Kaydediliyor…",retry:"Tekrar Dene",save:"Kaydet",guidance:"Rehberlik",errorBoundary:"Sohbet render hatası — yeniden yükleniyor…",disclaimer:"Must-b bilişsel bir asistandır; kritik çıktıları doğrulamanız önerilir.",placeholder:"Ne öğrenmek istiyorsunuz?",tools:"Araçlar",attachFile:"Dosya ekle",startDictation:"Sesli giriş başlat",stopDictation:"Durdur",settingsAck:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",professionAck:"Mesleğiniz hakkında gerekli araştırmaları yaptım ve zihnime (must-b.md) not aldım. Artık bir **{profession}** asistanı olarak hazırım."},nav:{chat:"Sohbet",browser:"Tarayıcı",workflows:"İş Akışları",voice:"Sesli",settings:"Ayarlar",files:"Dosyalar",memory:"Bellek",apiKeys:"API Anahtarları",skills:"Beceriler",plugins:"Eklentiler",mind:"Must-b Zihni"},voice:{title:"Must-b Sesli Komuta",back:"Geri Dön",wakeHint:'"Hey Must-b" demeyi dene.',tapHint:"Başlamak için mikrofona dokunun.",heard:"Sizi duyuyorum…",listening:"Dinleniyor…",stopHint:"Durdurmak için tıklayın",thinking:"İşleniyor…",cmdHint:"Buyurun, dinliyorum…",speakingHint:"Must-b konuşuyor…"},systemHealth:{lite:"LITE",safe:"GÜVENLİ",critical:"Kritik",warning:"Uyarı",info:"Bilgi",title:"Sistem Durumu",moreModels:"Daha Fazla Model / API Ayarları",kinds:{cpu:"İşlemci",ram:"RAM",memory:"Bellek",storage:"Depolama",network:"Ağ",process:"İşlem",battery:"Batarya",thermal:"Isı",disk:"Disk"},alerts:{cpu_high:"İşlemci kullanımı yüksek — LLM yükü sistemi doyuruyor.",ram_high:"Bellek kullanımı yüksek — performans düşebilir.",ram_critical:"Bellek kritik — sistem kilitlenme riski var."},recommendations:{cpu_high:"Arka plan işlemlerini kapatın veya daha küçük bir modele geçin.",ram_high:"Daha hafif bir modele geçmeyi düşünün.",ram_critical:"Hemen 8B veya 14B bir modele geçin."}},dock:{chat:"Sohbet",files:"Dosyalar",browser:"Tarayıcı",skills:"Beceriler",memory:"Bellek",plugins:"Eklentiler",workflows:"İş Akışları",settings:"Ayarlar",system:"Sistem",close:"Kapat",cat_webTools:"Web Araçları",cat_fileMedia:"Dosya & Medya",cat_aiAgents:"Yapay Zeka & Ajanlar",cat_systemTools:"Sistem Araçları",skill_webSearch:"Web Arama",skill_webFetch:"Web Çekme",skill_browserControl:"Tarayıcı Kontrolü",skill_pdfReader:"PDF Okuyucu",skill_imageAnalysis:"Görüntü Analizi",skill_imageGeneration:"Görüntü Oluşturma",skill_tts:"Metinden Sese",skill_spawnAgent:"Alt Ajan Başlat",skill_agentSessions:"Ajan Oturumları",skill_canvas:"Tuval",skill_git:"Git İşlemleri",skill_gateway:"Ağ Geçidi",skill_fileManager:"Dosya Yöneticisi",skill_cron:"Zamanlayıcı",skill_messages:"Mesajlar",desc_webSearch:"Gerçek zamanlı web araması (çoklu sağlayıcı)",desc_webFetch:"Herhangi bir URL'yi metin olarak çek",desc_browserControl:"Tam Playwright tarayıcı otomasyonu",desc_pdfReader:"PDF belgelerini çıkar ve analiz et",desc_imageAnalysis:"Görüntüleri tanımla ve analiz et",desc_imageGeneration:"Yapay zeka ile görüntü oluştur",desc_tts:"Metni doğal sese dönüştür",desc_spawnAgent:"Yeni özerk ajan oturumu başlat",desc_agentSessions:"Aktif oturumları listele ve yönet",desc_canvas:"Görsel çizim & beyaz tahta",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Sistemler arası & A2A iletişim",desc_fileManager:"Dosyaları oku, yaz ve yönet",desc_cron:"Tekrarlayan görevleri zamanla",desc_messages:"Ajanlar arası mesaj gönder ve al",cat_knowledgeBase:"Bilgi Tabanı",cat_personalOrg:"Kişisel Organizasyon",mem_browse:"Belleklere Göz At",mem_search:"Bellekte Ara",mem_add:"Bellek Ekle",mem_contacts:"Kişiler",mem_calendar:"Takvim",desc_memBrowse:"Tüm saklanan bilgi girişlerini görüntüle",desc_memSearch:"Bilgi tabanında anlamsal arama",desc_memAdd:"Yeni bilgi ve gerçekleri sakla",desc_contacts:"Kişileri ve kuruluşları yönet",desc_calendar:"Etkinlikleri zamanla ve yönet",cat_pluginManager:"Eklenti Yöneticisi",cat_developer:"Geliştirici",plug_marketplace:"Pazar Yeri",plug_installed:"Yüklü Eklentiler",plug_mcp:"MCP Sunucuları",plug_bundleMcp:"MCP Paketi",plug_cliCmds:"CLI Komutları",desc_marketplace:"ClawHub'da eklentileri keşfet",desc_installed:"Yüklü eklentileri yönet ve yapılandır",desc_mcp:"Model Context Protocol entegrasyonları",desc_bundleMcp:"MCP araç paketlerini oluştur ve dağıt",desc_cliCmds:"Özel eğik çizgi komutları kaydı",cat_automation:"Otomasyon",cat_advanced:"Gelişmiş",wf_automations:"Otomasyonlar",wf_scheduled:"Zamanlanmış Görevler",wf_commands:"Komutlar",wf_nodes:"Düğüm İş Akışı",wf_multiAgent:"Çoklu Ajan",desc_automations:"Otomatik iş akışları oluştur ve çalıştır",desc_scheduled:"Tüm cron zamanlamalarını yönet",desc_commands:"Özel eğik çizgi komutları",desc_nodes:"Görsel düğüm-grafik iş hatları",desc_multiAgent:"Ajan işbirliğini düzenle"},panels:{memory:{title:"Bellek Görüşleri",indexLabel:"İndeks:",clearIndex:"İndeksi Temizle",searchPlaceholder:"Belleğinizde arayın…",searchHint:"Anlamsal benzerlik araması — Enter'a basın veya tıklayın",emptyTitle:"Yapay Zeka Belleğinizi Arayın",emptyNoResults:"Bellek bulunamadı",emptyHint:"Beceriler, sohbetler ve dosyalarda anlamsal olarak benzer içerik bulmak için bir ifade yazın.",emptyNoResultsHint:"Farklı bir ifade deneyin veya yukarıdaki kontrollerle daha fazla içerik ekleyin.",refreshStats:"İstatistikleri yenile",indexControls:"İndeks kontrolleri",vectors:"vektör",skills:"beceri",files:"dosya",indexed:"İndekslendi",indexCleared:"İndeks temizlendi",opFailed:"İşlem başarısız",reqError:"İstek hatası"},plugins:{title:"Eklenti Mimarı",newPlugin:"Yeni Eklenti",buildTitle:"Yeni Eklenti Oluştur",namePlaceholder:"Eklenti adı (örn. hava-durumu-monitörü)",goalPlaceholder:"Hedef (örn. OpenWeather API'yi 5 dakikada bir sorgula)",contextPlaceholder:"İsteğe bağlı bağlam / notlar",generatePlugin:"Eklenti Oluştur",emptyTitle:"Yüklü eklenti yok",emptyHint:'İlk eklentinizi oluşturmak için "Yeni Eklenti"ye tıklayın.',installed:"yüklü",running:"ÇALIŞIYOR",stop:"Durdur",run:"Çalıştır",opFailed:"İşlem başarısız",reqError:"İstek hatası",buildFailed:"Oluşturma başarısız",refresh:"Yenile"},skills:{title:"Beceri Kütüphanesi",loading:"Beceriler yükleniyor…",emptyTitle:"Henüz kaydedilmiş beceri yok",emptyHint:"Sohbet sekmesinde bir iş akışını tamamlayın, ardından tıklayın",saveAsSkill:"Beceri Olarak Kaydet",emptyHint2:"kütüphanenizi oluşturmak için.",runningStatus:"Beceri çalışıyor…",completedStatus:"Beceri tamamlandı",failedStatus:"Beceri çalıştırma başarısız",never:"Hiçbir zaman",deleteConfirm:"Sil?",yes:"Evet",no:"Hayır",runBtn:"Çalıştır",runningBtn:"Çalışıyor…",doneBtn:"Tamamlandı",lastRun:"son çalıştırma"},settings:{title:"Ayarlar",hardwareScore:"Donanım Puanı",searchPlaceholder:"Sağlayıcı ara…",allProviders:"Tümü",apiKey:"API Anahtarı",baseUrl:"Temel URL",model:"Model",testConnection:"Bağlantıyı Test Et",save:"Kaydet",testOk:"Bağlantı başarılı",testFail:"Bağlantı başarısız",saved:"Kaydedildi",saving:"Kaydediliyor…",testing:"Test ediliyor…",apiKeyWarning:"API anahtarı gerekli — devam etmek için anahtarınızı güncelleyin."}}},l4={welcome:{tagline:"Ihr KI-Gehirn",title:"Must-b",sleeping:"Schläft...",waking:"Wird geweckt...",awake:"Erwacht...",wakeBtn:"Must-b wecken",wakeHint:"Tippen zum Fortfahren",reconfigure:"Neu konfigurieren",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Neuer Chat",recentChats:"Letzte Chats",platform:"Plattform",system:"System",automations:"Meine Automatisierungen",activeWorkflows:"Aktive Workflows",products:"Skills & Plugins",clients:"Kundenverwaltung",integrations:"Integrationen",logs:"Protokolle & Aktivität",settings:"Einstellungen",logout:"Abmelden",poweredBy:"Betrieben von",deleteChat:"Chat löschen?",deleteConfirm:"Diese Aktion kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",delete:"Löschen"},rightPanel:{agentRole:"Agentenrolle",hardware:"Hardware-Score",model:"Aktives Modell",connected:"Gateway verbunden",rank:{master:"Meister",planner:"Planer",worker:"Arbeiter"}},workflow:{title:"Aktiver Workflow",idle:"Leerlauf — wartet auf Aufgabe",goal:"Ziel",steps:{browse:"Browser wird geöffnet",write:"Datei wird geschrieben",think:"Wird nachgedacht",exec:"Befehl wird ausgeführt"}},dashboard:{placeholder:"Nachricht an Must-b senden...",thinking:"Must-b denkt nach..."},layout:{chats:"Chats",system:"System",openChats:"Chatverlauf öffnen",openSystem:"Systembereich öffnen",closePanel:"Bereich schließen"},chat:{inputPlaceholder:"Fragen Sie Must-b alles…",listening:"Höre zu…",thoughtProcess:"Denkprozess",saveAsSkill:"Als Fähigkeit speichern",skillSaved:"Fähigkeit in Ihrer Bibliothek gespeichert!",saving:"Speichere…",retry:"Erneut versuchen",save:"Speichern",guidance:"Hinweis",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Dateien",browser:"Browser",skills:"Fähigkeiten",memory:"Gedächtnis",plugins:"Plugins",workflows:"Workflows",settings:"Einstellungen",system:"System",close:"Schließen",cat_webTools:"Web-Werkzeuge",cat_fileMedia:"Datei & Medien",cat_aiAgents:"KI & Agenten",cat_systemTools:"Systemwerkzeuge",skill_webSearch:"Websuche",skill_webFetch:"Web-Abruf",skill_browserControl:"Browser-Steuerung",skill_pdfReader:"PDF-Leser",skill_imageAnalysis:"Bildanalyse",skill_imageGeneration:"Bilderzeugung",skill_tts:"Text-zu-Sprache",skill_spawnAgent:"Unteragent starten",skill_agentSessions:"Agentensitzungen",skill_canvas:"Leinwand",skill_git:"Git-Operationen",skill_gateway:"Gateway",skill_fileManager:"Dateimanager",skill_cron:"Aufgabenplaner",skill_messages:"Nachrichten",desc_webSearch:"Echtzeit-Websuche (Multi-Provider)",desc_webFetch:"Beliebige URL als sauberen Text abrufen",desc_browserControl:"Vollständige Playwright-Browserautomatisierung",desc_pdfReader:"PDF-Dokumente extrahieren & analysieren",desc_imageAnalysis:"Bilder beschreiben und analysieren",desc_imageGeneration:"KI-generierte Bilder erstellen",desc_tts:"Text in natürliche Sprache umwandeln",desc_spawnAgent:"Neue autonome Agentensitzung starten",desc_agentSessions:"Aktive Sitzungen auflisten und verwalten",desc_canvas:"Visueller Zeichen- & Whiteboard-Bereich",desc_git:"Commit, Branch, Diff, Push/Pull",desc_gateway:"Systemübergreifende & A2A-Kommunikation",desc_fileManager:"Dateien lesen, schreiben & verwalten",desc_cron:"Wiederkehrende Aufgaben planen",desc_messages:"Agenten-Nachrichten senden & empfangen",cat_knowledgeBase:"Wissensdatenbank",cat_personalOrg:"Persönliche Organisation",mem_browse:"Erinnerungen durchsuchen",mem_search:"Gedächtnis suchen",mem_add:"Erinnerung hinzufügen",mem_contacts:"Kontakte",mem_calendar:"Kalender",desc_memBrowse:"Alle gespeicherten Wissenseinträge anzeigen",desc_memSearch:"Semantische Suche in der Wissensdatenbank",desc_memAdd:"Neue Fakten und Wissen speichern",desc_contacts:"Personen und Organisationen verwalten",desc_calendar:"Termine planen und verwalten",cat_pluginManager:"Plugin-Manager",cat_developer:"Entwickler",plug_marketplace:"Marktplatz",plug_installed:"Installiert",plug_mcp:"MCP-Server",plug_bundleMcp:"MCP bündeln",plug_cliCmds:"CLI-Befehle",desc_marketplace:"Plugins auf ClawHub entdecken",desc_installed:"Installierte Plugins verwalten und konfigurieren",desc_mcp:"Model Context Protocol-Integrationen",desc_bundleMcp:"MCP-Werkzeugpakete erstellen & bereitstellen",desc_cliCmds:"Benutzerdefinierte Schrägstrichbefehle registrieren",cat_automation:"Automatisierung",cat_advanced:"Erweitert",wf_automations:"Automatisierungen",wf_scheduled:"Geplante Aufgaben",wf_commands:"Befehle",wf_nodes:"Knoten-Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Automatisierte Workflows erstellen und ausführen",desc_scheduled:"Alle Cron-Zeitpläne verwalten",desc_commands:"Benutzerdefinierte Schrägstrichbefehle",desc_nodes:"Visuelle Knoten-Graph-Pipelines",desc_multiAgent:"Agentenzusammenarbeit orchestrieren"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Gedächtnisübersicht",indexLabel:"Index:",clearIndex:"Index löschen",searchPlaceholder:"Gedächtnis durchsuchen…",searchHint:"Semantische Ähnlichkeitssuche — Enter drücken oder klicken",emptyTitle:"KI-Gedächtnis durchsuchen",emptyNoResults:"Keine Erinnerungen gefunden",emptyHint:"Geben Sie einen Begriff ein, um semantisch ähnliche Fähigkeiten, Gespräche und Dateien zu finden.",emptyNoResultsHint:"Versuchen Sie eine andere Formulierung oder indizieren Sie mehr Inhalte.",refreshStats:"Statistiken aktualisieren",indexControls:"Indexsteuerung",vectors:"Vektoren",skills:"Fähigkeiten",files:"Dateien",indexed:"Indiziert",indexCleared:"Index gelöscht",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler"},plugins:{title:"Plugin-Architekt",newPlugin:"Neues Plugin",buildTitle:"Neues Plugin erstellen",namePlaceholder:"Plugin-Name (z.B. wetter-monitor)",goalPlaceholder:"Ziel (z.B. OpenWeather API alle 5 Min. abfragen)",contextPlaceholder:"Optionaler Kontext / Notizen",generatePlugin:"Plugin generieren",emptyTitle:"Keine Plugins installiert",emptyHint:'Klicken Sie auf "Neues Plugin", um Ihr erstes Plugin zu erstellen.',installed:"installiert",running:"LÄUFT",stop:"Stoppen",run:"Ausführen",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler",buildFailed:"Erstellung fehlgeschlagen",refresh:"Aktualisieren"},skills:{title:"Fähigkeitenbibliothek",loading:"Fähigkeiten werden geladen…",emptyTitle:"Noch keine Fähigkeiten gespeichert",emptyHint:"Schließen Sie einen Workflow im Chat-Tab ab, dann klicken Sie auf",saveAsSkill:"Als Fähigkeit speichern",emptyHint2:"um Ihre Bibliothek aufzubauen.",runningStatus:"Fähigkeit wird ausgeführt…",completedStatus:"Fähigkeit abgeschlossen",failedStatus:"Ausführung fehlgeschlagen",never:"Nie",deleteConfirm:"Löschen?",yes:"Ja",no:"Nein",runBtn:"Ausführen",runningBtn:"Läuft…",doneBtn:"Fertig",lastRun:"letzter Lauf"},settings:{title:"Einstellungen",hardwareScore:"Hardware-Score",searchPlaceholder:"Anbieter suchen…",allProviders:"Alle",apiKey:"API-Schlüssel",baseUrl:"Basis-URL",model:"Modell",testConnection:"Verbindung testen",save:"Speichern",testOk:"Verbindung erfolgreich",testFail:"Verbindung fehlgeschlagen",saved:"Gespeichert",saving:"Speichern…",testing:"Teste…",apiKeyWarning:"API-Schlüssel erforderlich — aktualisieren Sie Ihren Schlüssel."}}},c4={welcome:{tagline:"Votre cerveau IA",title:"Must-b",sleeping:"En veille...",waking:"Réveil en cours...",awake:"Éveil...",wakeBtn:"Réveiller Must-b",wakeHint:"Appuyez pour continuer",reconfigure:"Reconfigurer",footer:"© 2026 Must-b — Plateforme Auto Step"},sidebar:{newChat:"Nouvelle discussion",recentChats:"Discussions récentes",platform:"Plateforme",system:"Système",automations:"Mes automatisations",activeWorkflows:"Flux de travail actifs",products:"Skills & Plugins",clients:"Gestion des clients",integrations:"Intégrations",logs:"Journaux & Activité",settings:"Paramètres",logout:"Déconnexion",poweredBy:"Propulsé par",deleteChat:"Supprimer la discussion ?",deleteConfirm:"Cette action est irréversible.",cancel:"Annuler",delete:"Supprimer"},rightPanel:{agentRole:"Rôle de l'agent",hardware:"Score matériel",model:"Modèle actif",connected:"Passerelle connectée",rank:{master:"Maître",planner:"Planificateur",worker:"Exécutant"}},workflow:{title:"Flux de travail actif",idle:"Inactif — en attente d'une tâche",goal:"Objectif",steps:{browse:"Ouverture du navigateur",write:"Écriture du fichier",think:"Réflexion",exec:"Exécution de la commande"}},dashboard:{placeholder:"Envoyer un message à Must-b...",thinking:"Must-b réfléchit..."},layout:{chats:"Discussions",system:"Système",openChats:"Ouvrir l'historique des discussions",openSystem:"Ouvrir le panneau système",closePanel:"Fermer le panneau"},chat:{inputPlaceholder:"Posez n'importe quelle question à Must-b…",listening:"Écoute en cours…",thoughtProcess:"Processus de réflexion",saveAsSkill:"Enregistrer comme compétence",skillSaved:"Compétence enregistrée dans votre bibliothèque !",saving:"Enregistrement…",retry:"Réessayer",save:"Enregistrer",guidance:"Conseils",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Discussion",files:"Fichiers",browser:"Navigateur",skills:"Compétences",memory:"Mémoire",plugins:"Plugins",workflows:"Flux de travail",settings:"Paramètres",system:"Système",close:"Fermer",cat_webTools:"Outils web",cat_fileMedia:"Fichiers & Médias",cat_aiAgents:"IA & Agents",cat_systemTools:"Outils système",skill_webSearch:"Recherche web",skill_webFetch:"Récupération web",skill_browserControl:"Contrôle du navigateur",skill_pdfReader:"Lecteur PDF",skill_imageAnalysis:"Analyse d'image",skill_imageGeneration:"Génération d'image",skill_tts:"Synthèse vocale",skill_spawnAgent:"Créer un sous-agent",skill_agentSessions:"Sessions d'agents",skill_canvas:"Tableau de travail",skill_git:"Opérations Git",skill_gateway:"Passerelle",skill_fileManager:"Gestionnaire de fichiers",skill_cron:"Planificateur Cron",skill_messages:"Messages",desc_webSearch:"Recherche web en temps réel (multi-fournisseur)",desc_webFetch:"Récupérer n'importe quelle URL en texte brut",desc_browserControl:"Automatisation complète du navigateur Playwright",desc_pdfReader:"Extraire et analyser des documents PDF",desc_imageAnalysis:"Décrire et analyser des images",desc_imageGeneration:"Créer des images générées par IA",desc_tts:"Convertir du texte en parole naturelle",desc_spawnAgent:"Lancer une nouvelle session d'agent autonome",desc_agentSessions:"Lister et gérer les sessions actives",desc_canvas:"Espace de dessin visuel et tableau blanc",desc_git:"Commit, branche, diff, push/pull",desc_gateway:"Communication inter-systèmes & A2A",desc_fileManager:"Lire, écrire et gérer des fichiers",desc_cron:"Planifier des tâches récurrentes",desc_messages:"Envoyer & recevoir des messages inter-agents",cat_knowledgeBase:"Base de connaissances",cat_personalOrg:"Organisation personnelle",mem_browse:"Parcourir les souvenirs",mem_search:"Rechercher dans la mémoire",mem_add:"Ajouter un souvenir",mem_contacts:"Contacts",mem_calendar:"Calendrier",desc_memBrowse:"Voir toutes les entrées de connaissances stockées",desc_memSearch:"Recherche sémantique dans votre base de connaissances",desc_memAdd:"Stocker de nouveaux faits et connaissances",desc_contacts:"Gérer les personnes et organisations",desc_calendar:"Planifier et gérer des événements",cat_pluginManager:"Gestionnaire de plugins",cat_developer:"Développeur",plug_marketplace:"Marché",plug_installed:"Installés",plug_mcp:"Serveurs MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Commandes CLI",desc_marketplace:"Découvrir des plugins sur ClawHub",desc_installed:"Gérer et configurer les plugins installés",desc_mcp:"Intégrations du protocole de contexte de modèle",desc_bundleMcp:"Empaqueter et déployer des bundles d'outils MCP",desc_cliCmds:"Enregistrement de commandes slash personnalisées",cat_automation:"Automatisation",cat_advanced:"Avancé",wf_automations:"Automatisations",wf_scheduled:"Tâches planifiées",wf_commands:"Commandes",wf_nodes:"Flux de nœuds",wf_multiAgent:"Multi-Agent",desc_automations:"Créer et exécuter des flux de travail automatisés",desc_scheduled:"Gérer tous les plannings cron",desc_commands:"Commandes slash personnalisées",desc_nodes:"Pipelines visuels en graphe de nœuds",desc_multiAgent:"Orchestrer la collaboration entre agents"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Aperçus de la mémoire",indexLabel:"Index :",clearIndex:"Effacer l'index",searchPlaceholder:"Rechercher dans votre mémoire…",searchHint:"Recherche par similarité sémantique — appuyez sur Entrée ou cliquez",emptyTitle:"Recherchez dans votre mémoire IA",emptyNoResults:"Aucun souvenir trouvé",emptyHint:"Saisissez une phrase pour trouver des compétences, conversations et fichiers sémantiquement similaires.",emptyNoResultsHint:"Essayez une phrase différente ou indexez plus de contenu via les contrôles ci-dessus.",refreshStats:"Actualiser les statistiques",indexControls:"Contrôles de l'index",vectors:"vecteurs",skills:"compétences",files:"fichiers",indexed:"Indexé",indexCleared:"Index effacé",opFailed:"Opération échouée",reqError:"Erreur de requête"},plugins:{title:"Architecte de plugins",newPlugin:"Nouveau plugin",buildTitle:"Créer un nouveau plugin",namePlaceholder:"Nom du plugin (ex. weather-monitor)",goalPlaceholder:"Objectif (ex. interroger l'API OpenWeather toutes les 5 min)",contextPlaceholder:"Contexte / notes optionnels",generatePlugin:"Générer le plugin",emptyTitle:"Aucun plugin installé",emptyHint:"Cliquez sur « Nouveau plugin » pour générer votre premier plugin.",installed:"installé",running:"EN COURS",stop:"Arrêter",run:"Exécuter",opFailed:"Opération échouée",reqError:"Erreur de requête",buildFailed:"Échec de la compilation",refresh:"Actualiser"},skills:{title:"Bibliothèque de compétences",loading:"Chargement des compétences…",emptyTitle:"Aucune compétence enregistrée",emptyHint:"Terminez un flux de travail dans l'onglet Discussion, puis cliquez sur",saveAsSkill:"Enregistrer comme compétence",emptyHint2:"pour constituer votre bibliothèque.",runningStatus:"Exécution de la compétence…",completedStatus:"Compétence terminée",failedStatus:"Échec de l'exécution",never:"Jamais",deleteConfirm:"Supprimer ?",yes:"Oui",no:"Non",runBtn:"Exécuter",runningBtn:"En cours…",doneBtn:"Terminé",lastRun:"dernière exécution"},settings:{title:"Paramètres",hardwareScore:"Score matériel",searchPlaceholder:"Rechercher des fournisseurs…",allProviders:"Tous",apiKey:"Clé API",baseUrl:"URL de base",model:"Modèle",testConnection:"Tester la connexion",save:"Enregistrer",testOk:"Connexion réussie",testFail:"Échec de la connexion",saved:"Enregistré",saving:"Enregistrement…",testing:"Test en cours…",apiKeyWarning:"Clé API requise — mettez à jour votre clé pour continuer."}}},u4={welcome:{tagline:"Tu cerebro de IA",title:"Must-b",sleeping:"Durmiendo...",waking:"Despertando...",awake:"Despertando...",wakeBtn:"Despertar Must-b",wakeHint:"Toca para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nueva conversación",recentChats:"Conversaciones recientes",platform:"Plataforma",system:"Sistema",automations:"Mis automatizaciones",activeWorkflows:"Flujos de trabajo activos",products:"Skills & Plugins",clients:"Gestión de clientes",integrations:"Integraciones",logs:"Registros y actividad",settings:"Configuración",logout:"Cerrar sesión",poweredBy:"Desarrollado por",deleteChat:"¿Eliminar conversación?",deleteConfirm:"Esta acción no se puede deshacer.",cancel:"Cancelar",delete:"Eliminar"},rightPanel:{agentRole:"Rol del agente",hardware:"Puntuación de hardware",model:"Modelo activo",connected:"Puerta de enlace conectada",rank:{master:"Maestro",planner:"Planificador",worker:"Trabajador"}},workflow:{title:"Flujo de trabajo activo",idle:"Inactivo — esperando tarea",goal:"Objetivo",steps:{browse:"Abriendo navegador",write:"Escribiendo archivo",think:"Pensando",exec:"Ejecutando comando"}},dashboard:{placeholder:"Envía un mensaje a Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversaciones",system:"Sistema",openChats:"Abrir historial de conversaciones",openSystem:"Abrir panel del sistema",closePanel:"Cerrar panel"},chat:{inputPlaceholder:"Pregunta cualquier cosa a Must-b…",listening:"Escuchando…",thoughtProcess:"Proceso de pensamiento",saveAsSkill:"Guardar como habilidad",skillSaved:"¡Habilidad guardada en tu biblioteca!",saving:"Guardando…",retry:"Reintentar",save:"Guardar",guidance:"Orientación",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversación",files:"Archivos",browser:"Navegador",skills:"Habilidades",memory:"Memoria",plugins:"Plugins",workflows:"Flujos de trabajo",settings:"Configuración",system:"Sistema",close:"Cerrar",cat_webTools:"Herramientas web",cat_fileMedia:"Archivos y medios",cat_aiAgents:"IA y agentes",cat_systemTools:"Herramientas del sistema",skill_webSearch:"Búsqueda web",skill_webFetch:"Recuperación web",skill_browserControl:"Control del navegador",skill_pdfReader:"Lector de PDF",skill_imageAnalysis:"Análisis de imagen",skill_imageGeneration:"Generación de imágenes",skill_tts:"Texto a voz",skill_spawnAgent:"Crear subagente",skill_agentSessions:"Sesiones de agentes",skill_canvas:"Lienzo",skill_git:"Operaciones Git",skill_gateway:"Puerta de enlace",skill_fileManager:"Gestor de archivos",skill_cron:"Planificador Cron",skill_messages:"Mensajes",desc_webSearch:"Búsqueda web en tiempo real (multi-proveedor)",desc_webFetch:"Obtener cualquier URL como texto limpio",desc_browserControl:"Automatización completa del navegador con Playwright",desc_pdfReader:"Extraer y analizar documentos PDF",desc_imageAnalysis:"Describir y analizar imágenes",desc_imageGeneration:"Crear imágenes generadas por IA",desc_tts:"Convertir texto en habla natural",desc_spawnAgent:"Iniciar una nueva sesión de agente autónomo",desc_agentSessions:"Listar y gestionar sesiones activas",desc_canvas:"Espacio de dibujo visual y pizarra",desc_git:"Commit, rama, diff, push/pull",desc_gateway:"Comunicación entre sistemas y A2A",desc_fileManager:"Leer, escribir y gestionar archivos",desc_cron:"Programar tareas recurrentes",desc_messages:"Enviar y recibir mensajes entre agentes",cat_knowledgeBase:"Base de conocimientos",cat_personalOrg:"Organización personal",mem_browse:"Explorar recuerdos",mem_search:"Buscar en memoria",mem_add:"Agregar recuerdo",mem_contacts:"Contactos",mem_calendar:"Calendario",desc_memBrowse:"Ver todas las entradas de conocimiento almacenadas",desc_memSearch:"Búsqueda semántica en tu base de conocimientos",desc_memAdd:"Almacenar nuevos hechos y conocimientos",desc_contacts:"Gestionar personas y organizaciones",desc_calendar:"Programar y gestionar eventos",cat_pluginManager:"Gestor de plugins",cat_developer:"Desarrollador",plug_marketplace:"Mercado",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descubrir plugins en ClawHub",desc_installed:"Gestionar y configurar plugins instalados",desc_mcp:"Integraciones del Protocolo de Contexto de Modelo",desc_bundleMcp:"Empaquetar y desplegar bundles de herramientas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automatización",cat_advanced:"Avanzado",wf_automations:"Automatizaciones",wf_scheduled:"Tareas programadas",wf_commands:"Comandos",wf_nodes:"Flujo de nodos",wf_multiAgent:"Multi-Agente",desc_automations:"Crear y ejecutar flujos de trabajo automatizados",desc_scheduled:"Gestionar todos los programas cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuales en grafo de nodos",desc_multiAgent:"Orquestar la colaboración entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Perspectivas de memoria",indexLabel:"Índice:",clearIndex:"Limpiar índice",searchPlaceholder:"Buscar en tu memoria…",searchHint:"Búsqueda por similitud semántica — presiona Enter o haz clic",emptyTitle:"Busca en tu memoria de IA",emptyNoResults:"No se encontraron recuerdos",emptyHint:"Escribe una frase para encontrar habilidades, conversaciones y archivos semánticamente similares.",emptyNoResultsHint:"Prueba una frase diferente o indexa más contenido usando los controles de arriba.",refreshStats:"Actualizar estadísticas",indexControls:"Controles de índice",vectors:"vectores",skills:"habilidades",files:"archivos",indexed:"Indexado",indexCleared:"Índice limpiado",opFailed:"Operación fallida",reqError:"Error de solicitud"},plugins:{title:"Arquitecto de plugins",newPlugin:"Nuevo plugin",buildTitle:"Crear nuevo plugin",namePlaceholder:"Nombre del plugin (ej. weather-monitor)",goalPlaceholder:"Objetivo (ej. consultar la API OpenWeather cada 5 min)",contextPlaceholder:"Contexto / notas opcionales",generatePlugin:"Generar plugin",emptyTitle:"No hay plugins instalados",emptyHint:"Haz clic en «Nuevo plugin» para generar tu primer plugin.",installed:"instalado",running:"EN EJECUCIÓN",stop:"Detener",run:"Ejecutar",opFailed:"Operación fallida",reqError:"Error de solicitud",buildFailed:"Error de compilación",refresh:"Actualizar"},skills:{title:"Biblioteca de habilidades",loading:"Cargando habilidades…",emptyTitle:"No hay habilidades guardadas aún",emptyHint:"Completa un flujo de trabajo en la pestaña Conversación, luego haz clic en",saveAsSkill:"Guardar como habilidad",emptyHint2:"para construir tu biblioteca.",runningStatus:"Ejecutando habilidad…",completedStatus:"Habilidad completada",failedStatus:"Fallo en la ejecución",never:"Nunca",deleteConfirm:"¿Eliminar?",yes:"Sí",no:"No",runBtn:"Ejecutar",runningBtn:"Ejecutando…",doneBtn:"Listo",lastRun:"última ejecución"},settings:{title:"Configuración",hardwareScore:"Puntuación de hardware",searchPlaceholder:"Buscar proveedores…",allProviders:"Todos",apiKey:"Clave API",baseUrl:"URL base",model:"Modelo",testConnection:"Probar conexión",save:"Guardar",testOk:"Conexión exitosa",testFail:"Conexión fallida",saved:"Guardado",saving:"Guardando…",testing:"Probando…",apiKeyWarning:"Clave API requerida — actualiza tu clave para continuar."}}},d4={welcome:{tagline:"あなたのAIブレイン",title:"Must-b",sleeping:"スリープ中...",waking:"起動中...",awake:"覚醒中...",wakeBtn:"Must-bを起動",wakeHint:"タップして続行",reconfigure:"再設定",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"新しいチャット",recentChats:"最近のチャット",platform:"プラットフォーム",system:"システム",automations:"マイオートメーション",activeWorkflows:"アクティブなワークフロー",products:"スキル & プラグイン",clients:"クライアント管理",integrations:"インテグレーション",logs:"ログ・アクティビティ",settings:"設定",logout:"ログアウト",poweredBy:"提供:",deleteChat:"チャットを削除しますか?",deleteConfirm:"この操作は元に戻せません。",cancel:"キャンセル",delete:"削除"},rightPanel:{agentRole:"エージェントの役割",hardware:"ハードウェアスコア",model:"アクティブモデル",connected:"ゲートウェイ接続済み",rank:{master:"マスター",planner:"プランナー",worker:"ワーカー"}},workflow:{title:"アクティブなワークフロー",idle:"待機中 — タスクを待っています",goal:"目標",steps:{browse:"ブラウザを開いています",write:"ファイルを書き込んでいます",think:"考えています",exec:"コマンドを実行しています"}},dashboard:{placeholder:"Must-bにメッセージを送信...",thinking:"Must-bが考えています..."},layout:{chats:"チャット",system:"システム",openChats:"チャット履歴を開く",openSystem:"システムパネルを開く",closePanel:"パネルを閉じる"},chat:{inputPlaceholder:"Must-bに何でも聞いてください…",listening:"聞いています…",thoughtProcess:"思考プロセス",saveAsSkill:"スキルとして保存",skillSaved:"スキルがライブラリに保存されました!",saving:"保存中…",retry:"再試行",save:"保存",guidance:"ガイダンス",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"チャット",files:"ファイル",browser:"ブラウザ",skills:"スキル",memory:"メモリ",plugins:"プラグイン",workflows:"ワークフロー",settings:"設定",system:"システム",close:"閉じる",cat_webTools:"ウェブツール",cat_fileMedia:"ファイル・メディア",cat_aiAgents:"AI・エージェント",cat_systemTools:"システムツール",skill_webSearch:"ウェブ検索",skill_webFetch:"ウェブ取得",skill_browserControl:"ブラウザ制御",skill_pdfReader:"PDFリーダー",skill_imageAnalysis:"画像分析",skill_imageGeneration:"画像生成",skill_tts:"テキスト読み上げ",skill_spawnAgent:"サブエージェント作成",skill_agentSessions:"エージェントセッション",skill_canvas:"キャンバス",skill_git:"Git操作",skill_gateway:"ゲートウェイ",skill_fileManager:"ファイルマネージャー",skill_cron:"Cronスケジューラー",skill_messages:"メッセージ",desc_webSearch:"リアルタイムウェブ検索(マルチプロバイダー)",desc_webFetch:"任意のURLをクリーンなテキストとして取得",desc_browserControl:"Playwrightによる完全なブラウザ自動化",desc_pdfReader:"PDFドキュメントの抽出と分析",desc_imageAnalysis:"画像の説明と分析",desc_imageGeneration:"AI生成画像の作成",desc_tts:"テキストを自然な音声に変換",desc_spawnAgent:"新しい自律エージェントセッションを起動",desc_agentSessions:"アクティブセッションの一覧と管理",desc_canvas:"ビジュアル描画・ホワイトボードワークスペース",desc_git:"コミット、ブランチ、差分、プッシュ/プル",desc_gateway:"システム間・A2A通信",desc_fileManager:"ファイルの読み取り、書き込み、管理",desc_cron:"定期タスクのスケジュール",desc_messages:"エージェント間メッセージの送受信",cat_knowledgeBase:"ナレッジベース",cat_personalOrg:"個人管理",mem_browse:"メモリを閲覧",mem_search:"メモリを検索",mem_add:"メモリを追加",mem_contacts:"連絡先",mem_calendar:"カレンダー",desc_memBrowse:"保存されたすべての知識エントリを表示",desc_memSearch:"ナレッジベース全体のセマンティック検索",desc_memAdd:"新しい事実と知識を保存",desc_contacts:"人物と組織の管理",desc_calendar:"イベントのスケジュールと管理",cat_pluginManager:"プラグインマネージャー",cat_developer:"開発者",plug_marketplace:"マーケットプレイス",plug_installed:"インストール済み",plug_mcp:"MCPサーバー",plug_bundleMcp:"MCPバンドル",plug_cliCmds:"CLIコマンド",desc_marketplace:"ClawHubでプラグインを探す",desc_installed:"インストール済みプラグインの管理と設定",desc_mcp:"モデルコンテキストプロトコル統合",desc_bundleMcp:"MCPツールバンドルのパッケージ化とデプロイ",desc_cliCmds:"カスタムスラッシュコマンドの登録",cat_automation:"自動化",cat_advanced:"高度な設定",wf_automations:"自動化",wf_scheduled:"スケジュールタスク",wf_commands:"コマンド",wf_nodes:"ノードワークフロー",wf_multiAgent:"マルチエージェント",desc_automations:"自動化されたワークフローの構築と実行",desc_scheduled:"すべてのCronスケジュールを管理",desc_commands:"カスタムスラッシュコマンド",desc_nodes:"ビジュアルノードグラフパイプライン",desc_multiAgent:"エージェント間の協調をオーケストレーション"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"メモリインサイト",indexLabel:"インデックス:",clearIndex:"インデックスをクリア",searchPlaceholder:"メモリを検索…",searchHint:"セマンティック類似性検索 — Enterキーを押すかクリック",emptyTitle:"AIメモリを検索",emptyNoResults:"メモリが見つかりません",emptyHint:"フレーズを入力して、意味的に類似したスキル、会話、ワークスペースファイルを見つけてください。",emptyNoResultsHint:"別のフレーズを試すか、上のコントロールを使ってより多くのコンテンツをインデックスしてください。",refreshStats:"統計を更新",indexControls:"インデックスコントロール",vectors:"ベクター",skills:"スキル",files:"ファイル",indexed:"インデックス済み",indexCleared:"インデックスをクリアしました",opFailed:"操作に失敗しました",reqError:"リクエストエラー"},plugins:{title:"プラグインアーキテクト",newPlugin:"新しいプラグイン",buildTitle:"新しいプラグインを作成",namePlaceholder:"プラグイン名(例:weather-monitor)",goalPlaceholder:"目標(例:5分ごとにOpenWeather APIをポーリング)",contextPlaceholder:"オプションのコンテキスト / メモ",generatePlugin:"プラグインを生成",emptyTitle:"プラグインがインストールされていません",emptyHint:"「新しいプラグイン」をクリックして最初のプラグインを生成してください。",installed:"インストール済み",running:"実行中",stop:"停止",run:"実行",opFailed:"操作に失敗しました",reqError:"リクエストエラー",buildFailed:"ビルド失敗",refresh:"更新"},skills:{title:"スキルライブラリ",loading:"スキルを読み込んでいます…",emptyTitle:"スキルがまだ保存されていません",emptyHint:"チャットタブでワークフローを完了したら、クリック",saveAsSkill:"スキルとして保存",emptyHint2:"してライブラリを構築してください。",runningStatus:"スキルを実行中…",completedStatus:"スキル完了",failedStatus:"スキルの実行に失敗しました",never:"なし",deleteConfirm:"削除しますか?",yes:"はい",no:"いいえ",runBtn:"実行",runningBtn:"実行中…",doneBtn:"完了",lastRun:"最終実行"},settings:{title:"設定",hardwareScore:"ハードウェアスコア",searchPlaceholder:"プロバイダーを検索…",allProviders:"すべて",apiKey:"APIキー",baseUrl:"ベースURL",model:"モデル",testConnection:"接続をテスト",save:"保存",testOk:"接続成功",testFail:"接続失敗",saved:"保存済み",saving:"保存中…",testing:"テスト中…",apiKeyWarning:"APIキーが必要です — 続行するにはキーを更新してください。"}}},h4={welcome:{tagline:"您的AI大脑",title:"Must-b",sleeping:"休眠中...",waking:"唤醒中...",awake:"正在觉醒...",wakeBtn:"唤醒 Must-b",wakeHint:"点击继续",reconfigure:"重新配置",footer:"© 2026 Must-b — Auto Step 平台"},sidebar:{newChat:"新建对话",recentChats:"最近对话",platform:"平台",system:"系统",automations:"我的自动化",activeWorkflows:"活跃工作流",products:"技能与插件",clients:"客户管理",integrations:"集成",logs:"日志与活动",settings:"设置",logout:"退出登录",poweredBy:"技术支持:",deleteChat:"删除对话?",deleteConfirm:"此操作无法撤销。",cancel:"取消",delete:"删除"},rightPanel:{agentRole:"代理角色",hardware:"硬件评分",model:"活跃模型",connected:"网关已连接",rank:{master:"主控",planner:"规划者",worker:"执行者"}},workflow:{title:"活跃工作流",idle:"空闲中 — 等待任务",goal:"目标",steps:{browse:"正在打开浏览器",write:"正在写入文件",think:"正在思考",exec:"正在执行命令"}},dashboard:{placeholder:"向 Must-b 发送消息...",thinking:"Must-b 正在思考..."},layout:{chats:"对话",system:"系统",openChats:"打开对话历史",openSystem:"打开系统面板",closePanel:"关闭面板"},chat:{inputPlaceholder:"向 Must-b 提问任何问题…",listening:"正在聆听…",thoughtProcess:"思考过程",saveAsSkill:"保存为技能",skillSaved:"技能已保存到您的库中!",saving:"保存中…",retry:"重试",save:"保存",guidance:"指导",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"对话",files:"文件",browser:"浏览器",skills:"技能",memory:"记忆",plugins:"插件",workflows:"工作流",settings:"设置",system:"系统",close:"关闭",cat_webTools:"网络工具",cat_fileMedia:"文件与媒体",cat_aiAgents:"AI与代理",cat_systemTools:"系统工具",skill_webSearch:"网络搜索",skill_webFetch:"网络获取",skill_browserControl:"浏览器控制",skill_pdfReader:"PDF阅读器",skill_imageAnalysis:"图像分析",skill_imageGeneration:"图像生成",skill_tts:"文字转语音",skill_spawnAgent:"创建子代理",skill_agentSessions:"代理会话",skill_canvas:"画布",skill_git:"Git操作",skill_gateway:"网关",skill_fileManager:"文件管理器",skill_cron:"Cron调度器",skill_messages:"消息",desc_webSearch:"实时网络搜索(多供应商)",desc_webFetch:"将任意URL获取为纯文本",desc_browserControl:"完整的Playwright浏览器自动化",desc_pdfReader:"提取和分析PDF文档",desc_imageAnalysis:"描述和分析图像",desc_imageGeneration:"创建AI生成的图像",desc_tts:"将文本转换为自然语音",desc_spawnAgent:"启动新的自主代理会话",desc_agentSessions:"列出并管理活跃会话",desc_canvas:"可视化绘图与白板工作区",desc_git:"提交、分支、差异、推送/拉取",desc_gateway:"系统间与A2A通信",desc_fileManager:"读取、写入和管理文件",desc_cron:"调度定期任务",desc_messages:"发送和接收代理间消息",cat_knowledgeBase:"知识库",cat_personalOrg:"个人组织",mem_browse:"浏览记忆",mem_search:"搜索记忆",mem_add:"添加记忆",mem_contacts:"联系人",mem_calendar:"日历",desc_memBrowse:"查看所有存储的知识条目",desc_memSearch:"在知识库中进行语义搜索",desc_memAdd:"存储新的事实和知识",desc_contacts:"管理人员和组织",desc_calendar:"安排和管理事件",cat_pluginManager:"插件管理器",cat_developer:"开发者",plug_marketplace:"市场",plug_installed:"已安装",plug_mcp:"MCP服务器",plug_bundleMcp:"MCP捆绑包",plug_cliCmds:"CLI命令",desc_marketplace:"在ClawHub上发现插件",desc_installed:"管理和配置已安装的插件",desc_mcp:"模型上下文协议集成",desc_bundleMcp:"打包和部署MCP工具捆绑包",desc_cliCmds:"自定义斜杠命令注册",cat_automation:"自动化",cat_advanced:"高级",wf_automations:"自动化",wf_scheduled:"计划任务",wf_commands:"命令",wf_nodes:"节点工作流",wf_multiAgent:"多代理",desc_automations:"构建和运行自动化工作流",desc_scheduled:"管理所有Cron计划",desc_commands:"自定义斜杠命令",desc_nodes:"可视化节点图管道",desc_multiAgent:"协调代理间协作"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"记忆洞察",indexLabel:"索引:",clearIndex:"清除索引",searchPlaceholder:"搜索您的记忆…",searchHint:"语义相似性搜索 — 按回车键或点击",emptyTitle:"搜索您的AI记忆",emptyNoResults:"未找到记忆",emptyHint:"输入短语以查找语义相似的技能、对话和工作区文件。",emptyNoResultsHint:"尝试不同的短语,或使用上方控件索引更多内容。",refreshStats:"刷新统计",indexControls:"索引控件",vectors:"向量",skills:"技能",files:"文件",indexed:"已索引",indexCleared:"索引已清除",opFailed:"操作失败",reqError:"请求错误"},plugins:{title:"插件架构师",newPlugin:"新建插件",buildTitle:"创建新插件",namePlaceholder:"插件名称(例:weather-monitor)",goalPlaceholder:"目标(例:每5分钟轮询OpenWeather API)",contextPlaceholder:"可选上下文 / 备注",generatePlugin:"生成插件",emptyTitle:"未安装任何插件",emptyHint:"点击「新建插件」生成您的第一个插件。",installed:"已安装",running:"运行中",stop:"停止",run:"运行",opFailed:"操作失败",reqError:"请求错误",buildFailed:"构建失败",refresh:"刷新"},skills:{title:"技能库",loading:"正在加载技能…",emptyTitle:"尚未保存任何技能",emptyHint:"在对话标签中完成工作流,然后点击",saveAsSkill:"保存为技能",emptyHint2:"来构建您的技能库。",runningStatus:"正在运行技能…",completedStatus:"技能已完成",failedStatus:"技能运行失败",never:"从未",deleteConfirm:"删除?",yes:"是",no:"否",runBtn:"运行",runningBtn:"运行中…",doneBtn:"完成",lastRun:"上次运行"},settings:{title:"设置",hardwareScore:"硬件评分",searchPlaceholder:"搜索供应商…",allProviders:"全部",apiKey:"API密钥",baseUrl:"基础URL",model:"模型",testConnection:"测试连接",save:"保存",testOk:"连接成功",testFail:"连接失败",saved:"已保存",saving:"保存中…",testing:"测试中…",apiKeyWarning:"需要API密钥 — 请更新您的密钥以继续。"}}},p4={welcome:{tagline:"Seu cérebro de IA",title:"Must-b",sleeping:"Dormindo...",waking:"Acordando...",awake:"Despertando...",wakeBtn:"Acordar Must-b",wakeHint:"Toque para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nova conversa",recentChats:"Conversas recentes",platform:"Plataforma",system:"Sistema",automations:"Minhas automações",activeWorkflows:"Fluxos de trabalho ativos",products:"Skills & Plugins",clients:"Gestão de clientes",integrations:"Integrações",logs:"Registros e atividade",settings:"Configurações",logout:"Sair",poweredBy:"Desenvolvido por",deleteChat:"Excluir conversa?",deleteConfirm:"Esta ação não pode ser desfeita.",cancel:"Cancelar",delete:"Excluir"},rightPanel:{agentRole:"Função do agente",hardware:"Pontuação de hardware",model:"Modelo ativo",connected:"Gateway conectado",rank:{master:"Mestre",planner:"Planejador",worker:"Trabalhador"}},workflow:{title:"Fluxo de trabalho ativo",idle:"Ocioso — aguardando tarefa",goal:"Objetivo",steps:{browse:"Abrindo navegador",write:"Escrevendo arquivo",think:"Pensando",exec:"Executando comando"}},dashboard:{placeholder:"Envie uma mensagem para Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversas",system:"Sistema",openChats:"Abrir histórico de conversas",openSystem:"Abrir painel do sistema",closePanel:"Fechar painel"},chat:{inputPlaceholder:"Pergunte qualquer coisa ao Must-b…",listening:"Ouvindo…",thoughtProcess:"Processo de pensamento",saveAsSkill:"Salvar como habilidade",skillSaved:"Habilidade salva na sua biblioteca!",saving:"Salvando…",retry:"Tentar novamente",save:"Salvar",guidance:"Orientação",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversa",files:"Arquivos",browser:"Navegador",skills:"Habilidades",memory:"Memória",plugins:"Plugins",workflows:"Fluxos de trabalho",settings:"Configurações",system:"Sistema",close:"Fechar",cat_webTools:"Ferramentas web",cat_fileMedia:"Arquivos e mídia",cat_aiAgents:"IA e agentes",cat_systemTools:"Ferramentas do sistema",skill_webSearch:"Pesquisa web",skill_webFetch:"Busca web",skill_browserControl:"Controle do navegador",skill_pdfReader:"Leitor de PDF",skill_imageAnalysis:"Análise de imagem",skill_imageGeneration:"Geração de imagens",skill_tts:"Texto para fala",skill_spawnAgent:"Criar subagente",skill_agentSessions:"Sessões de agentes",skill_canvas:"Canvas",skill_git:"Operações Git",skill_gateway:"Gateway",skill_fileManager:"Gerenciador de arquivos",skill_cron:"Agendador Cron",skill_messages:"Mensagens",desc_webSearch:"Pesquisa web em tempo real (multi-provedor)",desc_webFetch:"Buscar qualquer URL como texto limpo",desc_browserControl:"Automação completa do navegador com Playwright",desc_pdfReader:"Extrair e analisar documentos PDF",desc_imageAnalysis:"Descrever e analisar imagens",desc_imageGeneration:"Criar imagens geradas por IA",desc_tts:"Converter texto em fala natural",desc_spawnAgent:"Iniciar uma nova sessão de agente autônomo",desc_agentSessions:"Listar e gerenciar sessões ativas",desc_canvas:"Espaço de desenho visual e quadro branco",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Comunicação entre sistemas e A2A",desc_fileManager:"Ler, escrever e gerenciar arquivos",desc_cron:"Agendar tarefas recorrentes",desc_messages:"Enviar e receber mensagens entre agentes",cat_knowledgeBase:"Base de conhecimento",cat_personalOrg:"Organização pessoal",mem_browse:"Explorar memórias",mem_search:"Pesquisar memória",mem_add:"Adicionar memória",mem_contacts:"Contatos",mem_calendar:"Calendário",desc_memBrowse:"Ver todas as entradas de conhecimento armazenadas",desc_memSearch:"Pesquisa semântica na sua base de conhecimento",desc_memAdd:"Armazenar novos fatos e conhecimentos",desc_contacts:"Gerenciar pessoas e organizações",desc_calendar:"Agendar e gerenciar eventos",cat_pluginManager:"Gerenciador de plugins",cat_developer:"Desenvolvedor",plug_marketplace:"Marketplace",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descobrir plugins no ClawHub",desc_installed:"Gerenciar e configurar plugins instalados",desc_mcp:"Integrações do Protocolo de Contexto de Modelo",desc_bundleMcp:"Empacotar e implantar bundles de ferramentas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automação",cat_advanced:"Avançado",wf_automations:"Automações",wf_scheduled:"Tarefas agendadas",wf_commands:"Comandos",wf_nodes:"Fluxo de nós",wf_multiAgent:"Multi-Agente",desc_automations:"Criar e executar fluxos de trabalho automatizados",desc_scheduled:"Gerenciar todos os agendamentos cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuais em grafo de nós",desc_multiAgent:"Orquestrar colaboração entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Insights de memória",indexLabel:"Índice:",clearIndex:"Limpar índice",searchPlaceholder:"Pesquisar na sua memória…",searchHint:"Pesquisa por similaridade semântica — pressione Enter ou clique",emptyTitle:"Pesquise na sua memória de IA",emptyNoResults:"Nenhuma memória encontrada",emptyHint:"Digite uma frase para encontrar habilidades, conversas e arquivos semanticamente similares.",emptyNoResultsHint:"Tente uma frase diferente ou indexe mais conteúdo usando os controles acima.",refreshStats:"Atualizar estatísticas",indexControls:"Controles de índice",vectors:"vetores",skills:"habilidades",files:"arquivos",indexed:"Indexado",indexCleared:"Índice limpo",opFailed:"Operação falhou",reqError:"Erro de requisição"},plugins:{title:"Arquiteto de plugins",newPlugin:"Novo plugin",buildTitle:"Criar novo plugin",namePlaceholder:"Nome do plugin (ex.: weather-monitor)",goalPlaceholder:"Objetivo (ex.: consultar a API OpenWeather a cada 5 min)",contextPlaceholder:"Contexto / notas opcionais",generatePlugin:"Gerar plugin",emptyTitle:"Nenhum plugin instalado",emptyHint:"Clique em «Novo plugin» para gerar seu primeiro plugin.",installed:"instalado",running:"EM EXECUÇÃO",stop:"Parar",run:"Executar",opFailed:"Operação falhou",reqError:"Erro de requisição",buildFailed:"Falha na compilação",refresh:"Atualizar"},skills:{title:"Biblioteca de habilidades",loading:"Carregando habilidades…",emptyTitle:"Nenhuma habilidade salva ainda",emptyHint:"Conclua um fluxo de trabalho na aba Conversa, depois clique em",saveAsSkill:"Salvar como habilidade",emptyHint2:"para construir sua biblioteca.",runningStatus:"Executando habilidade…",completedStatus:"Habilidade concluída",failedStatus:"Falha na execução",never:"Nunca",deleteConfirm:"Excluir?",yes:"Sim",no:"Não",runBtn:"Executar",runningBtn:"Executando…",doneBtn:"Concluído",lastRun:"última execução"},settings:{title:"Configurações",hardwareScore:"Pontuação de hardware",searchPlaceholder:"Pesquisar provedores…",allProviders:"Todos",apiKey:"Chave API",baseUrl:"URL base",model:"Modelo",testConnection:"Testar conexão",save:"Salvar",testOk:"Conexão bem-sucedida",testFail:"Falha na conexão",saved:"Salvo",saving:"Salvando…",testing:"Testando…",apiKeyWarning:"Chave API necessária — atualize sua chave para continuar."}}},nc={en:d1,tr:o4,de:l4,fr:c4,es:u4,ja:d4,zh:h4,pt:p4},h1=f.createContext({locale:"en",t:d1,setLocale:()=>{}});function f4({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=f.useState(t&&t in nc?t:"en"),i=a=>{s(a);try{localStorage.setItem("mustb-lang",a)}catch{}fetch("/api/settings/language",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{})};return f.useEffect(()=>{fetch("/api/setup/status").then(a=>a.ok?a.json():null).then(a=>{if(!(a!=null&&a.activeLanguage))return;const o=a.activeLanguage;if(o in nc&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(h1.Provider,{value:{locale:n,t:nc[n],setLocale:i},children:e})}const ht=()=>f.useContext(h1);function xm(){const e=hn(),{t}=ht(),[n,s]=f.useState("sleeping"),i=async()=>{if(n==="sleeping"){s("exiting");try{const a=await fetch("/api/setup/status");if(a.ok&&!(await a.json()).configured){e("/setup",{replace:!0});return}await fetch("/api/auth/local").catch(()=>{})}catch{}setTimeout(()=>e("/app/chat",{replace:!0}),450)}};return r.jsxs("div",{className:"relative min-h-screen overflow-hidden flex flex-col",children:[r.jsx(ee,{children:n==="sleeping"&&r.jsxs($.div,{className:"fixed inset-0 z-40 flex flex-col items-center justify-center",initial:{opacity:1},exit:{opacity:0,filter:"blur(24px)"},transition:{duration:.65,ease:"easeInOut"},children:[r.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/avatar/sleep.png)"}}),r.jsx("div",{className:"absolute inset-0 bg-black/55"}),r.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 px-6",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx($.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(al,{size:20,className:"text-orange-400/70"})}),r.jsx("span",{className:"text-white/30 text-sm font-semibold tracking-widest uppercase select-none",children:"Must-b"})]}),r.jsxs($.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
666
+ */const Re=L("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),c1={welcome:{tagline:"Your AI Brain",title:"Must-b",sleeping:"Sleeping...",waking:"Waking up...",awake:"Awakening...",wakeBtn:"Wake Must-b",wakeHint:"Tap to continue",reconfigure:"Reconfigure",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"New Chat",recentChats:"Recent Chats",primary:"Primary",personalization:"Personalization",platform:"Platform",system:"System",automations:"My Automations",activeWorkflows:"Active Workflows",products:"Skills & Plugins",clients:"Client Management",integrations:"Integrations",logs:"Logs & Activity",settings:"Settings",logout:"Logout",poweredBy:"Powered by",deleteChat:"Delete Chat?",deleteConfirm:"This action cannot be undone.",cancel:"Cancel",delete:"Delete"},rightPanel:{agentRole:"Agent Role",hardware:"Hardware Score",model:"Active Model",connected:"Gateway Connected",rank:{master:"Master",planner:"Planner",worker:"Worker"}},workflow:{title:"Active Workflow",idle:"Idle — awaiting task",goal:"Goal",steps:{browse:"Opening browser",write:"Writing file",think:"Thinking",exec:"Executing command"}},dashboard:{placeholder:"Send a message to Must-b...",thinking:"Must-b is thinking..."},layout:{chats:"Chats",system:"System",openChats:"Open chat history",openSystem:"Open system panel",closePanel:"Close panel"},chat:{inputPlaceholder:"Ask Must-b anything…",listening:"Listening…",thoughtProcess:"Thought Process",saveAsSkill:"Save as Skill",skillSaved:"Skill saved to your library!",saving:"Saving…",retry:"Retry",save:"Save",guidance:"Guidance",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation",settingsAck:"Got it, settings updated permanently.",professionAck:"I've completed the necessary research on your profession and noted it in my mind (must-b.md). I'm now ready as your **{profession}** assistant."},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys",skills:"Skills",plugins:"Plugins",mind:"Must-b Mind"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I'm listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Files",browser:"Browser",skills:"Skills",memory:"Memory",plugins:"Plugins",workflows:"Workflows",settings:"Settings",system:"System",close:"Close",cat_webTools:"Web Tools",cat_fileMedia:"File & Media",cat_aiAgents:"AI & Agents",cat_systemTools:"System Tools",skill_webSearch:"Web Search",skill_webFetch:"Web Fetch",skill_browserControl:"Browser Control",skill_pdfReader:"PDF Reader",skill_imageAnalysis:"Image Analysis",skill_imageGeneration:"Image Generation",skill_tts:"Text-to-Speech",skill_spawnAgent:"Spawn Sub-Agent",skill_agentSessions:"Agent Sessions",skill_canvas:"Canvas",skill_git:"Git Operations",skill_gateway:"Gateway",skill_fileManager:"File Manager",skill_cron:"Cron Scheduler",skill_messages:"Messages",desc_webSearch:"Real-time web search (multi-provider)",desc_webFetch:"Fetch any URL as clean text",desc_browserControl:"Full Playwright browser automation",desc_pdfReader:"Extract & analyse PDF documents",desc_imageAnalysis:"Describe and analyse images",desc_imageGeneration:"Create AI-generated images",desc_tts:"Convert text to natural speech",desc_spawnAgent:"Launch a new autonomous agent session",desc_agentSessions:"List and manage active sessions",desc_canvas:"Visual drawing & whiteboard workspace",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Inter-system & A2A communication",desc_fileManager:"Read, write & manage files",desc_cron:"Schedule recurring tasks",desc_messages:"Send & receive inter-agent messages",cat_knowledgeBase:"Knowledge Base",cat_personalOrg:"Personal Organisation",mem_browse:"Browse Memories",mem_search:"Search Memory",mem_add:"Add Memory",mem_contacts:"Contacts",mem_calendar:"Calendar",desc_memBrowse:"View all stored knowledge entries",desc_memSearch:"Semantic search across your KB",desc_memAdd:"Store new facts and knowledge",desc_contacts:"Manage people and organisations",desc_calendar:"Schedule and manage events",cat_pluginManager:"Plugin Manager",cat_developer:"Developer",plug_marketplace:"Marketplace",plug_installed:"Installed",plug_mcp:"MCP Servers",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"CLI Commands",desc_marketplace:"Discover plugins on ClawHub",desc_installed:"Manage and configure installed plugins",desc_mcp:"Model Context Protocol integrations",desc_bundleMcp:"Package & deploy MCP tool bundles",desc_cliCmds:"Custom slash command registration",cat_automation:"Automation",cat_advanced:"Advanced",wf_automations:"Automations",wf_scheduled:"Scheduled Tasks",wf_commands:"Commands",wf_nodes:"Nodes Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Build and run automated workflows",desc_scheduled:"Manage all cron schedules",desc_commands:"Custom slash commands",desc_nodes:"Visual node-graph pipelines",desc_multiAgent:"Orchestrate agent collaboration"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",moreModels:"More Models / API Settings",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},alerts:{cpu_high:"High CPU usage — LLM load is saturating the system.",ram_high:"High memory usage — performance may degrade.",ram_critical:"Memory critical — system lockup risk."},recommendations:{cpu_high:"Close background processes or switch to a smaller model.",ram_high:"Consider switching to a lighter model.",ram_critical:"Switch to an 8B or 14B model immediately."}},panels:{memory:{title:"Memory Insights",indexLabel:"Index:",clearIndex:"Clear Index",searchPlaceholder:"Search your memory…",searchHint:"Semantic similarity search — press Enter or click",emptyTitle:"Search your AI memory",emptyNoResults:"No memories found",emptyHint:"Type a phrase to find semantically similar skills, conversations, and workspace files.",emptyNoResultsHint:"Try a different phrase or index more content using the controls above.",refreshStats:"Refresh stats",indexControls:"Index controls",vectors:"vectors",skills:"skills",files:"files",indexed:"Indexed",indexCleared:"Index cleared",opFailed:"Operation failed",reqError:"Request error"},plugins:{title:"Plugin Architect",newPlugin:"New Plugin",buildTitle:"Build New Plugin",namePlaceholder:"Plugin name (e.g. weather-monitor)",goalPlaceholder:"Goal (e.g. poll OpenWeather API every 5 min)",contextPlaceholder:"Optional context / notes",generatePlugin:"Generate Plugin",emptyTitle:"No plugins installed",emptyHint:'Click "New Plugin" to generate your first plugin.',installed:"installed",running:"RUNNING",stop:"Stop",run:"Run",opFailed:"Operation failed",reqError:"Request error",buildFailed:"Build failed",refresh:"Refresh"},skills:{title:"Skill Library",loading:"Loading skills…",emptyTitle:"No skills saved yet",emptyHint:"Complete a workflow in the Chat tab, then click",saveAsSkill:"Save as Skill",emptyHint2:"to build your library.",runningStatus:"Running skill…",completedStatus:"Skill completed",failedStatus:"Skill run failed",never:"Never",deleteConfirm:"Delete?",yes:"Yes",no:"No",runBtn:"Run",runningBtn:"Running…",doneBtn:"Done",lastRun:"last run"},settings:{title:"Settings",hardwareScore:"Hardware Score",searchPlaceholder:"Search providers…",allProviders:"All",apiKey:"API Key",baseUrl:"Base URL",model:"Model",testConnection:"Test Connection",save:"Save",testOk:"Connection successful",testFail:"Connection failed",saved:"Saved",saving:"Saving…",testing:"Testing…",apiKeyWarning:"API key required — update your key to continue."}}},i4={welcome:{tagline:"Yapay Zeka Beyniniz",title:"Must-b",sleeping:"Uyuyor...",waking:"Uyandırılıyor...",awake:"Uyanıyor...",wakeBtn:"Must-b'yi Uyandır",wakeHint:"Devam etmek için uyandır",reconfigure:"Yeniden Yapılandır",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Yeni Sohbet",recentChats:"Son Sohbetler",primary:"Birincil",personalization:"Kişiselleştirme",platform:"Platform",system:"Sistem",automations:"Otomasyonlarım",activeWorkflows:"Aktif İş Akışları",products:"Araçlar & Eklentiler",clients:"Müşteri Yönetimi",integrations:"Entegrasyonlar",logs:"Kayıtlar & Aktivite",settings:"Ayarlar",logout:"Çıkış",poweredBy:"Altyapısı:",deleteChat:"Sohbet Silinsin mi?",deleteConfirm:"Bu işlem geri alınamaz.",cancel:"İptal",delete:"Sil"},rightPanel:{agentRole:"Ajan Rolü",hardware:"Donanım Puanı",model:"Aktif Model",connected:"Gateway Bağlı",rank:{master:"Usta",planner:"Planlayıcı",worker:"İşçi"}},workflow:{title:"Aktif İş Akışı",idle:"Boşta — görev bekleniyor",goal:"Hedef",steps:{browse:"Tarayıcı açılıyor",write:"Dosya yazılıyor",think:"Düşünülüyor",exec:"Komut çalıştırılıyor"}},dashboard:{placeholder:"Must-b'ye bir mesaj gönderin...",thinking:"Must-b düşünüyor..."},layout:{chats:"Sohbetler",system:"Sistem",openChats:"Sohbet geçmişini aç",openSystem:"Sistem panelini aç",closePanel:"Paneli kapat"},chat:{inputPlaceholder:"Must-b'ye her şeyi sorun…",listening:"Dinleniyor…",thoughtProcess:"Düşünce Süreci",saveAsSkill:"Beceri Olarak Kaydet",skillSaved:"Beceri kütüphanenize kaydedildi!",saving:"Kaydediliyor…",retry:"Tekrar Dene",save:"Kaydet",guidance:"Rehberlik",errorBoundary:"Sohbet render hatası — yeniden yükleniyor…",disclaimer:"Must-b bilişsel bir asistandır; kritik çıktıları doğrulamanız önerilir.",placeholder:"Ne öğrenmek istiyorsunuz?",tools:"Araçlar",attachFile:"Dosya ekle",startDictation:"Sesli giriş başlat",stopDictation:"Durdur",settingsAck:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",professionAck:"Mesleğiniz hakkında gerekli araştırmaları yaptım ve zihnime (must-b.md) not aldım. Artık bir **{profession}** asistanı olarak hazırım."},nav:{chat:"Sohbet",browser:"Tarayıcı",workflows:"İş Akışları",voice:"Sesli",settings:"Ayarlar",files:"Dosyalar",memory:"Bellek",apiKeys:"API Anahtarları",skills:"Beceriler",plugins:"Eklentiler",mind:"Must-b Zihni"},voice:{title:"Must-b Sesli Komuta",back:"Geri Dön",wakeHint:'"Hey Must-b" demeyi dene.',tapHint:"Başlamak için mikrofona dokunun.",heard:"Sizi duyuyorum…",listening:"Dinleniyor…",stopHint:"Durdurmak için tıklayın",thinking:"İşleniyor…",cmdHint:"Buyurun, dinliyorum…",speakingHint:"Must-b konuşuyor…"},systemHealth:{lite:"LITE",safe:"GÜVENLİ",critical:"Kritik",warning:"Uyarı",info:"Bilgi",title:"Sistem Durumu",moreModels:"Daha Fazla Model / API Ayarları",kinds:{cpu:"İşlemci",ram:"RAM",memory:"Bellek",storage:"Depolama",network:"Ağ",process:"İşlem",battery:"Batarya",thermal:"Isı",disk:"Disk"},alerts:{cpu_high:"İşlemci kullanımı yüksek — LLM yükü sistemi doyuruyor.",ram_high:"Bellek kullanımı yüksek — performans düşebilir.",ram_critical:"Bellek kritik — sistem kilitlenme riski var."},recommendations:{cpu_high:"Arka plan işlemlerini kapatın veya daha küçük bir modele geçin.",ram_high:"Daha hafif bir modele geçmeyi düşünün.",ram_critical:"Hemen 8B veya 14B bir modele geçin."}},dock:{chat:"Sohbet",files:"Dosyalar",browser:"Tarayıcı",skills:"Beceriler",memory:"Bellek",plugins:"Eklentiler",workflows:"İş Akışları",settings:"Ayarlar",system:"Sistem",close:"Kapat",cat_webTools:"Web Araçları",cat_fileMedia:"Dosya & Medya",cat_aiAgents:"Yapay Zeka & Ajanlar",cat_systemTools:"Sistem Araçları",skill_webSearch:"Web Arama",skill_webFetch:"Web Çekme",skill_browserControl:"Tarayıcı Kontrolü",skill_pdfReader:"PDF Okuyucu",skill_imageAnalysis:"Görüntü Analizi",skill_imageGeneration:"Görüntü Oluşturma",skill_tts:"Metinden Sese",skill_spawnAgent:"Alt Ajan Başlat",skill_agentSessions:"Ajan Oturumları",skill_canvas:"Tuval",skill_git:"Git İşlemleri",skill_gateway:"Ağ Geçidi",skill_fileManager:"Dosya Yöneticisi",skill_cron:"Zamanlayıcı",skill_messages:"Mesajlar",desc_webSearch:"Gerçek zamanlı web araması (çoklu sağlayıcı)",desc_webFetch:"Herhangi bir URL'yi metin olarak çek",desc_browserControl:"Tam Playwright tarayıcı otomasyonu",desc_pdfReader:"PDF belgelerini çıkar ve analiz et",desc_imageAnalysis:"Görüntüleri tanımla ve analiz et",desc_imageGeneration:"Yapay zeka ile görüntü oluştur",desc_tts:"Metni doğal sese dönüştür",desc_spawnAgent:"Yeni özerk ajan oturumu başlat",desc_agentSessions:"Aktif oturumları listele ve yönet",desc_canvas:"Görsel çizim & beyaz tahta",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Sistemler arası & A2A iletişim",desc_fileManager:"Dosyaları oku, yaz ve yönet",desc_cron:"Tekrarlayan görevleri zamanla",desc_messages:"Ajanlar arası mesaj gönder ve al",cat_knowledgeBase:"Bilgi Tabanı",cat_personalOrg:"Kişisel Organizasyon",mem_browse:"Belleklere Göz At",mem_search:"Bellekte Ara",mem_add:"Bellek Ekle",mem_contacts:"Kişiler",mem_calendar:"Takvim",desc_memBrowse:"Tüm saklanan bilgi girişlerini görüntüle",desc_memSearch:"Bilgi tabanında anlamsal arama",desc_memAdd:"Yeni bilgi ve gerçekleri sakla",desc_contacts:"Kişileri ve kuruluşları yönet",desc_calendar:"Etkinlikleri zamanla ve yönet",cat_pluginManager:"Eklenti Yöneticisi",cat_developer:"Geliştirici",plug_marketplace:"Pazar Yeri",plug_installed:"Yüklü Eklentiler",plug_mcp:"MCP Sunucuları",plug_bundleMcp:"MCP Paketi",plug_cliCmds:"CLI Komutları",desc_marketplace:"ClawHub'da eklentileri keşfet",desc_installed:"Yüklü eklentileri yönet ve yapılandır",desc_mcp:"Model Context Protocol entegrasyonları",desc_bundleMcp:"MCP araç paketlerini oluştur ve dağıt",desc_cliCmds:"Özel eğik çizgi komutları kaydı",cat_automation:"Otomasyon",cat_advanced:"Gelişmiş",wf_automations:"Otomasyonlar",wf_scheduled:"Zamanlanmış Görevler",wf_commands:"Komutlar",wf_nodes:"Düğüm İş Akışı",wf_multiAgent:"Çoklu Ajan",desc_automations:"Otomatik iş akışları oluştur ve çalıştır",desc_scheduled:"Tüm cron zamanlamalarını yönet",desc_commands:"Özel eğik çizgi komutları",desc_nodes:"Görsel düğüm-grafik iş hatları",desc_multiAgent:"Ajan işbirliğini düzenle"},panels:{memory:{title:"Bellek Görüşleri",indexLabel:"İndeks:",clearIndex:"İndeksi Temizle",searchPlaceholder:"Belleğinizde arayın…",searchHint:"Anlamsal benzerlik araması — Enter'a basın veya tıklayın",emptyTitle:"Yapay Zeka Belleğinizi Arayın",emptyNoResults:"Bellek bulunamadı",emptyHint:"Beceriler, sohbetler ve dosyalarda anlamsal olarak benzer içerik bulmak için bir ifade yazın.",emptyNoResultsHint:"Farklı bir ifade deneyin veya yukarıdaki kontrollerle daha fazla içerik ekleyin.",refreshStats:"İstatistikleri yenile",indexControls:"İndeks kontrolleri",vectors:"vektör",skills:"beceri",files:"dosya",indexed:"İndekslendi",indexCleared:"İndeks temizlendi",opFailed:"İşlem başarısız",reqError:"İstek hatası"},plugins:{title:"Eklenti Mimarı",newPlugin:"Yeni Eklenti",buildTitle:"Yeni Eklenti Oluştur",namePlaceholder:"Eklenti adı (örn. hava-durumu-monitörü)",goalPlaceholder:"Hedef (örn. OpenWeather API'yi 5 dakikada bir sorgula)",contextPlaceholder:"İsteğe bağlı bağlam / notlar",generatePlugin:"Eklenti Oluştur",emptyTitle:"Yüklü eklenti yok",emptyHint:'İlk eklentinizi oluşturmak için "Yeni Eklenti"ye tıklayın.',installed:"yüklü",running:"ÇALIŞIYOR",stop:"Durdur",run:"Çalıştır",opFailed:"İşlem başarısız",reqError:"İstek hatası",buildFailed:"Oluşturma başarısız",refresh:"Yenile"},skills:{title:"Beceri Kütüphanesi",loading:"Beceriler yükleniyor…",emptyTitle:"Henüz kaydedilmiş beceri yok",emptyHint:"Sohbet sekmesinde bir iş akışını tamamlayın, ardından tıklayın",saveAsSkill:"Beceri Olarak Kaydet",emptyHint2:"kütüphanenizi oluşturmak için.",runningStatus:"Beceri çalışıyor…",completedStatus:"Beceri tamamlandı",failedStatus:"Beceri çalıştırma başarısız",never:"Hiçbir zaman",deleteConfirm:"Sil?",yes:"Evet",no:"Hayır",runBtn:"Çalıştır",runningBtn:"Çalışıyor…",doneBtn:"Tamamlandı",lastRun:"son çalıştırma"},settings:{title:"Ayarlar",hardwareScore:"Donanım Puanı",searchPlaceholder:"Sağlayıcı ara…",allProviders:"Tümü",apiKey:"API Anahtarı",baseUrl:"Temel URL",model:"Model",testConnection:"Bağlantıyı Test Et",save:"Kaydet",testOk:"Bağlantı başarılı",testFail:"Bağlantı başarısız",saved:"Kaydedildi",saving:"Kaydediliyor…",testing:"Test ediliyor…",apiKeyWarning:"API anahtarı gerekli — devam etmek için anahtarınızı güncelleyin."}}},a4={welcome:{tagline:"Ihr KI-Gehirn",title:"Must-b",sleeping:"Schläft...",waking:"Wird geweckt...",awake:"Erwacht...",wakeBtn:"Must-b wecken",wakeHint:"Tippen zum Fortfahren",reconfigure:"Neu konfigurieren",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"Neuer Chat",recentChats:"Letzte Chats",platform:"Plattform",system:"System",automations:"Meine Automatisierungen",activeWorkflows:"Aktive Workflows",products:"Skills & Plugins",clients:"Kundenverwaltung",integrations:"Integrationen",logs:"Protokolle & Aktivität",settings:"Einstellungen",logout:"Abmelden",poweredBy:"Betrieben von",deleteChat:"Chat löschen?",deleteConfirm:"Diese Aktion kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",delete:"Löschen"},rightPanel:{agentRole:"Agentenrolle",hardware:"Hardware-Score",model:"Aktives Modell",connected:"Gateway verbunden",rank:{master:"Meister",planner:"Planer",worker:"Arbeiter"}},workflow:{title:"Aktiver Workflow",idle:"Leerlauf — wartet auf Aufgabe",goal:"Ziel",steps:{browse:"Browser wird geöffnet",write:"Datei wird geschrieben",think:"Wird nachgedacht",exec:"Befehl wird ausgeführt"}},dashboard:{placeholder:"Nachricht an Must-b senden...",thinking:"Must-b denkt nach..."},layout:{chats:"Chats",system:"System",openChats:"Chatverlauf öffnen",openSystem:"Systembereich öffnen",closePanel:"Bereich schließen"},chat:{inputPlaceholder:"Fragen Sie Must-b alles…",listening:"Höre zu…",thoughtProcess:"Denkprozess",saveAsSkill:"Als Fähigkeit speichern",skillSaved:"Fähigkeit in Ihrer Bibliothek gespeichert!",saving:"Speichere…",retry:"Erneut versuchen",save:"Speichern",guidance:"Hinweis",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Chat",files:"Dateien",browser:"Browser",skills:"Fähigkeiten",memory:"Gedächtnis",plugins:"Plugins",workflows:"Workflows",settings:"Einstellungen",system:"System",close:"Schließen",cat_webTools:"Web-Werkzeuge",cat_fileMedia:"Datei & Medien",cat_aiAgents:"KI & Agenten",cat_systemTools:"Systemwerkzeuge",skill_webSearch:"Websuche",skill_webFetch:"Web-Abruf",skill_browserControl:"Browser-Steuerung",skill_pdfReader:"PDF-Leser",skill_imageAnalysis:"Bildanalyse",skill_imageGeneration:"Bilderzeugung",skill_tts:"Text-zu-Sprache",skill_spawnAgent:"Unteragent starten",skill_agentSessions:"Agentensitzungen",skill_canvas:"Leinwand",skill_git:"Git-Operationen",skill_gateway:"Gateway",skill_fileManager:"Dateimanager",skill_cron:"Aufgabenplaner",skill_messages:"Nachrichten",desc_webSearch:"Echtzeit-Websuche (Multi-Provider)",desc_webFetch:"Beliebige URL als sauberen Text abrufen",desc_browserControl:"Vollständige Playwright-Browserautomatisierung",desc_pdfReader:"PDF-Dokumente extrahieren & analysieren",desc_imageAnalysis:"Bilder beschreiben und analysieren",desc_imageGeneration:"KI-generierte Bilder erstellen",desc_tts:"Text in natürliche Sprache umwandeln",desc_spawnAgent:"Neue autonome Agentensitzung starten",desc_agentSessions:"Aktive Sitzungen auflisten und verwalten",desc_canvas:"Visueller Zeichen- & Whiteboard-Bereich",desc_git:"Commit, Branch, Diff, Push/Pull",desc_gateway:"Systemübergreifende & A2A-Kommunikation",desc_fileManager:"Dateien lesen, schreiben & verwalten",desc_cron:"Wiederkehrende Aufgaben planen",desc_messages:"Agenten-Nachrichten senden & empfangen",cat_knowledgeBase:"Wissensdatenbank",cat_personalOrg:"Persönliche Organisation",mem_browse:"Erinnerungen durchsuchen",mem_search:"Gedächtnis suchen",mem_add:"Erinnerung hinzufügen",mem_contacts:"Kontakte",mem_calendar:"Kalender",desc_memBrowse:"Alle gespeicherten Wissenseinträge anzeigen",desc_memSearch:"Semantische Suche in der Wissensdatenbank",desc_memAdd:"Neue Fakten und Wissen speichern",desc_contacts:"Personen und Organisationen verwalten",desc_calendar:"Termine planen und verwalten",cat_pluginManager:"Plugin-Manager",cat_developer:"Entwickler",plug_marketplace:"Marktplatz",plug_installed:"Installiert",plug_mcp:"MCP-Server",plug_bundleMcp:"MCP bündeln",plug_cliCmds:"CLI-Befehle",desc_marketplace:"Plugins auf ClawHub entdecken",desc_installed:"Installierte Plugins verwalten und konfigurieren",desc_mcp:"Model Context Protocol-Integrationen",desc_bundleMcp:"MCP-Werkzeugpakete erstellen & bereitstellen",desc_cliCmds:"Benutzerdefinierte Schrägstrichbefehle registrieren",cat_automation:"Automatisierung",cat_advanced:"Erweitert",wf_automations:"Automatisierungen",wf_scheduled:"Geplante Aufgaben",wf_commands:"Befehle",wf_nodes:"Knoten-Workflow",wf_multiAgent:"Multi-Agent",desc_automations:"Automatisierte Workflows erstellen und ausführen",desc_scheduled:"Alle Cron-Zeitpläne verwalten",desc_commands:"Benutzerdefinierte Schrägstrichbefehle",desc_nodes:"Visuelle Knoten-Graph-Pipelines",desc_multiAgent:"Agentenzusammenarbeit orchestrieren"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Gedächtnisübersicht",indexLabel:"Index:",clearIndex:"Index löschen",searchPlaceholder:"Gedächtnis durchsuchen…",searchHint:"Semantische Ähnlichkeitssuche — Enter drücken oder klicken",emptyTitle:"KI-Gedächtnis durchsuchen",emptyNoResults:"Keine Erinnerungen gefunden",emptyHint:"Geben Sie einen Begriff ein, um semantisch ähnliche Fähigkeiten, Gespräche und Dateien zu finden.",emptyNoResultsHint:"Versuchen Sie eine andere Formulierung oder indizieren Sie mehr Inhalte.",refreshStats:"Statistiken aktualisieren",indexControls:"Indexsteuerung",vectors:"Vektoren",skills:"Fähigkeiten",files:"Dateien",indexed:"Indiziert",indexCleared:"Index gelöscht",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler"},plugins:{title:"Plugin-Architekt",newPlugin:"Neues Plugin",buildTitle:"Neues Plugin erstellen",namePlaceholder:"Plugin-Name (z.B. wetter-monitor)",goalPlaceholder:"Ziel (z.B. OpenWeather API alle 5 Min. abfragen)",contextPlaceholder:"Optionaler Kontext / Notizen",generatePlugin:"Plugin generieren",emptyTitle:"Keine Plugins installiert",emptyHint:'Klicken Sie auf "Neues Plugin", um Ihr erstes Plugin zu erstellen.',installed:"installiert",running:"LÄUFT",stop:"Stoppen",run:"Ausführen",opFailed:"Vorgang fehlgeschlagen",reqError:"Anfragefehler",buildFailed:"Erstellung fehlgeschlagen",refresh:"Aktualisieren"},skills:{title:"Fähigkeitenbibliothek",loading:"Fähigkeiten werden geladen…",emptyTitle:"Noch keine Fähigkeiten gespeichert",emptyHint:"Schließen Sie einen Workflow im Chat-Tab ab, dann klicken Sie auf",saveAsSkill:"Als Fähigkeit speichern",emptyHint2:"um Ihre Bibliothek aufzubauen.",runningStatus:"Fähigkeit wird ausgeführt…",completedStatus:"Fähigkeit abgeschlossen",failedStatus:"Ausführung fehlgeschlagen",never:"Nie",deleteConfirm:"Löschen?",yes:"Ja",no:"Nein",runBtn:"Ausführen",runningBtn:"Läuft…",doneBtn:"Fertig",lastRun:"letzter Lauf"},settings:{title:"Einstellungen",hardwareScore:"Hardware-Score",searchPlaceholder:"Anbieter suchen…",allProviders:"Alle",apiKey:"API-Schlüssel",baseUrl:"Basis-URL",model:"Modell",testConnection:"Verbindung testen",save:"Speichern",testOk:"Verbindung erfolgreich",testFail:"Verbindung fehlgeschlagen",saved:"Gespeichert",saving:"Speichern…",testing:"Teste…",apiKeyWarning:"API-Schlüssel erforderlich — aktualisieren Sie Ihren Schlüssel."}}},o4={welcome:{tagline:"Votre cerveau IA",title:"Must-b",sleeping:"En veille...",waking:"Réveil en cours...",awake:"Éveil...",wakeBtn:"Réveiller Must-b",wakeHint:"Appuyez pour continuer",reconfigure:"Reconfigurer",footer:"© 2026 Must-b — Plateforme Auto Step"},sidebar:{newChat:"Nouvelle discussion",recentChats:"Discussions récentes",platform:"Plateforme",system:"Système",automations:"Mes automatisations",activeWorkflows:"Flux de travail actifs",products:"Skills & Plugins",clients:"Gestion des clients",integrations:"Intégrations",logs:"Journaux & Activité",settings:"Paramètres",logout:"Déconnexion",poweredBy:"Propulsé par",deleteChat:"Supprimer la discussion ?",deleteConfirm:"Cette action est irréversible.",cancel:"Annuler",delete:"Supprimer"},rightPanel:{agentRole:"Rôle de l'agent",hardware:"Score matériel",model:"Modèle actif",connected:"Passerelle connectée",rank:{master:"Maître",planner:"Planificateur",worker:"Exécutant"}},workflow:{title:"Flux de travail actif",idle:"Inactif — en attente d'une tâche",goal:"Objectif",steps:{browse:"Ouverture du navigateur",write:"Écriture du fichier",think:"Réflexion",exec:"Exécution de la commande"}},dashboard:{placeholder:"Envoyer un message à Must-b...",thinking:"Must-b réfléchit..."},layout:{chats:"Discussions",system:"Système",openChats:"Ouvrir l'historique des discussions",openSystem:"Ouvrir le panneau système",closePanel:"Fermer le panneau"},chat:{inputPlaceholder:"Posez n'importe quelle question à Must-b…",listening:"Écoute en cours…",thoughtProcess:"Processus de réflexion",saveAsSkill:"Enregistrer comme compétence",skillSaved:"Compétence enregistrée dans votre bibliothèque !",saving:"Enregistrement…",retry:"Réessayer",save:"Enregistrer",guidance:"Conseils",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Discussion",files:"Fichiers",browser:"Navigateur",skills:"Compétences",memory:"Mémoire",plugins:"Plugins",workflows:"Flux de travail",settings:"Paramètres",system:"Système",close:"Fermer",cat_webTools:"Outils web",cat_fileMedia:"Fichiers & Médias",cat_aiAgents:"IA & Agents",cat_systemTools:"Outils système",skill_webSearch:"Recherche web",skill_webFetch:"Récupération web",skill_browserControl:"Contrôle du navigateur",skill_pdfReader:"Lecteur PDF",skill_imageAnalysis:"Analyse d'image",skill_imageGeneration:"Génération d'image",skill_tts:"Synthèse vocale",skill_spawnAgent:"Créer un sous-agent",skill_agentSessions:"Sessions d'agents",skill_canvas:"Tableau de travail",skill_git:"Opérations Git",skill_gateway:"Passerelle",skill_fileManager:"Gestionnaire de fichiers",skill_cron:"Planificateur Cron",skill_messages:"Messages",desc_webSearch:"Recherche web en temps réel (multi-fournisseur)",desc_webFetch:"Récupérer n'importe quelle URL en texte brut",desc_browserControl:"Automatisation complète du navigateur Playwright",desc_pdfReader:"Extraire et analyser des documents PDF",desc_imageAnalysis:"Décrire et analyser des images",desc_imageGeneration:"Créer des images générées par IA",desc_tts:"Convertir du texte en parole naturelle",desc_spawnAgent:"Lancer une nouvelle session d'agent autonome",desc_agentSessions:"Lister et gérer les sessions actives",desc_canvas:"Espace de dessin visuel et tableau blanc",desc_git:"Commit, branche, diff, push/pull",desc_gateway:"Communication inter-systèmes & A2A",desc_fileManager:"Lire, écrire et gérer des fichiers",desc_cron:"Planifier des tâches récurrentes",desc_messages:"Envoyer & recevoir des messages inter-agents",cat_knowledgeBase:"Base de connaissances",cat_personalOrg:"Organisation personnelle",mem_browse:"Parcourir les souvenirs",mem_search:"Rechercher dans la mémoire",mem_add:"Ajouter un souvenir",mem_contacts:"Contacts",mem_calendar:"Calendrier",desc_memBrowse:"Voir toutes les entrées de connaissances stockées",desc_memSearch:"Recherche sémantique dans votre base de connaissances",desc_memAdd:"Stocker de nouveaux faits et connaissances",desc_contacts:"Gérer les personnes et organisations",desc_calendar:"Planifier et gérer des événements",cat_pluginManager:"Gestionnaire de plugins",cat_developer:"Développeur",plug_marketplace:"Marché",plug_installed:"Installés",plug_mcp:"Serveurs MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Commandes CLI",desc_marketplace:"Découvrir des plugins sur ClawHub",desc_installed:"Gérer et configurer les plugins installés",desc_mcp:"Intégrations du protocole de contexte de modèle",desc_bundleMcp:"Empaqueter et déployer des bundles d'outils MCP",desc_cliCmds:"Enregistrement de commandes slash personnalisées",cat_automation:"Automatisation",cat_advanced:"Avancé",wf_automations:"Automatisations",wf_scheduled:"Tâches planifiées",wf_commands:"Commandes",wf_nodes:"Flux de nœuds",wf_multiAgent:"Multi-Agent",desc_automations:"Créer et exécuter des flux de travail automatisés",desc_scheduled:"Gérer tous les plannings cron",desc_commands:"Commandes slash personnalisées",desc_nodes:"Pipelines visuels en graphe de nœuds",desc_multiAgent:"Orchestrer la collaboration entre agents"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Aperçus de la mémoire",indexLabel:"Index :",clearIndex:"Effacer l'index",searchPlaceholder:"Rechercher dans votre mémoire…",searchHint:"Recherche par similarité sémantique — appuyez sur Entrée ou cliquez",emptyTitle:"Recherchez dans votre mémoire IA",emptyNoResults:"Aucun souvenir trouvé",emptyHint:"Saisissez une phrase pour trouver des compétences, conversations et fichiers sémantiquement similaires.",emptyNoResultsHint:"Essayez une phrase différente ou indexez plus de contenu via les contrôles ci-dessus.",refreshStats:"Actualiser les statistiques",indexControls:"Contrôles de l'index",vectors:"vecteurs",skills:"compétences",files:"fichiers",indexed:"Indexé",indexCleared:"Index effacé",opFailed:"Opération échouée",reqError:"Erreur de requête"},plugins:{title:"Architecte de plugins",newPlugin:"Nouveau plugin",buildTitle:"Créer un nouveau plugin",namePlaceholder:"Nom du plugin (ex. weather-monitor)",goalPlaceholder:"Objectif (ex. interroger l'API OpenWeather toutes les 5 min)",contextPlaceholder:"Contexte / notes optionnels",generatePlugin:"Générer le plugin",emptyTitle:"Aucun plugin installé",emptyHint:"Cliquez sur « Nouveau plugin » pour générer votre premier plugin.",installed:"installé",running:"EN COURS",stop:"Arrêter",run:"Exécuter",opFailed:"Opération échouée",reqError:"Erreur de requête",buildFailed:"Échec de la compilation",refresh:"Actualiser"},skills:{title:"Bibliothèque de compétences",loading:"Chargement des compétences…",emptyTitle:"Aucune compétence enregistrée",emptyHint:"Terminez un flux de travail dans l'onglet Discussion, puis cliquez sur",saveAsSkill:"Enregistrer comme compétence",emptyHint2:"pour constituer votre bibliothèque.",runningStatus:"Exécution de la compétence…",completedStatus:"Compétence terminée",failedStatus:"Échec de l'exécution",never:"Jamais",deleteConfirm:"Supprimer ?",yes:"Oui",no:"Non",runBtn:"Exécuter",runningBtn:"En cours…",doneBtn:"Terminé",lastRun:"dernière exécution"},settings:{title:"Paramètres",hardwareScore:"Score matériel",searchPlaceholder:"Rechercher des fournisseurs…",allProviders:"Tous",apiKey:"Clé API",baseUrl:"URL de base",model:"Modèle",testConnection:"Tester la connexion",save:"Enregistrer",testOk:"Connexion réussie",testFail:"Échec de la connexion",saved:"Enregistré",saving:"Enregistrement…",testing:"Test en cours…",apiKeyWarning:"Clé API requise — mettez à jour votre clé pour continuer."}}},l4={welcome:{tagline:"Tu cerebro de IA",title:"Must-b",sleeping:"Durmiendo...",waking:"Despertando...",awake:"Despertando...",wakeBtn:"Despertar Must-b",wakeHint:"Toca para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nueva conversación",recentChats:"Conversaciones recientes",platform:"Plataforma",system:"Sistema",automations:"Mis automatizaciones",activeWorkflows:"Flujos de trabajo activos",products:"Skills & Plugins",clients:"Gestión de clientes",integrations:"Integraciones",logs:"Registros y actividad",settings:"Configuración",logout:"Cerrar sesión",poweredBy:"Desarrollado por",deleteChat:"¿Eliminar conversación?",deleteConfirm:"Esta acción no se puede deshacer.",cancel:"Cancelar",delete:"Eliminar"},rightPanel:{agentRole:"Rol del agente",hardware:"Puntuación de hardware",model:"Modelo activo",connected:"Puerta de enlace conectada",rank:{master:"Maestro",planner:"Planificador",worker:"Trabajador"}},workflow:{title:"Flujo de trabajo activo",idle:"Inactivo — esperando tarea",goal:"Objetivo",steps:{browse:"Abriendo navegador",write:"Escribiendo archivo",think:"Pensando",exec:"Ejecutando comando"}},dashboard:{placeholder:"Envía un mensaje a Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversaciones",system:"Sistema",openChats:"Abrir historial de conversaciones",openSystem:"Abrir panel del sistema",closePanel:"Cerrar panel"},chat:{inputPlaceholder:"Pregunta cualquier cosa a Must-b…",listening:"Escuchando…",thoughtProcess:"Proceso de pensamiento",saveAsSkill:"Guardar como habilidad",skillSaved:"¡Habilidad guardada en tu biblioteca!",saving:"Guardando…",retry:"Reintentar",save:"Guardar",guidance:"Orientación",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversación",files:"Archivos",browser:"Navegador",skills:"Habilidades",memory:"Memoria",plugins:"Plugins",workflows:"Flujos de trabajo",settings:"Configuración",system:"Sistema",close:"Cerrar",cat_webTools:"Herramientas web",cat_fileMedia:"Archivos y medios",cat_aiAgents:"IA y agentes",cat_systemTools:"Herramientas del sistema",skill_webSearch:"Búsqueda web",skill_webFetch:"Recuperación web",skill_browserControl:"Control del navegador",skill_pdfReader:"Lector de PDF",skill_imageAnalysis:"Análisis de imagen",skill_imageGeneration:"Generación de imágenes",skill_tts:"Texto a voz",skill_spawnAgent:"Crear subagente",skill_agentSessions:"Sesiones de agentes",skill_canvas:"Lienzo",skill_git:"Operaciones Git",skill_gateway:"Puerta de enlace",skill_fileManager:"Gestor de archivos",skill_cron:"Planificador Cron",skill_messages:"Mensajes",desc_webSearch:"Búsqueda web en tiempo real (multi-proveedor)",desc_webFetch:"Obtener cualquier URL como texto limpio",desc_browserControl:"Automatización completa del navegador con Playwright",desc_pdfReader:"Extraer y analizar documentos PDF",desc_imageAnalysis:"Describir y analizar imágenes",desc_imageGeneration:"Crear imágenes generadas por IA",desc_tts:"Convertir texto en habla natural",desc_spawnAgent:"Iniciar una nueva sesión de agente autónomo",desc_agentSessions:"Listar y gestionar sesiones activas",desc_canvas:"Espacio de dibujo visual y pizarra",desc_git:"Commit, rama, diff, push/pull",desc_gateway:"Comunicación entre sistemas y A2A",desc_fileManager:"Leer, escribir y gestionar archivos",desc_cron:"Programar tareas recurrentes",desc_messages:"Enviar y recibir mensajes entre agentes",cat_knowledgeBase:"Base de conocimientos",cat_personalOrg:"Organización personal",mem_browse:"Explorar recuerdos",mem_search:"Buscar en memoria",mem_add:"Agregar recuerdo",mem_contacts:"Contactos",mem_calendar:"Calendario",desc_memBrowse:"Ver todas las entradas de conocimiento almacenadas",desc_memSearch:"Búsqueda semántica en tu base de conocimientos",desc_memAdd:"Almacenar nuevos hechos y conocimientos",desc_contacts:"Gestionar personas y organizaciones",desc_calendar:"Programar y gestionar eventos",cat_pluginManager:"Gestor de plugins",cat_developer:"Desarrollador",plug_marketplace:"Mercado",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descubrir plugins en ClawHub",desc_installed:"Gestionar y configurar plugins instalados",desc_mcp:"Integraciones del Protocolo de Contexto de Modelo",desc_bundleMcp:"Empaquetar y desplegar bundles de herramientas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automatización",cat_advanced:"Avanzado",wf_automations:"Automatizaciones",wf_scheduled:"Tareas programadas",wf_commands:"Comandos",wf_nodes:"Flujo de nodos",wf_multiAgent:"Multi-Agente",desc_automations:"Crear y ejecutar flujos de trabajo automatizados",desc_scheduled:"Gestionar todos los programas cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuales en grafo de nodos",desc_multiAgent:"Orquestar la colaboración entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Perspectivas de memoria",indexLabel:"Índice:",clearIndex:"Limpiar índice",searchPlaceholder:"Buscar en tu memoria…",searchHint:"Búsqueda por similitud semántica — presiona Enter o haz clic",emptyTitle:"Busca en tu memoria de IA",emptyNoResults:"No se encontraron recuerdos",emptyHint:"Escribe una frase para encontrar habilidades, conversaciones y archivos semánticamente similares.",emptyNoResultsHint:"Prueba una frase diferente o indexa más contenido usando los controles de arriba.",refreshStats:"Actualizar estadísticas",indexControls:"Controles de índice",vectors:"vectores",skills:"habilidades",files:"archivos",indexed:"Indexado",indexCleared:"Índice limpiado",opFailed:"Operación fallida",reqError:"Error de solicitud"},plugins:{title:"Arquitecto de plugins",newPlugin:"Nuevo plugin",buildTitle:"Crear nuevo plugin",namePlaceholder:"Nombre del plugin (ej. weather-monitor)",goalPlaceholder:"Objetivo (ej. consultar la API OpenWeather cada 5 min)",contextPlaceholder:"Contexto / notas opcionales",generatePlugin:"Generar plugin",emptyTitle:"No hay plugins instalados",emptyHint:"Haz clic en «Nuevo plugin» para generar tu primer plugin.",installed:"instalado",running:"EN EJECUCIÓN",stop:"Detener",run:"Ejecutar",opFailed:"Operación fallida",reqError:"Error de solicitud",buildFailed:"Error de compilación",refresh:"Actualizar"},skills:{title:"Biblioteca de habilidades",loading:"Cargando habilidades…",emptyTitle:"No hay habilidades guardadas aún",emptyHint:"Completa un flujo de trabajo en la pestaña Conversación, luego haz clic en",saveAsSkill:"Guardar como habilidad",emptyHint2:"para construir tu biblioteca.",runningStatus:"Ejecutando habilidad…",completedStatus:"Habilidad completada",failedStatus:"Fallo en la ejecución",never:"Nunca",deleteConfirm:"¿Eliminar?",yes:"Sí",no:"No",runBtn:"Ejecutar",runningBtn:"Ejecutando…",doneBtn:"Listo",lastRun:"última ejecución"},settings:{title:"Configuración",hardwareScore:"Puntuación de hardware",searchPlaceholder:"Buscar proveedores…",allProviders:"Todos",apiKey:"Clave API",baseUrl:"URL base",model:"Modelo",testConnection:"Probar conexión",save:"Guardar",testOk:"Conexión exitosa",testFail:"Conexión fallida",saved:"Guardado",saving:"Guardando…",testing:"Probando…",apiKeyWarning:"Clave API requerida — actualiza tu clave para continuar."}}},c4={welcome:{tagline:"あなたのAIブレイン",title:"Must-b",sleeping:"スリープ中...",waking:"起動中...",awake:"覚醒中...",wakeBtn:"Must-bを起動",wakeHint:"タップして続行",reconfigure:"再設定",footer:"© 2026 Must-b — Auto Step Platform"},sidebar:{newChat:"新しいチャット",recentChats:"最近のチャット",platform:"プラットフォーム",system:"システム",automations:"マイオートメーション",activeWorkflows:"アクティブなワークフロー",products:"スキル & プラグイン",clients:"クライアント管理",integrations:"インテグレーション",logs:"ログ・アクティビティ",settings:"設定",logout:"ログアウト",poweredBy:"提供:",deleteChat:"チャットを削除しますか?",deleteConfirm:"この操作は元に戻せません。",cancel:"キャンセル",delete:"削除"},rightPanel:{agentRole:"エージェントの役割",hardware:"ハードウェアスコア",model:"アクティブモデル",connected:"ゲートウェイ接続済み",rank:{master:"マスター",planner:"プランナー",worker:"ワーカー"}},workflow:{title:"アクティブなワークフロー",idle:"待機中 — タスクを待っています",goal:"目標",steps:{browse:"ブラウザを開いています",write:"ファイルを書き込んでいます",think:"考えています",exec:"コマンドを実行しています"}},dashboard:{placeholder:"Must-bにメッセージを送信...",thinking:"Must-bが考えています..."},layout:{chats:"チャット",system:"システム",openChats:"チャット履歴を開く",openSystem:"システムパネルを開く",closePanel:"パネルを閉じる"},chat:{inputPlaceholder:"Must-bに何でも聞いてください…",listening:"聞いています…",thoughtProcess:"思考プロセス",saveAsSkill:"スキルとして保存",skillSaved:"スキルがライブラリに保存されました!",saving:"保存中…",retry:"再試行",save:"保存",guidance:"ガイダンス",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"チャット",files:"ファイル",browser:"ブラウザ",skills:"スキル",memory:"メモリ",plugins:"プラグイン",workflows:"ワークフロー",settings:"設定",system:"システム",close:"閉じる",cat_webTools:"ウェブツール",cat_fileMedia:"ファイル・メディア",cat_aiAgents:"AI・エージェント",cat_systemTools:"システムツール",skill_webSearch:"ウェブ検索",skill_webFetch:"ウェブ取得",skill_browserControl:"ブラウザ制御",skill_pdfReader:"PDFリーダー",skill_imageAnalysis:"画像分析",skill_imageGeneration:"画像生成",skill_tts:"テキスト読み上げ",skill_spawnAgent:"サブエージェント作成",skill_agentSessions:"エージェントセッション",skill_canvas:"キャンバス",skill_git:"Git操作",skill_gateway:"ゲートウェイ",skill_fileManager:"ファイルマネージャー",skill_cron:"Cronスケジューラー",skill_messages:"メッセージ",desc_webSearch:"リアルタイムウェブ検索(マルチプロバイダー)",desc_webFetch:"任意のURLをクリーンなテキストとして取得",desc_browserControl:"Playwrightによる完全なブラウザ自動化",desc_pdfReader:"PDFドキュメントの抽出と分析",desc_imageAnalysis:"画像の説明と分析",desc_imageGeneration:"AI生成画像の作成",desc_tts:"テキストを自然な音声に変換",desc_spawnAgent:"新しい自律エージェントセッションを起動",desc_agentSessions:"アクティブセッションの一覧と管理",desc_canvas:"ビジュアル描画・ホワイトボードワークスペース",desc_git:"コミット、ブランチ、差分、プッシュ/プル",desc_gateway:"システム間・A2A通信",desc_fileManager:"ファイルの読み取り、書き込み、管理",desc_cron:"定期タスクのスケジュール",desc_messages:"エージェント間メッセージの送受信",cat_knowledgeBase:"ナレッジベース",cat_personalOrg:"個人管理",mem_browse:"メモリを閲覧",mem_search:"メモリを検索",mem_add:"メモリを追加",mem_contacts:"連絡先",mem_calendar:"カレンダー",desc_memBrowse:"保存されたすべての知識エントリを表示",desc_memSearch:"ナレッジベース全体のセマンティック検索",desc_memAdd:"新しい事実と知識を保存",desc_contacts:"人物と組織の管理",desc_calendar:"イベントのスケジュールと管理",cat_pluginManager:"プラグインマネージャー",cat_developer:"開発者",plug_marketplace:"マーケットプレイス",plug_installed:"インストール済み",plug_mcp:"MCPサーバー",plug_bundleMcp:"MCPバンドル",plug_cliCmds:"CLIコマンド",desc_marketplace:"ClawHubでプラグインを探す",desc_installed:"インストール済みプラグインの管理と設定",desc_mcp:"モデルコンテキストプロトコル統合",desc_bundleMcp:"MCPツールバンドルのパッケージ化とデプロイ",desc_cliCmds:"カスタムスラッシュコマンドの登録",cat_automation:"自動化",cat_advanced:"高度な設定",wf_automations:"自動化",wf_scheduled:"スケジュールタスク",wf_commands:"コマンド",wf_nodes:"ノードワークフロー",wf_multiAgent:"マルチエージェント",desc_automations:"自動化されたワークフローの構築と実行",desc_scheduled:"すべてのCronスケジュールを管理",desc_commands:"カスタムスラッシュコマンド",desc_nodes:"ビジュアルノードグラフパイプライン",desc_multiAgent:"エージェント間の協調をオーケストレーション"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"メモリインサイト",indexLabel:"インデックス:",clearIndex:"インデックスをクリア",searchPlaceholder:"メモリを検索…",searchHint:"セマンティック類似性検索 — Enterキーを押すかクリック",emptyTitle:"AIメモリを検索",emptyNoResults:"メモリが見つかりません",emptyHint:"フレーズを入力して、意味的に類似したスキル、会話、ワークスペースファイルを見つけてください。",emptyNoResultsHint:"別のフレーズを試すか、上のコントロールを使ってより多くのコンテンツをインデックスしてください。",refreshStats:"統計を更新",indexControls:"インデックスコントロール",vectors:"ベクター",skills:"スキル",files:"ファイル",indexed:"インデックス済み",indexCleared:"インデックスをクリアしました",opFailed:"操作に失敗しました",reqError:"リクエストエラー"},plugins:{title:"プラグインアーキテクト",newPlugin:"新しいプラグイン",buildTitle:"新しいプラグインを作成",namePlaceholder:"プラグイン名(例:weather-monitor)",goalPlaceholder:"目標(例:5分ごとにOpenWeather APIをポーリング)",contextPlaceholder:"オプションのコンテキスト / メモ",generatePlugin:"プラグインを生成",emptyTitle:"プラグインがインストールされていません",emptyHint:"「新しいプラグイン」をクリックして最初のプラグインを生成してください。",installed:"インストール済み",running:"実行中",stop:"停止",run:"実行",opFailed:"操作に失敗しました",reqError:"リクエストエラー",buildFailed:"ビルド失敗",refresh:"更新"},skills:{title:"スキルライブラリ",loading:"スキルを読み込んでいます…",emptyTitle:"スキルがまだ保存されていません",emptyHint:"チャットタブでワークフローを完了したら、クリック",saveAsSkill:"スキルとして保存",emptyHint2:"してライブラリを構築してください。",runningStatus:"スキルを実行中…",completedStatus:"スキル完了",failedStatus:"スキルの実行に失敗しました",never:"なし",deleteConfirm:"削除しますか?",yes:"はい",no:"いいえ",runBtn:"実行",runningBtn:"実行中…",doneBtn:"完了",lastRun:"最終実行"},settings:{title:"設定",hardwareScore:"ハードウェアスコア",searchPlaceholder:"プロバイダーを検索…",allProviders:"すべて",apiKey:"APIキー",baseUrl:"ベースURL",model:"モデル",testConnection:"接続をテスト",save:"保存",testOk:"接続成功",testFail:"接続失敗",saved:"保存済み",saving:"保存中…",testing:"テスト中…",apiKeyWarning:"APIキーが必要です — 続行するにはキーを更新してください。"}}},u4={welcome:{tagline:"您的AI大脑",title:"Must-b",sleeping:"休眠中...",waking:"唤醒中...",awake:"正在觉醒...",wakeBtn:"唤醒 Must-b",wakeHint:"点击继续",reconfigure:"重新配置",footer:"© 2026 Must-b — Auto Step 平台"},sidebar:{newChat:"新建对话",recentChats:"最近对话",platform:"平台",system:"系统",automations:"我的自动化",activeWorkflows:"活跃工作流",products:"技能与插件",clients:"客户管理",integrations:"集成",logs:"日志与活动",settings:"设置",logout:"退出登录",poweredBy:"技术支持:",deleteChat:"删除对话?",deleteConfirm:"此操作无法撤销。",cancel:"取消",delete:"删除"},rightPanel:{agentRole:"代理角色",hardware:"硬件评分",model:"活跃模型",connected:"网关已连接",rank:{master:"主控",planner:"规划者",worker:"执行者"}},workflow:{title:"活跃工作流",idle:"空闲中 — 等待任务",goal:"目标",steps:{browse:"正在打开浏览器",write:"正在写入文件",think:"正在思考",exec:"正在执行命令"}},dashboard:{placeholder:"向 Must-b 发送消息...",thinking:"Must-b 正在思考..."},layout:{chats:"对话",system:"系统",openChats:"打开对话历史",openSystem:"打开系统面板",closePanel:"关闭面板"},chat:{inputPlaceholder:"向 Must-b 提问任何问题…",listening:"正在聆听…",thoughtProcess:"思考过程",saveAsSkill:"保存为技能",skillSaved:"技能已保存到您的库中!",saving:"保存中…",retry:"重试",save:"保存",guidance:"指导",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"对话",files:"文件",browser:"浏览器",skills:"技能",memory:"记忆",plugins:"插件",workflows:"工作流",settings:"设置",system:"系统",close:"关闭",cat_webTools:"网络工具",cat_fileMedia:"文件与媒体",cat_aiAgents:"AI与代理",cat_systemTools:"系统工具",skill_webSearch:"网络搜索",skill_webFetch:"网络获取",skill_browserControl:"浏览器控制",skill_pdfReader:"PDF阅读器",skill_imageAnalysis:"图像分析",skill_imageGeneration:"图像生成",skill_tts:"文字转语音",skill_spawnAgent:"创建子代理",skill_agentSessions:"代理会话",skill_canvas:"画布",skill_git:"Git操作",skill_gateway:"网关",skill_fileManager:"文件管理器",skill_cron:"Cron调度器",skill_messages:"消息",desc_webSearch:"实时网络搜索(多供应商)",desc_webFetch:"将任意URL获取为纯文本",desc_browserControl:"完整的Playwright浏览器自动化",desc_pdfReader:"提取和分析PDF文档",desc_imageAnalysis:"描述和分析图像",desc_imageGeneration:"创建AI生成的图像",desc_tts:"将文本转换为自然语音",desc_spawnAgent:"启动新的自主代理会话",desc_agentSessions:"列出并管理活跃会话",desc_canvas:"可视化绘图与白板工作区",desc_git:"提交、分支、差异、推送/拉取",desc_gateway:"系统间与A2A通信",desc_fileManager:"读取、写入和管理文件",desc_cron:"调度定期任务",desc_messages:"发送和接收代理间消息",cat_knowledgeBase:"知识库",cat_personalOrg:"个人组织",mem_browse:"浏览记忆",mem_search:"搜索记忆",mem_add:"添加记忆",mem_contacts:"联系人",mem_calendar:"日历",desc_memBrowse:"查看所有存储的知识条目",desc_memSearch:"在知识库中进行语义搜索",desc_memAdd:"存储新的事实和知识",desc_contacts:"管理人员和组织",desc_calendar:"安排和管理事件",cat_pluginManager:"插件管理器",cat_developer:"开发者",plug_marketplace:"市场",plug_installed:"已安装",plug_mcp:"MCP服务器",plug_bundleMcp:"MCP捆绑包",plug_cliCmds:"CLI命令",desc_marketplace:"在ClawHub上发现插件",desc_installed:"管理和配置已安装的插件",desc_mcp:"模型上下文协议集成",desc_bundleMcp:"打包和部署MCP工具捆绑包",desc_cliCmds:"自定义斜杠命令注册",cat_automation:"自动化",cat_advanced:"高级",wf_automations:"自动化",wf_scheduled:"计划任务",wf_commands:"命令",wf_nodes:"节点工作流",wf_multiAgent:"多代理",desc_automations:"构建和运行自动化工作流",desc_scheduled:"管理所有Cron计划",desc_commands:"自定义斜杠命令",desc_nodes:"可视化节点图管道",desc_multiAgent:"协调代理间协作"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"记忆洞察",indexLabel:"索引:",clearIndex:"清除索引",searchPlaceholder:"搜索您的记忆…",searchHint:"语义相似性搜索 — 按回车键或点击",emptyTitle:"搜索您的AI记忆",emptyNoResults:"未找到记忆",emptyHint:"输入短语以查找语义相似的技能、对话和工作区文件。",emptyNoResultsHint:"尝试不同的短语,或使用上方控件索引更多内容。",refreshStats:"刷新统计",indexControls:"索引控件",vectors:"向量",skills:"技能",files:"文件",indexed:"已索引",indexCleared:"索引已清除",opFailed:"操作失败",reqError:"请求错误"},plugins:{title:"插件架构师",newPlugin:"新建插件",buildTitle:"创建新插件",namePlaceholder:"插件名称(例:weather-monitor)",goalPlaceholder:"目标(例:每5分钟轮询OpenWeather API)",contextPlaceholder:"可选上下文 / 备注",generatePlugin:"生成插件",emptyTitle:"未安装任何插件",emptyHint:"点击「新建插件」生成您的第一个插件。",installed:"已安装",running:"运行中",stop:"停止",run:"运行",opFailed:"操作失败",reqError:"请求错误",buildFailed:"构建失败",refresh:"刷新"},skills:{title:"技能库",loading:"正在加载技能…",emptyTitle:"尚未保存任何技能",emptyHint:"在对话标签中完成工作流,然后点击",saveAsSkill:"保存为技能",emptyHint2:"来构建您的技能库。",runningStatus:"正在运行技能…",completedStatus:"技能已完成",failedStatus:"技能运行失败",never:"从未",deleteConfirm:"删除?",yes:"是",no:"否",runBtn:"运行",runningBtn:"运行中…",doneBtn:"完成",lastRun:"上次运行"},settings:{title:"设置",hardwareScore:"硬件评分",searchPlaceholder:"搜索供应商…",allProviders:"全部",apiKey:"API密钥",baseUrl:"基础URL",model:"模型",testConnection:"测试连接",save:"保存",testOk:"连接成功",testFail:"连接失败",saved:"已保存",saving:"保存中…",testing:"测试中…",apiKeyWarning:"需要API密钥 — 请更新您的密钥以继续。"}}},d4={welcome:{tagline:"Seu cérebro de IA",title:"Must-b",sleeping:"Dormindo...",waking:"Acordando...",awake:"Despertando...",wakeBtn:"Acordar Must-b",wakeHint:"Toque para continuar",reconfigure:"Reconfigurar",footer:"© 2026 Must-b — Plataforma Auto Step"},sidebar:{newChat:"Nova conversa",recentChats:"Conversas recentes",platform:"Plataforma",system:"Sistema",automations:"Minhas automações",activeWorkflows:"Fluxos de trabalho ativos",products:"Skills & Plugins",clients:"Gestão de clientes",integrations:"Integrações",logs:"Registros e atividade",settings:"Configurações",logout:"Sair",poweredBy:"Desenvolvido por",deleteChat:"Excluir conversa?",deleteConfirm:"Esta ação não pode ser desfeita.",cancel:"Cancelar",delete:"Excluir"},rightPanel:{agentRole:"Função do agente",hardware:"Pontuação de hardware",model:"Modelo ativo",connected:"Gateway conectado",rank:{master:"Mestre",planner:"Planejador",worker:"Trabalhador"}},workflow:{title:"Fluxo de trabalho ativo",idle:"Ocioso — aguardando tarefa",goal:"Objetivo",steps:{browse:"Abrindo navegador",write:"Escrevendo arquivo",think:"Pensando",exec:"Executando comando"}},dashboard:{placeholder:"Envie uma mensagem para Must-b...",thinking:"Must-b está pensando..."},layout:{chats:"Conversas",system:"Sistema",openChats:"Abrir histórico de conversas",openSystem:"Abrir painel do sistema",closePanel:"Fechar painel"},chat:{inputPlaceholder:"Pergunte qualquer coisa ao Must-b…",listening:"Ouvindo…",thoughtProcess:"Processo de pensamento",saveAsSkill:"Salvar como habilidade",skillSaved:"Habilidade salva na sua biblioteca!",saving:"Salvando…",retry:"Tentar novamente",save:"Salvar",guidance:"Orientação",errorBoundary:"Chat rendering error — reloading…",disclaimer:"Must-b is a cognitive assistant; verify critical outputs for accuracy.",placeholder:"What do you want to know?",tools:"Tools",attachFile:"Attach file",startDictation:"Start voice dictation",stopDictation:"Stop dictation"},nav:{chat:"Chat",browser:"Browser",workflows:"Workflows",voice:"Voice",settings:"Settings",files:"Files",memory:"Memory",apiKeys:"API Keys"},voice:{title:"Must-b Voice Command",back:"Go Back",wakeHint:'Say "Hey Must-b" to get started.',tapHint:"Tap the microphone to begin.",heard:"I hear you…",listening:"Listening…",stopHint:"Click to stop",thinking:"Processing…",cmdHint:"Go ahead, I am listening…",speakingHint:"Must-b is speaking…"},dock:{chat:"Conversa",files:"Arquivos",browser:"Navegador",skills:"Habilidades",memory:"Memória",plugins:"Plugins",workflows:"Fluxos de trabalho",settings:"Configurações",system:"Sistema",close:"Fechar",cat_webTools:"Ferramentas web",cat_fileMedia:"Arquivos e mídia",cat_aiAgents:"IA e agentes",cat_systemTools:"Ferramentas do sistema",skill_webSearch:"Pesquisa web",skill_webFetch:"Busca web",skill_browserControl:"Controle do navegador",skill_pdfReader:"Leitor de PDF",skill_imageAnalysis:"Análise de imagem",skill_imageGeneration:"Geração de imagens",skill_tts:"Texto para fala",skill_spawnAgent:"Criar subagente",skill_agentSessions:"Sessões de agentes",skill_canvas:"Canvas",skill_git:"Operações Git",skill_gateway:"Gateway",skill_fileManager:"Gerenciador de arquivos",skill_cron:"Agendador Cron",skill_messages:"Mensagens",desc_webSearch:"Pesquisa web em tempo real (multi-provedor)",desc_webFetch:"Buscar qualquer URL como texto limpo",desc_browserControl:"Automação completa do navegador com Playwright",desc_pdfReader:"Extrair e analisar documentos PDF",desc_imageAnalysis:"Descrever e analisar imagens",desc_imageGeneration:"Criar imagens geradas por IA",desc_tts:"Converter texto em fala natural",desc_spawnAgent:"Iniciar uma nova sessão de agente autônomo",desc_agentSessions:"Listar e gerenciar sessões ativas",desc_canvas:"Espaço de desenho visual e quadro branco",desc_git:"Commit, branch, diff, push/pull",desc_gateway:"Comunicação entre sistemas e A2A",desc_fileManager:"Ler, escrever e gerenciar arquivos",desc_cron:"Agendar tarefas recorrentes",desc_messages:"Enviar e receber mensagens entre agentes",cat_knowledgeBase:"Base de conhecimento",cat_personalOrg:"Organização pessoal",mem_browse:"Explorar memórias",mem_search:"Pesquisar memória",mem_add:"Adicionar memória",mem_contacts:"Contatos",mem_calendar:"Calendário",desc_memBrowse:"Ver todas as entradas de conhecimento armazenadas",desc_memSearch:"Pesquisa semântica na sua base de conhecimento",desc_memAdd:"Armazenar novos fatos e conhecimentos",desc_contacts:"Gerenciar pessoas e organizações",desc_calendar:"Agendar e gerenciar eventos",cat_pluginManager:"Gerenciador de plugins",cat_developer:"Desenvolvedor",plug_marketplace:"Marketplace",plug_installed:"Instalados",plug_mcp:"Servidores MCP",plug_bundleMcp:"Bundle MCP",plug_cliCmds:"Comandos CLI",desc_marketplace:"Descobrir plugins no ClawHub",desc_installed:"Gerenciar e configurar plugins instalados",desc_mcp:"Integrações do Protocolo de Contexto de Modelo",desc_bundleMcp:"Empacotar e implantar bundles de ferramentas MCP",desc_cliCmds:"Registro de comandos slash personalizados",cat_automation:"Automação",cat_advanced:"Avançado",wf_automations:"Automações",wf_scheduled:"Tarefas agendadas",wf_commands:"Comandos",wf_nodes:"Fluxo de nós",wf_multiAgent:"Multi-Agente",desc_automations:"Criar e executar fluxos de trabalho automatizados",desc_scheduled:"Gerenciar todos os agendamentos cron",desc_commands:"Comandos slash personalizados",desc_nodes:"Pipelines visuais em grafo de nós",desc_multiAgent:"Orquestrar colaboração entre agentes"},systemHealth:{lite:"LITE",safe:"SAFE",critical:"Critical",warning:"Warning",info:"Info",title:"System Health",kinds:{cpu:"CPU",ram:"RAM",memory:"Memory",storage:"Storage",network:"Network",process:"Process",battery:"Battery",thermal:"Thermal",disk:"Disk"},moreModels:"More Models / API Settings"},panels:{memory:{title:"Insights de memória",indexLabel:"Índice:",clearIndex:"Limpar índice",searchPlaceholder:"Pesquisar na sua memória…",searchHint:"Pesquisa por similaridade semântica — pressione Enter ou clique",emptyTitle:"Pesquise na sua memória de IA",emptyNoResults:"Nenhuma memória encontrada",emptyHint:"Digite uma frase para encontrar habilidades, conversas e arquivos semanticamente similares.",emptyNoResultsHint:"Tente uma frase diferente ou indexe mais conteúdo usando os controles acima.",refreshStats:"Atualizar estatísticas",indexControls:"Controles de índice",vectors:"vetores",skills:"habilidades",files:"arquivos",indexed:"Indexado",indexCleared:"Índice limpo",opFailed:"Operação falhou",reqError:"Erro de requisição"},plugins:{title:"Arquiteto de plugins",newPlugin:"Novo plugin",buildTitle:"Criar novo plugin",namePlaceholder:"Nome do plugin (ex.: weather-monitor)",goalPlaceholder:"Objetivo (ex.: consultar a API OpenWeather a cada 5 min)",contextPlaceholder:"Contexto / notas opcionais",generatePlugin:"Gerar plugin",emptyTitle:"Nenhum plugin instalado",emptyHint:"Clique em «Novo plugin» para gerar seu primeiro plugin.",installed:"instalado",running:"EM EXECUÇÃO",stop:"Parar",run:"Executar",opFailed:"Operação falhou",reqError:"Erro de requisição",buildFailed:"Falha na compilação",refresh:"Atualizar"},skills:{title:"Biblioteca de habilidades",loading:"Carregando habilidades…",emptyTitle:"Nenhuma habilidade salva ainda",emptyHint:"Conclua um fluxo de trabalho na aba Conversa, depois clique em",saveAsSkill:"Salvar como habilidade",emptyHint2:"para construir sua biblioteca.",runningStatus:"Executando habilidade…",completedStatus:"Habilidade concluída",failedStatus:"Falha na execução",never:"Nunca",deleteConfirm:"Excluir?",yes:"Sim",no:"Não",runBtn:"Executar",runningBtn:"Executando…",doneBtn:"Concluído",lastRun:"última execução"},settings:{title:"Configurações",hardwareScore:"Pontuação de hardware",searchPlaceholder:"Pesquisar provedores…",allProviders:"Todos",apiKey:"Chave API",baseUrl:"URL base",model:"Modelo",testConnection:"Testar conexão",save:"Salvar",testOk:"Conexão bem-sucedida",testFail:"Falha na conexão",saved:"Salvo",saving:"Salvando…",testing:"Testando…",apiKeyWarning:"Chave API necessária — atualize sua chave para continuar."}}},nc={en:c1,tr:i4,de:a4,fr:o4,es:l4,ja:c4,zh:u4,pt:d4},u1=f.createContext({locale:"en",t:c1,setLocale:()=>{}});function h4({children:e}){const t=typeof localStorage<"u"?localStorage.getItem("mustb-lang"):null,[n,s]=f.useState(t&&t in nc?t:"en"),i=a=>{s(a);try{localStorage.setItem("mustb-lang",a)}catch{}fetch("/api/settings/language",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:a})}).catch(()=>{})};return f.useEffect(()=>{fetch("/api/setup/status").then(a=>a.ok?a.json():null).then(a=>{if(!(a!=null&&a.activeLanguage))return;const o=a.activeLanguage;if(o in nc&&o!==n){s(o);try{localStorage.setItem("mustb-lang",o)}catch{}}}).catch(()=>{})},[]),r.jsx(u1.Provider,{value:{locale:n,t:nc[n],setLocale:i},children:e})}const ht=()=>f.useContext(u1);function xm(){const e=un(),{t}=ht(),[n,s]=f.useState("sleeping"),i=async()=>{if(n==="sleeping"){s("exiting");try{const a=await fetch("/api/setup/status");if(a.ok&&!(await a.json()).configured){e("/setup",{replace:!0});return}await fetch("/api/auth/local").catch(()=>{})}catch{}setTimeout(()=>e("/app/chat",{replace:!0}),450)}};return r.jsxs("div",{className:"relative min-h-screen overflow-hidden flex flex-col",children:[r.jsx(ee,{children:n==="sleeping"&&r.jsxs($.div,{className:"fixed inset-0 z-40 flex flex-col items-center justify-center",initial:{opacity:1},exit:{opacity:0,filter:"blur(24px)"},transition:{duration:.65,ease:"easeInOut"},children:[r.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(/avatar/sleep.png)"}}),r.jsx("div",{className:"absolute inset-0 bg-black/55"}),r.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 px-6",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx($.div,{animate:{opacity:[.5,1,.5]},transition:{duration:3,repeat:1/0,ease:"easeInOut"},children:r.jsx(al,{size:20,className:"text-orange-400/70"})}),r.jsx("span",{className:"text-white/30 text-sm font-semibold tracking-widest uppercase select-none",children:"Must-b"})]}),r.jsxs($.button,{onClick:i,disabled:n==="exiting",className:`group relative flex items-center gap-3 px-8 py-4 rounded-2xl
677
667
  bg-orange-500/15 border border-orange-500/35 text-orange-300
678
668
  backdrop-blur-md hover:bg-orange-500/25 hover:border-orange-500/60
679
- transition-all duration-300 disabled:opacity-50 select-none`,animate:{y:[0,-6,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.97},children:[r.jsx("span",{className:"text-[15px] font-bold tracking-wider",children:t.welcome.wakeBtn}),r.jsx("div",{className:"w-8 h-8 rounded-full bg-orange-500/20 border border-orange-500/40 flex items-center justify-center",children:r.jsx(wS,{size:14,className:"text-orange-400"})})]}),r.jsx("p",{className:"text-white/20 text-[11px] tracking-widest uppercase select-none",children:t.welcome.wakeHint})]})]},"sleep-screen")}),r.jsx(ee,{children:n==="exiting"&&r.jsx($.div,{className:"fixed inset-0 z-50 pointer-events-none",style:{background:"linear-gradient(180deg, #1a0802 0%, #f97316 40%, #0d0602 100%)"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.45}})})]})}function p1(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=p1(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function tt(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=p1(e))&&(s&&(s+=" "),s+=t);return s}const m4={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},g4=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],ym=[{value:"en-US",label:"English (US)"},{value:"tr-TR",label:"Türkçe"},{value:"de-DE",label:"Deutsch"},{value:"es-ES",label:"Español"},{value:"fr-FR",label:"Français"},{value:"zh-CN",label:"中文 (简体)"},{value:"ja-JP",label:"日本語"},{value:"ar-SA",label:"العربية"}],Xa=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],sc=[{id:"meta-llama/llama-4-scout:free",label:"Llama 4 Scout (Free)",desc:"Meta's latest · 10M ctx · fast & free",free:!0},{id:"nvidia/llama-3.1-nemotron-ultra-253b:free",label:"Nemotron Ultra 253B (Free)",desc:"NVIDIA's flagship open-source model — highly capable",free:!0},{id:"meta-llama/llama-4-maverick:free",label:"Llama 4 Maverick (Free)",desc:"Meta's latest Llama 4 release — free tier",free:!0},{id:"mistralai/mistral-small-3.1-24b-instruct:free",label:"Mistral Small 3.1 (Free)",desc:"Mistral's efficient 24B instruction model",free:!0},{id:"deepseek/deepseek-r1:free",label:"DeepSeek R1 (Free)",desc:"Strong reasoning model — open weights",free:!0},{id:"openai/gpt-4o-mini",label:"GPT-4o Mini",desc:"OpenAI's fast & affordable flagship mini",free:!1},{id:"anthropic/claude-3-5-haiku",label:"Claude 3.5 Haiku",desc:"Anthropic's fastest Claude model",free:!1},{id:"google/gemini-flash-1.5",label:"Gemini Flash 1.5",desc:"Google's ultra-fast flash model",free:!1}],vm=[{id:"telegram",label:"Telegram",emoji:"✈️",hint:"Create a bot at t.me/BotFather",fields:[{key:"TELEGRAM_BOT_TOKEN",label:"Bot Token",placeholder:"123456789:AAF...",secret:!0}]},{id:"discord",label:"Discord",emoji:"🎮",hint:"discord.com/developers → Applications",fields:[{key:"DISCORD_BOT_TOKEN",label:"Bot Token",placeholder:"MT…",secret:!0},{key:"DISCORD_CLIENT_ID",label:"Client ID",placeholder:"012…",secret:!1}]},{id:"slack",label:"Slack",emoji:"💬",hint:"api.slack.com/apps → OAuth & Permissions",fields:[{key:"SLACK_BOT_TOKEN",label:"Bot Token",placeholder:"xoxb-…",secret:!0},{key:"SLACK_SIGNING_SECRET",label:"Signing Secret",placeholder:"abc123…",secret:!0}]},{id:"whatsapp",label:"WhatsApp",emoji:"📱",hint:"developers.facebook.com → WhatsApp",fields:[{key:"WHATSAPP_API_KEY",label:"API Token",placeholder:"EAA…",secret:!0},{key:"WHATSAPP_PHONE_ID",label:"Phone ID",placeholder:"1234567890",secret:!1}]}];function x4({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:tt("w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300",n?"bg-orange-500 text-white":s?"bg-orange-500/20 border-2 border-orange-500 text-orange-400":"bg-white/5 border border-white/10 text-gray-400"),children:n?r.jsx(Kt,{size:13}):e+1}),e<Xa.length-1&&r.jsx("div",{className:tt("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function y4({label:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-white/5 text-gray-400 border border-white/8",children:e})}function v4({fit:e}){return e==="recommended"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-green-400 bg-green-500/10 border border-green-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(Kt,{size:9})," Recommended"]}):e==="marginal"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-orange-400 bg-orange-500/10 border border-orange-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(Re,{size:9})," Marginal"]}):r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-red-400 bg-red-500/10 border border-red-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(es,{size:9})," Heavy"]})}function bm({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:tt("w-full flex items-center gap-4 px-4 py-4 rounded-xl border transition-all text-left",e?"bg-orange-500/10 border-orange-500/30 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200",e?"bg-orange-500":"bg-white/15"),children:r.jsx("div",{className:tt("absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all duration-200",e?"left-6":"left-1")})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm",children:n}),s&&r.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s})]})]})}function b4(){var Or,Xt;hn();const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!0),[c,u]=f.useState("~/Mustb-Projects"),[d,p]=f.useState(0),[h,m]=f.useState(""),[v,w]=f.useState("en-US"),[b,g]=f.useState("openrouter"),[x,k]=f.useState(""),[C,j]=f.useState(""),[S,y]=f.useState(sc[0].id),[N,P]=f.useState(sc),[_,T]=f.useState(!1),[O,F]=f.useState("http://localhost:11434"),[D,M]=f.useState(""),[z,V]=f.useState(""),[E,R]=f.useState(!1),[B,Z]=f.useState(!1),[K,ie]=f.useState({}),[te,ce]=f.useState({}),[fe,ae]=f.useState({}),[Je,kt]=f.useState("idle"),[W,Y]=f.useState(!1),[Mt,Lr]=f.useState(null);f.useEffect(()=>{fetch("/api/setup/providers").then(A=>A.ok?A.json():{providers:[]}).then(A=>{var Q;(Q=A.providers)!=null&&Q.length&&t(A.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(A=>A.ok?A.json():null).then(A=>{A!=null&&A.suggested&&(u(A.suggested),V(A.suggested))}).catch(()=>{})},[]),f.useEffect(()=>{b==="openrouter"&&(T(!0),fetch("/api/openrouter/free-models").then(A=>A.ok?A.json():null).then(A=>{if(A!=null&&A.models&&A.models.length>0){const Q=A.models.slice(0,16).map(De=>({id:De.id,label:De.label??De.name??De.id,desc:De.desc??De.description??"",free:De.id.endsWith(":free")})),X=new Set(Q.map(De=>De.id)),Ee=sc.filter(De=>!X.has(De.id));P([...Q,...Ee])}}).catch(()=>{}).finally(()=>T(!1)))},[b]),f.useEffect(()=>{b==="ollama"&&fetch("/api/setup/ollama-models").then(A=>A.ok?A.json():null).then(A=>{A!=null&&A.models&&s(A.models),A!=null&&A.hardware&&a(A.hardware)}).catch(()=>{})},[b]);const Ds=b==="ollama",Ze=e.find(A=>A.id===b),Is=f.useMemo(()=>{const A=x.toLowerCase().trim();return A?e.filter(Q=>Q.label.toLowerCase().includes(A)||Q.description.toLowerCase().includes(A)||Q.tags.some(X=>X.toLowerCase().includes(A))):e},[e,x]),dl=f.useMemo(()=>{const A={};for(const Q of Is)A[Q.category]||(A[Q.category]=[]),A[Q.category].push(Q);return A},[Is]),Bs=()=>{switch(d){case 0:return h.trim().length>0;case 1:{if(Ds){const A=n.length===0||D.trim().length>0;return O.trim().length>0&&A}return b==="openrouter"?C.trim().length>0&&S.trim().length>0:Ze!=null&&Ze.envKeyIsUrl?!0:C.trim().length>0}case 2:return z.trim().length>0;default:return!0}},hl=async()=>{kt("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(Q=>Q.stop()),kt("granted")}catch{kt("denied")}},ra=async A=>{ae(Q=>({...Q,[A]:"testing"}));try{const X=await(await fetch(`/api/channels/${A}/status`)).json().catch(()=>({}));ae(Ee=>({...Ee,[A]:X.configured?"ok":"fail"}))}catch{ae(Q=>({...Q,[A]:"fail"}))}},ls=async()=>{Y(!0),Lr(null);try{const A={};for(const Ee of vm)if(K[Ee.id]){for(const De of Ee.fields){const ia=(te[De.key]??"").trim();ia&&(A[De.key]=ia)}A[`CHANNEL_${Ee.id.toUpperCase()}_ENABLED`]="true"}const Q={name:h.trim()||"User",language:v,provider:b,apiKey:Ds?O:C,model:Ds?D:b==="openrouter"?S:Ze==null?void 0:Ze.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:z.trim()||c,wakeWord:E,telemetry:B,channels:A};let X=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)});if(!X.ok&&X.status===404&&(X=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})),!X.ok){const Ee=await X.json().catch(()=>({}));throw new Error(Ee.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(A){Lr(A instanceof Error?A.message:"Unknown error"),Y(!1)}};return r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center px-4 py-12 relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 pointer-events-none",children:r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-orange-900/12 rounded-full blur-[120px]"})}),r.jsxs("div",{className:"relative z-10 w-full max-w-xl",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("div",{className:"flex justify-center mb-4",children:r.jsxs("div",{className:"relative w-14 h-14",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-lg opacity-40 animate-pulse"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]})}),r.jsx("h1",{className:"text-3xl font-extrabold text-white tracking-tight",children:"Setup Must-b"}),r.jsx("p",{className:"text-gray-400 mt-1.5 text-sm",children:"First-time configuration · 6 steps"})]}),r.jsx("div",{className:"flex justify-center items-center mb-6",children:Xa.map((A,Q)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(x4,{index:Q,current:d}),r.jsx("span",{className:tt("text-[9px] font-bold uppercase tracking-widest transition-colors",Q===d?"text-orange-400":Q<d?"text-orange-500/50":"text-gray-700"),children:A})]},Q))}),r.jsx(ee,{mode:"wait",children:r.jsxs($.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.18},className:"glass rounded-2xl p-6 border border-white/8",children:[r.jsxs("p",{className:"text-[10px] font-bold text-orange-500/60 uppercase tracking-widest mb-1",children:["Step ",d+1," of ",Xa.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:Xa[d]}),d===0&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Your name"}),r.jsx("input",{autoFocus:!0,type:"text",value:h,onChange:A=>m(A.target.value),onKeyDown:A=>A.key==="Enter"&&Bs()&&p(1),placeholder:"e.g. Burak",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-base"}),r.jsx("p",{className:"text-gray-400 text-xs",children:"Used in greetings and memory. Editable anytime in Settings."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Language"}),r.jsxs("div",{className:"relative",children:[r.jsx(Xe,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:v,onChange:A=>w(A.target.value),className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-sm appearance-none cursor-pointer",children:ym.map(A=>r.jsx("option",{value:A.value,className:"bg-[#0d1117] text-white",children:A.label},A.value))}),r.jsx(ln,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),d===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:A=>k(A.target.value),placeholder:"Search providers…",className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 text-sm"})]}),r.jsxs("div",{className:"max-h-[260px] overflow-y-auto space-y-4 pr-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:[o?r.jsx("p",{className:"text-center py-6 text-gray-400 text-sm",children:"Loading providers…"}):g4.map(A=>{const Q=dl[A];return Q!=null&&Q.length?r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:m4[A]}),r.jsx("div",{className:"space-y-1",children:Q.map(X=>r.jsxs("button",{onClick:()=>{g(X.id),j("")},className:tt("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",b===X.id?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",b===X.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:X.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:X.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:X.tags.slice(0,2).map(Ee=>r.jsx(y4,{label:Ee},Ee))})]},X.id))})]},A):null}),!o&&Is.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Ds?r.jsxs("div",{className:"space-y-3 pt-1 border-t border-white/6",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Ollama Base URL"}),r.jsx("input",{type:"url",value:O,onChange:A=>F(A.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),i&&r.jsxs("div",{className:"flex items-center gap-4 rounded-xl bg-white/3 border border-white/8 px-3 py-2 text-xs text-gray-400",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(r1,{size:11,className:"text-orange-400"}),i.ramGb.toFixed(1)," GB RAM"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(un,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Re,{size:11,className:"text-orange-400"}),"Score ",i.score," · ",i.tier]})]}),n.length>0&&r.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:n.map(A=>r.jsxs("button",{onClick:()=>M(A.modelId),className:tt("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",D===A.modelId?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0",D===A.modelId?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-semibold text-sm",children:A.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:A.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:A.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(v4,{fit:A.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[A.ramGb," GB"]})]})]},A.id))})]}):Ze?r.jsxs("div",{className:"space-y-2 pt-1 border-t border-white/6",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:Ze.envKeyIsUrl?"Base URL":`${Ze.label} API Key`}),r.jsx("input",{type:Ze.envKeyIsUrl?"url":"password",value:C,onChange:A=>j(A.target.value),placeholder:Ze.placeholder,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"}),b==="openrouter"&&r.jsxs("div",{className:"space-y-2 pt-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold flex-1",children:"Select Model"}),_&&r.jsx("span",{className:"text-[10px] text-orange-400/60 animate-pulse",children:"Loading live models…"}),r.jsx("span",{className:"text-[10px] text-green-500/60",children:"✓ Offline list always ready"})]}),r.jsx("div",{className:"max-h-[200px] overflow-y-auto space-y-1.5 pr-1",children:N.map(A=>r.jsxs("button",{type:"button",onClick:()=>y(A.id),className:tt("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",S===A.id?"bg-orange-500/12 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",S===A.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:A.label}),A.free&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/15 text-green-400 border border-green-500/20",children:"FREE"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:A.desc})]})]},A.id))}),!S&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(es,{size:11})," Select a model to continue"]})]}),b!=="openrouter"&&Ze.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:Ze.latestModels.slice(0,4).map(A=>r.jsx("span",{className:"text-[11px] font-mono text-orange-400/60 bg-orange-500/5 border border-orange-500/10 px-2 py-0.5 rounded-lg",children:A},A))}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Stored locally in ",r.jsx("code",{className:"text-orange-500/60",children:".env"})," — never sent to external servers."]})]}):null]}),d===2&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Workspace Directory"}),r.jsxs("div",{className:"relative",children:[r.jsx(TS,{size:13,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("input",{autoFocus:!0,type:"text",value:z,onChange:A=>V(A.target.value),placeholder:c,className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Must-b will read and write files ",r.jsx("span",{className:"text-orange-500/70 font-medium",children:"only within this directory"}),". The folder will be created if it doesn't exist."]})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-white/3 border border-white/8 px-4 py-3",children:[r.jsx(QS,{size:15,className:"text-green-400 flex-shrink-0 mt-0.5"}),r.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:"Must-b operates in a sandboxed workspace. It cannot access files outside this directory unless you explicitly provide a path in a prompt."})]})]}),d===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(bm,{checked:E,onChange:R,label:'Enable "Hey Must-b" Wake Word',description:"Always-on voice activation — must-b-ui listens passively via your microphone."}),r.jsx("div",{className:"rounded-xl bg-white/3 border border-white/8 px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-white",children:"Test Microphone Permission"}),r.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:[Je==="idle"&&"Click to verify your browser can access the microphone.",Je==="testing"&&"Requesting permission…",Je==="granted"&&"Microphone access granted ✓",Je==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:hl,disabled:Je==="testing",className:tt("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",Je==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":Je==="denied"?"bg-red-500/10 border border-red-500/20 text-red-400":"bg-white/5 border border-white/10 text-gray-300 hover:border-white/25 hover:text-white"),children:Je==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:12})," Granted"]}):Je==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(gh,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nr,{size:12})," Test"]})})]})}),r.jsx("p",{className:"text-gray-700 text-xs px-1",children:"Wake word and microphone can be reconfigured at any time in Settings → Voice."})]}),d===4&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-[12px] text-gray-500",children:"Connect messaging channels so Must-b can send and receive messages on your behalf. All tokens are stored locally. You can skip and configure later in Settings."}),vm.map(A=>{const Q=!!K[A.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:Q?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:Q?"rgba(234,88,12,0.06)":"rgba(255,255,255,0.02)"},children:[r.jsxs("div",{className:"flex items-center",children:[r.jsxs("button",{onClick:()=>ie(X=>({...X,[A.id]:!Q})),className:"flex-1 flex items-center justify-between px-4 py-3",children:[r.jsxs("span",{className:"flex items-center gap-2.5 text-[13px] font-semibold text-gray-200",children:[r.jsx("span",{className:"text-base",children:A.emoji}),A.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:A.hint}),fe[A.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),fe[A.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),fe[A.id]==="testing"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400 animate-pulse flex-shrink-0"})]}),r.jsx("span",{className:"w-8 h-4 rounded-full relative transition-all flex-shrink-0",style:{background:Q?"#ea580c":"rgba(255,255,255,0.1)"},children:r.jsx("span",{className:"absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all shadow-sm",style:{left:Q?"calc(100% - 14px)":"2px"}})})]}),Q&&A.fields.some(X=>(te[X.key]??"").trim())&&r.jsx("button",{onClick:X=>{X.stopPropagation(),ra(A.id)},disabled:fe[A.id]==="testing",className:"mr-3 px-2 py-1 rounded-lg text-[10px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",color:"#fb923c"},children:fe[A.id]==="testing"?"…":"Test"})]}),Q&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:A.fields.map(X=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:X.label}),r.jsx("input",{type:X.secret?"password":"text",value:te[X.key]??"",onChange:Ee=>ce(De=>({...De,[X.key]:Ee.target.value})),placeholder:X.placeholder,className:"w-full px-3 py-2 rounded-lg text-[12px] text-gray-200 placeholder-gray-700 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)"}})]},X.key))})]},A.id)})]}),d===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(bm,{checked:B,onChange:Z,label:"Send anonymous crash reports",description:"Helps improve Must-b. No personal data, no conversation content — only error traces."}),r.jsxs("div",{className:"rounded-xl bg-white/3 border border-white/6 px-4 py-4 space-y-2",children:[r.jsx("p",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest mb-2",children:"Configuration Summary"}),[{label:"Name",value:h||"—"},{label:"Language",value:((Or=ym.find(A=>A.value===v))==null?void 0:Or.label)??v},{label:"Provider",value:((Xt=e.find(A=>A.id===b))==null?void 0:Xt.label)??b},{label:"Workspace",value:(z||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:E?"Enabled":"Disabled"}].map(A=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:A.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:A.value})]},A.label))]}),Mt&&r.jsx("div",{className:"rounded-xl bg-red-500/10 border border-red-500/20 px-4 py-3 text-red-400 text-sm",children:Mt}),r.jsx("button",{onClick:ls,disabled:W,className:"w-full flex items-center justify-center gap-3 px-8 py-4 rounded-2xl bg-gradient-to-r from-orange-600 to-amber-600 hover:from-orange-500 hover:to-amber-500 text-white font-bold text-base transition-all shadow-lg shadow-orange-500/25 active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",children:W?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-5 h-5 border-2 border-white/40 border-t-white rounded-full animate-spin"})," Initializing…"]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-lg",children:"🚀"})," Initialize Must-b"]})})]})]},d)}),d<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(A=>A-1),disabled:d===0,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all disabled:opacity-25 disabled:cursor-not-allowed text-sm font-medium",children:[r.jsx(pm,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(A=>A+1),disabled:!Bs(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-orange-600 hover:bg-orange-500 text-white font-semibold text-sm transition-all shadow-lg shadow-orange-500/20 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed",children:["Continue ",r.jsx(ln,{size:16})]})]}),d===5&&r.jsx("div",{className:"flex justify-start mt-5",children:r.jsxs("button",{onClick:()=>p(4),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all text-sm font-medium",children:[r.jsx(pm,{size:16})," Back"]})}),r.jsxs("p",{className:"text-center text-xs text-gray-700 mt-5",children:["All settings saved locally · Run ",r.jsx("code",{className:"text-orange-500/60",children:"must-b doctor"})," to verify"]})]})]})}const dn=Object.create(null);dn.open="0";dn.close="1";dn.ping="2";dn.pong="3";dn.message="4";dn.upgrade="5";dn.noop="6";const Qa=Object.create(null);Object.keys(dn).forEach(e=>{Qa[dn[e]]=e});const _u={type:"error",data:"parser error"},f1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",m1=typeof ArrayBuffer=="function",g1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,wh=({type:e,data:t},n,s)=>f1&&t instanceof Blob?n?s(t):wm(t,s):m1&&(t instanceof ArrayBuffer||g1(t))?n?s(t):wm(new Blob([t]),s):s(dn[e]+(t||"")),wm=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function km(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let rc;function w4(e,t){if(f1&&e.data instanceof Blob)return e.data.arrayBuffer().then(km).then(t);if(m1&&(e.data instanceof ArrayBuffer||g1(e.data)))return t(km(e.data));wh(e,!1,n=>{rc||(rc=new TextEncoder),t(rc.encode(n))})}const jm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ti=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jm.length;e++)ti[jm.charCodeAt(e)]=e;const k4=e=>{let t=e.length*.75,n=e.length,s,i=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(s=0;s<n;s+=4)a=ti[e.charCodeAt(s)],o=ti[e.charCodeAt(s+1)],l=ti[e.charCodeAt(s+2)],c=ti[e.charCodeAt(s+3)],d[i++]=a<<2|o>>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},j4=typeof ArrayBuffer=="function",kh=(e,t)=>{if(typeof e!="string")return{type:"message",data:x1(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:N4(e.substring(1),t)}:Qa[n]?e.length>1?{type:Qa[n],data:e.substring(1)}:{type:Qa[n]}:_u},N4=(e,t)=>{if(j4){const n=k4(e);return x1(n,t)}else return{base64:!0,data:e}},x1=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y1="",S4=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{wh(a,!1,l=>{s[o]=l,++i===n&&t(s.join(y1))})})},C4=(e,t)=>{const n=e.split(y1),s=[];for(let i=0;i<n.length;i++){const a=kh(n[i],t);if(s.push(a),a.type==="error")break}return s};function _4(){return new TransformStream({transform(e,t){w4(e,n=>{const s=n.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,s)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let ic;function Pa(e){return e.reduce((t,n)=>t+n.length,0)}function Aa(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let i=0;i<t;i++)n[i]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function E4(e,t){ic||(ic=new TextDecoder);const n=[];let s=0,i=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(s===0){if(Pa(n)<1)break;const c=Aa(n,1);a=(c[0]&128)===128,i=c[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(Pa(n)<2)break;const c=Aa(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Pa(n)<8)break;const c=Aa(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(_u);break}i=d*Math.pow(2,32)+u.getUint32(4),s=3}else{if(Pa(n)<i)break;const c=Aa(n,i);l.enqueue(kh(a?c:ic.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(_u);break}}}})}const v1=4;function ze(e){if(e)return T4(e)}function T4(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,i=0;i<n.length;i++)if(s=n[i],s===t||s.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ze.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,i=n.length;s<i;++s)n[s].apply(this,t)}return this};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const cl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),P4="arraybuffer";function b1(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const A4=_t.setTimeout,M4=_t.clearTimeout;function ul(e,t){t.useNativeTimers?(e.setTimeoutFn=A4.bind(_t),e.clearTimeoutFn=M4.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const z4=1.33;function R4(e){return typeof e=="string"?L4(e):Math.ceil((e.byteLength||e.size)*z4)}function L4(e){let t=0,n=0;for(let s=0,i=e.length;s<i;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function w1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function O4(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function D4(e){let t={},n=e.split("&");for(let s=0,i=n.length;s<i;s++){let a=n[s].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class I4 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class jh extends ze{constructor(t){super(),this.writable=!1,ul(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new I4(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=kh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=O4(t);return n.length?"?"+n:""}}class B4 extends jh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};C4(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,S4(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=w1()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let k1=!1;try{k1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const F4=k1;function V4(){}class $4 extends B4{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class on extends ze{constructor(t,n,s){super(),this.createRequest=t,ul(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=b1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=on.requestsCount++,on.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=V4,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete on.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}on.requestsCount=0;on.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Nm);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,Nm,!1)}}function Nm(){for(let e in on.requests)on.requests.hasOwnProperty(e)&&on.requests[e].abort()}const U4=function(){const e=j1({xdomain:!1});return e&&e.responseType!==null}();class H4 extends $4{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=U4&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new on(j1,this.uri(),t)}}function j1(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||F4))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const N1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class W4 extends jh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=N1?{}:b1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;wh(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&cl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=w1()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ac=_t.WebSocket||_t.MozWebSocket;class G4 extends W4{createSocket(t,n,s){return N1?new ac(t,n,s):n?new ac(t,n):new ac(t)}doWrite(t,n){this.ws.send(n)}}class K4 extends jh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=E4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=_4();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{s.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;this._writer.write(s).then(()=>{i&&cl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const q4={websocket:G4,webtransport:K4,polling:H4},Y4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,X4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Eu(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let i=Y4.exec(e||""),a={},o=14;for(;o--;)a[X4[o]]=i[o]||"";return n!=-1&&s!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Q4(a,a.path),a.queryKey=J4(a,a.query),a}function Q4(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function J4(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const Tu=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ja=[];Tu&&addEventListener("offline",()=>{Ja.forEach(e=>e())},!1);class Yn extends ze{constructor(t,n){if(super(),this.binaryType=P4,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=Eu(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=Eu(n.host).host);ul(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=D4(this.opts.query)),Tu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ja.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=v1,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Yn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Yn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(n+=R4(i)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,cl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,i){if(typeof n=="function"&&(i=n,n=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const a={type:t,data:n,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(Yn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Ja.indexOf(this._offlineEventListener);s!==-1&&Ja.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yn.protocol=v1;class Z4 extends Yn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;Yn.priorWebsocketSuccess=!1;const i=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Yn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function a(){s||(s=!0,d(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,a(),this.emitReserved("upgradeError",h)};function l(){o("transport closed")}function c(){o("socket closed")}function u(p){n&&p.name!==n.name&&a()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let e3=class extends Z4{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>q4[i]).filter(i=>!!i)),super(t,s)}};function t3(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=Eu(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const a=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+a+":"+s.port+t,s.href=s.protocol+"://"+a+(n&&n.port===s.port?"":":"+s.port),s}const n3=typeof ArrayBuffer=="function",s3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,S1=Object.prototype.toString,r3=typeof Blob=="function"||typeof Blob<"u"&&S1.call(Blob)==="[object BlobConstructor]",i3=typeof File=="function"||typeof File<"u"&&S1.call(File)==="[object FileConstructor]";function Nh(e){return n3&&(e instanceof ArrayBuffer||s3(e))||r3&&e instanceof Blob||i3&&e instanceof File}function Za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(Za(e[n]))return!0;return!1}if(Nh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Za(e[n]))return!0;return!1}function a3(e){const t=[],n=e.data,s=e;return s.data=Pu(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Pu(e,t){if(!e)return e;if(Nh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=Pu(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Pu(e[s],t));return n}return e}function o3(e,t){return e.data=Au(e.data,t),delete e.attachments,e}function Au(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Au(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Au(e[n],t));return e}const l3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var se;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(se||(se={}));class c3{constructor(t){this.replacer=t}encode(t){return(t.type===se.EVENT||t.type===se.ACK)&&Za(t)?this.encodeAsBinary({type:t.type===se.EVENT?se.BINARY_EVENT:se.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===se.BINARY_EVENT||t.type===se.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=a3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class Sh extends ze{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===se.BINARY_EVENT;s||n.type===se.BINARY_ACK?(n.type=s?se.EVENT:se.ACK,this.reconstructor=new u3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Nh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(se[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===se.BINARY_EVENT||s.type===se.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(a,n)}else s.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}s.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Sh.isPayloadValid(s.type,a))s.data=a;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case se.CONNECT:return Sm(n);case se.DISCONNECT:return n===void 0;case se.CONNECT_ERROR:return typeof n=="string"||Sm(n);case se.EVENT:case se.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&l3.indexOf(n[0])===-1);case se.ACK:case se.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class u3{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=o3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Sm(e){return Object.prototype.toString.call(e)==="[object Object]"}const d3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Sh,Encoder:c3,get PacketType(){return se}},Symbol.toStringTag,{value:"Module"}));function Vt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const h3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class C1 extends ze{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Vt(t,"open",this.onopen.bind(this)),Vt(t,"packet",this.onpacket.bind(this)),Vt(t,"error",this.onerror.bind(this)),Vt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,i,a;if(h3.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:se.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const l=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((s,i)=>{const a=(o,l)=>o?i(o):s(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case se.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case se.EVENT:case se.BINARY_EVENT:this.onevent(t);break;case se.ACK:case se.BINARY_ACK:this.onack(t);break;case se.DISCONNECT:this.ondisconnect();break;case se.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...i){s||(s=!0,n.packet({type:se.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Rr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Rr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Rr.prototype.reset=function(){this.attempts=0};Rr.prototype.setMin=function(e){this.ms=e};Rr.prototype.setMax=function(e){this.max=e};Rr.prototype.setJitter=function(e){this.jitter=e};class Mu extends ze{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ul(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Rr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||d3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new e3(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=Vt(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Vt(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Vt(t,"ping",this.onping.bind(this)),Vt(t,"data",this.ondata.bind(this)),Vt(t,"error",this.onerror.bind(this)),Vt(t,"close",this.onclose.bind(this)),Vt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){cl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new C1(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gr={};function xi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=t3(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=Gr[i]&&a in Gr[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new Mu(s,t):(Gr[i]||(Gr[i]=new Mu(s,t)),c=Gr[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(xi,{Manager:Mu,Socket:C1,io:xi,connect:xi});let ds=null;function pt(){return ds||(ds=xi(window.location.origin,{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),ds.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),ds.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),ds.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),ds.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),ds}const p3={};let ni=null;const f3=(()=>{const e=p3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function _1(e){return e.startsWith("http")?e:`${f3}${e}`}async function m3(){if(ni)return ni;try{const e=await fetch(_1("/api/auth/local"));if(e.ok)return ni=(await e.json()).token??null,ni}catch{}return null}async function U(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await m3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=_1(e);let l;for(let c=1;c<=n;c++)try{const u=await fetch(o,{...t,headers:a});return u.status===401&&(ni=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),u}catch(u){l=u,c<n&&await new Promise(d=>setTimeout(d,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function Cm(e){const t=e.toLowerCase();if(t.includes("gemini-2")||t.includes("gemini-flash"))return 9999;if(t.includes("llama-3")&&(t.includes("70b")||t.includes("405b")))return 9998;if(t.includes("gpt-4o"))return 8888;if(t.includes("claude-3-5")||t.includes("claude-3.5"))return 8887;if(t.includes("gemini-pro")||t.includes("gemini-1.5-pro"))return 8886;const n=t.match(/(\d+)x(\d+)b/);if(n)return parseFloat(n[1])*parseFloat(n[2]);const s=t.match(/(\d+(?:\.\d+)?)b/);return s?parseFloat(s[1]):0}function oc(e){return[...e].sort((t,n)=>Cm(n.id)-Cm(t.id))}function g3(){const{t:e}=ht(),[t,n]=f.useState(!1),[s,i]=f.useState("Loading…"),[a,o]=f.useState([]),l=f.useRef(null);f.useEffect(()=>{U("/api/setup/status").then(h=>h.ok?h.json():null).then(h=>{if(!h)return;h.activeModel&&i(h.activeModel),(h.activeProvider??"openrouter").toLowerCase()==="ollama"?U("/api/models").then(v=>v.ok?v.json():[]).then(v=>{const b=(Array.isArray(v)?v:[]).map(g=>({id:g.id??String(g),name:g.name??g.id??String(g),free:!0}));o(oc(b))}).catch(()=>{}):U("/api/providers/openrouter/models").then(v=>v.ok?v.json():{}).then(v=>{const w=oc((v.free??[]).map(x=>({id:x.id,name:x.name??x.id,free:!0}))),b=oc((v.power??[]).map(x=>({id:x.id,name:x.name??x.id,free:!1}))),g=[...w,...b];o(g),!(h!=null&&h.activeModel)&&g.length>0&&i(g[0].id)}).catch(()=>{})}).catch(()=>{})},[]),f.useEffect(()=>{if(!t)return;const h=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const c=async h=>{i(h),n(!1),await U("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{})},u=a.filter(h=>h.free),d=a.filter(h=>!h.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(h=>!h),className:"flex items-center gap-1 px-2 py-1 rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 text-white/50 hover:text-white/80 text-[11px] font-medium transition-all",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 shrink-0"}),r.jsx("span",{className:"truncate max-w-[110px]",children:p}),r.jsx(ea,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(ee,{children:t&&r.jsxs($.div,{initial:{opacity:0,y:6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-72 rounded-xl shadow-xl border border-white/10 flex flex-col",style:{background:"rgba(18,8,2,0.97)",backdropFilter:"blur(24px)",maxHeight:"400px"},children:[r.jsxs("div",{className:"overflow-y-auto flex-1 p-1.5",children:[u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-emerald-500/80",children:"Free"}),u.slice(0,5).map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===h.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-orange-400/80",children:"Pro"}),d.map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===h.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),a.length===0&&r.jsx("div",{className:"px-3 py-4 text-[12px] text-white/30 text-center",children:"No models available"})]}),r.jsx("div",{className:"shrink-0 border-t border-white/8 p-1.5",children:r.jsxs(hi,{to:"/app/settings",onClick:()=>n(!1),className:"flex items-center justify-center gap-1.5 w-full px-2.5 py-2 rounded-lg text-[11px] font-medium text-white/35 hover:text-orange-400 hover:bg-orange-500/8 transition-colors",children:[r.jsx(yh,{size:11}),e.systemHealth.moreModels]})})]})})]})}function gs(e){if(typeof e=="string")return e;if(e==null)return"";if(typeof e=="object"){const t=e,n=t.message??t.error??t.text??t.content??t.result;return n!==void 0?gs(n):JSON.stringify(e)}return String(e)}function x3(e,t){switch(e){case"planGenerated":{const n=t.steps;return`Plan ready — ${(n==null?void 0:n.length)??0} step(s)`}case"stepStart":{const n=t.step;return`▶ ${(n==null?void 0:n.description)??gs(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${gs(t.error)}`;const n=t.step,s=t.result!==void 0?gs(t.result):void 0,i=(n==null?void 0:n.description)??"Step complete";return s&&s.length<180?`✓ ${i} → ${s}`:`✓ ${i}`}case"agentRepair":{const n=gs(t.action),s=t.reason?` — ${gs(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function y3(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function v3({lang:e,code:t}){const[n,s]=f.useState(!1);return r.jsxs("div",{className:"my-3 rounded-xl overflow-hidden border border-white/8 bg-[#1a0800]/90",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 border-b border-white/6 select-none",children:[r.jsx("span",{className:"text-[11px] font-mono text-orange-300/50",children:e||"code"}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t).catch(()=>{}),s(!0),setTimeout(()=>s(!1),2e3)},className:"flex items-center gap-1.5 text-[11px] text-orange-300/50 hover:text-orange-200 transition-colors",children:n?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(sl,{size:10}),"Copy"]})})]}),r.jsx("pre",{className:"overflow-x-auto px-4 py-3 text-[13px] text-orange-50 font-mono leading-relaxed whitespace-pre",children:r.jsx("code",{children:t})})]})}function Us(e,t){return e.split(/(`[^`\n]+`)/).map((s,i)=>{if(s.startsWith("`")&&s.endsWith("`")&&s.length>2)return r.jsx("code",{className:"px-1.5 py-0.5 rounded bg-black/15 text-orange-700 font-mono text-[12px]",children:s.slice(1,-1)},`${t}-ic${i}`);const a=s.split(/(\*\*[^*\n]+\*\*|\*[^*\n]+\*)/);return r.jsx(f.Fragment,{children:a.map((o,l)=>o.startsWith("**")&&o.endsWith("**")&&o.length>4?r.jsx("strong",{className:"font-bold text-[#1a0c06]",children:o.slice(2,-2)},`${t}-b${i}-${l}`):o.startsWith("*")&&o.endsWith("*")&&o.length>2?r.jsx("em",{className:"italic",children:o.slice(1,-1)},`${t}-em${i}-${l}`):r.jsx("span",{children:o},`${t}-s${i}-${l}`))},`${t}-bi${i}`)})}function b3({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
680
- `);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],u=c.match(/^```(\w*)/);if(u){const v=u[1]??"",w=[];for(a++;a<i.length&&!i[a].startsWith("```");)w.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(v3,{lang:v,code:w.join(`
681
- `)},l()));continue}const d=c.match(/^### (.+)/);if(d){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Us(d[1],l())},l())),a++;continue}const p=c.match(/^## (.+)/);if(p){s.push(r.jsx("h2",{className:`text-base font-bold mt-5 mb-1.5 ${n}`,children:Us(p[1],l())},l())),a++;continue}const h=c.match(/^# (.+)/);if(h){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Us(h[1],l())},l())),a++;continue}if(c.match(/^[-*]{3,}$/)){s.push(r.jsx("hr",{className:"border-black/10 my-4"},l())),a++;continue}if(c.match(/^[-*•] /)){const v=[];for(;a<i.length&&i[a].match(/^[-*•] /);)v.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:v.map((w,b)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsx("span",{className:"mt-[7px] w-1.5 h-1.5 rounded-full bg-orange-500/60 flex-shrink-0"}),r.jsx("span",{children:Us(w,`ul-${b}`)})]},b))},l()));continue}if(c.match(/^\d+\. /)){const v=[];for(;a<i.length&&i[a].match(/^\d+\. /);)v.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:v.map((w,b)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsxs("span",{className:"flex-shrink-0 mt-px font-mono text-[12px] w-5 text-right text-orange-600/60",children:[b+1,"."]}),r.jsx("span",{children:Us(w,`ol-${b}`)})]},b))},l()));continue}if(c.trim()===""){a++;continue}const m=[];for(;a<i.length&&i[a].trim()!==""&&!i[a].match(/^(```|#{1,3} |[-*•] |\d+\. |[-*]{3,}$)/);)m.push(i[a]),a++;m.length&&s.push(r.jsx("p",{className:`text-[14px] leading-[1.75] my-1.5 ${n}`,children:Us(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function w3({workflow:e,onDismiss:t}){const[n,s]=f.useState("idle"),[i,a]=f.useState(e.goal.slice(0,52)+(e.goal.length>52?"…":"")),o=async()=>{s("saving");try{const l=await U("/api/skills/save",{method:"POST",body:JSON.stringify({goal:e.goal,answer:e.answer,steps:e.steps,name:i.trim()||void 0})});if(!l.ok)throw new Error(`HTTP ${l.status}`);s("saved"),setTimeout(t,1800)}catch{s("error"),setTimeout(()=>s("idle"),3e3)}};return r.jsx($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},className:"mt-3",children:r.jsx("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-xl bg-orange-900/20 border border-orange-600/30",children:n==="saved"?r.jsxs(r.Fragment,{children:[r.jsx(Ue,{size:13,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-xs font-medium text-orange-400",children:"Skill saved!"})]}):r.jsxs(r.Fragment,{children:[r.jsx(qy,{size:13,className:"text-orange-600 shrink-0"}),r.jsx("span",{className:"text-[11px] text-orange-200 shrink-0 font-medium",children:"Save as Skill:"}),r.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&n==="idle"&&o(),placeholder:"Skill name…",className:"flex-1 bg-transparent text-[12px] text-orange-100 outline-none placeholder-orange-600/50 min-w-0"}),r.jsx("button",{onClick:o,disabled:n!=="idle",className:"flex items-center gap-1 px-3 py-1 rounded-lg bg-orange-900/30 hover:bg-orange-900/50 border border-orange-800/40 text-orange-200 text-[11px] font-semibold transition-all shrink-0 disabled:opacity-50",children:n==="saving"?r.jsxs(r.Fragment,{children:[r.jsx(re,{size:10,className:"animate-spin"})," Saving…"]}):n==="error"?"Retry":"Save"}),r.jsx("button",{onClick:t,className:"text-orange-700 hover:text-orange-500 transition-colors text-[11px] shrink-0",children:"✕"})]})})})}function k3({src:e,onClose:t}){const[n,s]=f.useState(!1);f.useEffect(()=>{const o=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t]);const i=()=>{const o=document.createElement("a");o.href=e,o.download=`mustb-image-${Date.now()}.jpg`,o.click()},a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}};return r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm",onClick:t,children:[r.jsxs("div",{className:"absolute top-5 right-5 flex items-center gap-2",onClick:o=>o.stopPropagation(),children:[r.jsxs("button",{onClick:a,title:"Copy link",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[n?r.jsx(Kt,{size:14,className:"text-green-400"}):r.jsx(sl,{size:14}),n?"Copied!":"Copy"]}),r.jsxs("button",{onClick:i,title:"Download image",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[r.jsx(Jy,{size:14}),"Download"]}),r.jsx("button",{onClick:t,className:"w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all",children:r.jsx(st,{size:18})})]}),r.jsx("img",{src:e,alt:"Preview",className:"max-w-[90vw] max-h-[85vh] object-contain rounded-2xl shadow-2xl",onClick:o=>o.stopPropagation()})]})}class j3 extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t.message??"Unknown error"}}componentDidCatch(t,n){console.error("[ChatErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[r.jsx("span",{className:"text-2xl",children:"⚠️"}),r.jsx("p",{className:"text-red-400 font-bold text-sm",children:"Chat render error"}),r.jsx("p",{className:"text-orange-200/70 text-xs font-mono max-w-sm break-all",children:this.state.error}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-1 px-4 py-2 rounded-xl bg-orange-900/20 border border-orange-800/30 text-orange-200 text-xs font-bold hover:bg-orange-900/40 transition-all",children:"Retry"})]}):this.props.children}}const _m=[{id:"terminal",label:"Terminal",Icon:Ps},{id:"browser",label:"Browser",Icon:Xe},{id:"image-gen",label:"Görsel Üret",Icon:o1},{id:"web-search",label:"Web Search",Icon:qt},{id:"file-manager",label:"Files",Icon:os},{id:"code",label:"Code",Icon:cn},{id:"screen-sense",label:"Ekranı Gör",Icon:xh}];function N3({onSend:e,onStop:t,disabled:n}){const{t:s}=ht(),[i,a]=f.useState(""),[o,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState([]),[h,m]=f.useState([]),[v,w]=f.useState(!1),b=f.useRef(null),g=f.useRef(!1),x=f.useRef(null),k=f.useRef(null),C=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),j=()=>{const M=window.SpeechRecognition||window.webkitSpeechRecognition;if(!M)return;const z=new M;z.continuous=!0,z.interimResults=!0,z.lang="tr-TR",z.onresult=V=>{let E="",R="";for(let B=V.resultIndex;B<V.results.length;B++)V.results[B].isFinal?E+=V.results[B][0].transcript:R+=V.results[B][0].transcript;E?(a(B=>(B.trim()?B.trimEnd()+" ":"")+E.trim()),u("")):u(R)},z.onend=()=>{u(""),g.current?setTimeout(j,150):(l(!1),b.current=null)},z.onerror=V=>{V.error!=="no-speech"&&l(!1),u(""),g.current&&V.error!=="not-allowed"&&setTimeout(j,500)},b.current=z;try{z.start()}catch{}},S=()=>{var M;o?(g.current=!1,(M=b.current)==null||M.stop(),u("")):(g.current=!0,l(!0),j())},y=M=>{p(z=>[...z,...Array.from(M)])},N=M=>{const z=Array.from(M.clipboardData.files);z.length&&(M.preventDefault(),y(z))},P=M=>{M.preventDefault(),y(M.dataTransfer.files)},_=M=>p(z=>z.filter((V,E)=>E!==M));f.useEffect(()=>{if(!v)return;const M=z=>{k.current&&!k.current.contains(z.target)&&w(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[v]);const T=async()=>{try{const M=await navigator.mediaDevices.getDisplayMedia({video:!0}),z=document.createElement("video");z.srcObject=M,z.muted=!0,await new Promise(E=>{z.onloadedmetadata=()=>{z.play(),E()}}),await new Promise(E=>setTimeout(E,120));const V=document.createElement("canvas");V.width=z.videoWidth,V.height=z.videoHeight,V.getContext("2d").drawImage(z,0,0),M.getTracks().forEach(E=>E.stop()),V.toBlob(E=>{if(!E)return;const R=new File([E],`ekran-${Date.now()}.png`,{type:"image/png"});y([R]),a(B=>B.trim()?B:"Bu ekranı analiz et ve ne gördüğünü açıkla."),pe.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(M){(M==null?void 0:M.name)!=="NotAllowedError"&&pe.error("Ekran yakalanamadı.")}},O=M=>{if(M==="screen-sense"){T(),w(!1);return}m(z=>z.includes(M)?z.filter(V=>V!==M):[...z,M])},F=()=>{var V;const M=i.trim();if(!M||n)return;o&&(g.current=!1,(V=b.current)==null||V.stop(),u(""));const z=[...d];a(""),p([]),e(M,h.length>0?h:void 0,z.length>0?z:void 0)};f.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),f.useEffect(()=>{const M=z=>{var E;const V=((E=z.detail)==null?void 0:E.text)??"";a(V),setTimeout(()=>{var R;return(R=x.current)==null?void 0:R.focus()},60)};return window.addEventListener("mustb:prefill",M),()=>window.removeEventListener("mustb:prefill",M)},[]);const D=o?c||s.chat.listening:"What do you want to know?";return r.jsx("div",{className:"max-w-3xl mx-auto w-full",children:r.jsxs("div",{className:"glass-input rounded-2xl flex flex-col px-4 pt-3 pb-3 gap-2.5",onPaste:N,onDrop:P,onDragOver:M=>M.preventDefault(),children:[d.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:d.map((M,z)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[M.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(M),alt:M.name,className:"w-12 h-12 object-cover rounded-lg border border-orange-500/20"}):r.jsx("div",{className:"w-12 h-12 rounded-lg border border-orange-500/20 bg-orange-500/10 flex items-center justify-center",children:r.jsx(Yt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>_(z),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx(st,{size:9})})]},z))}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{ref:k,className:"flex items-center gap-0.5 mb-0.5 shrink-0 relative",children:[r.jsx("button",{type:"button",onClick:()=>w(M=>!M),title:"Araçlar",className:`p-2 rounded-full transition-all ${v||h.length>0?"text-orange-400 bg-orange-500/15 border border-orange-500/25":"text-white/30 hover:text-white/70 hover:bg-white/8"}`,children:r.jsx(bh,{size:16})}),r.jsx(ee,{children:v&&r.jsxs($.div,{initial:{opacity:0,y:8,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-52 rounded-2xl p-2 shadow-2xl",style:{background:"rgba(16,7,2,0.97)",border:"1px solid rgba(249,115,22,0.18)",backdropFilter:"blur(24px)"},children:[r.jsx("p",{className:"px-2.5 pt-1.5 pb-1 text-[9.5px] font-black uppercase tracking-[0.14em] text-orange-400/60",children:"Araçlar"}),_m.map(({id:M,label:z,Icon:V})=>{const E=h.includes(M);return r.jsxs("button",{onClick:()=>O(M),className:`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-xl transition-all text-left ${E?"bg-orange-500/15 text-orange-300":"text-white/55 hover:bg-white/6 hover:text-white/90"}`,children:[r.jsx(V,{size:13,className:E?"text-orange-400":"text-white/30"}),r.jsx("span",{className:"text-[12px] font-medium",children:z}),E&&r.jsx("span",{className:"ml-auto w-3.5 h-3.5 rounded-full bg-orange-500/30 border border-orange-500/60 flex items-center justify-center text-[8px] text-orange-300",children:"✓"})]},M)})]})}),r.jsxs("label",{className:"p-2 rounded-full cursor-pointer text-white/30 hover:text-white/70 hover:bg-white/8 transition-all",title:s.chat.attachFile,children:[r.jsx(HS,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:M=>M.target.files&&y(M.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:M=>a(M.target.value),onKeyDown:M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),F())},placeholder:D,disabled:n,rows:1,className:"flex-1 bg-transparent text-white/90 placeholder-white/35 text-[15px] outline-none resize-none min-h-[28px] max-h-[160px] scrollbar-hide leading-relaxed"}),r.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5 shrink-0",children:[C&&r.jsx("button",{onClick:S,title:o?"Stop dictation":"Start voice dictation (append mode)",className:`p-2 rounded-full transition-all ${o?"text-red-400 bg-red-500/15 border border-red-500/30 shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-white/40 hover:text-white/70 hover:bg-white/8"}`,children:o?r.jsx(kS,{size:17,className:"animate-pulse"}):r.jsx(Nr,{size:17})}),n?r.jsx("button",{onClick:t,title:"Durdur",className:"w-9 h-9 rounded-full flex items-center justify-center transition-all bg-red-600/80 hover:bg-red-500 text-white shadow-[0_0_12px_rgba(239,68,68,0.5)] active:scale-95",children:r.jsx(vh,{size:14})}):r.jsx("button",{onClick:F,disabled:!i.trim(),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all ${i.trim()?"bg-orange-600 hover:bg-orange-500 text-white shadow-[0_0_15px_rgba(249,115,22,0.4)] active:scale-95":"bg-white/10 text-white/25 cursor-not-allowed"}`,children:r.jsx(qS,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:h.map(M=>{const z=_m.find(R=>R.id===M);if(!z)return null;const{Icon:V,label:E}=z;return r.jsxs("span",{className:"flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-orange-500/15 border border-orange-500/25 text-orange-300 text-[11px] font-medium",children:[r.jsx(V,{size:10}),r.jsx("span",{children:E}),r.jsx("button",{type:"button",onClick:()=>O(M),className:"ml-0.5 p-0.5 rounded-full hover:bg-orange-500/20 text-orange-400/60 hover:text-orange-300 transition-colors",children:r.jsx(st,{size:9})})]},M)})}):r.jsx("div",{className:"flex-1"}),r.jsx(g3,{})]})]})})}function lc(e){return`mustb_chat_turns_${e}`}function S3(){const{t:e,setLocale:t}=ht(),n=f.useRef(e);f.useEffect(()=>{n.current=e},[e]);const[s]=m2(),i=hn(),a=s.get("chat")??"default",o=f.useRef(null),[l,c]=f.useState(null),[u,d]=f.useState(()=>{try{const y=localStorage.getItem(lc(a));if(y)return JSON.parse(y)}catch{}return[]}),p=f.useRef(null),h=f.useRef(null),m=f.useRef(a),[v,w]=f.useState(!1),[b,g]=f.useState(null),x=u.some(y=>y.kind==="assistant"&&y.status==="pending");f.useEffect(()=>{m.current=a;try{const y=localStorage.getItem(lc(a));d(y?JSON.parse(y):[])}catch{d([])}p.current=null},[a]),f.useEffect(()=>{if(a==="default"||!o.current)return;const y=o.current;o.current=null,setTimeout(()=>j(y.text,y.tools,y.files),0)},[a]),f.useEffect(()=>{const y=pt();return y.on("agentUpdate",N=>{const{type:P,..._}=N;if(P==="memorySearch")return;if(P==="planStart"){const F=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;p.current=F,d(D=>[...D,{id:F,kind:"assistant",content:"",thoughts:[],status:"pending"}]);return}if(P==="finalAnswer"){const F=p.current;if(!F)return;d(D=>D.map(M=>M.id===F?{...M,content:gs(_.answer??"Done.")}:M));return}if(P==="planFinish"){w(!1);const F=p.current;if(!F)return;const D=_.status==="failed"?"error":"done",M=_.status==="completed"?{goal:String(_.goal??""),answer:String(_.answer??""),steps:_.steps??[]}:void 0;d(z=>z.map(V=>V.id===F?{...V,status:D,...M?{workflow:M}:{}}:V)),p.current=null;return}if(P==="professionResearched"){const F=String(_.profession??"");if(!F)return;const D=n.current.chat.professionAck.replace("{profession}",F);d(M=>[...M,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:D,thoughts:[],status:"done"}]);return}const T=x3(P,_);if(!T)return;const O=p.current;O&&d(F=>F.map(D=>D.id===O?{...D,thoughts:[...D.thoughts,T]}:D))}),()=>{y.off("agentUpdate")}},[]),f.useEffect(()=>{var y;(y=h.current)==null||y.scrollIntoView({behavior:"smooth"})},[u]),f.useEffect(()=>{const y=N=>{var O;const P=(O=N.detail)==null?void 0:O.skill;if(!P)return;const T={"web-search":"Search the web for: ","web-fetch":"Fetch and summarize this URL: ",browser:"Open the browser and navigate to: ",pdf:"Read and summarize this PDF: ","image-analysis":"Analyze this image: ","image-generate":"Generate an image of: ",tts:"Convert this text to speech: ","spawn-agent":"Spawn a new agent to: ",sessions:"List all active agent sessions",canvas:"Open the canvas workspace",git:"Run a git operation: ",gateway:"Connect to Must-b gateway node: ","file-manager":"Open the file manager",cron:"Create a scheduled task: ",messages:"Check and reply to messages","memory-add":"Save this to memory: ",contacts:"Look up contact: ",calendar:"Check my calendar for: ",automations:"Create an automation that: ","scheduled-tasks":"List all scheduled tasks",commands:"Run this command: ",nodes:"List all gateway nodes","multi-agent":"Start a multi-agent workflow to: ","chat-focus":""}[P]??`Run skill "${P}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:T}}))};return window.addEventListener("mustb:invoke-skill",y),()=>window.removeEventListener("mustb:invoke-skill",y)},[]),f.useEffect(()=>{if(m.current===a)try{localStorage.setItem(lc(a),JSON.stringify(u))}catch{}},[u,a]),f.useEffect(()=>{const y=u[u.length-1];if(!y||y.kind!=="assistant"||y.status!=="done"||!y.content)return;const N=[...u].reverse().find(_=>_.kind==="user");if(!N)return;const P=`Q: ${N.content}
682
- A: ${y.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:P,tags:["chat","autosave"]})}).catch(()=>{})},[u.length]);const k=y=>{const N=[[/\b(spanish mode|speak spanish|habla español|en español)\b/i,"es"],[/\b(french mode|speak french|en français|parle français)\b/i,"fr"],[/\b(german mode|speak german|auf deutsch|deutsch mode)\b/i,"de"],[/\b(japanese mode|speak japanese|日本語モード)\b/i,"ja"],[/\b(chinese mode|speak chinese|中文模式)\b/i,"zh"],[/\b(portuguese mode|fala português)\b/i,"pt"],[/\b(turkish mode|türkçe mode|türkçe konuş)\b/i,"tr"],[/\b(english mode|switch to english|speak english)\b/i,"en"]],P={tr:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",en:"Got it, settings updated permanently.",es:"Entendido, configuración actualizada permanentemente.",fr:"Compris, paramètres mis à jour définitivement.",de:"Verstanden, Einstellungen dauerhaft aktualisiert.",ja:"了解です。設定が永久に更新されました。",zh:"明白,设置已永久更新。",pt:"Entendido, configurações atualizadas permanentemente."};for(const[T,O]of N)if(T.test(y)){t(O);const F=P[O]??P.en;return d(D=>[...D,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:F,thoughts:[],status:"done"}]),!0}const _=[[/use\s+gpt[-\s]?4o?\b/i,"openai/gpt-4o"],[/use\s+(claude[-\s]?3\.5|claude[-\s]?sonnet|claude[-\s]?opus)\b/i,"anthropic/claude-3-5-sonnet"],[/use\s+(gemini[-\s]?flash|gemini[-\s]?pro|gemini)\b/i,"google/gemini-flash"],[/use\s+(llama[-\s]?3|llama)\b/i,"meta-llama/llama-3-70b-instruct:free"],[/use\s+mistral\b/i,"mistralai/mistral-7b-instruct:free"],[/use\s+deepseek\b/i,"deepseek/deepseek-chat"]];for(const[T,O]of _)if(T.test(y))return U("/api/settings/model",{method:"POST",body:JSON.stringify({model:O})}).catch(()=>{}),d(F=>[...F,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},C=y=>{const N=[[/\bi(?:'m| am)\s+a(?:n)?\s+(lawyer|attorney|solicitor|barrister)\b/i,"lawyer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(doctor|physician|nurse|surgeon|pharmacist)\b/i,"medical"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(software engineer|developer|programmer|coder)\b/i,"software-engineer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(teacher|professor|educator|instructor)\b/i,"educator"],[/\bi(?:'m| am)\s+a(?:n)?\s+(accountant|auditor|financial advisor|analyst)\b/i,"finance"],[/\bi(?:'m| am)\s+a(?:n)?\s+(architect|civil engineer|structural engineer)\b/i,"engineering"],[/\bi(?:'m| am)\s+a(?:n)?\s+(designer|ux designer|graphic designer)\b/i,"designer"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(data scientist|ml engineer|ai researcher)\b/i,"data-science"],[/\bben\s+bir?\s+avukat\b/i,"lawyer"],[/\bavukat(?:ım|ım)?\b/i,"lawyer"],[/\bben\s+bir?\s+doktor\b/i,"medical"],[/\bdoktor(?:um|um)?\b/i,"medical"],[/\bben\s+bir?\s+hemşire\b/i,"medical"],[/\bben\s+bir?\s+mühendis\b/i,"engineering"],[/\bmühendis(?:im|im)?\b/i,"engineering"],[/\bben\s+bir?\s+yazılımcı\b/i,"software-engineer"],[/\byazılımcı(?:yım|yım)?\b/i,"software-engineer"],[/\bben\s+bir?\s+öğretmen\b/i,"educator"],[/\böğretmen(?:im|im)?\b/i,"educator"],[/\bben\s+bir?\s+muhasebeci\b/i,"finance"],[/\bmuhasebeci(?:yim|yim)?\b/i,"finance"],[/\bben\s+bir?\s+tasarımcı\b/i,"designer"],[/\btasarımcı(?:yım|yım)?\b/i,"designer"],[/\bben\s+bir?\s+mimar\b/i,"engineering"],[/\bmimar(?:ım|ım)?\b/i,"engineering"]];for(const[P,_]of N)if(P.test(y)){U("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:_,userMessage:y})}).catch(()=>{});break}},j=async(y,N,P)=>{if(y.startsWith("__GUIDANCE__")){const D=y.slice(12);d(M=>[...M,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${D}`,thoughts:[],status:"done"}]);return}if(k(y))return;C(y);let _=y;if(N!=null&&N.includes("image-gen")&&!y.toLowerCase().startsWith("generate")&&!y.toLowerCase().startsWith("create")&&(_=`Görsel oluştur: ${y}`),a==="default")try{const D=y.trim().split(/\s+/).slice(0,4).join(" "),M=await U("/api/chats",{method:"POST",body:JSON.stringify({title:D})});if(M.ok){const z=await M.json();o.current={text:_,tools:N,files:P},i(`/app?chat=${z.id}`);return}}catch{}if(!u.some(D=>D.kind==="user")&&a!=="default"){const D=y.trim().split(/\s+/).slice(0,4).join(" ");D&&U(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:D})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:D}}))}).catch(()=>{})}d(D=>D.map(M=>({...M,workflow:void 0})));const O=P==null?void 0:P.filter(D=>D.type.startsWith("image/")).map(D=>URL.createObjectURL(D));d(D=>[...D,{id:`user-${Date.now()}`,kind:"user",content:y,thoughts:[],status:"done",...O!=null&&O.length?{attachments:O}:{}}]);const F={goal:_};if(N&&N.length>0&&(F.focus_tools=N),P&&P.length>0)try{F.attachments=await Promise.all(P.map(async D=>({name:D.name,type:D.type,data:await y3(D)})))}catch{}w(!0);try{await U("/api/goal",{method:"POST",body:JSON.stringify(F)})}catch{w(!1)}},S=u.length>0;return r.jsxs(j3,{children:[l&&r.jsx(k3,{src:l,onClose:()=>c(null)}),r.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:S?r.jsxs("div",{className:"max-w-3xl mx-auto w-full px-5 pt-6 pb-4",children:[u.map(y=>{if(y.kind==="user")return r.jsx("div",{className:"flex justify-end mb-5",children:r.jsxs("div",{className:"max-w-[78%] flex flex-col items-end gap-2",children:[y.attachments&&y.attachments.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 justify-end",children:y.attachments.map((O,F)=>r.jsxs("div",{className:"relative group w-24 h-24 shrink-0",children:[r.jsx("img",{src:O,alt:`attachment-${F}`,onClick:()=>c(O),width:96,height:96,className:"w-24 h-24 object-cover rounded-xl border border-orange-500/25 hover:opacity-90 transition-opacity duration-150 cursor-zoom-in",style:{minWidth:96,minHeight:96}}),r.jsx("button",{onClick:D=>{D.stopPropagation(),j("Bu görseli analiz et ve açıkla",void 0,void 0)},title:"Düzenle / Analiz Et",className:"absolute bottom-1 right-1 w-6 h-6 flex items-center justify-center rounded-full bg-black/70 hover:bg-orange-600 opacity-0 group-hover:opacity-100 transition-all duration-150 text-white",children:r.jsx(GS,{size:11})})]},F))}),r.jsx("div",{className:"rounded-2xl rounded-br-sm px-5 py-3 text-white text-[14px] leading-relaxed whitespace-pre-wrap",style:{background:"rgba(25,10,2,0.72)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(12px)"},children:y.content})]})},y.id);const N=y.thoughts.length>0,P=y.content.length>0,_=y.status==="pending",T=y.status==="error"&&!P;return r.jsxs("div",{className:"mb-8",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[r.jsxs("div",{className:"relative w-5 h-5 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-600/30 rounded-full blur-sm"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 tracking-wide",children:"Must-b"}),N&&r.jsxs("span",{className:"text-[10px] text-white/35 font-mono",children:[y.thoughts.length," step",y.thoughts.length!==1?"s":""]})]}),N&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},...P?{}:{open:!0},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(ln,{size:10,className:"text-orange-400/50 group-open:rotate-90 transition-transform duration-150 flex-shrink-0"}),r.jsxs("span",{className:"text-[10px] font-semibold text-orange-300/50 hover:text-orange-300/80 transition-colors tracking-wide uppercase",children:[y.thoughts.length," step",y.thoughts.length!==1?"s":""," · Thought process"]})]}),r.jsx("div",{className:"mt-2 ml-3.5 pl-3 border-l border-orange-500/15 space-y-1",children:y.thoughts.map((O,F)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:O},F))})]}),P?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(b3,{text:y.content,dark:!0}),r.jsx("div",{className:"flex justify-end mt-3",children:r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(y.content).catch(()=>{}),g(y.id),setTimeout(()=>g(null),2e3)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 text-[11px] transition-all border border-white/6",children:b===y.id?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:12,className:"text-green-400"})," Kopyalandı"]}):r.jsxs(r.Fragment,{children:[r.jsx(sl,{size:12})," Kopyala"]})})})]}):_?r.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[[0,120,240].map(O=>r.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"rgba(251,146,60,0.7)",animationDelay:`${O}ms`}},O)),r.jsx("span",{className:"text-[11px] text-white/25 ml-1",children:"Thinking…"})]}):T?r.jsxs("div",{className:"rounded-xl px-4 py-3 flex items-center gap-2",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:[r.jsx("span",{className:"text-red-400 text-sm",children:"⚠"}),r.jsx("p",{className:"text-sm text-red-300/80",children:"Something went wrong. Please try again."})]}):null,r.jsx(ee,{children:y.workflow&&!_&&r.jsx(w3,{workflow:y.workflow,onDismiss:()=>d(O=>O.map(F=>F.id===y.id?{...F,workflow:void 0}:F))})})]},y.id)}),r.jsx("div",{ref:h,className:"h-2"})]}):r.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6 select-none",children:r.jsx(ee,{children:r.jsx($.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-10,scale:.96},transition:{duration:.55,ease:"easeOut"},className:"flex flex-col items-center gap-4 mb-10",children:r.jsx("span",{className:"font-black tracking-tighter select-none leading-none px-2 w-full text-center",style:{fontSize:"clamp(56px, 16vw, 120px)",background:"linear-gradient(135deg, rgba(249,115,22,0.92) 0%, rgba(253,186,116,0.75) 40%, rgba(255,255,255,0.30) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",paddingBottom:"0.05em",paddingRight:"20px"},children:"Must-b"})},"hero")})})}),r.jsxs("div",{className:"shrink-0 px-4 pb-3 pt-2",children:[r.jsx(N3,{onSend:(y,N,P)=>j(y,N,P),onStop:()=>{w(!1),U("/api/goal/abort",{method:"POST"}).catch(()=>{}),d(y=>y.map(N=>N.status==="pending"?{...N,status:"done",content:N.content||"⏹ Durduruldu."}:N)),p.current=null},disabled:v||x}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function C3(){const[e,t]=f.useState(!1);return f.useEffect(()=>{const n=pt();return n.on("agentUpdate",s=>{s.type==="SCREEN_CAPTURE_START"&&t(!0),(s.type==="SCREEN_CAPTURED"||s.type==="SCREEN_CAPTURE_END")&&setTimeout(()=>t(!1),700)}),()=>{n.off("agentUpdate")}},[]),r.jsx(ee,{children:e&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},className:"fixed inset-0 z-[9999] pointer-events-none",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("div",{className:"absolute top-0 left-0 w-12 h-12 border-t-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute top-0 right-0 w-12 h-12 border-t-2 border-r-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-12 h-12 border-b-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 right-0 w-12 h-12 border-b-2 border-r-2 border-orange-500/70"})]}),r.jsx($.div,{className:"absolute left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-orange-500/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:1.4,repeat:1/0,ease:"linear"}}),r.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2",children:r.jsxs($.div,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},className:"flex items-center gap-2 px-4 py-2 bg-black/80 border border-orange-500/30 rounded-full shadow-[0_0_20px_rgba(234,88,12,0.3)] backdrop-blur-xl",children:[r.jsxs("span",{className:"relative flex h-2 w-2",children:[r.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),r.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-orange-500"})]}),r.jsx(Hi,{size:12,className:"text-orange-400 animate-spin"}),r.jsx("span",{className:"text-orange-300 text-xs font-semibold tracking-wide",children:"Scanning screen…"})]})})]},"scan-overlay")})}const Ma={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"},_3={browse:Xe,write:Yt,think:Gt,exec:Ps},E3={running:"bg-orange-500/8 border border-orange-500/20 text-orange-300",done:"bg-green-500/5 border border-green-500/10 text-gray-500",queued:"bg-white/2 border border-white/5 text-gray-600"},T3={mouseMove:US,mouseClick:a1,typeText:RS,visionClick:Ts},P3={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function A3(){const{t:e}=ht(),[t,n]=f.useState(!1),[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),u=f.useRef(null),[d,p]=f.useState(null),[h,m]=f.useState(!1),[v,w]=f.useState(()=>new Array(3).fill(null)),[b,g]=f.useState(0),[x,k]=f.useState([]),[C,j]=f.useState(null),[S,y]=f.useState([]),N=f.useRef(null),[P,_]=f.useState(!1),[T,O]=f.useState(!1);f.useEffect(()=>{if(!s||!u.current)return;const z=u.current,V=z.getContext("2d");if(!V)return;const E=new Image;E.onload=()=>{var R;if(z.width=E.width,z.height=E.height,V.drawImage(E,0,0),(R=s.elements)!=null&&R.length)for(const B of s.elements)V.strokeStyle=Ma[B.type]??Ma.unknown,V.lineWidth=Math.max(2,Math.round(E.width/400)),V.strokeRect(B.x,B.y,B.width,B.height),V.fillStyle=Ma[B.type]??Ma.unknown,V.font=`${Math.max(10,Math.round(E.width/120))}px monospace`,V.fillText(B.type,B.x+4,B.y+14)},E.src=`data:image/png;base64,${s.base64}`},[s]),f.useEffect(()=>{const z=pt(),V=E=>{if(E.type==="SCREEN_CAPTURE_START"&&n(!0),E.type==="SCREEN_CAPTURED"&&(n(!1),i({base64:E.base64,width:E.width,height:E.height,source:E.source,elements:E.elements}),_(!1),O(!1)),E.type==="workflowStart"&&(j(E.goal??null),k(E.steps??[]),_(!1),O(!1)),E.type==="workflowStep"&&E.step){const R=E.step;k(B=>B.map(Z=>Z.id===R.id?R:Z))}if(E.type==="workflowDone"&&setTimeout(()=>{k([]),j(null)},2500),E.type==="shadowFrame"&&typeof E.slot!="number"&&(p(E.base64),m(!0),_(!1)),E.type==="shadowToggle"&&typeof E.slot!="number"&&(m(E.enabled),E.enabled||p(null)),E.type==="ghostFrame"){const R=typeof E.slot=="number"?E.slot:-1;R>=0&&R<=2&&typeof E.base64=="string"&&(w(B=>{const Z=[...B];return Z[R]=E.base64,Z}),_(!1))}if(E.type==="ghostSlot"){const R=typeof E.slot=="number"?E.slot:-1;R>=0&&R<=2&&g(R)}if(E.type==="shadowToggle"&&typeof E.slot=="number"){const R=E.slot;R>=0&&R<=2&&!E.enabled&&w(B=>{const Z=[...B];return Z[R]=null,Z})}if(E.type==="inputAction"){const R={id:`${Date.now()}-${Math.random()}`,action:E.action??"mouseClick",label:E.label??"",timestamp:E.timestamp??Date.now()};y(B=>[...B.slice(-11),R]),_(!1),O(!1)}};return z.on("agentUpdate",V),()=>{z.off("agentUpdate",V)}},[]),f.useEffect(()=>{var z;(z=N.current)==null||z.scrollIntoView({behavior:"smooth"})},[S]);const F=async()=>{if(!t){try{const z=await U("/api/system/vision-guidance");if(z.ok){const V=await z.json();V.warn&&V.message&&o(V.message)}}catch{}await U("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},D=v.some(z=>z!==null);return!(s||x.length>0||S.length>0||t||h||D)||T?null:r.jsx(ee,{children:r.jsxs($.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.22},className:"mx-4 mb-3 bg-[#0a0d16] border border-orange-500/12 rounded-2xl overflow-hidden shadow-xl shadow-orange-500/4 shrink-0",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500 animate-pulse"}),r.jsx("span",{className:"text-[10px] font-bold text-orange-400 uppercase tracking-widest",children:"War Room"}),s&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[s.width,"×",s.height]}),h&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-purple-400 bg-purple-500/10 border border-purple-500/25 px-2 py-0.5 rounded-full",children:[r.jsx(Ta,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:F,disabled:t,className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[11px] font-medium transition-all ${t?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-600 hover:text-orange-400 hover:bg-orange-500/8 border border-white/5"}`,children:[r.jsx(Hi,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(ph,{size:12}):r.jsx(Ts,{size:12})}),r.jsx("button",{onClick:()=>_(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:P?"Expand war room":"Collapse war room",children:P?r.jsx(ea,{size:12}):r.jsx(hh,{size:12})}),r.jsx("button",{onClick:()=>O(!0),className:"text-gray-700 hover:text-red-400 transition-colors",title:"Dismiss war room",children:r.jsx(st,{size:12})})]})]}),r.jsx(ee,{children:!P&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:[a&&r.jsxs("div",{className:"px-4 py-2 bg-amber-500/8 border-b border-amber-500/15 flex items-start justify-between gap-2",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed flex-1",children:a}),r.jsx("button",{onClick:()=>o(null),className:"text-[10px] text-amber-600 hover:text-amber-400 shrink-0",children:"Dismiss"})]}),r.jsxs("div",{className:"flex gap-0 divide-x divide-white/5",children:[r.jsx("div",{className:"w-1/2 shrink-0",children:D&&v[b]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(z=>v[z]!==null&&r.jsxs("button",{onClick:()=>g(z),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${b===z?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Ta,{size:7})," G",z+1]},z))}),r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[110px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${v[b]}`,alt:`Ghost ${b+1}`,className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ta,{size:8,className:"animate-pulse"})," G",b+1]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]})]}):h&&d?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${d}`,alt:"Shadow browser",className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ta,{size:8,className:"animate-pulse"})," SHADOW"]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]}):s?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("canvas",{ref:u,className:"w-full object-contain",style:{imageRendering:"auto"}}),s.elements&&s.elements.length>0&&r.jsxs("div",{className:"absolute bottom-1.5 right-1.5 px-2 py-0.5 bg-black/70 rounded text-[9px] font-mono text-orange-400 border border-orange-500/20",children:[s.elements.length," elements"]})]}):t?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(Hi,{size:13,className:"animate-spin"})," Scanning…"]}):r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-[11px]",children:"No capture yet"})}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.length>0&&r.jsxs("div",{className:"border-b border-white/5",children:[C&&r.jsx("div",{className:"px-3 py-1.5 border-b border-white/4 bg-white/[0.01]",children:r.jsxs("p",{className:"text-[10px] text-gray-500 truncate",children:[e.workflow.goal,": ",r.jsx("span",{className:"text-gray-300",children:C})]})}),r.jsx("div",{className:"p-2 space-y-1 max-h-[100px] overflow-y-auto scrollbar-hide",children:x.map(z=>{const V=_3[z.type]??Gt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${E3[z.status]}`,children:[z.status==="running"?r.jsx(re,{size:11,className:"animate-spin text-orange-400 shrink-0"}):z.status==="done"?r.jsx(Ue,{size:11,className:"text-green-500 shrink-0"}):r.jsx(V,{size:11,className:"text-gray-600 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.label})]},z.id)})})]}),S.length>0&&r.jsxs("div",{className:"flex-1 overflow-hidden",children:[r.jsx("div",{className:"px-3 py-1 border-b border-white/4",children:r.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Control Feed"})}),r.jsxs("div",{className:"px-2 py-1 space-y-px overflow-y-auto max-h-[100px] scrollbar-hide font-mono",children:[S.map(z=>{const V=T3[z.action]??a1,E=P3[z.action]??"text-gray-500";return r.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[r.jsx(V,{size:10,className:`${E} shrink-0`}),r.jsx("span",{className:`text-[10px] ${E} truncate flex-1`,children:z.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(z.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},z.id)}),r.jsx("div",{ref:N})]})]})]})]})]})})]})})}const Em="mustb_briefing_shown",M3=14*60*60*1e3,zu={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:na,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Gt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:Zy,color:"#fbbf24"}};function z3(e){const t=Object.keys(zu).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?zu[t]:{label:e,Icon:ll,color:"#fb923c"}}function R3(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function Tm(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function L3(e){const t=Date.now()-e,n=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return n>0?`${n} saat ${s} dk önce`:s>0?`${s} dk önce`:"Az önce"}const O3={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},D3={hidden:{opacity:0,y:32,scale:.97},show:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:260,damping:26}},exit:{opacity:0,y:20,scale:.97,transition:{duration:.25}}},I3={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},B3={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function F3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState([]),[o,l]=f.useState(!0),c=f.useRef(!1);f.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const d=await U("/api/automation/nightowl/status");if(!d.ok)return;const p=await d.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>M3||localStorage.getItem(Em)===String(p.lastShiftTs)||p.totalFindings===0)return;const h=await U("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),v=(h.ok?await h.json():{results:[]}).results.filter(w=>w.tags.some(b=>b.toLowerCase().includes("nightshift"))).slice(0,8).map(w=>({task:R3(w.tags),summary:w.content.replace(/\n/g," ").slice(0,180)}));s(p),a(v),l(!1),t(!0),localStorage.setItem(Em,String(p.lastShiftTs))}catch{}})())},[]);const u=()=>t(!1);return r.jsx(ee,{children:e&&r.jsx($.div,{variants:O3,initial:"hidden",animate:"show",exit:"exit",className:"fixed inset-0 z-[400] flex items-center justify-center px-4",style:{background:"rgba(4,1,0,0.82)",backdropFilter:"blur(8px)"},onClick:d=>{d.target===d.currentTarget&&u()},children:r.jsxs($.div,{variants:D3,initial:"hidden",animate:"show",exit:"exit",className:"relative w-full max-w-[620px] max-h-[88vh] flex flex-col rounded-3xl overflow-hidden",style:{background:"rgba(14,6,1,0.92)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(32px)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsx("button",{onClick:u,className:"absolute top-4 right-4 z-10 w-7 h-7 rounded-full flex items-center justify-center text-white/25 hover:text-white/70 hover:bg-white/8 transition-all",children:r.jsx(st,{size:14})}),r.jsxs("div",{className:"flex-shrink-0 px-8 pt-8 pb-6",style:{borderBottom:"1px solid rgba(249,115,22,0.10)"},children:[r.jsxs($.div,{initial:{opacity:0,y:-12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.5},className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)",boxShadow:"0 0 24px rgba(249,115,22,0.15)"},children:r.jsx(al,{size:22,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-semibold text-orange-400/60 tracking-widest uppercase mb-1",children:"Sabah Raporu"}),r.jsx("h2",{className:"text-[22px] font-black text-white/90 leading-tight tracking-tight",children:"Gece Vardiyası Tamamlandı"}),(n==null?void 0:n.lastShiftTs)&&r.jsxs("p",{className:"text-[12px] text-white/35 mt-1",children:[L3(n.lastShiftTs)," · ",Tm(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"flex items-center gap-4 mt-5",children:[{label:"Bulgu",value:String(n.totalFindings)},{label:"Görev",value:String(Object.keys(zu).length)},{label:"Süre",value:Tm(n.lastShiftMs)}].map(d=>r.jsxs("div",{className:"flex-1 rounded-xl px-3 py-2.5 text-center",style:{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.12)"},children:[r.jsx("p",{className:"text-[18px] font-black text-orange-400",children:d.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:d.label})]},d.label))})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-5 space-y-2.5",style:{scrollbarWidth:"none"},children:[o&&r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"flex gap-1.5",children:[0,1,2].map(d=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${d*.15}s`}},d))})}),!o&&i.length===0&&r.jsx("p",{className:"text-center text-[13px] text-white/30 py-10",children:"Kayıtlı bulgu bulunamadı."}),!o&&i.length>0&&r.jsx($.div,{variants:I3,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((d,p)=>{const h=z3(d.task),m=h.Icon;return r.jsx($.div,{variants:B3,children:r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-2xl",style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${h.color}22`},children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${h.color}15`,border:`1px solid ${h.color}30`},children:r.jsx(m,{size:14,style:{color:h.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-bold mb-1 tracking-wide",style:{color:h.color},children:h.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:d.summary})]}),r.jsx(ln,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex-shrink-0 px-8 py-5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:r.jsxs("button",{onClick:u,className:"w-full py-3 rounded-2xl flex items-center justify-center gap-2 font-bold text-[14px] transition-all active:scale-[0.98]",style:{background:"rgba(249,115,22,0.15)",border:"1px solid rgba(249,115,22,0.30)",color:"#fdba74"},onMouseEnter:d=>d.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:d=>d.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(Re,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const Pm={CodeHealth:{label:"Kod Sağlığı",Icon:cn,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:na,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Gt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:Zy,color:"#fbbf24"}};function V3(e){const t=Object.keys(Pm).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?Pm[t]:{label:e,Icon:ll,color:"#fb923c"}}function $3(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const U3={hidden:{opacity:0,x:24,scale:.96},show:{opacity:1,x:0,scale:1,transition:{type:"spring",stiffness:320,damping:28}},exit:{opacity:0,x:24,scale:.96,transition:{duration:.22}}},H3={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function W3(){const[e,t]=f.useState("idle"),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,u]=f.useState(!1),d=f.useRef(null),p=f.useRef(0),h=f.useCallback((v=2e4)=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{l(!1),setTimeout(()=>u(!1),600)},v)},[]);if(f.useEffect(()=>{const v=pt();return v.on("nightOwlEvent",w=>{if(w.type==="shiftStart"){d.current&&clearTimeout(d.current),t("scanning"),s([]),a(null),u(!0),l(!0);return}if(w.type==="finding"){const b={id:`${++p.current}`,task:String(w.task??"General"),summary:String(w.summary??"").slice(0,120),ts:Number(w.ts??Date.now())};s(g=>[b,...g].slice(0,20));return}if(w.type==="shiftEnd"){t("done"),a({findingsCount:Number(w.findingsCount??0),durationMs:Number(w.durationMs??0),ts:Number(w.ts??Date.now())}),h(2e4);return}}),()=>{v.off("nightOwlEvent"),d.current&&clearTimeout(d.current)}},[h]),!c)return null;const m="#fb923c";return r.jsx(ee,{children:r.jsx($.div,{variants:U3,initial:"hidden",animate:"show",exit:"exit",className:"fixed z-[130] flex flex-col",style:{top:"80px",right:"20px",width:"300px",maxHeight:"70vh",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.90)",border:`1px solid ${m}28`,backdropFilter:"blur(24px)",boxShadow:"0 12px 40px rgba(0,0,0,0.60), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("button",{onClick:()=>{l(v=>!v),d.current&&clearTimeout(d.current)},className:"flex items-center justify-between px-4 py-3 w-full select-none",style:{borderBottom:o?`1px solid ${m}10`:"none"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[e==="scanning"?r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-400 animate-ping opacity-70"})]}):e==="done"?r.jsx(Ue,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(al,{size:13,className:"text-orange-300/50 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-white/75",children:e==="scanning"?"Gece Vardiyası":"Vardiya Logu"}),e==="scanning"&&r.jsx("span",{className:"text-[10px] text-orange-400/70 font-mono animate-pulse",children:"taranıyor…"}),e==="done"&&i&&r.jsxs("span",{className:"text-[10px] text-white/30 font-mono",children:[i.findingsCount," bulgu · ",$3(i.durationMs)]})]}),o?r.jsx(hh,{size:12,className:"text-white/25"}):r.jsx(ea,{size:12,className:"text-white/25"})]}),r.jsx(ee,{children:o&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"52vh",scrollbarWidth:"none"},children:[e==="scanning"&&n.length===0&&r.jsxs("div",{className:"flex items-center justify-center py-8 gap-2",children:[r.jsx("div",{className:"flex gap-1",children:[0,1,2].map(v=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${v*.15}s`}},v))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(ee,{initial:!1,children:n.map(v=>{const w=V3(v.task),b=w.Icon;return r.jsxs($.div,{variants:H3,initial:"hidden",animate:"show",exit:{opacity:0,height:0},className:"flex items-start gap-3 px-4 py-3",style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[r.jsx("div",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${w.color}15`,border:`1px solid ${w.color}30`},children:r.jsx(b,{size:11,style:{color:w.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:w.color},children:w.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:v.summary})]})]},v.id)})}),e==="done"&&n.length===0&&r.jsx("p",{className:"text-center text-[12px] text-white/25 py-8",children:"Kayda değer bulgu yok."})]}),e==="done"&&i&&r.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between",style:{borderTop:`1px solid ${m}10`},children:[r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(i.ts).toLocaleTimeString("tr-TR")}),r.jsx("span",{className:"text-[10px] text-green-400/70 font-semibold",children:"✓ Tamamlandı"})]})]},"log-body")})]})},"night-shift-log")})}const Am="mustb_boot_report",Mm=14e3;function G3({value:e,max:t=10}){const n=Math.round(e/t*100),s=n>=70?"#22c55e":n>=40?"#f97316":"#ef4444";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.08)"},children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${n}%`,background:s}})}),r.jsx("span",{className:"text-[11px] font-mono",style:{color:s},children:e.toFixed(1)})]})}function K3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),i=f.useCallback(()=>{t(!1),localStorage.removeItem(Am)},[]);return f.useEffect(()=>{if(localStorage.getItem(Am)!=="1")return;t(!0),U("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,Mm);return()=>clearTimeout(a)},[i]),r.jsx(ee,{children:e&&r.jsx($.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:16},transition:{duration:.28,ease:"easeOut"},className:"fixed inset-0 z-[500] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)"},children:r.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl overflow-hidden",style:{background:"rgba(14,6,2,0.92)",border:"1px solid rgba(234,88,12,0.30)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(234,88,12,0.10)",backdropFilter:"blur(24px)"},children:[r.jsx("button",{onClick:i,className:"absolute top-3 right-3 text-white/25 hover:text-white/60 transition-colors z-10",children:r.jsx(st,{size:14})}),r.jsxs("div",{className:"px-5 pt-5 pb-3 flex items-center gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.25)"},children:r.jsx(Ue,{size:18,style:{color:"#22c55e"}})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:"System Ready"}),r.jsx("p",{className:"text-[11px] text-white/40",children:"Must-b initialised successfully"})]})]}),r.jsx("div",{style:{height:1,background:"rgba(255,255,255,0.05)",margin:"0 20px"}}),r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Agent"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.role)??"—"})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Model"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.model)??"—"})]})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5 space-y-2",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(un,{size:10})," CPU"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[(n==null?void 0:n.cpuPct)??0,"%"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(r1,{size:10})," RAM"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[((n==null?void 0:n.ramGb)??0).toFixed(2)," GB"]})]}),n&&r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(Re,{size:10})," Score"]}),r.jsx(G3,{value:n.score})]})]}),r.jsxs("div",{className:"flex items-center justify-between px-1",children:[r.jsx("span",{className:"text-[10px] text-white/30",children:"Dashboard port"}),r.jsxs("span",{className:"text-[11px] font-mono text-orange-400/70",children:[":",(n==null?void 0:n.port)??4309]})]})]}),r.jsx("div",{className:"px-5 pb-4",style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px"},children:r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-semibold transition-all",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.30)",color:"#fb923c"},children:"Open Dashboard"})}),r.jsx($.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:Mm/1e3,ease:"linear"},style:{position:"absolute",bottom:0,left:0,right:0,height:2,background:"rgba(234,88,12,0.50)",transformOrigin:"left"}})]})},"boot-report")})}function zm(){return f.useEffect(()=>{pt()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(C3,{}),r.jsx(A3,{}),r.jsx(S3,{}),r.jsx(K3,{}),r.jsx(F3,{}),r.jsx(W3,{})]})}function sa(){const[e,t]=f.useState(!1),[n,s]=f.useState(!0),i=f.useRef(!0),a=f.useCallback(async()=>{try{const o=await U("/api/gateway/status",{},{retries:1,retryDelay:500});if(!i.current)return;const l=await o.json().catch(()=>({}));t(!!(l!=null&&l.online))}catch{i.current&&t(!1)}finally{i.current&&s(!1)}},[]);return f.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},u=()=>{i.current&&t(!1)};try{pt()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",u),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",u)}},[a]),{online:e,loading:n}}function Rm({connected:e,configured:t}){return e?r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}):t?r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-400 flex-shrink-0"}):r.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-600 flex-shrink-0"})}function q3(){const{online:e}=sa(),[t,n]=f.useState(null),[s,i]=f.useState([]),[a,o]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!0);f.useEffect(()=>{(async()=>{var g;d(!0);try{const k=await(await U("/api/gateway/channels")).json();n(k),(g=k.channelOrder)!=null&&g.length&&o(k.channelOrder[0])}catch{n({offline:!0,channelOrder:[],channelLabels:{},channelAccounts:{}})}finally{d(!1)}})()},[e]),f.useEffect(()=>{t!=null&&t.offline&&U("/api/channels").then(b=>b.json()).then(i).catch(()=>i([]))},[t==null?void 0:t.offline]);const p=async(b,g)=>{c(`${b}-${g}`);try{await U(`/api/gateway/channels/${b}/logout`,{method:"POST",body:JSON.stringify({accountId:g})});const x=await U("/api/gateway/channels");n(await x.json())}catch{}finally{c(null)}};if(u)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(de,{size:18,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Kanallar yükleniyor…"})]});if(t!=null&&t.offline)return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:14,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Must-b gateway çevrimdışı — yerel kanallar gösteriliyor."})]}),s.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:"Yapılandırılmış kanal yok."}):r.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(b=>r.jsxs("div",{className:"px-3 py-2.5 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(Rm,{configured:b.configured,connected:!1}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200",children:b.name}),b.configured&&r.jsx("span",{className:"ml-auto text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/10 border border-orange-500/20 text-orange-400",children:"Yapılandırıldı"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:b.description})]},b.id))})]});const h=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},v=(t==null?void 0:t.channelAccounts)??{};if(h.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const w=a?v[a]??[]:[];return r.jsxs("div",{className:"flex gap-4 min-h-[320px]",children:[r.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:h.map(b=>{const g=v[b]??[],x=g.some(C=>C.connected),k=g.some(C=>C.configured);return r.jsx("button",{onClick:()=>o(b),className:`w-full text-left px-3 py-2 rounded-xl border transition-all ${a===b?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rm,{connected:x,configured:k}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-200 truncate",children:m[b]??b}),g.length>0&&r.jsx("span",{className:"ml-auto text-[10px] font-bold text-gray-500",children:g.length})]})},b)})}),r.jsx("div",{className:"flex-1 min-w-0",children:a?w.length===0?r.jsxs("div",{className:"px-4 py-4 rounded-xl bg-white/3 border border-white/6",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-300 mb-1",children:m[a]??a}),r.jsx("p",{className:"text-[12px] text-gray-500",children:"Henüz bağlı hesap yok."})]}):r.jsx("div",{className:"space-y-2",children:w.map(b=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.connected?r.jsx(Ue,{size:13,className:"text-green-400 flex-shrink-0"}):b.lastError?r.jsx(Xy,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(es,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200 truncate",children:b.name??b.accountId}),r.jsxs("button",{onClick:()=>p(a,b.accountId),disabled:l===`${a}-${b.accountId}`,className:"ml-auto flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[r.jsx(mh,{size:9}),"Logout"]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Status"}),r.jsx("span",{className:`text-[11px] font-semibold ${b.connected?"text-green-400":"text-gray-500"}`,children:b.connected?"Connected":"Disconnected"})]}),b.lastConnectedAt&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Last seen"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:new Date(b.lastConnectedAt).toLocaleString()})]}),b.lastError&&r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0 pt-0.5",children:"Error"}),r.jsx("span",{className:"text-[11px] text-red-400 break-all",children:b.lastError})]})]})]},b.accountId))}):r.jsx("p",{className:"text-sm text-gray-600 pt-4",children:"Bir kanal seçin."})})]})}function Y3(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function X3(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const Lm={free:{label:"Free",icon:r.jsx(PS,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(KS,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(Re,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function Q3({currentModel:e,onSelect:t,className:n}){const[s,i]=f.useState(null),[a,o]=f.useState(!0),[l,c]=f.useState(null),[u,d]=f.useState("free"),[p,h]=f.useState(""),m=f.useRef(null),v=(g=!1)=>{o(!0),c(null),fetch(`/api/providers/openrouter/models${g?"?refresh=1":""}`).then(x=>x.ok?x.json():Promise.reject(new Error(`HTTP ${x.status}`))).then(x=>{if(i(x),e){const k=x.free.some(C=>C.id===e)?"free":x.balanced.some(C=>C.id===e)?"balanced":x.power.some(C=>C.id===e)?"power":"free";d(k)}o(!1)}).catch(x=>{c(x.message),o(!1)})};f.useEffect(()=>{v()},[]),f.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[u,s]);const w=(s==null?void 0:s[u])??[],b=p?w.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):w;return r.jsxs("div",{className:`flex flex-col rounded-xl overflow-hidden ${n??""}`,style:{background:"rgba(12,5,2,0.85)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2",children:[r.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"OpenRouter Models"}),r.jsx("button",{onClick:()=>v(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(de,{size:11,className:a?"animate-spin":""})})]}),r.jsx("div",{className:"flex gap-1 px-3 pb-2",children:["free","balanced","power"].map(g=>{var j;const x=Lm[g],k=((j=s==null?void 0:s.totals)==null?void 0:j[g])??0,C=u===g;return r.jsxs("button",{onClick:()=>d(g),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-[11px] font-semibold transition-all",style:{background:C?x.bg:"transparent",color:C?x.color:"#6b7280",border:`1px solid ${C?x.color+"40":"transparent"}`},children:[x.icon,x.label,k>0&&r.jsx("span",{className:"text-[9px] font-bold opacity-60",children:k})]},g)})}),r.jsx("div",{className:"px-3 pb-2",children:r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>h(g.target.value),placeholder:"Search models…",className:"w-full pl-7 pr-3 py-1.5 rounded-lg text-[11px] text-gray-300 placeholder-gray-600 outline-none",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"}})]})}),r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:[a&&r.jsxs("div",{className:"py-8 text-center text-[11px] text-gray-600",children:[r.jsx(de,{size:14,className:"animate-spin mx-auto mb-2"}),"Fetching live catalog…"]}),!a&&l&&r.jsxs("div",{className:"py-6 px-4 text-center text-[11px] text-red-400",children:[l,r.jsx("br",{}),r.jsx("button",{onClick:()=>v(!0),className:"mt-2 underline text-orange-400 hover:text-orange-300",children:"Retry"})]}),!a&&!l&&b.length===0&&r.jsx("div",{className:"py-8 text-center text-[11px] text-gray-600",children:"No models found."}),!a&&!l&&b.map(g=>{const x=g.id===e,k=Lm[g.tier];return r.jsx("button",{ref:x?m:void 0,onClick:()=>t(g.id),className:"w-full text-left px-3 py-2 transition-all",style:{background:x?"rgba(234,88,12,0.10)":"transparent",borderLeft:x?"2px solid #ea580c":"2px solid transparent"},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`text-[12px] font-semibold truncate ${x?"text-orange-300":"text-gray-300"}`,children:g.name}),g.hasVision&&r.jsx(Ts,{size:9,className:"text-purple-400 flex-shrink-0",title:"Vision / multimodal"})]}),r.jsx("span",{className:"text-[9px] text-gray-600 font-mono truncate block",children:g.id}),g.description&&r.jsx("span",{className:"text-[10px] text-gray-600 line-clamp-1 mt-0.5",children:g.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx("span",{className:"text-[9px] font-bold",style:{color:k.color},children:Y3(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[X3(g.contextK)," ctx"]})]})]})},g.id)})]}),s&&r.jsx("div",{className:"px-3 py-1.5 border-t",style:{borderColor:"rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-gray-700 font-mono",children:["Catalog cached · ",new Date(s.fetchedAt).toLocaleTimeString()]})})]})}const cc=[{code:"en",label:"English",flag:"🇬🇧",native:"English"},{code:"tr",label:"Turkish",flag:"🇹🇷",native:"Türkçe"},{code:"de",label:"German",flag:"🇩🇪",native:"Deutsch"},{code:"fr",label:"French",flag:"🇫🇷",native:"Français"},{code:"es",label:"Spanish",flag:"🇪🇸",native:"Español"},{code:"pt",label:"Portuguese (Brazil)",flag:"🇧🇷",native:"Português"},{code:"ja",label:"Japanese",flag:"🇯🇵",native:"日本語"},{code:"zh",label:"Chinese (Simplified)",flag:"🇨🇳",native:"简体中文"}];function J3(){const{locale:e,setLocale:t}=ht(),[n,s]=f.useState(!1),i=f.useRef(null),a=cc.find(o=>o.code===e)??cc[0];return f.useEffect(()=>{if(!n)return;const o=l=>{l.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),r.jsxs("div",{ref:i,className:"relative",children:[r.jsxs("button",{onClick:()=>s(o=>!o),"aria-label":"Switch language",className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border text-[12px] font-semibold transition-all select-none ${n?"bg-orange-500/15 border-orange-400/30 text-orange-700":"text-black/65 border-transparent hover:text-black hover:bg-black/6"}`,children:[r.jsx(LS,{size:12,className:"text-orange-400 shrink-0"}),r.jsx("span",{children:a.flag}),r.jsx("span",{className:"tracking-wide",children:a.code.toUpperCase()})]}),r.jsx(ee,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs($.div,{initial:{opacity:0,y:-6,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-6,scale:.96},transition:{duration:.13,ease:"easeOut"},className:"absolute right-0 top-full mt-2 z-20 w-52 bg-[#100806]/96 backdrop-blur-2xl border border-orange-500/15 rounded-xl shadow-2xl shadow-black/60 overflow-hidden max-h-72 overflow-y-auto",children:[r.jsx("div",{className:"px-3 py-2 border-b border-white/6",children:r.jsx("p",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Language"})}),cc.map(o=>{const l=e===o.code;return r.jsxs("button",{onClick:()=>{t(o.code),s(!1)},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[12px] font-medium transition-colors ${l?"bg-orange-500/12 text-orange-400":"text-gray-300 hover:bg-white/5 hover:text-white"}`,children:[r.jsx("span",{className:"text-base leading-none",children:o.flag}),r.jsxs("div",{className:"text-left flex-1",children:[r.jsx("p",{className:"leading-none",children:o.native}),!l&&r.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:o.label})]}),l&&r.jsx(Kt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const Om={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},Dm=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function E1({tag:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-[9px] text-gray-400 font-medium",children:e})}function Z3({p:e,active:t,onClick:n}){return r.jsx("button",{onClick:n,className:`w-full text-left px-3 py-2.5 rounded-xl border transition-all ${t?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:`text-[13px] font-semibold leading-tight truncate ${t?"text-orange-300":"text-gray-200"}`,children:e.label}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5 leading-snug line-clamp-2",children:e.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:e.tags.slice(0,3).map(s=>r.jsx(E1,{tag:s},s))})]}),t&&r.jsx(ln,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function eC(){const{t:e}=ht(),t=e.panels.settings,[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState([]),[c,u]=f.useState("all"),[d,p]=f.useState(""),[h,m]=f.useState(null),[v,w]=f.useState(""),[b,g]=f.useState(""),[x,k]=f.useState(!1),[C,j]=f.useState(!1),[S,y]=f.useState(!1),[N,P]=f.useState(null),[_,T]=f.useState(null),[O,F]=f.useState(!!window.__MUSTB_NEED_API_KEY),[D,M]=f.useState(null),[z,V]=f.useState("providers"),E=f.useRef(null);f.useEffect(()=>{U("/api/setup/providers").then(Y=>Y.ok?Y.json():null).then(Y=>{Y!=null&&Y.providers&&s(Y.providers)}).catch(()=>{}),U("/api/setup/status").then(Y=>Y.ok?Y.json():null).then(Y=>{Y&&a(Y)}).catch(()=>{}),U("/api/setup/ollama-models").then(Y=>Y.ok?Y.json():null).then(Y=>{Y!=null&&Y.models&&l(Y.models)}).catch(()=>{});const W=()=>{F(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",W),()=>window.removeEventListener("mustb:401",W)},[]),f.useEffect(()=>{h&&w(h.defaultModel)},[h]);const R=d.toLowerCase(),B=n.filter(W=>!(c!=="all"&&W.category!==c||R&&!W.label.toLowerCase().includes(R)&&!W.description.toLowerCase().includes(R))),Z={};for(const W of B)Z[W.category]||(Z[W.category]=[]),Z[W.category].push(W);const K=async()=>{if(h){j(!0),P(null);try{const Y=await(await U("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:b||void 0,model:v||void 0})})).json();P({ok:Y.ok,msg:Y.message??(Y.ok?"Connection successful":"Connection failed")})}catch{P({ok:!1,msg:"Gateway unreachable"})}j(!1)}},ie=async()=>{if(!(!h||!h.envKeyIsUrl&&!b.trim())){y(!0),T(null);try{const Y=await U("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:b||void 0,model:v||void 0})});if(Y.ok){T("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,F(!1);const Mt=await U("/api/setup/status");Mt.ok&&a(await Mt.json())}else{const Mt=await Y.json();T(Mt.error??"Failed to save.")}}catch{T("Gateway unreachable.")}y(!1),setTimeout(()=>T(null),6e3)}},te=W=>{M(W),U("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:W})}).finally(()=>{setTimeout(()=>M(null),3e3)})},ce=(h==null?void 0:h.envKeyIsUrl)??!1,fe=(h==null?void 0:h.id)==="ollama",ae=(h==null?void 0:h.id)==="openrouter",Je=Dm.filter(W=>n.some(Y=>Y.category===W)),kt=i?i.score>=70?"text-green-400":i.score>=40?"text-amber-400":"text-red-400":"text-gray-400";return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden font-sans",children:[r.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center",children:r.jsx(yh,{size:15,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white leading-tight",children:t.title}),r.jsxs("p",{className:"text-[10px] text-gray-400 leading-tight",children:[i!=null&&i.configured?`Active · ${i.provider??"unknown"}`:"Not configured",i!=null&&i.mode?` · ${i.mode}`:""]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(J3,{}),i&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8",children:[r.jsx(un,{size:11,className:kt}),r.jsxs("span",{className:`text-[11px] font-semibold ${kt}`,children:["HW ",i.score]}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:["· ",i.tier]})]})]})]}),O&&r.jsxs("div",{className:"shrink-0 mx-4 mt-3 flex items-start gap-2.5 px-3.5 py-2.5 rounded-xl bg-red-500/10 border border-red-500/25 text-red-300",children:[r.jsx(es,{size:14,className:"shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold",children:"API key missing or invalid"}),r.jsx("p",{className:"text-[10px] text-red-400/70 mt-0.5",children:"A request returned 401 Unauthorized. Select a provider and update your key below."})]})]}),r.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-5 pt-3 pb-0",children:[r.jsxs("button",{onClick:()=>V("providers"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="providers"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(un,{size:11})," LLM Providers"]}),r.jsxs("button",{onClick:()=>V("channels"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="channels"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(i1,{size:11})," Kanallar"]})]}),z==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(q3,{})}),z==="providers"&&r.jsxs("div",{className:"flex flex-1 min-h-0 gap-0",children:[r.jsxs("div",{className:"w-[52%] flex flex-col border-r border-white/6 min-h-0",children:[r.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-2 space-y-2.5",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:E,type:"text",value:d,onChange:W=>p(W.target.value),placeholder:t.searchPlaceholder,className:"w-full bg-white/4 border border-white/8 rounded-xl pl-8 pr-3 py-2 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.jsx("button",{onClick:()=>u("all"),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c==="all"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:t.allProviders}),Je.map(W=>r.jsx("button",{onClick:()=>u(W),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c===W?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:Om[W]},W))]})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4 space-y-4",children:[n.length===0&&r.jsxs("div",{className:"flex items-center gap-2 py-6 text-gray-400 text-[12px]",children:[r.jsx(re,{size:13,className:"animate-spin"})," Loading providers…"]}),Dm.filter(W=>{var Y;return(Y=Z[W])==null?void 0:Y.length}).map(W=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:Om[W]}),r.jsx("div",{className:"space-y-1.5",children:Z[W].map(Y=>r.jsx(Z3,{p:Y,active:(h==null?void 0:h.id)===Y.id,onClick:()=>{m(Y),P(null),g("")}},Y.id))})]},W)),n.length>0&&B.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',d,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:h?r.jsxs("div",{className:"p-5 space-y-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-[16px] font-bold text-white",children:h.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:h.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.tags.map(W=>r.jsx(E1,{tag:W},W))})]}),r.jsxs("a",{href:h.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white transition-colors",children:["Docs ",r.jsx(il,{size:10})]})]}),fe&&o.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:"Recommended Models for Your Hardware"}),r.jsx("div",{className:"space-y-1.5",children:o.map(W=>{const Y=W.fit==="recommended"?"text-green-400 border-green-500/20 bg-green-500/6":W.fit==="marginal"?"text-amber-400 border-amber-500/20 bg-amber-500/6":"text-red-400 border-red-500/20 bg-red-500/6";return r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-200 truncate",children:W.label}),r.jsxs("p",{className:"text-[10px] text-gray-400",children:[W.sizeGb," GB"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${Y}`,children:W.fit}),r.jsxs("button",{onClick:()=>{w(W.id),te(W.id)},disabled:D===W.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/10 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[D===W.id?r.jsx(re,{size:10,className:"animate-spin"}):r.jsx(Jy,{size:10}),D===W.id?"Pulling…":"Pull"]})]})]},W.id)})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[ce?r.jsx(YS,{size:9}):r.jsx(zS,{size:9}),ce?t.baseUrl:t.apiKey]}),fe&&!ce?r.jsx("div",{className:"px-3.5 py-2.5 rounded-xl bg-green-500/6 border border-green-500/15 text-green-400 text-[12px]",children:"Ollama runs locally — no API key required. Just make sure Ollama is running."}):r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:x||ce?"text":"password",value:b,onChange:W=>{g(W.target.value),P(null)},placeholder:h.placeholder,className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 pr-10 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),!ce&&r.jsx("button",{onClick:()=>k(W=>!W),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300 transition-colors",children:x?r.jsx(ph,{size:13}):r.jsx(Ts,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:ce?`Stored in .env as ${h.envKey}. Default: ${h.placeholder}`:`Stored locally in .env as ${h.envKey} — never sent to external servers.`})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(Re,{size:9}),t.model]}),ae?r.jsx(Q3,{currentModel:v,onSelect:w,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:v,onChange:W=>w(W.target.value),className:"w-full bg-white/4 border border-white/10 rounded-xl px-3 py-2.5 text-[12px] text-white outline-none focus:border-orange-500/40 transition-colors appearance-none",children:h.latestModels.map(W=>r.jsx("option",{value:W,className:"bg-[#1a0c06]",children:W},W))})]}),r.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[!fe&&r.jsxs("button",{onClick:K,disabled:C||!b&&!(i!=null&&i.configured),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-white/5 border border-white/10 text-[12px] text-gray-300 font-medium hover:bg-white/8 hover:text-white transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:C?"animate-spin":""}),C?t.testing:t.testConnection]}),r.jsxs("button",{onClick:ie,disabled:S||!b.trim()&&!ce&&!fe,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-orange-600 hover:bg-orange-500 text-white text-[12px] font-semibold transition-all disabled:opacity-40 shadow-lg shadow-orange-500/20",children:[r.jsx(l1,{size:12,className:S?"animate-spin":""}),S?t.saving:t.save]})]}),N&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${N.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[N.ok?r.jsx(Ue,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(es,{size:13,className:"shrink-0 mt-0.5"}),N.msg]}),_&&r.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20 text-orange-300 text-[12px]",children:[r.jsx(Ue,{size:13,className:"shrink-0"}),_]}),fe&&r.jsxs("div",{className:"pt-1 space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(MS,{size:9}),"Custom Base URL (optional)"]}),r.jsx("input",{type:"text",value:b,onChange:W=>g(W.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:"Leave blank to use the default http://localhost:11434"})]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-8",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl bg-orange-500/8 border border-orange-500/15 flex items-center justify-center",children:r.jsx(Xe,{size:20,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[13px] text-gray-400",children:"Select a provider from the left to configure your API key"})]})})]})]})}function tC(e){if(!e)return"—";const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}s önce`:t<36e5?`${Math.floor(t/6e4)}dk önce`:`${Math.floor(t/36e5)}sa önce`}function nC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),l=async()=>{i(!0);try{const p=await(await U("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),h=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(h)}catch{n([])}finally{i(!1)}};f.useEffect(()=>{l()},[e]);const c=d=>!!d.runningAtMs&&Date.now()-d.runningAtMs<12e4,u=t.filter(d=>a==="running"?c(d):a==="idle"?!c(d):!0);return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(Xe,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Aktif Oturumlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," oturum"]})]})]}),r.jsxs("button",{onClick:l,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""}),"Yenile"]})]}),!e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Gateway çevrimdışı — oturum verisi alınamıyor."})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","running","idle"].map(d=>r.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"Tümü":d==="running"?"Çalışıyor":"Boşta"},d))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):u.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ta,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Aktif oturum bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:u.map(d=>{const p=c(d);return r.jsx("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:p?r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400 animate-pulse"}):r.jsx("span",{className:"block w-2 h-2 rounded-full bg-gray-700"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:d.derivedTitle??d.label??d.key.slice(0,20)+"…"}),d.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(un,{size:9}),d.agentId]})]}),d.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:d.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[d.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[d.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(en,{size:9}),tC(d.lastActivityAt)]})]})]})]})},d.key)})})]})}function sC(e){if(!e||typeof e!="object")return String(e??"—");const t=e;return t.type==="every"&&t.intervalMs?`Her ${Math.round(t.intervalMs/6e4)} dakika`:t.type==="at"&&t.time?`Her gün ${t.time}`:t.type==="cron"&&t.expression?`Cron: ${t.expression}`:JSON.stringify(e).slice(0,40)}function rC(e){if(!e)return"—";const t=e-Date.now();return t<0?"Geçti":t<6e4?`${Math.floor(t/1e3)}s sonra`:t<36e5?`${Math.floor(t/6e4)}dk sonra`:`${Math.floor(t/36e5)}sa sonra`}function iC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),[l,c]=f.useState(null),[u,d]=f.useState(null),p=async()=>{i(!0);try{const x=await(await U("/api/gateway/automations?enabled=all&limit=50")).json();n(Array.isArray(x==null?void 0:x.jobs)?x.jobs:Array.isArray(x)?x:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{p()},[e]);const h=async g=>{try{await U(`/api/gateway/automations/${g.id}`,{method:"PATCH",body:JSON.stringify({patch:{enabled:!g.enabled}})}),n(x=>x.map(k=>k.id===g.id?{...k,enabled:!k.enabled}:k))}catch{}},m=async g=>{c(g);try{await U(`/api/gateway/automations/${g}/run`,{method:"POST"}),await p()}catch{}finally{c(null)}},v=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){d(g);try{await U(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(k=>k.id!==g))}catch{}finally{d(null)}}},w=t.filter(g=>a==="enabled"?g.enabled:a==="disabled"?!g.enabled:!0),b=g=>g==="ok"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-green-400",children:[r.jsx(Ue,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(Xy,{size:9})," Hata"]}):r.jsx("span",{className:"text-[10px] text-gray-600",children:"—"});return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(Re,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Otomasyonlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," zamanlanmış görev"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:p,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","enabled","disabled"].map(g=>r.jsx("button",{onClick:()=>o(g),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===g?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:g==="all"?"Tümü":g==="enabled"?"Aktif":"Pasif"},g))}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):w.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Re,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Otomasyon bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:w.map(g=>{var x,k;return r.jsx("div",{className:`px-4 py-3 rounded-xl border transition-all ${g.enabled?"bg-white/[0.025] border-white/6":"bg-white/[0.01] border-white/4"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("button",{onClick:()=>h(g),disabled:!e,className:"mt-0.5 text-gray-500 hover:text-orange-400 transition-colors disabled:opacity-40",title:g.enabled?"Devre dışı bırak":"Etkinleştir",children:g.enabled?r.jsx(t4,{size:18,className:"text-orange-400"}):r.jsx(e4,{size:18})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:`text-[13px] font-semibold truncate ${g.enabled?"text-gray-200":"text-gray-500"}`,children:g.name??g.id}),b((x=g.state)==null?void 0:x.lastRunStatus)]}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-gray-500",children:[r.jsx(en,{size:9})," ",sC(g.schedule)]}),((k=g.state)==null?void 0:k.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:rC(g.state.nextRunAtMs)})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsxs("button",{onClick:()=>m(g.id),disabled:!e||l===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/8 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[l===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx(Rs,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>v(g.id),disabled:!e||u===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[u===g.id?r.jsx(de,{size:9,className:"animate-spin"}):r.jsx(Ls,{size:9}),"Sil"]})]})]})},g.id)})})]})}function aC(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function oC({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(mm,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(mm,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Ky,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(xh,{size:14,className:"text-blue-400"}):r.jsx(OS,{size:14,className:"text-gray-500"})}function lC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState(null),[l,c]=f.useState(""),u=async()=>{i(!0);try{const h=await(await U("/api/gateway/clients")).json();n(Array.isArray(h==null?void 0:h.nodes)?h.nodes:Array.isArray(h)?h:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{u()},[e]);const d=async p=>{if(!l.trim()){o(null);return}try{await U(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(h=>h.map(m=>m.nodeId===p?{...m,displayName:l.trim()}:m))}catch{}finally{o(null)}};return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(gm,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Bağlı Nodlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," cihaz"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:u,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(de,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):t.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(gm,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Bağlı node yok.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map(p=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[r.jsx(oC,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:h=>c(h.target.value),onBlur:()=>d(p.nodeId),onKeyDown:h=>{h.key==="Enter"&&d(p.nodeId),h.key==="Escape"&&o(null)},className:"w-full bg-white/6 border border-orange-500/30 rounded-lg px-2 py-0.5 text-[13px] text-white outline-none"}):r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate cursor-text",onDoubleClick:()=>{o(p.nodeId),c(p.displayName??"")},title:"Çift tıklayarak düzenle",children:p.displayName??p.nodeId})}),r.jsx("span",{className:`flex-shrink-0 w-2 h-2 rounded-full mt-1 ${aC(p)?"bg-green-400 animate-pulse":"bg-gray-700"}`})]}),r.jsxs("div",{className:"space-y-1",children:[p.platform&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Platform"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.platform})]}),p.version&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Versiyon"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.version})]}),(p.caps??[]).length>0&&r.jsxs("div",{className:"flex items-center gap-1 flex-wrap mt-1",children:[(p.caps??[]).slice(0,3).map(h=>r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-[9px] text-orange-400 font-medium",children:h},h)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function cC({online:e}){var u;const[t,n]=f.useState({}),[s,i]=f.useState(!0),a=f.useRef(0),o=f.useRef(null),l=async(d=0)=>{try{const h=await(await U(`/api/gateway/logs?cursor=${d}&limit=200`)).json();d===0?(n(h),a.current=h.cursor??0):(n(m=>({...h,lines:[...m.lines??[],...h.lines??[]]})),a.current=h.cursor??a.current)}catch{}finally{i(!1)}};f.useEffect(()=>{l(0)},[e]),f.useEffect(()=>{const d=setInterval(()=>l(a.current),1e4);return()=>clearInterval(d)},[e]),f.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(u=t.lines)==null?void 0:u.length]);const c=d=>d.includes("error")||d.includes("ERROR")?"text-red-400":d.includes("warn")||d.includes("WARN")?"text-amber-400":d.includes("info")||d.includes("INFO")?"text-green-400":"text-gray-400";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("p",{className:"text-[11px] text-gray-600",children:[(t.lines??[]).length," satır"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{onClick:()=>navigator.clipboard.writeText((t.lines??[]).join(`
683
- `)),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(sl,{size:10})," Kopyala"]}),r.jsxs("button",{onClick:()=>{a.current=0,l(0)},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(de,{size:10})," Sıfırla"]})]})]}),r.jsx("div",{ref:o,className:"h-96 overflow-y-auto rounded-xl bg-black/40 border border-white/6 p-3 font-mono text-[11px] space-y-0.5",children:s?r.jsx("p",{className:"text-gray-600",children:"Yükleniyor…"}):!e||t.offline?r.jsx("p",{className:"text-orange-500",children:"Gateway çevrimdışı — log verisi alınamıyor."}):(t.lines??[]).length===0?r.jsx("p",{className:"text-gray-600",children:"Henüz log yok."}):(t.lines??[]).map((d,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(d)}`,children:d},p))})]})}function uC({online:e}){var l,c;const[t,n]=f.useState({}),[s,i]=f.useState(!0);f.useEffect(()=>{i(!0),U("/api/gateway/usage/cost").then(u=>u.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(u=>u.tokens??0));return r.jsxs("div",{className:"space-y-4",children:[(!e||t.offline)&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:12,className:"text-orange-400"}),r.jsx("p",{className:"text-[11px] text-orange-300",children:"Gateway çevrimdışı."})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsx("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest",children:"Toplam Token"}),r.jsx("p",{className:"text-xl font-bold text-white",children:s?"—":(((l=t.total)==null?void 0:l.tokens)??0).toLocaleString()})]}),r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest flex items-center gap-1",children:[r.jsx(CS,{size:8})," Tahmini Maliyet"]}),r.jsx("p",{className:"text-xl font-bold text-orange-400",children:s?"—":`$${(((c=t.total)==null?void 0:c.cost)??0).toFixed(4)}`})]})]}),(t.providers??[]).length>0&&r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{children:"Provider"}),r.jsx("span",{className:"text-right",children:"Giriş"}),r.jsx("span",{className:"text-right",children:"Çıkış"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),(t.providers??[]).map((u,d)=>r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"text-gray-300 font-medium truncate",children:u.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(u.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(u.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(u.cost??0).toFixed(4)]})]},d))]}),a.length>0&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"Günlük Kullanım"}),r.jsx("div",{className:"flex items-end gap-1 h-16 px-1",children:a.slice(-14).map((u,d)=>{var h;const p=Math.max(2,Math.round((u.tokens??0)/o*56));return r.jsxs("div",{className:"flex-1 flex flex-col items-center gap-0.5",children:[r.jsx("div",{style:{height:p},className:"w-full rounded-sm bg-orange-500/40 hover:bg-orange-500/60 transition-all",title:`${u.date}: ${(u.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(h=u.date)==null?void 0:h.slice(5)})]},d)})})]})]})}function dC({online:e}){const[t,n]=f.useState([]),[s,i]=f.useState(!0);return f.useEffect(()=>{i(!0),U("/api/gateway/sessions/usage?limit=30").then(a=>a.json()).then(a=>n(Array.isArray(a)?a:(a==null?void 0:a.sessions)??[])).catch(()=>n([])).finally(()=>i(!1))},[e]),r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{className:"col-span-2",children:"Oturum"}),r.jsx("span",{className:"text-right",children:"Token"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),s?r.jsx("div",{className:"flex justify-center py-6",children:r.jsx(de,{size:14,className:"animate-spin text-orange-400"})}):t.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:e?"Oturum bulunamadı.":"Gateway çevrimdışı."}):t.map((a,o)=>{var l;return r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"col-span-2 text-gray-300 truncate font-mono text-[10px]",children:((l=a.key)==null?void 0:l.slice(0,28))??"—"}),r.jsx("span",{className:"text-right text-gray-500",children:(a.tokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(a.cost??0).toFixed(4)]})]},o)})]})}function hC(){const{online:e}=sa(),[t,n]=f.useState("logs");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(NS,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Loglar & Aktivite"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b gateway log, kullanım ve oturum istatistikleri"})]}),!e&&r.jsxs("span",{className:"ml-auto flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]})]}),r.jsx("div",{className:"flex gap-1.5",children:["logs","usage","sessions"].map(s=>r.jsx("button",{onClick:()=>n(s),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${t===s?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:s==="logs"?"Loglar":s==="usage"?"Kullanım":"Oturumlar"},s))}),t==="logs"&&r.jsx(cC,{online:e}),t==="usage"&&r.jsx(uC,{online:e}),t==="sessions"&&r.jsx(dC,{online:e})]})}function pC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState("all"),[o,l]=f.useState(new Set);f.useEffect(()=>{s(!0),U("/api/tools").then(d=>d.json()).then(d=>{const p=Array.isArray(d==null?void 0:d.groups)?d.groups:[];t(p),l(new Set(p.slice(0,3).map(h=>h.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(d=>({...d,tools:(d.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(d=>d.tools.length>0),u=d=>{l(p=>{const h=new Set(p);return h.has(d)?h.delete(d):h.add(d),h})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(d=>r.jsx("button",{onClick:()=>a(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"All":d==="core"?"Core":"Plugin"},d))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):c.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No tools found."}):r.jsx("div",{className:"space-y-2",children:c.map(d=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>u(d.id),className:"w-full flex items-center justify-between px-4 py-2.5 hover:bg-white/3 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bh,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:d.label??d.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=d.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(d.id)?r.jsx(ea,{size:12,className:"text-gray-600"}):r.jsx(ln,{size:12,className:"text-gray-600"})]}),o.has(d.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(d.tools??[]).map((h,m)=>r.jsxs("div",{className:"px-4 py-2 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300",children:h.label??h.name}),h.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:h.description})]}),r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${h.source==="plugin"?"bg-blue-500/8 border-blue-500/20 text-blue-400":"bg-orange-500/8 border-orange-500/20 text-orange-400"}`,children:h.source==="plugin"?"plugin":"core"})})]},m))})]},d.id)})})]})}function fC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0);return f.useEffect(()=>{s(!0),U("/api/agents").then(i=>i.json()).then(i=>t(Array.isArray(i==null?void 0:i.agents)?i.agents:[])).catch(()=>t([])).finally(()=>s(!1))},[]),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(de,{size:18,className:"animate-spin text-orange-400"})}):e.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No agents found."}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(i=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[r.jsx("span",{className:"text-xl",children:i.emoji??"🤖"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:i.name??i.id})}),i.isDefault&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/12 border border-orange-500/25 text-orange-400",children:"Default"})]}),i.description&&r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:i.description})]},i.id))})}function mC(){const[e,t]=f.useState("tools");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(na,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Skills & Plugins"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b tool catalog and agent management"})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["tools","agents"].map(n=>r.jsxs("button",{onClick:()=>t(n),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${e===n?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:[n==="tools"?r.jsx(bh,{size:11}):r.jsx(Ui,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(pC,{}),e==="agents"&&r.jsx(fC,{})]})}const Im=[{key:"all",label:"Tümü",icon:rl,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:al,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:u1,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:s1,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:en,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Gt,test:e=>e.category==="semantic"}],gC={episodic:{border:"rgba(249,115,22,0.30)",bg:"rgba(249,115,22,0.08)",dot:"#f97316",label:"Episodik"},semantic:{border:"rgba(99,102,241,0.30)",bg:"rgba(99,102,241,0.08)",dot:"#6366f1",label:"Semantik"}};function xC(e){const n=(Date.now()-new Date(e+"Z").getTime())/1e3,s=n/60,i=s/60,a=i/24;return n<60?{label:"az önce",tier:"fresh"}:s<60?{label:`${Math.floor(s)}d önce`,tier:"fresh"}:i<24?{label:`${Math.floor(i)}s önce`,tier:"recent"}:a<7?{label:`${Math.floor(a)}g önce`,tier:"recent"}:a<30?{label:`${Math.floor(a/7)}h önce`,tier:"old"}:{label:`${Math.floor(a/30)}ay önce`,tier:"ancient"}}const yC={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function Bm(e,t){return t.trim()?e.split(new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((s,i)=>s.toLowerCase()===t.toLowerCase()?r.jsx("mark",{className:"bg-orange-500/30 text-orange-300 rounded px-0.5",children:s},i):s):e}function vC({entry:e,query:t,index:n,onDelete:s}){const[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=xC(e.createdAt),u=gC[e.category],d=e.content.slice(0,180),p=e.content.length>180,h=async m=>{m.stopPropagation(),l(!0);try{(await U(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),pe.success("Kayıt silindi.")):pe.error("Silinemedi.")}catch{pe.error("Bağlantı hatası.")}l(!1)};return r.jsxs($.div,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,scale:.97},transition:{delay:Math.min(n*.03,.3),duration:.25},className:"rounded-2xl overflow-hidden cursor-pointer group",style:{background:"rgba(10,4,1,0.78)",border:`1px solid ${u.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${u.bg}, inset 0 1px 0 rgba(255,255,255,0.03)`},onClick:()=>a(m=>!m),children:[r.jsxs("div",{className:"flex items-start gap-3 px-4 pt-3.5 pb-2.5",style:{borderBottom:`1px solid ${u.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:u.dot,boxShadow:`0 0 6px ${u.dot}`}}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed break-words",children:Bm(i?e.content:d+(p?"…":""),t)})}),p&&r.jsx($.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(ln,{size:14})}),r.jsx("button",{onClick:h,disabled:o,className:"flex-shrink-0 p-1 rounded-lg opacity-0 group-hover:opacity-100 text-white/25 hover:text-red-400 hover:bg-red-500/12 transition-all disabled:opacity-30",title:"Bu kaydı sil",children:r.jsx(Ls,{size:13})})]}),r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 flex-wrap",children:[r.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase px-2 py-0.5 rounded-full",style:{color:u.dot,background:u.bg,border:`1px solid ${u.border}`},children:u.label}),e.tags.slice(0,3).map(m=>r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/35 px-1.5 py-0.5 rounded-md",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)"},children:[r.jsx(c1,{size:8,className:"opacity-60"}),m]},m)),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium",style:{color:yC[c.tier]},title:e.createdAt,children:[r.jsx(en,{size:9}),c.label]})]})]})}function bC({entries:e}){const t=e.filter(a=>a.category==="episodic").length,n=e.filter(a=>a.category==="semantic").length,s=e.filter(a=>a.tags.some(o=>/nightshift|nightowl/i.test(o))).length,i=[{label:`${e.length} toplam`,color:"#f97316"},{label:`${t} episodik`,color:"#f97316"},{label:`${n} semantik`,color:"#6366f1"},{label:`${s} NightOwl`,color:"#a78bfa"}];return r.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:i.map(a=>r.jsx("span",{className:"text-[11px] font-semibold px-2.5 py-1 rounded-full",style:{color:a.color,background:`${a.color}14`,border:`1px solid ${a.color}30`},children:a.label},a.label))})}function wC({onConfirm:e,onCancel:t}){return r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4",children:r.jsxs($.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(18,8,2,0.97)",border:"1px solid rgba(249,115,22,0.25)"},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)"},children:r.jsx(es,{size:18,className:"text-red-400"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-[15px] font-bold text-white/90",children:"Tüm Hafızayı Temizle"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Bu işlem geri alınamaz"})]}),r.jsx("button",{onClick:t,className:"ml-auto p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/6 transition-all",children:r.jsx(st,{size:15})})]}),r.jsx("p",{className:"text-[13px] text-white/50 mb-5 leading-relaxed",children:"Tüm episodik ve semantik hafıza kayıtları kalıcı olarak silinecek. Bu işlem geri alınamaz."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:t,className:"flex-1 px-4 py-2.5 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-[13px] font-medium transition-colors",children:"İptal"}),r.jsx("button",{onClick:e,className:"flex-1 px-4 py-2.5 rounded-xl bg-red-600/80 hover:bg-red-600 text-white text-[13px] font-semibold transition-colors border border-red-500/30",children:"Tümünü Sil"})]})]})})}function kC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(""),[o,l]=f.useState("all"),[c,u]=f.useState(!1),[d,p]=f.useState(!1),h=f.useCallback(async()=>{s(!0);try{const b=await U("/api/memory/ltm/explore?category=all&limit=200");if(b.ok){const g=await b.json();t(g.entries??[])}}catch{}s(!1)},[]);f.useEffect(()=>{h()},[h]);const m=b=>{t(g=>g.filter(x=>x.id!==b))},v=async()=>{p(!0);try{const b=await U("/api/memory/ltm/clear-all",{method:"DELETE"});if(b.ok){const g=await b.json();t([]),pe.success(`${g.deleted??0} kayıt temizlendi.`)}else pe.error("Temizleme başarısız.")}catch{pe.error("Bağlantı hatası.")}p(!1),u(!1)},w=f.useMemo(()=>{var x;const b=((x=Im.find(k=>k.key===o))==null?void 0:x.test)??(()=>!0),g=i.trim().toLowerCase();return e.filter(b).filter(k=>!g||k.content.toLowerCase().includes(g)||k.tags.some(C=>C.includes(g)))},[e,o,i]);return r.jsxs("div",{className:"h-[calc(100vh-72px)] overflow-y-auto px-6 py-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.28)",boxShadow:"0 0 16px rgba(249,115,22,0.12)"},children:r.jsx(Gt,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[15px] font-bold text-white/90 tracking-tight",children:"Hafıza Tüneli"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Long-Term Memory Explorer — semantik & episodik"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>u(!0),disabled:d||e.length===0,className:"flex items-center gap-1.5 text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all border border-red-500/20 text-red-400/70 hover:text-red-400 hover:bg-red-500/10 disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"rgba(239,68,68,0.04)"},children:[r.jsx(Ls,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void h(),disabled:n,className:"flex items-center gap-1.5 text-[11px] text-white/40 hover:text-white/70 transition-colors px-3 py-1.5 rounded-lg",style:{border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[r.jsx(de,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(bC,{entries:e}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(12px)"},children:[r.jsx(qt,{size:13,className:"text-white/30 flex-shrink-0"}),r.jsx("input",{type:"text",value:i,onChange:b=>a(b.target.value),placeholder:"Hafızada ara…",className:"flex-1 bg-transparent text-[13px] text-white/80 placeholder:text-white/25 outline-none"}),i&&r.jsx("button",{onClick:()=>a(""),className:"text-white/25 hover:text-white/60 text-xs",children:"✕"})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(ES,{size:11,className:"text-white/25"}),Im.map(b=>{const g=b.icon,x=o===b.key,k=e.filter(b.test).length;return r.jsxs("button",{onClick:()=>l(b.key),className:"flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-full transition-all",style:{background:x?"rgba(249,115,22,0.16)":"rgba(255,255,255,0.04)",border:x?"1px solid rgba(249,115,22,0.40)":"1px solid rgba(255,255,255,0.08)",color:x?"#fb923c":"rgba(255,255,255,0.45)"},children:[r.jsx(g,{size:10}),b.label,r.jsxs("span",{style:{opacity:.6},children:["(",k,")"]})]},b.key)})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx($.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Gt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):w.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(ll,{size:28,className:"text-white/15"}),r.jsx("p",{className:"text-[13px] text-white/30",children:e.length===0?"Henüz hafıza yok. İlk konuşmadan sonra dolmaya başlar.":"Filtrene uyan kayıt yok."})]}):r.jsxs("div",{className:"space-y-3 pb-8",children:[r.jsxs("p",{className:"text-[11px] text-white/25",children:[w.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(ee,{mode:"popLayout",children:w.map((b,g)=>r.jsx(vC,{entry:b,query:i,index:g,onDelete:m},b.id))})]}),r.jsx(ee,{children:c&&r.jsx(wC,{onConfirm:v,onCancel:()=>u(!1)})})]})}const za=`# Must-b Zihni
669
+ transition-all duration-300 disabled:opacity-50 select-none`,animate:{y:[0,-6,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.97},children:[r.jsx("span",{className:"text-[15px] font-bold tracking-wider",children:t.welcome.wakeBtn}),r.jsx("div",{className:"w-8 h-8 rounded-full bg-orange-500/20 border border-orange-500/40 flex items-center justify-center",children:r.jsx(vS,{size:14,className:"text-orange-400"})})]}),r.jsx("p",{className:"text-white/20 text-[11px] tracking-widest uppercase select-none",children:t.welcome.wakeHint})]})]},"sleep-screen")}),r.jsx(ee,{children:n==="exiting"&&r.jsx($.div,{className:"fixed inset-0 z-50 pointer-events-none",style:{background:"linear-gradient(180deg, #1a0802 0%, #f97316 40%, #0d0602 100%)"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.45}})})]})}function d1(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=d1(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function tt(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=d1(e))&&(s&&(s+=" "),s+=t);return s}const p4={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast Inference",local:"💻 Local / Offline",open:"🔓 Open Source Cloud",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},f4=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"],ym=[{value:"en-US",label:"English (US)"},{value:"tr-TR",label:"Türkçe"},{value:"de-DE",label:"Deutsch"},{value:"es-ES",label:"Español"},{value:"fr-FR",label:"Français"},{value:"zh-CN",label:"中文 (简体)"},{value:"ja-JP",label:"日本語"},{value:"ar-SA",label:"العربية"}],Xa=["Identity","AI Engine","Workspace","Voice","Channels","Finalize"],sc=[{id:"meta-llama/llama-4-scout:free",label:"Llama 4 Scout (Free)",desc:"Meta's latest · 10M ctx · fast & free",free:!0},{id:"nvidia/llama-3.1-nemotron-ultra-253b:free",label:"Nemotron Ultra 253B (Free)",desc:"NVIDIA's flagship open-source model — highly capable",free:!0},{id:"meta-llama/llama-4-maverick:free",label:"Llama 4 Maverick (Free)",desc:"Meta's latest Llama 4 release — free tier",free:!0},{id:"mistralai/mistral-small-3.1-24b-instruct:free",label:"Mistral Small 3.1 (Free)",desc:"Mistral's efficient 24B instruction model",free:!0},{id:"deepseek/deepseek-r1:free",label:"DeepSeek R1 (Free)",desc:"Strong reasoning model — open weights",free:!0},{id:"openai/gpt-4o-mini",label:"GPT-4o Mini",desc:"OpenAI's fast & affordable flagship mini",free:!1},{id:"anthropic/claude-3-5-haiku",label:"Claude 3.5 Haiku",desc:"Anthropic's fastest Claude model",free:!1},{id:"google/gemini-flash-1.5",label:"Gemini Flash 1.5",desc:"Google's ultra-fast flash model",free:!1}],vm=[{id:"telegram",label:"Telegram",emoji:"✈️",hint:"Create a bot at t.me/BotFather",fields:[{key:"TELEGRAM_BOT_TOKEN",label:"Bot Token",placeholder:"123456789:AAF...",secret:!0}]},{id:"discord",label:"Discord",emoji:"🎮",hint:"discord.com/developers → Applications",fields:[{key:"DISCORD_BOT_TOKEN",label:"Bot Token",placeholder:"MT…",secret:!0},{key:"DISCORD_CLIENT_ID",label:"Client ID",placeholder:"012…",secret:!1}]},{id:"slack",label:"Slack",emoji:"💬",hint:"api.slack.com/apps → OAuth & Permissions",fields:[{key:"SLACK_BOT_TOKEN",label:"Bot Token",placeholder:"xoxb-…",secret:!0},{key:"SLACK_SIGNING_SECRET",label:"Signing Secret",placeholder:"abc123…",secret:!0}]},{id:"whatsapp",label:"WhatsApp",emoji:"📱",hint:"developers.facebook.com → WhatsApp",fields:[{key:"WHATSAPP_API_KEY",label:"API Token",placeholder:"EAA…",secret:!0},{key:"WHATSAPP_PHONE_ID",label:"Phone ID",placeholder:"1234567890",secret:!1}]}];function m4({index:e,current:t}){const n=e<t,s=e===t;return r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:tt("w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300",n?"bg-orange-500 text-white":s?"bg-orange-500/20 border-2 border-orange-500 text-orange-400":"bg-white/5 border border-white/10 text-gray-400"),children:n?r.jsx(Kt,{size:13}):e+1}),e<Xa.length-1&&r.jsx("div",{className:tt("w-8 h-px transition-colors duration-300",n?"bg-orange-500/50":"bg-white/10")})]})}function g4({label:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-white/5 text-gray-400 border border-white/8",children:e})}function x4({fit:e}){return e==="recommended"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-green-400 bg-green-500/10 border border-green-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(Kt,{size:9})," Recommended"]}):e==="marginal"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-orange-400 bg-orange-500/10 border border-orange-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(Re,{size:9})," Marginal"]}):r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-red-400 bg-red-500/10 border border-red-500/20 px-1.5 py-0.5 rounded",children:[r.jsx(es,{size:9})," Heavy"]})}function bm({checked:e,onChange:t,label:n,description:s}){return r.jsxs("button",{type:"button",onClick:()=>t(!e),className:tt("w-full flex items-center gap-4 px-4 py-4 rounded-xl border transition-all text-left",e?"bg-orange-500/10 border-orange-500/30 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("relative flex-shrink-0 w-11 h-6 rounded-full transition-colors duration-200",e?"bg-orange-500":"bg-white/15"),children:r.jsx("div",{className:tt("absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all duration-200",e?"left-6":"left-1")})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm",children:n}),s&&r.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s})]})]})}function y4(){var Or,Xt;un();const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!0),[c,u]=f.useState("~/Mustb-Projects"),[d,p]=f.useState(0),[h,m]=f.useState(""),[y,w]=f.useState("en-US"),[v,g]=f.useState("openrouter"),[x,k]=f.useState(""),[j,b]=f.useState(""),[S,N]=f.useState(sc[0].id),[C,_]=f.useState(sc),[E,P]=f.useState(!1),[O,F]=f.useState("http://localhost:11434"),[D,M]=f.useState(""),[z,V]=f.useState(""),[T,R]=f.useState(!1),[B,Z]=f.useState(!1),[K,re]=f.useState({}),[te,ce]=f.useState({}),[fe,ie]=f.useState({}),[Je,kt]=f.useState("idle"),[W,Y]=f.useState(!1),[Mt,Lr]=f.useState(null);f.useEffect(()=>{fetch("/api/setup/providers").then(A=>A.ok?A.json():{providers:[]}).then(A=>{var Q;(Q=A.providers)!=null&&Q.length&&t(A.providers)}).catch(()=>{}).finally(()=>l(!1)),fetch("/api/setup/workspace-default").then(A=>A.ok?A.json():null).then(A=>{A!=null&&A.suggested&&(u(A.suggested),V(A.suggested))}).catch(()=>{})},[]),f.useEffect(()=>{v==="openrouter"&&(P(!0),fetch("/api/openrouter/free-models").then(A=>A.ok?A.json():null).then(A=>{if(A!=null&&A.models&&A.models.length>0){const Q=A.models.slice(0,16).map(De=>({id:De.id,label:De.label??De.name??De.id,desc:De.desc??De.description??"",free:De.id.endsWith(":free")})),X=new Set(Q.map(De=>De.id)),Ee=sc.filter(De=>!X.has(De.id));_([...Q,...Ee])}}).catch(()=>{}).finally(()=>P(!1)))},[v]),f.useEffect(()=>{v==="ollama"&&fetch("/api/setup/ollama-models").then(A=>A.ok?A.json():null).then(A=>{A!=null&&A.models&&s(A.models),A!=null&&A.hardware&&a(A.hardware)}).catch(()=>{})},[v]);const Ds=v==="ollama",Ze=e.find(A=>A.id===v),Is=f.useMemo(()=>{const A=x.toLowerCase().trim();return A?e.filter(Q=>Q.label.toLowerCase().includes(A)||Q.description.toLowerCase().includes(A)||Q.tags.some(X=>X.toLowerCase().includes(A))):e},[e,x]),dl=f.useMemo(()=>{const A={};for(const Q of Is)A[Q.category]||(A[Q.category]=[]),A[Q.category].push(Q);return A},[Is]),Bs=()=>{switch(d){case 0:return h.trim().length>0;case 1:{if(Ds){const A=n.length===0||D.trim().length>0;return O.trim().length>0&&A}return v==="openrouter"?j.trim().length>0&&S.trim().length>0:Ze!=null&&Ze.envKeyIsUrl?!0:j.trim().length>0}case 2:return z.trim().length>0;default:return!0}},hl=async()=>{kt("testing");try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(Q=>Q.stop()),kt("granted")}catch{kt("denied")}},ra=async A=>{ie(Q=>({...Q,[A]:"testing"}));try{const X=await(await fetch(`/api/channels/${A}/status`)).json().catch(()=>({}));ie(Ee=>({...Ee,[A]:X.configured?"ok":"fail"}))}catch{ie(Q=>({...Q,[A]:"fail"}))}},ls=async()=>{Y(!0),Lr(null);try{const A={};for(const Ee of vm)if(K[Ee.id]){for(const De of Ee.fields){const ia=(te[De.key]??"").trim();ia&&(A[De.key]=ia)}A[`CHANNEL_${Ee.id.toUpperCase()}_ENABLED`]="true"}const Q={name:h.trim()||"User",language:y,provider:v,apiKey:Ds?O:j,model:Ds?D:v==="openrouter"?S:Ze==null?void 0:Ze.defaultModel,skills:["browser","terminal","memory","web_search","filesystem","git","vision","input","telegram","analyzer"],mode:"local",workspacePath:z.trim()||c,wakeWord:T,telemetry:B,channels:A};let X=await fetch("/api/setup/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)});if(!X.ok&&X.status===404&&(X=await fetch("/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})),!X.ok){const Ee=await X.json().catch(()=>({}));throw new Error(Ee.error??"Setup failed")}localStorage.setItem("mustb_boot_report","1"),localStorage.setItem("mustb_setup_complete","1"),window.location.href="/app"}catch(A){Lr(A instanceof Error?A.message:"Unknown error"),Y(!1)}};return r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center px-4 py-12 relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 pointer-events-none",children:r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-orange-900/12 rounded-full blur-[120px]"})}),r.jsxs("div",{className:"relative z-10 w-full max-w-xl",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("div",{className:"flex justify-center mb-4",children:r.jsxs("div",{className:"relative w-14 h-14",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-lg opacity-40 animate-pulse"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]})}),r.jsx("h1",{className:"text-3xl font-extrabold text-white tracking-tight",children:"Setup Must-b"}),r.jsx("p",{className:"text-gray-400 mt-1.5 text-sm",children:"First-time configuration · 6 steps"})]}),r.jsx("div",{className:"flex justify-center items-center mb-6",children:Xa.map((A,Q)=>r.jsxs("div",{className:"flex flex-col items-center gap-1",children:[r.jsx(m4,{index:Q,current:d}),r.jsx("span",{className:tt("text-[9px] font-bold uppercase tracking-widest transition-colors",Q===d?"text-orange-400":Q<d?"text-orange-500/50":"text-gray-700"),children:A})]},Q))}),r.jsx(ee,{mode:"wait",children:r.jsxs($.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.18},className:"glass rounded-2xl p-6 border border-white/8",children:[r.jsxs("p",{className:"text-[10px] font-bold text-orange-500/60 uppercase tracking-widest mb-1",children:["Step ",d+1," of ",Xa.length]}),r.jsx("h2",{className:"text-xl font-bold text-white mb-5",children:Xa[d]}),d===0&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Your name"}),r.jsx("input",{autoFocus:!0,type:"text",value:h,onChange:A=>m(A.target.value),onKeyDown:A=>A.key==="Enter"&&Bs()&&p(1),placeholder:"e.g. Burak",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-base"}),r.jsx("p",{className:"text-gray-400 text-xs",children:"Used in greetings and memory. Editable anytime in Settings."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Language"}),r.jsxs("div",{className:"relative",children:[r.jsx(Ye,{size:14,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("select",{value:y,onChange:A=>w(A.target.value),className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white focus:outline-none focus:ring-1 focus:ring-orange-500/50 transition-all text-sm appearance-none cursor-pointer",children:ym.map(A=>r.jsx("option",{value:A.value,className:"bg-[#0d1117] text-white",children:A.label},A.value))}),r.jsx(on,{size:13,className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none rotate-90"})]})]})]}),d===1&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{type:"text",value:x,onChange:A=>k(A.target.value),placeholder:"Search providers…",className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 text-sm"})]}),r.jsxs("div",{className:"max-h-[260px] overflow-y-auto space-y-4 pr-1 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:[o?r.jsx("p",{className:"text-center py-6 text-gray-400 text-sm",children:"Loading providers…"}):f4.map(A=>{const Q=dl[A];return Q!=null&&Q.length?r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:p4[A]}),r.jsx("div",{className:"space-y-1",children:Q.map(X=>r.jsxs("button",{onClick:()=>{g(X.id),b("")},className:tt("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",v===X.id?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0 transition-all",v===X.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:X.label}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:X.description})]}),r.jsx("div",{className:"flex flex-wrap gap-1 justify-end flex-shrink-0 max-w-[120px]",children:X.tags.slice(0,2).map(Ee=>r.jsx(g4,{label:Ee},Ee))})]},X.id))})]},A):null}),!o&&Is.length===0&&r.jsxs("p",{className:"text-center py-6 text-gray-400 text-sm",children:['No providers match "',x,'"']})]}),Ds?r.jsxs("div",{className:"space-y-3 pt-1 border-t border-white/6",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Ollama Base URL"}),r.jsx("input",{type:"url",value:O,onChange:A=>F(A.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),i&&r.jsxs("div",{className:"flex items-center gap-4 rounded-xl bg-white/3 border border-white/8 px-3 py-2 text-xs text-gray-400",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(s1,{size:11,className:"text-orange-400"}),i.ramGb.toFixed(1)," GB RAM"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Sn,{size:11,className:"text-orange-400"}),i.cpuCount," CPUs"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Re,{size:11,className:"text-orange-400"}),"Score ",i.score," · ",i.tier]})]}),n.length>0&&r.jsx("div",{className:"max-h-[180px] overflow-y-auto space-y-1.5 pr-1",children:n.map(A=>r.jsxs("button",{onClick:()=>M(A.modelId),className:tt("w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",D===A.modelId?"bg-orange-500/10 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0",D===A.modelId?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("p",{className:"font-semibold text-sm",children:A.name}),r.jsx("span",{className:"text-[10px] text-gray-400 font-mono",children:A.params})]}),r.jsx("p",{className:"text-xs text-gray-400 truncate",children:A.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx(x4,{fit:A.fit}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:[A.ramGb," GB"]})]})]},A.id))})]}):Ze?r.jsxs("div",{className:"space-y-2 pt-1 border-t border-white/6",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:Ze.envKeyIsUrl?"Base URL":`${Ze.label} API Key`}),r.jsx("input",{type:Ze.envKeyIsUrl?"url":"password",value:j,onChange:A=>b(A.target.value),placeholder:Ze.placeholder,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"}),v==="openrouter"&&r.jsxs("div",{className:"space-y-2 pt-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold flex-1",children:"Select Model"}),E&&r.jsx("span",{className:"text-[10px] text-orange-400/60 animate-pulse",children:"Loading live models…"}),r.jsx("span",{className:"text-[10px] text-green-500/60",children:"✓ Offline list always ready"})]}),r.jsx("div",{className:"max-h-[200px] overflow-y-auto space-y-1.5 pr-1",children:C.map(A=>r.jsxs("button",{type:"button",onClick:()=>N(A.id),className:tt("w-full flex items-start gap-3 px-3 py-2.5 rounded-xl border transition-all text-left",S===A.id?"bg-orange-500/12 border-orange-500/40 text-white":"bg-white/3 border-white/8 text-gray-400 hover:border-white/20 hover:text-white"),children:[r.jsx("div",{className:tt("w-3 h-3 rounded-full border-2 flex-shrink-0 mt-0.5",S===A.id?"border-orange-500 bg-orange-500":"border-gray-600")}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("p",{className:"font-semibold text-sm leading-tight",children:A.label}),A.free&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded bg-green-500/15 text-green-400 border border-green-500/20",children:"FREE"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:A.desc})]})]},A.id))}),!S&&r.jsxs("p",{className:"text-xs text-orange-400 flex items-center gap-1.5",children:[r.jsx(es,{size:11})," Select a model to continue"]})]}),v!=="openrouter"&&Ze.latestModels.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:Ze.latestModels.slice(0,4).map(A=>r.jsx("span",{className:"text-[11px] font-mono text-orange-400/60 bg-orange-500/5 border border-orange-500/10 px-2 py-0.5 rounded-lg",children:A},A))}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Stored locally in ",r.jsx("code",{className:"text-orange-500/60",children:".env"})," — never sent to external servers."]})]}):null]}),d===2&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs text-gray-400 uppercase tracking-widest font-bold",children:"Workspace Directory"}),r.jsxs("div",{className:"relative",children:[r.jsx(_S,{size:13,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),r.jsx("input",{autoFocus:!0,type:"text",value:z,onChange:A=>V(A.target.value),placeholder:c,className:"w-full bg-white/5 border border-white/10 rounded-xl pl-9 pr-4 py-3 text-white placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-orange-500/50 font-mono text-sm"})]}),r.jsxs("p",{className:"text-gray-400 text-xs",children:["Must-b will read and write files ",r.jsx("span",{className:"text-orange-500/70 font-medium",children:"only within this directory"}),". The folder will be created if it doesn't exist."]})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-white/3 border border-white/8 px-4 py-3",children:[r.jsx(QS,{size:15,className:"text-green-400 flex-shrink-0 mt-0.5"}),r.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:"Must-b operates in a sandboxed workspace. It cannot access files outside this directory unless you explicitly provide a path in a prompt."})]})]}),d===3&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(bm,{checked:T,onChange:R,label:'Enable "Hey Must-b" Wake Word',description:"Always-on voice activation — must-b-ui listens passively via your microphone."}),r.jsx("div",{className:"rounded-xl bg-white/3 border border-white/8 px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-white",children:"Test Microphone Permission"}),r.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:[Je==="idle"&&"Click to verify your browser can access the microphone.",Je==="testing"&&"Requesting permission…",Je==="granted"&&"Microphone access granted ✓",Je==="denied"&&"Permission denied — check browser settings."]})]}),r.jsx("button",{onClick:hl,disabled:Je==="testing",className:tt("flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all shrink-0",Je==="granted"?"bg-green-500/10 border border-green-500/20 text-green-400 cursor-default":Je==="denied"?"bg-red-500/10 border border-red-500/20 text-red-400":"bg-white/5 border border-white/10 text-gray-300 hover:border-white/25 hover:text-white"),children:Je==="granted"?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:12})," Granted"]}):Je==="denied"?r.jsxs(r.Fragment,{children:[r.jsx(gh,{size:12})," Denied"]}):r.jsxs(r.Fragment,{children:[r.jsx(Nr,{size:12})," Test"]})})]})}),r.jsx("p",{className:"text-gray-700 text-xs px-1",children:"Wake word and microphone can be reconfigured at any time in Settings → Voice."})]}),d===4&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-[12px] text-gray-500",children:"Connect messaging channels so Must-b can send and receive messages on your behalf. All tokens are stored locally. You can skip and configure later in Settings."}),vm.map(A=>{const Q=!!K[A.id];return r.jsxs("div",{className:"rounded-xl border transition-all overflow-hidden",style:{borderColor:Q?"rgba(234,88,12,0.35)":"rgba(255,255,255,0.07)",background:Q?"rgba(234,88,12,0.06)":"rgba(255,255,255,0.02)"},children:[r.jsxs("div",{className:"flex items-center",children:[r.jsxs("button",{onClick:()=>re(X=>({...X,[A.id]:!Q})),className:"flex-1 flex items-center justify-between px-4 py-3",children:[r.jsxs("span",{className:"flex items-center gap-2.5 text-[13px] font-semibold text-gray-200",children:[r.jsx("span",{className:"text-base",children:A.emoji}),A.label,r.jsx("span",{className:"text-[10px] text-gray-600 font-normal",children:A.hint}),fe[A.id]==="ok"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0"}),fe[A.id]==="fail"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),fe[A.id]==="testing"&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400 animate-pulse flex-shrink-0"})]}),r.jsx("span",{className:"w-8 h-4 rounded-full relative transition-all flex-shrink-0",style:{background:Q?"#ea580c":"rgba(255,255,255,0.1)"},children:r.jsx("span",{className:"absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all shadow-sm",style:{left:Q?"calc(100% - 14px)":"2px"}})})]}),Q&&A.fields.some(X=>(te[X.key]??"").trim())&&r.jsx("button",{onClick:X=>{X.stopPropagation(),ra(A.id)},disabled:fe[A.id]==="testing",className:"mr-3 px-2 py-1 rounded-lg text-[10px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",color:"#fb923c"},children:fe[A.id]==="testing"?"…":"Test"})]}),Q&&r.jsx("div",{className:"px-4 pb-3 space-y-2 border-t",style:{borderColor:"rgba(234,88,12,0.15)"},children:A.fields.map(X=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase tracking-widest mb-1 mt-2",children:X.label}),r.jsx("input",{type:X.secret?"password":"text",value:te[X.key]??"",onChange:Ee=>ce(De=>({...De,[X.key]:Ee.target.value})),placeholder:X.placeholder,className:"w-full px-3 py-2 rounded-lg text-[12px] text-gray-200 placeholder-gray-700 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)"}})]},X.key))})]},A.id)})]}),d===5&&r.jsxs("div",{className:"space-y-5",children:[r.jsx(bm,{checked:B,onChange:Z,label:"Send anonymous crash reports",description:"Helps improve Must-b. No personal data, no conversation content — only error traces."}),r.jsxs("div",{className:"rounded-xl bg-white/3 border border-white/6 px-4 py-4 space-y-2",children:[r.jsx("p",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest mb-2",children:"Configuration Summary"}),[{label:"Name",value:h||"—"},{label:"Language",value:((Or=ym.find(A=>A.value===y))==null?void 0:Or.label)??y},{label:"Provider",value:((Xt=e.find(A=>A.id===v))==null?void 0:Xt.label)??v},{label:"Workspace",value:(z||c).replace(/^.*\/([^/]+\/[^/]+)$/,"…/$1")},{label:"Wake Word",value:T?"Enabled":"Disabled"}].map(A=>r.jsxs("div",{className:"flex items-center justify-between text-xs",children:[r.jsx("span",{className:"text-gray-400",children:A.label}),r.jsx("span",{className:"text-gray-300 font-mono truncate max-w-[200px]",children:A.value})]},A.label))]}),Mt&&r.jsx("div",{className:"rounded-xl bg-red-500/10 border border-red-500/20 px-4 py-3 text-red-400 text-sm",children:Mt}),r.jsx("button",{onClick:ls,disabled:W,className:"w-full flex items-center justify-center gap-3 px-8 py-4 rounded-2xl bg-gradient-to-r from-orange-600 to-amber-600 hover:from-orange-500 hover:to-amber-500 text-white font-bold text-base transition-all shadow-lg shadow-orange-500/25 active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed",children:W?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-5 h-5 border-2 border-white/40 border-t-white rounded-full animate-spin"})," Initializing…"]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-lg",children:"🚀"})," Initialize Must-b"]})})]})]},d)}),d<5&&r.jsxs("div",{className:"flex items-center justify-between mt-5",children:[r.jsxs("button",{onClick:()=>p(A=>A-1),disabled:d===0,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all disabled:opacity-25 disabled:cursor-not-allowed text-sm font-medium",children:[r.jsx(pm,{size:16})," Back"]}),r.jsxs("button",{onClick:()=>p(A=>A+1),disabled:!Bs(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-orange-600 hover:bg-orange-500 text-white font-semibold text-sm transition-all shadow-lg shadow-orange-500/20 active:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed",children:["Continue ",r.jsx(on,{size:16})]})]}),d===5&&r.jsx("div",{className:"flex justify-start mt-5",children:r.jsxs("button",{onClick:()=>p(4),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-gray-400 hover:text-white hover:bg-white/5 transition-all text-sm font-medium",children:[r.jsx(pm,{size:16})," Back"]})}),r.jsxs("p",{className:"text-center text-xs text-gray-700 mt-5",children:["All settings saved locally · Run ",r.jsx("code",{className:"text-orange-500/60",children:"must-b doctor"})," to verify"]})]})]})}const cn=Object.create(null);cn.open="0";cn.close="1";cn.ping="2";cn.pong="3";cn.message="4";cn.upgrade="5";cn.noop="6";const Qa=Object.create(null);Object.keys(cn).forEach(e=>{Qa[cn[e]]=e});const _u={type:"error",data:"parser error"},h1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",p1=typeof ArrayBuffer=="function",f1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,wh=({type:e,data:t},n,s)=>h1&&t instanceof Blob?n?s(t):wm(t,s):p1&&(t instanceof ArrayBuffer||f1(t))?n?s(t):wm(new Blob([t]),s):s(cn[e]+(t||"")),wm=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function km(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let rc;function v4(e,t){if(h1&&e.data instanceof Blob)return e.data.arrayBuffer().then(km).then(t);if(p1&&(e.data instanceof ArrayBuffer||f1(e.data)))return t(km(e.data));wh(e,!1,n=>{rc||(rc=new TextEncoder),t(rc.encode(n))})}const jm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ti=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<jm.length;e++)ti[jm.charCodeAt(e)]=e;const b4=e=>{let t=e.length*.75,n=e.length,s,i=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(s=0;s<n;s+=4)a=ti[e.charCodeAt(s)],o=ti[e.charCodeAt(s+1)],l=ti[e.charCodeAt(s+2)],c=ti[e.charCodeAt(s+3)],d[i++]=a<<2|o>>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},w4=typeof ArrayBuffer=="function",kh=(e,t)=>{if(typeof e!="string")return{type:"message",data:m1(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:k4(e.substring(1),t)}:Qa[n]?e.length>1?{type:Qa[n],data:e.substring(1)}:{type:Qa[n]}:_u},k4=(e,t)=>{if(w4){const n=b4(e);return m1(n,t)}else return{base64:!0,data:e}},m1=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},g1="",j4=(e,t)=>{const n=e.length,s=new Array(n);let i=0;e.forEach((a,o)=>{wh(a,!1,l=>{s[o]=l,++i===n&&t(s.join(g1))})})},N4=(e,t)=>{const n=e.split(g1),s=[];for(let i=0;i<n.length;i++){const a=kh(n[i],t);if(s.push(a),a.type==="error")break}return s};function S4(){return new TransformStream({transform(e,t){v4(e,n=>{const s=n.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,s)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let ic;function Pa(e){return e.reduce((t,n)=>t+n.length,0)}function Aa(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let i=0;i<t;i++)n[i]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function C4(e,t){ic||(ic=new TextDecoder);const n=[];let s=0,i=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(s===0){if(Pa(n)<1)break;const c=Aa(n,1);a=(c[0]&128)===128,i=c[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(Pa(n)<2)break;const c=Aa(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),s=3}else if(s===2){if(Pa(n)<8)break;const c=Aa(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(_u);break}i=d*Math.pow(2,32)+u.getUint32(4),s=3}else{if(Pa(n)<i)break;const c=Aa(n,i);l.enqueue(kh(a?c:ic.decode(c),t)),s=0}if(i===0||i>e){l.enqueue(_u);break}}}})}const x1=4;function ze(e){if(e)return _4(e)}function _4(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,i=0;i<n.length;i++)if(s=n[i],s===t||s.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ze.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,i=n.length;s<i;++s)n[s].apply(this,t)}return this};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const cl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),E4="arraybuffer";function y1(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const T4=_t.setTimeout,P4=_t.clearTimeout;function ul(e,t){t.useNativeTimers?(e.setTimeoutFn=T4.bind(_t),e.clearTimeoutFn=P4.bind(_t)):(e.setTimeoutFn=_t.setTimeout.bind(_t),e.clearTimeoutFn=_t.clearTimeout.bind(_t))}const A4=1.33;function M4(e){return typeof e=="string"?z4(e):Math.ceil((e.byteLength||e.size)*A4)}function z4(e){let t=0,n=0;for(let s=0,i=e.length;s<i;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function v1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function R4(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function L4(e){let t={},n=e.split("&");for(let s=0,i=n.length;s<i;s++){let a=n[s].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class O4 extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class jh extends ze{constructor(t){super(),this.writable=!1,ul(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new O4(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=kh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=R4(t);return n.length?"?"+n:""}}class D4 extends jh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};N4(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,j4(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=v1()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let b1=!1;try{b1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const I4=b1;function B4(){}class F4 extends D4{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}class an extends ze{constructor(t,n,s){super(),this.createRequest=t,ul(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=y1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=an.requestsCount++,an.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=B4,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Nm);else if(typeof addEventListener=="function"){const e="onpagehide"in _t?"pagehide":"unload";addEventListener(e,Nm,!1)}}function Nm(){for(let e in an.requests)an.requests.hasOwnProperty(e)&&an.requests[e].abort()}const V4=function(){const e=w1({xdomain:!1});return e&&e.responseType!==null}();class $4 extends F4{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=V4&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new an(w1,this.uri(),t)}}function w1(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||I4))return new XMLHttpRequest}catch{}if(!t)try{return new _t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const k1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class U4 extends jh{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=k1?{}:y1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;wh(s,this.supportsBinary,a=>{try{this.doWrite(s,a)}catch{}i&&cl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=v1()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ac=_t.WebSocket||_t.MozWebSocket;class H4 extends U4{createSocket(t,n,s){return k1?new ac(t,n,s):n?new ac(t,n):new ac(t)}doWrite(t,n){this.ws.send(n)}}class W4 extends jh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=C4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),i=S4();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{s.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],i=n===t.length-1;this._writer.write(s).then(()=>{i&&cl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const G4={websocket:H4,webtransport:W4,polling:$4},K4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,q4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Eu(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let i=K4.exec(e||""),a={},o=14;for(;o--;)a[q4[o]]=i[o]||"";return n!=-1&&s!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Y4(a,a.path),a.queryKey=X4(a,a.query),a}function Y4(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function X4(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,a){i&&(n[i]=a)}),n}const Tu=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ja=[];Tu&&addEventListener("offline",()=>{Ja.forEach(e=>e())},!1);class Yn extends ze{constructor(t,n){if(super(),this.binaryType=E4,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=Eu(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=Eu(n.host).host);ul(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=L4(this.opts.query)),Tu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ja.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=x1,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Yn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Yn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(n+=M4(i)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,cl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,i){if(typeof n=="function"&&(i=n,n=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const a={type:t,data:n,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(Yn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Ja.indexOf(this._offlineEventListener);s!==-1&&Ja.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Yn.protocol=x1;class Q4 extends Yn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;Yn.priorWebsocketSuccess=!1;const i=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Yn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function a(){s||(s=!0,d(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,a(),this.emitReserved("upgradeError",h)};function l(){o("transport closed")}function c(){o("socket closed")}function u(p){n&&p.name!==n.name&&a()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let J4=class extends Q4{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>G4[i]).filter(i=>!!i)),super(t,s)}};function Z4(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=Eu(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const a=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+a+":"+s.port+t,s.href=s.protocol+"://"+a+(n&&n.port===s.port?"":":"+s.port),s}const e3=typeof ArrayBuffer=="function",t3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,j1=Object.prototype.toString,n3=typeof Blob=="function"||typeof Blob<"u"&&j1.call(Blob)==="[object BlobConstructor]",s3=typeof File=="function"||typeof File<"u"&&j1.call(File)==="[object FileConstructor]";function Nh(e){return e3&&(e instanceof ArrayBuffer||t3(e))||n3&&e instanceof Blob||s3&&e instanceof File}function Za(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(Za(e[n]))return!0;return!1}if(Nh(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Za(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Za(e[n]))return!0;return!1}function r3(e){const t=[],n=e.data,s=e;return s.data=Pu(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Pu(e,t){if(!e)return e;if(Nh(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=Pu(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Pu(e[s],t));return n}return e}function i3(e,t){return e.data=Au(e.data,t),delete e.attachments,e}function Au(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Au(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Au(e[n],t));return e}const a3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var se;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(se||(se={}));class o3{constructor(t){this.replacer=t}encode(t){return(t.type===se.EVENT||t.type===se.ACK)&&Za(t)?this.encodeAsBinary({type:t.type===se.EVENT?se.BINARY_EVENT:se.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===se.BINARY_EVENT||t.type===se.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=r3(t),s=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(s),i}}class Sh extends ze{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===se.BINARY_EVENT;s||n.type===se.BINARY_ACK?(n.type=s?se.EVENT:se.ACK,this.reconstructor=new l3(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Nh(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(se[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===se.BINARY_EVENT||s.type===se.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(a,n)}else s.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}s.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Sh.isPayloadValid(s.type,a))s.data=a;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case se.CONNECT:return Sm(n);case se.DISCONNECT:return n===void 0;case se.CONNECT_ERROR:return typeof n=="string"||Sm(n);case se.EVENT:case se.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&a3.indexOf(n[0])===-1);case se.ACK:case se.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class l3{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=i3(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Sm(e){return Object.prototype.toString.call(e)==="[object Object]"}const c3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Sh,Encoder:o3,get PacketType(){return se}},Symbol.toStringTag,{value:"Module"}));function Vt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const u3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class N1 extends ze{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Vt(t,"open",this.onopen.bind(this)),Vt(t,"packet",this.onpacket.bind(this)),Vt(t,"error",this.onerror.bind(this)),Vt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,i,a;if(u3.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:se.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const l=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((s,i)=>{const a=(o,l)=>o?i(o):s(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case se.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case se.EVENT:case se.BINARY_EVENT:this.onevent(t);break;case se.ACK:case se.BINARY_ACK:this.onack(t);break;case se.DISCONNECT:this.ondisconnect();break;case se.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...i){s||(s=!0,n.packet({type:se.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Rr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Rr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Rr.prototype.reset=function(){this.attempts=0};Rr.prototype.setMin=function(e){this.ms=e};Rr.prototype.setMax=function(e){this.max=e};Rr.prototype.setJitter=function(e){this.jitter=e};class Mu extends ze{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ul(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Rr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||c3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new J4(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=Vt(n,"open",function(){s.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Vt(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Vt(t,"ping",this.onping.bind(this)),Vt(t,"data",this.ondata.bind(this)),Vt(t,"error",this.onerror.bind(this)),Vt(t,"close",this.onclose.bind(this)),Vt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){cl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new N1(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Gr={};function xi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Z4(e,t.path||"/socket.io"),s=n.source,i=n.id,a=n.path,o=Gr[i]&&a in Gr[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new Mu(s,t):(Gr[i]||(Gr[i]=new Mu(s,t)),c=Gr[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(xi,{Manager:Mu,Socket:N1,io:xi,connect:xi});let ds=null;function pt(){return ds||(ds=xi(window.location.origin,{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.3,timeout:1e4}),ds.on("agentUpdate",e=>{try{e!=null&&window.dispatchEvent(new CustomEvent("mustb:agentUpdate",{detail:e}))}catch{}}),ds.on("connect",()=>{window.dispatchEvent(new CustomEvent("mustb:connected"))}),ds.on("disconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:disconnected",{detail:{reason:e}}))}),ds.io.on("reconnect",e=>{window.dispatchEvent(new CustomEvent("mustb:reconnected",{detail:{attemptNumber:e}}))})),ds}const d3={};let ni=null;const h3=(()=>{const e=d3,t=(e==null?void 0:e.VITE_BACKEND_URL)??"";return t&&!t.includes(window.location.hostname)?t.replace(/\/$/,""):""})();function S1(e){return e.startsWith("http")?e:`${h3}${e}`}async function p3(){if(ni)return ni;try{const e=await fetch(S1("/api/auth/local"));if(e.ok)return ni=(await e.json()).token??null,ni}catch{}return null}async function U(e,t={},{retries:n=3,retryDelay:s=800}={}){const i=await p3(),a={"Content-Type":"application/json",...t.headers};i&&(a.Authorization=`Bearer ${i}`);const o=S1(e);let l;for(let c=1;c<=n;c++)try{const u=await fetch(o,{...t,headers:a});return u.status===401&&(ni=null,window.dispatchEvent(new CustomEvent("mustb:401",{detail:{url:o}}))),u}catch(u){l=u,c<n&&await new Promise(d=>setTimeout(d,s*c))}throw window.dispatchEvent(new CustomEvent("mustb:offline",{detail:{url:o}})),l}function Cm(e){const t=e.toLowerCase();if(t.includes("gemini-2")||t.includes("gemini-flash"))return 9999;if(t.includes("llama-3")&&(t.includes("70b")||t.includes("405b")))return 9998;if(t.includes("gpt-4o"))return 8888;if(t.includes("claude-3-5")||t.includes("claude-3.5"))return 8887;if(t.includes("gemini-pro")||t.includes("gemini-1.5-pro"))return 8886;const n=t.match(/(\d+)x(\d+)b/);if(n)return parseFloat(n[1])*parseFloat(n[2]);const s=t.match(/(\d+(?:\.\d+)?)b/);return s?parseFloat(s[1]):0}function oc(e){return[...e].sort((t,n)=>Cm(n.id)-Cm(t.id))}function f3(){const{t:e}=ht(),[t,n]=f.useState(!1),[s,i]=f.useState("Loading…"),[a,o]=f.useState([]),l=f.useRef(null);f.useEffect(()=>{U("/api/setup/status").then(h=>h.ok?h.json():null).then(h=>{if(!h)return;h.activeModel&&i(h.activeModel),(h.activeProvider??"openrouter").toLowerCase()==="ollama"?U("/api/models").then(y=>y.ok?y.json():[]).then(y=>{const v=(Array.isArray(y)?y:[]).map(g=>({id:g.id??String(g),name:g.name??g.id??String(g),free:!0}));o(oc(v))}).catch(()=>{}):U("/api/providers/openrouter/models").then(y=>y.ok?y.json():{}).then(y=>{const w=oc((y.free??[]).map(x=>({id:x.id,name:x.name??x.id,free:!0}))),v=oc((y.power??[]).map(x=>({id:x.id,name:x.name??x.id,free:!1}))),g=[...w,...v];o(g),!(h!=null&&h.activeModel)&&g.length>0&&i(g[0].id)}).catch(()=>{})}).catch(()=>{})},[]),f.useEffect(()=>{if(!t)return;const h=m=>{l.current&&!l.current.contains(m.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t]);const c=async h=>{i(h),n(!1),await U("/api/settings/model",{method:"POST",body:JSON.stringify({model:h})}).catch(()=>{})},u=a.filter(h=>h.free),d=a.filter(h=>!h.free),p=s.length>28?s.slice(0,26)+"…":s;return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{onClick:()=>n(h=>!h),className:"flex items-center gap-1 px-2 py-1 rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 text-white/50 hover:text-white/80 text-[11px] font-medium transition-all",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-500 shrink-0"}),r.jsx("span",{className:"truncate max-w-[110px]",children:p}),r.jsx(ea,{size:10,className:`transition-transform duration-200 shrink-0 text-white/30 ${t?"rotate-180":""}`})]}),r.jsx(ee,{children:t&&r.jsxs($.div,{initial:{opacity:0,y:6,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-72 rounded-xl shadow-xl border border-white/10 flex flex-col",style:{background:"rgba(18,8,2,0.97)",backdropFilter:"blur(24px)",maxHeight:"400px"},children:[r.jsxs("div",{className:"overflow-y-auto flex-1 p-1.5",children:[u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-emerald-500/80",children:"Free"}),u.slice(0,5).map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===h.id?"bg-orange-500":"bg-emerald-400"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-2.5 pt-2 pb-1 text-[9.5px] font-black uppercase tracking-[0.12em] text-orange-400/80",children:"Pro"}),d.map(h=>r.jsxs("button",{onClick:()=>c(h.id),className:`w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-left transition-colors ${s===h.id?"bg-orange-500/15 text-orange-300":"text-white/60 hover:bg-white/5 hover:text-white/90"}`,children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${s===h.id?"bg-orange-500":"bg-orange-300"}`}),r.jsx("span",{className:"text-[12px] font-medium truncate",children:h.name}),s===h.id&&r.jsx("span",{className:"ml-auto text-[9px] font-semibold text-orange-400 shrink-0",children:"active"})]},h.id))]}),a.length===0&&r.jsx("div",{className:"px-3 py-4 text-[12px] text-white/30 text-center",children:"No models available"})]}),r.jsx("div",{className:"shrink-0 border-t border-white/8 p-1.5",children:r.jsxs(hi,{to:"/app/settings",onClick:()=>n(!1),className:"flex items-center justify-center gap-1.5 w-full px-2.5 py-2 rounded-lg text-[11px] font-medium text-white/35 hover:text-orange-400 hover:bg-orange-500/8 transition-colors",children:[r.jsx(yh,{size:11}),e.systemHealth.moreModels]})})]})})]})}function gs(e){if(typeof e=="string")return e;if(e==null)return"";if(typeof e=="object"){const t=e,n=t.message??t.error??t.text??t.content??t.result;return n!==void 0?gs(n):JSON.stringify(e)}return String(e)}function m3(e,t){switch(e){case"planGenerated":{const n=t.steps;return`Plan ready — ${(n==null?void 0:n.length)??0} step(s)`}case"stepStart":{const n=t.step;return`▶ ${(n==null?void 0:n.description)??gs(t.step)}`}case"stepFinish":{if(t.status==="error")return`✗ ${gs(t.error)}`;const n=t.step,s=t.result!==void 0?gs(t.result):void 0,i=(n==null?void 0:n.description)??"Step complete";return s&&s.length<180?`✓ ${i} → ${s}`:`✓ ${i}`}case"agentRepair":{const n=gs(t.action),s=t.reason?` — ${gs(t.reason).slice(0,120)}`:"";return`⟳ Repair: ${n}${s}`}default:return null}}function g3(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(e)})}function x3({lang:e,code:t}){const[n,s]=f.useState(!1);return r.jsxs("div",{className:"my-3 rounded-xl overflow-hidden border border-white/8 bg-[#1a0800]/90",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 border-b border-white/6 select-none",children:[r.jsx("span",{className:"text-[11px] font-mono text-orange-300/50",children:e||"code"}),r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t).catch(()=>{}),s(!0),setTimeout(()=>s(!1),2e3)},className:"flex items-center gap-1.5 text-[11px] text-orange-300/50 hover:text-orange-200 transition-colors",children:n?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:10,className:"text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Copied"})]}):r.jsxs(r.Fragment,{children:[r.jsx(sl,{size:10}),"Copy"]})})]}),r.jsx("pre",{className:"overflow-x-auto px-4 py-3 text-[13px] text-orange-50 font-mono leading-relaxed whitespace-pre",children:r.jsx("code",{children:t})})]})}function Us(e,t){return e.split(/(`[^`\n]+`)/).map((s,i)=>{if(s.startsWith("`")&&s.endsWith("`")&&s.length>2)return r.jsx("code",{className:"px-1.5 py-0.5 rounded bg-black/15 text-orange-700 font-mono text-[12px]",children:s.slice(1,-1)},`${t}-ic${i}`);const a=s.split(/(\*\*[^*\n]+\*\*|\*[^*\n]+\*)/);return r.jsx(f.Fragment,{children:a.map((o,l)=>o.startsWith("**")&&o.endsWith("**")&&o.length>4?r.jsx("strong",{className:"font-bold text-[#1a0c06]",children:o.slice(2,-2)},`${t}-b${i}-${l}`):o.startsWith("*")&&o.endsWith("*")&&o.length>2?r.jsx("em",{className:"italic",children:o.slice(1,-1)},`${t}-em${i}-${l}`):r.jsx("span",{children:o},`${t}-s${i}-${l}`))},`${t}-bi${i}`)})}function y3({text:e,dark:t=!1}){const n=t?"text-orange-50":"text-[#3d1a06]",s=[],i=e.split(`
670
+ `);let a=0,o=0;const l=()=>`md-${o++}`;for(;a<i.length;){const c=i[a],u=c.match(/^```(\w*)/);if(u){const y=u[1]??"",w=[];for(a++;a<i.length&&!i[a].startsWith("```");)w.push(i[a]),a++;a<i.length&&a++,s.push(r.jsx(x3,{lang:y,code:w.join(`
671
+ `)},l()));continue}const d=c.match(/^### (.+)/);if(d){s.push(r.jsx("h3",{className:`text-sm font-bold mt-4 mb-1 ${n}`,children:Us(d[1],l())},l())),a++;continue}const p=c.match(/^## (.+)/);if(p){s.push(r.jsx("h2",{className:`text-base font-bold mt-5 mb-1.5 ${n}`,children:Us(p[1],l())},l())),a++;continue}const h=c.match(/^# (.+)/);if(h){s.push(r.jsx("h1",{className:`text-lg font-bold mt-6 mb-2 ${n}`,children:Us(h[1],l())},l())),a++;continue}if(c.match(/^[-*]{3,}$/)){s.push(r.jsx("hr",{className:"border-black/10 my-4"},l())),a++;continue}if(c.match(/^[-*•] /)){const y=[];for(;a<i.length&&i[a].match(/^[-*•] /);)y.push(i[a].replace(/^[-*•] /,"")),a++;s.push(r.jsx("ul",{className:"my-2 space-y-1.5 pl-1",children:y.map((w,v)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsx("span",{className:"mt-[7px] w-1.5 h-1.5 rounded-full bg-orange-500/60 flex-shrink-0"}),r.jsx("span",{children:Us(w,`ul-${v}`)})]},v))},l()));continue}if(c.match(/^\d+\. /)){const y=[];for(;a<i.length&&i[a].match(/^\d+\. /);)y.push(i[a].replace(/^\d+\. /,"")),a++;s.push(r.jsx("ol",{className:"my-2 space-y-1.5 pl-1",children:y.map((w,v)=>r.jsxs("li",{className:`flex items-start gap-2.5 text-[14px] leading-relaxed ${n}`,children:[r.jsxs("span",{className:"flex-shrink-0 mt-px font-mono text-[12px] w-5 text-right text-orange-600/60",children:[v+1,"."]}),r.jsx("span",{children:Us(w,`ol-${v}`)})]},v))},l()));continue}if(c.trim()===""){a++;continue}const m=[];for(;a<i.length&&i[a].trim()!==""&&!i[a].match(/^(```|#{1,3} |[-*•] |\d+\. |[-*]{3,}$)/);)m.push(i[a]),a++;m.length&&s.push(r.jsx("p",{className:`text-[14px] leading-[1.75] my-1.5 ${n}`,children:Us(m.join(" "),`p-${o}`)},l()))}return r.jsx("div",{children:s})}function v3({workflow:e,onDismiss:t}){const[n,s]=f.useState("idle"),[i,a]=f.useState(e.goal.slice(0,52)+(e.goal.length>52?"…":"")),o=async()=>{s("saving");try{const l=await U("/api/skills/save",{method:"POST",body:JSON.stringify({goal:e.goal,answer:e.answer,steps:e.steps,name:i.trim()||void 0})});if(!l.ok)throw new Error(`HTTP ${l.status}`);s("saved"),setTimeout(t,1800)}catch{s("error"),setTimeout(()=>s("idle"),3e3)}};return r.jsx($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2},className:"mt-3",children:r.jsx("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-xl bg-orange-900/20 border border-orange-600/30",children:n==="saved"?r.jsxs(r.Fragment,{children:[r.jsx(Qe,{size:13,className:"text-orange-400 shrink-0"}),r.jsx("span",{className:"text-xs font-medium text-orange-400",children:"Skill saved!"})]}):r.jsxs(r.Fragment,{children:[r.jsx(qy,{size:13,className:"text-orange-600 shrink-0"}),r.jsx("span",{className:"text-[11px] text-orange-200 shrink-0 font-medium",children:"Save as Skill:"}),r.jsx("input",{value:i,onChange:l=>a(l.target.value),onKeyDown:l=>l.key==="Enter"&&n==="idle"&&o(),placeholder:"Skill name…",className:"flex-1 bg-transparent text-[12px] text-orange-100 outline-none placeholder-orange-600/50 min-w-0"}),r.jsx("button",{onClick:o,disabled:n!=="idle",className:"flex items-center gap-1 px-3 py-1 rounded-lg bg-orange-900/30 hover:bg-orange-900/50 border border-orange-800/40 text-orange-200 text-[11px] font-semibold transition-all shrink-0 disabled:opacity-50",children:n==="saving"?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:10,className:"animate-spin"})," Saving…"]}):n==="error"?"Retry":"Save"}),r.jsx("button",{onClick:t,className:"text-orange-700 hover:text-orange-500 transition-colors text-[11px] shrink-0",children:"✕"})]})})})}function b3({src:e,onClose:t}){const[n,s]=f.useState(!1);f.useEffect(()=>{const o=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t]);const i=()=>{const o=document.createElement("a");o.href=e,o.download=`mustb-image-${Date.now()}.jpg`,o.click()},a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}};return r.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-black/90 backdrop-blur-sm",onClick:t,children:[r.jsxs("div",{className:"absolute top-5 right-5 flex items-center gap-2",onClick:o=>o.stopPropagation(),children:[r.jsxs("button",{onClick:a,title:"Copy link",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[n?r.jsx(Kt,{size:14,className:"text-green-400"}):r.jsx(sl,{size:14}),n?"Copied!":"Copy"]}),r.jsxs("button",{onClick:i,title:"Download image",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white text-[12px] font-medium transition-all",children:[r.jsx(Jy,{size:14}),"Download"]}),r.jsx("button",{onClick:t,className:"w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all",children:r.jsx(st,{size:18})})]}),r.jsx("img",{src:e,alt:"Preview",className:"max-w-[90vw] max-h-[85vh] object-contain rounded-2xl shadow-2xl",onClick:o=>o.stopPropagation()})]})}class w3 extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t.message??"Unknown error"}}componentDidCatch(t,n){console.error("[ChatErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[r.jsx("span",{className:"text-2xl",children:"⚠️"}),r.jsx("p",{className:"text-red-400 font-bold text-sm",children:"Chat render error"}),r.jsx("p",{className:"text-orange-200/70 text-xs font-mono max-w-sm break-all",children:this.state.error}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-1 px-4 py-2 rounded-xl bg-orange-900/20 border border-orange-800/30 text-orange-200 text-xs font-bold hover:bg-orange-900/40 transition-all",children:"Retry"})]}):this.props.children}}const _m=[{id:"terminal",label:"Terminal",Icon:Ps},{id:"browser",label:"Browser",Icon:Ye},{id:"image-gen",label:"Görsel Üret",Icon:i1},{id:"web-search",label:"Web Search",Icon:qt},{id:"file-manager",label:"Files",Icon:os},{id:"code",label:"Code",Icon:ln},{id:"screen-sense",label:"Ekranı Gör",Icon:xh}];function k3({onSend:e,onStop:t,disabled:n}){const{t:s}=ht(),[i,a]=f.useState(""),[o,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState([]),[h,m]=f.useState([]),[y,w]=f.useState(!1),v=f.useRef(null),g=f.useRef(!1),x=f.useRef(null),k=f.useRef(null),j=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),b=()=>{const M=window.SpeechRecognition||window.webkitSpeechRecognition;if(!M)return;const z=new M;z.continuous=!0,z.interimResults=!0,z.lang="tr-TR",z.onresult=V=>{let T="",R="";for(let B=V.resultIndex;B<V.results.length;B++)V.results[B].isFinal?T+=V.results[B][0].transcript:R+=V.results[B][0].transcript;T?(a(B=>(B.trim()?B.trimEnd()+" ":"")+T.trim()),u("")):u(R)},z.onend=()=>{u(""),g.current?setTimeout(b,150):(l(!1),v.current=null)},z.onerror=V=>{V.error!=="no-speech"&&l(!1),u(""),g.current&&V.error!=="not-allowed"&&setTimeout(b,500)},v.current=z;try{z.start()}catch{}},S=()=>{var M;o?(g.current=!1,(M=v.current)==null||M.stop(),u("")):(g.current=!0,l(!0),b())},N=M=>{p(z=>[...z,...Array.from(M)])},C=M=>{const z=Array.from(M.clipboardData.files);z.length&&(M.preventDefault(),N(z))},_=M=>{M.preventDefault(),N(M.dataTransfer.files)},E=M=>p(z=>z.filter((V,T)=>T!==M));f.useEffect(()=>{if(!y)return;const M=z=>{k.current&&!k.current.contains(z.target)&&w(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y]);const P=async()=>{try{const M=await navigator.mediaDevices.getDisplayMedia({video:!0}),z=document.createElement("video");z.srcObject=M,z.muted=!0,await new Promise(T=>{z.onloadedmetadata=()=>{z.play(),T()}}),await new Promise(T=>setTimeout(T,120));const V=document.createElement("canvas");V.width=z.videoWidth,V.height=z.videoHeight,V.getContext("2d").drawImage(z,0,0),M.getTracks().forEach(T=>T.stop()),V.toBlob(T=>{if(!T)return;const R=new File([T],`ekran-${Date.now()}.png`,{type:"image/png"});N([R]),a(B=>B.trim()?B:"Bu ekranı analiz et ve ne gördüğünü açıkla."),he.success("Ekran yakalandı — göndermek için ▶ basın.")},"image/png",.9)}catch(M){(M==null?void 0:M.name)!=="NotAllowedError"&&he.error("Ekran yakalanamadı.")}},O=M=>{if(M==="screen-sense"){P(),w(!1);return}m(z=>z.includes(M)?z.filter(V=>V!==M):[...z,M])},F=()=>{var V;const M=i.trim();if(!M||n)return;o&&(g.current=!1,(V=v.current)==null||V.stop(),u(""));const z=[...d];a(""),p([]),e(M,h.length>0?h:void 0,z.length>0?z:void 0)};f.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,160)}px`)},[i]),f.useEffect(()=>{const M=z=>{var T;const V=((T=z.detail)==null?void 0:T.text)??"";a(V),setTimeout(()=>{var R;return(R=x.current)==null?void 0:R.focus()},60)};return window.addEventListener("mustb:prefill",M),()=>window.removeEventListener("mustb:prefill",M)},[]);const D=o?c||s.chat.listening:"What do you want to know?";return r.jsx("div",{className:"max-w-3xl mx-auto w-full",children:r.jsxs("div",{className:"glass-input rounded-2xl flex flex-col px-4 pt-3 pb-3 gap-2.5",onPaste:C,onDrop:_,onDragOver:M=>M.preventDefault(),children:[d.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:d.map((M,z)=>r.jsxs("div",{className:"relative group w-12 h-12",children:[M.type.startsWith("image/")?r.jsx("img",{src:URL.createObjectURL(M),alt:M.name,className:"w-12 h-12 object-cover rounded-lg border border-orange-500/20"}):r.jsx("div",{className:"w-12 h-12 rounded-lg border border-orange-500/20 bg-orange-500/10 flex items-center justify-center",children:r.jsx(Yt,{size:16,className:"text-orange-400"})}),r.jsx("button",{onClick:()=>E(z),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:r.jsx(st,{size:9})})]},z))}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{ref:k,className:"flex items-center gap-0.5 mb-0.5 shrink-0 relative",children:[r.jsx("button",{type:"button",onClick:()=>w(M=>!M),title:"Araçlar",className:`p-2 rounded-full transition-all ${y||h.length>0?"text-orange-400 bg-orange-500/15 border border-orange-500/25":"text-white/30 hover:text-white/70 hover:bg-white/8"}`,children:r.jsx(bh,{size:16})}),r.jsx(ee,{children:y&&r.jsxs($.div,{initial:{opacity:0,y:8,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.97},transition:{duration:.14,ease:[.22,1,.36,1]},className:"absolute bottom-full mb-2 left-0 z-50 w-52 rounded-2xl p-2 shadow-2xl",style:{background:"rgba(16,7,2,0.97)",border:"1px solid rgba(249,115,22,0.18)",backdropFilter:"blur(24px)"},children:[r.jsx("p",{className:"px-2.5 pt-1.5 pb-1 text-[9.5px] font-black uppercase tracking-[0.14em] text-orange-400/60",children:"Araçlar"}),_m.map(({id:M,label:z,Icon:V})=>{const T=h.includes(M);return r.jsxs("button",{onClick:()=>O(M),className:`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-xl transition-all text-left ${T?"bg-orange-500/15 text-orange-300":"text-white/55 hover:bg-white/6 hover:text-white/90"}`,children:[r.jsx(V,{size:13,className:T?"text-orange-400":"text-white/30"}),r.jsx("span",{className:"text-[12px] font-medium",children:z}),T&&r.jsx("span",{className:"ml-auto w-3.5 h-3.5 rounded-full bg-orange-500/30 border border-orange-500/60 flex items-center justify-center text-[8px] text-orange-300",children:"✓"})]},M)})]})}),r.jsxs("label",{className:"p-2 rounded-full cursor-pointer text-white/30 hover:text-white/70 hover:bg-white/8 transition-all",title:s.chat.attachFile,children:[r.jsx(HS,{size:16}),r.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:M=>M.target.files&&N(M.target.files)})]})]}),r.jsx("textarea",{ref:x,value:i,onChange:M=>a(M.target.value),onKeyDown:M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),F())},placeholder:D,disabled:n,rows:1,className:"flex-1 bg-transparent text-white/90 placeholder-white/35 text-[15px] outline-none resize-none min-h-[28px] max-h-[160px] scrollbar-hide leading-relaxed"}),r.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5 shrink-0",children:[j&&r.jsx("button",{onClick:S,title:o?"Stop dictation":"Start voice dictation (append mode)",className:`p-2 rounded-full transition-all ${o?"text-red-400 bg-red-500/15 border border-red-500/30 shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-white/40 hover:text-white/70 hover:bg-white/8"}`,children:o?r.jsx(bS,{size:17,className:"animate-pulse"}):r.jsx(Nr,{size:17})}),n?r.jsx("button",{onClick:t,title:"Durdur",className:"w-9 h-9 rounded-full flex items-center justify-center transition-all bg-red-600/80 hover:bg-red-500 text-white shadow-[0_0_12px_rgba(239,68,68,0.5)] active:scale-95",children:r.jsx(vh,{size:14})}):r.jsx("button",{onClick:F,disabled:!i.trim(),className:`w-9 h-9 rounded-full flex items-center justify-center transition-all ${i.trim()?"bg-orange-600 hover:bg-orange-500 text-white shadow-[0_0_15px_rgba(249,115,22,0.4)] active:scale-95":"bg-white/10 text-white/25 cursor-not-allowed"}`,children:r.jsx(qS,{size:16})})]})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5 flex-1",children:h.map(M=>{const z=_m.find(R=>R.id===M);if(!z)return null;const{Icon:V,label:T}=z;return r.jsxs("span",{className:"flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-orange-500/15 border border-orange-500/25 text-orange-300 text-[11px] font-medium",children:[r.jsx(V,{size:10}),r.jsx("span",{children:T}),r.jsx("button",{type:"button",onClick:()=>O(M),className:"ml-0.5 p-0.5 rounded-full hover:bg-orange-500/20 text-orange-400/60 hover:text-orange-300 transition-colors",children:r.jsx(st,{size:9})})]},M)})}):r.jsx("div",{className:"flex-1"}),r.jsx(f3,{})]})]})})}function lc(e){return`mustb_chat_turns_${e}`}function j3(){const{t:e,setLocale:t}=ht(),n=f.useRef(e);f.useEffect(()=>{n.current=e},[e]);const[s]=p2(),i=un(),a=s.get("chat")??"default",o=f.useRef(null),[l,c]=f.useState(null),[u,d]=f.useState(()=>{try{const N=localStorage.getItem(lc(a));if(N)return JSON.parse(N)}catch{}return[]}),p=f.useRef(null),h=f.useRef(null),m=f.useRef(a),[y,w]=f.useState(!1),[v,g]=f.useState(null),x=u.some(N=>N.kind==="assistant"&&N.status==="pending");f.useEffect(()=>{m.current=a;try{const N=localStorage.getItem(lc(a));d(N?JSON.parse(N):[])}catch{d([])}p.current=null},[a]),f.useEffect(()=>{if(a==="default"||!o.current)return;const N=o.current;o.current=null,setTimeout(()=>b(N.text,N.tools,N.files),0)},[a]),f.useEffect(()=>{const N=pt();return N.on("agentUpdate",C=>{const{type:_,...E}=C;if(_==="memorySearch")return;if(_==="planStart"){const F=`asst-${Date.now()}-${Math.random().toString(36).slice(2)}`;p.current=F,d(D=>[...D,{id:F,kind:"assistant",content:"",thoughts:[],status:"pending"}]);return}if(_==="finalAnswer"){const F=p.current;if(!F)return;d(D=>D.map(M=>M.id===F?{...M,content:gs(E.answer??"Done.")}:M));return}if(_==="planFinish"){w(!1);const F=p.current;if(!F)return;const D=E.status==="failed"?"error":"done",M=E.status==="completed"?{goal:String(E.goal??""),answer:String(E.answer??""),steps:E.steps??[]}:void 0;d(z=>z.map(V=>V.id===F?{...V,status:D,...M?{workflow:M}:{}}:V)),p.current=null;return}if(_==="professionResearched"){const F=String(E.profession??"");if(!F)return;const D=n.current.chat.professionAck.replace("{profession}",F);d(M=>[...M,{id:`prof-ack-${Date.now()}`,kind:"assistant",content:D,thoughts:[],status:"done"}]);return}const P=m3(_,E);if(!P)return;const O=p.current;O&&d(F=>F.map(D=>D.id===O?{...D,thoughts:[...D.thoughts,P]}:D))}),()=>{N.off("agentUpdate")}},[]),f.useEffect(()=>{var N;(N=h.current)==null||N.scrollIntoView({behavior:"smooth"})},[u]),f.useEffect(()=>{const N=C=>{var O;const _=(O=C.detail)==null?void 0:O.skill;if(!_)return;const P={"web-search":"Search the web for: ","web-fetch":"Fetch and summarize this URL: ",browser:"Open the browser and navigate to: ",pdf:"Read and summarize this PDF: ","image-analysis":"Analyze this image: ","image-generate":"Generate an image of: ",tts:"Convert this text to speech: ","spawn-agent":"Spawn a new agent to: ",sessions:"List all active agent sessions",canvas:"Open the canvas workspace",git:"Run a git operation: ",gateway:"Connect to Must-b gateway node: ","file-manager":"Open the file manager",cron:"Create a scheduled task: ",messages:"Check and reply to messages","memory-add":"Save this to memory: ",contacts:"Look up contact: ",calendar:"Check my calendar for: ",automations:"Create an automation that: ","scheduled-tasks":"List all scheduled tasks",commands:"Run this command: ",nodes:"List all gateway nodes","multi-agent":"Start a multi-agent workflow to: ","chat-focus":""}[_]??`Run skill "${_}": `;window.dispatchEvent(new CustomEvent("mustb:prefill",{detail:{text:P}}))};return window.addEventListener("mustb:invoke-skill",N),()=>window.removeEventListener("mustb:invoke-skill",N)},[]),f.useEffect(()=>{if(m.current===a)try{localStorage.setItem(lc(a),JSON.stringify(u))}catch{}},[u,a]),f.useEffect(()=>{const N=u[u.length-1];if(!N||N.kind!=="assistant"||N.status!=="done"||!N.content)return;const C=[...u].reverse().find(E=>E.kind==="user");if(!C)return;const _=`Q: ${C.content}
672
+ A: ${N.content.slice(0,400)}`;fetch("/api/memory/ltm/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:_,tags:["chat","autosave"]})}).catch(()=>{})},[u.length]);const k=N=>{const C=[[/\b(spanish mode|speak spanish|habla español|en español)\b/i,"es"],[/\b(french mode|speak french|en français|parle français)\b/i,"fr"],[/\b(german mode|speak german|auf deutsch|deutsch mode)\b/i,"de"],[/\b(japanese mode|speak japanese|日本語モード)\b/i,"ja"],[/\b(chinese mode|speak chinese|中文模式)\b/i,"zh"],[/\b(portuguese mode|fala português)\b/i,"pt"],[/\b(turkish mode|türkçe mode|türkçe konuş)\b/i,"tr"],[/\b(english mode|switch to english|speak english)\b/i,"en"]],_={tr:"Anlaşıldı, ayarlar kalıcı olarak güncellendi.",en:"Got it, settings updated permanently.",es:"Entendido, configuración actualizada permanentemente.",fr:"Compris, paramètres mis à jour définitivement.",de:"Verstanden, Einstellungen dauerhaft aktualisiert.",ja:"了解です。設定が永久に更新されました。",zh:"明白,设置已永久更新。",pt:"Entendido, configurações atualizadas permanentemente."};for(const[P,O]of C)if(P.test(N)){t(O);const F=_[O]??_.en;return d(D=>[...D,{id:`cfg-lang-${Date.now()}`,kind:"assistant",content:F,thoughts:[],status:"done"}]),!0}const E=[[/use\s+gpt[-\s]?4o?\b/i,"openai/gpt-4o"],[/use\s+(claude[-\s]?3\.5|claude[-\s]?sonnet|claude[-\s]?opus)\b/i,"anthropic/claude-3-5-sonnet"],[/use\s+(gemini[-\s]?flash|gemini[-\s]?pro|gemini)\b/i,"google/gemini-flash"],[/use\s+(llama[-\s]?3|llama)\b/i,"meta-llama/llama-3-70b-instruct:free"],[/use\s+mistral\b/i,"mistralai/mistral-7b-instruct:free"],[/use\s+deepseek\b/i,"deepseek/deepseek-chat"]];for(const[P,O]of E)if(P.test(N))return U("/api/settings/model",{method:"POST",body:JSON.stringify({model:O})}).catch(()=>{}),d(F=>[...F,{id:`cfg-model-${Date.now()}`,kind:"assistant",content:e.chat.settingsAck,thoughts:[],status:"done"}]),!0;return!1},j=N=>{const C=[[/\bi(?:'m| am)\s+a(?:n)?\s+(lawyer|attorney|solicitor|barrister)\b/i,"lawyer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(doctor|physician|nurse|surgeon|pharmacist)\b/i,"medical"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(software engineer|developer|programmer|coder)\b/i,"software-engineer"],[/\bi(?:'m| am)\s+a(?:n)?\s+(teacher|professor|educator|instructor)\b/i,"educator"],[/\bi(?:'m| am)\s+a(?:n)?\s+(accountant|auditor|financial advisor|analyst)\b/i,"finance"],[/\bi(?:'m| am)\s+a(?:n)?\s+(architect|civil engineer|structural engineer)\b/i,"engineering"],[/\bi(?:'m| am)\s+a(?:n)?\s+(designer|ux designer|graphic designer)\b/i,"designer"],[/\bi(?:'m| am)\s+a(?:n?)?\s+(data scientist|ml engineer|ai researcher)\b/i,"data-science"],[/\bben\s+bir?\s+avukat\b/i,"lawyer"],[/\bavukat(?:ım|ım)?\b/i,"lawyer"],[/\bben\s+bir?\s+doktor\b/i,"medical"],[/\bdoktor(?:um|um)?\b/i,"medical"],[/\bben\s+bir?\s+hemşire\b/i,"medical"],[/\bben\s+bir?\s+mühendis\b/i,"engineering"],[/\bmühendis(?:im|im)?\b/i,"engineering"],[/\bben\s+bir?\s+yazılımcı\b/i,"software-engineer"],[/\byazılımcı(?:yım|yım)?\b/i,"software-engineer"],[/\bben\s+bir?\s+öğretmen\b/i,"educator"],[/\böğretmen(?:im|im)?\b/i,"educator"],[/\bben\s+bir?\s+muhasebeci\b/i,"finance"],[/\bmuhasebeci(?:yim|yim)?\b/i,"finance"],[/\bben\s+bir?\s+tasarımcı\b/i,"designer"],[/\btasarımcı(?:yım|yım)?\b/i,"designer"],[/\bben\s+bir?\s+mimar\b/i,"engineering"],[/\bmimar(?:ım|ım)?\b/i,"engineering"]];for(const[_,E]of C)if(_.test(N)){U("/api/memory/profession-research",{method:"POST",body:JSON.stringify({profession:E,userMessage:N})}).catch(()=>{});break}},b=async(N,C,_)=>{if(N.startsWith("__GUIDANCE__")){const D=N.slice(12);d(M=>[...M,{id:`guidance-${Date.now()}`,kind:"assistant",content:`ℹ ${D}`,thoughts:[],status:"done"}]);return}if(k(N))return;j(N);let E=N;if(C!=null&&C.includes("image-gen")&&!N.toLowerCase().startsWith("generate")&&!N.toLowerCase().startsWith("create")&&(E=`Görsel oluştur: ${N}`),a==="default")try{const D=N.trim().split(/\s+/).slice(0,4).join(" "),M=await U("/api/chats",{method:"POST",body:JSON.stringify({title:D})});if(M.ok){const z=await M.json();o.current={text:E,tools:C,files:_},i(`/app?chat=${z.id}`);return}}catch{}if(!u.some(D=>D.kind==="user")&&a!=="default"){const D=N.trim().split(/\s+/).slice(0,4).join(" ");D&&U(`/api/chats/${a}`,{method:"PATCH",body:JSON.stringify({title:D})}).then(()=>{window.dispatchEvent(new CustomEvent("mustb:chat-renamed",{detail:{id:a,title:D}}))}).catch(()=>{})}d(D=>D.map(M=>({...M,workflow:void 0})));const O=_==null?void 0:_.filter(D=>D.type.startsWith("image/")).map(D=>URL.createObjectURL(D));d(D=>[...D,{id:`user-${Date.now()}`,kind:"user",content:N,thoughts:[],status:"done",...O!=null&&O.length?{attachments:O}:{}}]);const F={goal:E};if(C&&C.length>0&&(F.focus_tools=C),_&&_.length>0)try{F.attachments=await Promise.all(_.map(async D=>({name:D.name,type:D.type,data:await g3(D)})))}catch{}w(!0);try{await U("/api/goal",{method:"POST",body:JSON.stringify(F)})}catch{w(!1)}},S=u.length>0;return r.jsxs(w3,{children:[l&&r.jsx(b3,{src:l,onClose:()=>c(null)}),r.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:S?r.jsxs("div",{className:"max-w-3xl mx-auto w-full px-5 pt-6 pb-4",children:[u.map(N=>{if(N.kind==="user")return r.jsx("div",{className:"flex justify-end mb-5",children:r.jsxs("div",{className:"max-w-[78%] flex flex-col items-end gap-2",children:[N.attachments&&N.attachments.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2 justify-end",children:N.attachments.map((O,F)=>r.jsxs("div",{className:"relative group w-24 h-24 shrink-0",children:[r.jsx("img",{src:O,alt:`attachment-${F}`,onClick:()=>c(O),width:96,height:96,className:"w-24 h-24 object-cover rounded-xl border border-orange-500/25 hover:opacity-90 transition-opacity duration-150 cursor-zoom-in",style:{minWidth:96,minHeight:96}}),r.jsx("button",{onClick:D=>{D.stopPropagation(),b("Bu görseli analiz et ve açıkla",void 0,void 0)},title:"Düzenle / Analiz Et",className:"absolute bottom-1 right-1 w-6 h-6 flex items-center justify-center rounded-full bg-black/70 hover:bg-orange-600 opacity-0 group-hover:opacity-100 transition-all duration-150 text-white",children:r.jsx(GS,{size:11})})]},F))}),r.jsx("div",{className:"rounded-2xl rounded-br-sm px-5 py-3 text-white text-[14px] leading-relaxed whitespace-pre-wrap",style:{background:"rgba(25,10,2,0.72)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(12px)"},children:N.content})]})},N.id);const C=N.thoughts.length>0,_=N.content.length>0,E=N.status==="pending",P=N.status==="error"&&!_;return r.jsxs("div",{className:"mb-8",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[r.jsxs("div",{className:"relative w-5 h-5 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-600/30 rounded-full blur-sm"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 tracking-wide",children:"Must-b"}),C&&r.jsxs("span",{className:"text-[10px] text-white/35 font-mono",children:[N.thoughts.length," step",N.thoughts.length!==1?"s":""]})]}),C&&r.jsxs("details",{className:"mb-3 group",style:{background:"rgba(255,255,255,0.025)",borderRadius:"10px",padding:"6px 10px"},..._?{}:{open:!0},children:[r.jsxs("summary",{className:"flex items-center gap-1.5 cursor-pointer list-none select-none w-fit",children:[r.jsx(on,{size:10,className:"text-orange-400/50 group-open:rotate-90 transition-transform duration-150 flex-shrink-0"}),r.jsxs("span",{className:"text-[10px] font-semibold text-orange-300/50 hover:text-orange-300/80 transition-colors tracking-wide uppercase",children:[N.thoughts.length," step",N.thoughts.length!==1?"s":""," · Thought process"]})]}),r.jsx("div",{className:"mt-2 ml-3.5 pl-3 border-l border-orange-500/15 space-y-1",children:N.thoughts.map((O,F)=>r.jsx("p",{className:"text-[11px] font-mono text-white/30 leading-relaxed break-all",children:O},F))})]}),_?r.jsxs("div",{className:"w-full py-2",children:[r.jsx(y3,{text:N.content,dark:!0}),r.jsx("div",{className:"flex justify-end mt-3",children:r.jsx("button",{onClick:()=>{navigator.clipboard.writeText(N.content).catch(()=>{}),g(N.id),setTimeout(()=>g(null),2e3)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 text-[11px] transition-all border border-white/6",children:v===N.id?r.jsxs(r.Fragment,{children:[r.jsx(Kt,{size:12,className:"text-green-400"})," Kopyalandı"]}):r.jsxs(r.Fragment,{children:[r.jsx(sl,{size:12})," Kopyala"]})})})]}):E?r.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[[0,120,240].map(O=>r.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"rgba(251,146,60,0.7)",animationDelay:`${O}ms`}},O)),r.jsx("span",{className:"text-[11px] text-white/25 ml-1",children:"Thinking…"})]}):P?r.jsxs("div",{className:"rounded-xl px-4 py-3 flex items-center gap-2",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:[r.jsx("span",{className:"text-red-400 text-sm",children:"⚠"}),r.jsx("p",{className:"text-sm text-red-300/80",children:"Something went wrong. Please try again."})]}):null,r.jsx(ee,{children:N.workflow&&!E&&r.jsx(v3,{workflow:N.workflow,onDismiss:()=>d(O=>O.map(F=>F.id===N.id?{...F,workflow:void 0}:F))})})]},N.id)}),r.jsx("div",{ref:h,className:"h-2"})]}):r.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6 select-none",children:r.jsx(ee,{children:r.jsx($.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-10,scale:.96},transition:{duration:.55,ease:"easeOut"},className:"flex flex-col items-center gap-4 mb-10",children:r.jsx("span",{className:"font-black tracking-tighter select-none leading-none px-2 w-full text-center",style:{fontSize:"clamp(56px, 16vw, 120px)",background:"linear-gradient(135deg, rgba(249,115,22,0.92) 0%, rgba(253,186,116,0.75) 40%, rgba(255,255,255,0.30) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",paddingBottom:"0.05em",paddingRight:"20px"},children:"Must-b"})},"hero")})})}),r.jsxs("div",{className:"shrink-0 px-4 pb-3 pt-2",children:[r.jsx(k3,{onSend:(N,C,_)=>b(N,C,_),onStop:()=>{w(!1),U("/api/goal/abort",{method:"POST"}).catch(()=>{}),d(N=>N.map(C=>C.status==="pending"?{...C,status:"done",content:C.content||"⏹ Durduruldu."}:C)),p.current=null},disabled:y||x}),r.jsx("p",{className:"text-center text-[11px] text-white/20 mt-2 select-none",children:e.chat.disclaimer})]})]})]})}function N3(){const[e,t]=f.useState(!1);return f.useEffect(()=>{const n=pt();return n.on("agentUpdate",s=>{s.type==="SCREEN_CAPTURE_START"&&t(!0),(s.type==="SCREEN_CAPTURED"||s.type==="SCREEN_CAPTURE_END")&&setTimeout(()=>t(!1),700)}),()=>{n.off("agentUpdate")}},[]),r.jsx(ee,{children:e&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},className:"fixed inset-0 z-[9999] pointer-events-none",children:[r.jsxs("div",{className:"absolute inset-0",children:[r.jsx("div",{className:"absolute top-0 left-0 w-12 h-12 border-t-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute top-0 right-0 w-12 h-12 border-t-2 border-r-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-12 h-12 border-b-2 border-l-2 border-orange-500/70"}),r.jsx("div",{className:"absolute bottom-0 right-0 w-12 h-12 border-b-2 border-r-2 border-orange-500/70"})]}),r.jsx($.div,{className:"absolute left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-orange-500/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:1.4,repeat:1/0,ease:"linear"}}),r.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2",children:r.jsxs($.div,{initial:{y:-10,opacity:0},animate:{y:0,opacity:1},className:"flex items-center gap-2 px-4 py-2 bg-black/80 border border-orange-500/30 rounded-full shadow-[0_0_20px_rgba(234,88,12,0.3)] backdrop-blur-xl",children:[r.jsxs("span",{className:"relative flex h-2 w-2",children:[r.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),r.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-orange-500"})]}),r.jsx(Hi,{size:12,className:"text-orange-400 animate-spin"}),r.jsx("span",{className:"text-orange-300 text-xs font-semibold tracking-wide",children:"Scanning screen…"})]})})]},"scan-overlay")})}const Ma={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"},S3={browse:Ye,write:Yt,think:Gt,exec:Ps},C3={running:"bg-orange-500/8 border border-orange-500/20 text-orange-300",done:"bg-green-500/5 border border-green-500/10 text-gray-500",queued:"bg-white/2 border border-white/5 text-gray-600"},_3={mouseMove:US,mouseClick:r1,typeText:zS,visionClick:Ts},E3={mouseMove:"text-gray-500",mouseClick:"text-orange-400",typeText:"text-blue-400",visionClick:"text-purple-400"};function T3(){const{t:e}=ht(),[t,n]=f.useState(!1),[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),u=f.useRef(null),[d,p]=f.useState(null),[h,m]=f.useState(!1),[y,w]=f.useState(()=>new Array(3).fill(null)),[v,g]=f.useState(0),[x,k]=f.useState([]),[j,b]=f.useState(null),[S,N]=f.useState([]),C=f.useRef(null),[_,E]=f.useState(!1),[P,O]=f.useState(!1);f.useEffect(()=>{if(!s||!u.current)return;const z=u.current,V=z.getContext("2d");if(!V)return;const T=new Image;T.onload=()=>{var R;if(z.width=T.width,z.height=T.height,V.drawImage(T,0,0),(R=s.elements)!=null&&R.length)for(const B of s.elements)V.strokeStyle=Ma[B.type]??Ma.unknown,V.lineWidth=Math.max(2,Math.round(T.width/400)),V.strokeRect(B.x,B.y,B.width,B.height),V.fillStyle=Ma[B.type]??Ma.unknown,V.font=`${Math.max(10,Math.round(T.width/120))}px monospace`,V.fillText(B.type,B.x+4,B.y+14)},T.src=`data:image/png;base64,${s.base64}`},[s]),f.useEffect(()=>{const z=pt(),V=T=>{if(T.type==="SCREEN_CAPTURE_START"&&n(!0),T.type==="SCREEN_CAPTURED"&&(n(!1),i({base64:T.base64,width:T.width,height:T.height,source:T.source,elements:T.elements}),E(!1),O(!1)),T.type==="workflowStart"&&(b(T.goal??null),k(T.steps??[]),E(!1),O(!1)),T.type==="workflowStep"&&T.step){const R=T.step;k(B=>B.map(Z=>Z.id===R.id?R:Z))}if(T.type==="workflowDone"&&setTimeout(()=>{k([]),b(null)},2500),T.type==="shadowFrame"&&typeof T.slot!="number"&&(p(T.base64),m(!0),E(!1)),T.type==="shadowToggle"&&typeof T.slot!="number"&&(m(T.enabled),T.enabled||p(null)),T.type==="ghostFrame"){const R=typeof T.slot=="number"?T.slot:-1;R>=0&&R<=2&&typeof T.base64=="string"&&(w(B=>{const Z=[...B];return Z[R]=T.base64,Z}),E(!1))}if(T.type==="ghostSlot"){const R=typeof T.slot=="number"?T.slot:-1;R>=0&&R<=2&&g(R)}if(T.type==="shadowToggle"&&typeof T.slot=="number"){const R=T.slot;R>=0&&R<=2&&!T.enabled&&w(B=>{const Z=[...B];return Z[R]=null,Z})}if(T.type==="inputAction"){const R={id:`${Date.now()}-${Math.random()}`,action:T.action??"mouseClick",label:T.label??"",timestamp:T.timestamp??Date.now()};N(B=>[...B.slice(-11),R]),E(!1),O(!1)}};return z.on("agentUpdate",V),()=>{z.off("agentUpdate",V)}},[]),f.useEffect(()=>{var z;(z=C.current)==null||z.scrollIntoView({behavior:"smooth"})},[S]);const F=async()=>{if(!t){try{const z=await U("/api/system/vision-guidance");if(z.ok){const V=await z.json();V.warn&&V.message&&o(V.message)}}catch{}await U("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}},D=y.some(z=>z!==null);return!(s||x.length>0||S.length>0||t||h||D)||P?null:r.jsx(ee,{children:r.jsxs($.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.22},className:"mx-4 mb-3 bg-[#0a0d16] border border-orange-500/12 rounded-2xl overflow-hidden shadow-xl shadow-orange-500/4 shrink-0",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500 animate-pulse"}),r.jsx("span",{className:"text-[10px] font-bold text-orange-400 uppercase tracking-widest",children:"War Room"}),s&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[s.width,"×",s.height]}),h&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold text-purple-400 bg-purple-500/10 border border-purple-500/25 px-2 py-0.5 rounded-full",children:[r.jsx(Ta,{size:9,className:"animate-pulse"}),"Shadow Active"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:F,disabled:t,className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[11px] font-medium transition-all ${t?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-600 hover:text-orange-400 hover:bg-orange-500/8 border border-white/5"}`,children:[r.jsx(Hi,{size:10}),t?"Scanning…":"Capture"]}),s&&r.jsx("button",{onClick:()=>c(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:l?"Collapse preview":"Expand preview",children:l?r.jsx(ph,{size:12}):r.jsx(Ts,{size:12})}),r.jsx("button",{onClick:()=>E(z=>!z),className:"text-gray-700 hover:text-gray-400 transition-colors",title:_?"Expand war room":"Collapse war room",children:_?r.jsx(ea,{size:12}):r.jsx(hh,{size:12})}),r.jsx("button",{onClick:()=>O(!0),className:"text-gray-700 hover:text-red-400 transition-colors",title:"Dismiss war room",children:r.jsx(st,{size:12})})]})]}),r.jsx(ee,{children:!_&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:[a&&r.jsxs("div",{className:"px-4 py-2 bg-amber-500/8 border-b border-amber-500/15 flex items-start justify-between gap-2",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed flex-1",children:a}),r.jsx("button",{onClick:()=>o(null),className:"text-[10px] text-amber-600 hover:text-amber-400 shrink-0",children:"Dismiss"})]}),r.jsxs("div",{className:"flex gap-0 divide-x divide-white/5",children:[r.jsx("div",{className:"w-1/2 shrink-0",children:D&&y[v]?r.jsxs("div",{className:"flex flex-col",children:[r.jsx("div",{className:"flex border-b border-white/5",children:[0,1,2].map(z=>y[z]!==null&&r.jsxs("button",{onClick:()=>g(z),className:`flex items-center gap-0.5 px-2 py-1 text-[9px] font-bold transition-colors ${v===z?"text-purple-400 border-b-2 border-purple-500":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Ta,{size:7})," G",z+1]},z))}),r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[110px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${y[v]}`,alt:`Ghost ${v+1}`,className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ta,{size:8,className:"animate-pulse"})," G",v+1]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]})]}):h&&d?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("img",{src:`data:image/jpeg;base64,${d}`,alt:"Shadow browser",className:"w-full object-contain"}),r.jsxs("div",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 px-2 py-0.5 bg-black/75 rounded-lg text-[9px] font-bold text-purple-400 border border-purple-500/30",children:[r.jsx(Ta,{size:8,className:"animate-pulse"})," SHADOW"]}),r.jsx("div",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 bg-black/70 rounded text-[8px] font-mono text-purple-300 border border-purple-500/20",children:"LIVE"})]}):s?r.jsxs("div",{className:`relative overflow-hidden transition-all duration-300 ${l?"max-h-[300px]":"max-h-[120px]"}`,children:[r.jsx("canvas",{ref:u,className:"w-full object-contain",style:{imageRendering:"auto"}}),s.elements&&s.elements.length>0&&r.jsxs("div",{className:"absolute bottom-1.5 right-1.5 px-2 py-0.5 bg-black/70 rounded text-[9px] font-mono text-orange-400 border border-orange-500/20",children:[s.elements.length," elements"]})]}):t?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(Hi,{size:13,className:"animate-spin"})," Scanning…"]}):r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-[11px]",children:"No capture yet"})}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.length>0&&r.jsxs("div",{className:"border-b border-white/5",children:[j&&r.jsx("div",{className:"px-3 py-1.5 border-b border-white/4 bg-white/[0.01]",children:r.jsxs("p",{className:"text-[10px] text-gray-500 truncate",children:[e.workflow.goal,": ",r.jsx("span",{className:"text-gray-300",children:j})]})}),r.jsx("div",{className:"p-2 space-y-1 max-h-[100px] overflow-y-auto scrollbar-hide",children:x.map(z=>{const V=S3[z.type]??Gt;return r.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-xl text-[11px] font-medium ${C3[z.status]}`,children:[z.status==="running"?r.jsx(oe,{size:11,className:"animate-spin text-orange-400 shrink-0"}):z.status==="done"?r.jsx(Qe,{size:11,className:"text-green-500 shrink-0"}):r.jsx(V,{size:11,className:"text-gray-600 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.label})]},z.id)})})]}),S.length>0&&r.jsxs("div",{className:"flex-1 overflow-hidden",children:[r.jsx("div",{className:"px-3 py-1 border-b border-white/4",children:r.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Control Feed"})}),r.jsxs("div",{className:"px-2 py-1 space-y-px overflow-y-auto max-h-[100px] scrollbar-hide font-mono",children:[S.map(z=>{const V=_3[z.action]??r1,T=E3[z.action]??"text-gray-500";return r.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[r.jsx(V,{size:10,className:`${T} shrink-0`}),r.jsx("span",{className:`text-[10px] ${T} truncate flex-1`,children:z.label}),r.jsx("span",{className:"text-[9px] text-gray-700 shrink-0 tabular-nums",children:new Date(z.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},z.id)}),r.jsx("div",{ref:C})]})]})]})]})]})})]})})}const Em="mustb_briefing_shown",P3=14*60*60*1e3,zu={CodeHealth:{label:"Kod Sağlığı",Icon:ln,color:"#fb923c"},DepAudit:{label:"Bağımlılık Denetimi",Icon:na,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek Boşluğu",Icon:Gt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklik Özeti",Icon:Zy,color:"#fbbf24"}};function A3(e){const t=Object.keys(zu).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?zu[t]:{label:e,Icon:ll,color:"#fb923c"}}function M3(e){const t=new Set(["NightShift-Insights","nightshift-insights","nightshift","night-shift"]);return e.find(n=>!t.has(n))??"General"}function Tm(e){if(!e)return"—";const t=Math.round(e/1e3);return t<60?`${t} sn`:`${Math.floor(t/60)} dk ${t%60} sn`}function z3(e){const t=Date.now()-e,n=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return n>0?`${n} saat ${s} dk önce`:s>0?`${s} dk önce`:"Az önce"}const R3={hidden:{opacity:0},show:{opacity:1,transition:{duration:.4}},exit:{opacity:0,transition:{duration:.35}}},L3={hidden:{opacity:0,y:32,scale:.97},show:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:260,damping:26}},exit:{opacity:0,y:20,scale:.97,transition:{duration:.25}}},O3={hidden:{},show:{transition:{staggerChildren:.11,delayChildren:.45}}},D3={hidden:{opacity:0,x:24},show:{opacity:1,x:0,transition:{type:"spring",stiffness:300,damping:28}}};function I3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState([]),[o,l]=f.useState(!0),c=f.useRef(!1);f.useEffect(()=>{c.current||(c.current=!0,(async()=>{try{const d=await U("/api/automation/nightowl/status");if(!d.ok)return;const p=await d.json();if(!p.lastShiftTs||Date.now()-p.lastShiftTs>P3||localStorage.getItem(Em)===String(p.lastShiftTs)||p.totalFindings===0)return;const h=await U("/api/memory/ltm/search?q=NightShift-Insights&limit=15&category=semantic"),y=(h.ok?await h.json():{results:[]}).results.filter(w=>w.tags.some(v=>v.toLowerCase().includes("nightshift"))).slice(0,8).map(w=>({task:M3(w.tags),summary:w.content.replace(/\n/g," ").slice(0,180)}));s(p),a(y),l(!1),t(!0),localStorage.setItem(Em,String(p.lastShiftTs))}catch{}})())},[]);const u=()=>t(!1);return r.jsx(ee,{children:e&&r.jsx($.div,{variants:R3,initial:"hidden",animate:"show",exit:"exit",className:"fixed inset-0 z-[400] flex items-center justify-center px-4",style:{background:"rgba(4,1,0,0.82)",backdropFilter:"blur(8px)"},onClick:d=>{d.target===d.currentTarget&&u()},children:r.jsxs($.div,{variants:L3,initial:"hidden",animate:"show",exit:"exit",className:"relative w-full max-w-[620px] max-h-[88vh] flex flex-col rounded-3xl overflow-hidden",style:{background:"rgba(14,6,1,0.92)",border:"1px solid rgba(249,115,22,0.22)",backdropFilter:"blur(32px)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsx("button",{onClick:u,className:"absolute top-4 right-4 z-10 w-7 h-7 rounded-full flex items-center justify-center text-white/25 hover:text-white/70 hover:bg-white/8 transition-all",children:r.jsx(st,{size:14})}),r.jsxs("div",{className:"flex-shrink-0 px-8 pt-8 pb-6",style:{borderBottom:"1px solid rgba(249,115,22,0.10)"},children:[r.jsxs($.div,{initial:{opacity:0,y:-12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.5},className:"flex items-start gap-4",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)",boxShadow:"0 0 24px rgba(249,115,22,0.15)"},children:r.jsx(al,{size:22,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-semibold text-orange-400/60 tracking-widest uppercase mb-1",children:"Sabah Raporu"}),r.jsx("h2",{className:"text-[22px] font-black text-white/90 leading-tight tracking-tight",children:"Gece Vardiyası Tamamlandı"}),(n==null?void 0:n.lastShiftTs)&&r.jsxs("p",{className:"text-[12px] text-white/35 mt-1",children:[z3(n.lastShiftTs)," · ",Tm(n.lastShiftMs)," sürdü"]})]})]}),n&&r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"flex items-center gap-4 mt-5",children:[{label:"Bulgu",value:String(n.totalFindings)},{label:"Görev",value:String(Object.keys(zu).length)},{label:"Süre",value:Tm(n.lastShiftMs)}].map(d=>r.jsxs("div",{className:"flex-1 rounded-xl px-3 py-2.5 text-center",style:{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.12)"},children:[r.jsx("p",{className:"text-[18px] font-black text-orange-400",children:d.value}),r.jsx("p",{className:"text-[10px] text-white/30 font-medium mt-0.5",children:d.label})]},d.label))})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-5 space-y-2.5",style:{scrollbarWidth:"none"},children:[o&&r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"flex gap-1.5",children:[0,1,2].map(d=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/40 animate-bounce",style:{animationDelay:`${d*.15}s`}},d))})}),!o&&i.length===0&&r.jsx("p",{className:"text-center text-[13px] text-white/30 py-10",children:"Kayıtlı bulgu bulunamadı."}),!o&&i.length>0&&r.jsx($.div,{variants:O3,initial:"hidden",animate:"show",className:"space-y-2.5",children:i.map((d,p)=>{const h=A3(d.task),m=h.Icon;return r.jsx($.div,{variants:D3,children:r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-2xl",style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${h.color}22`},children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${h.color}15`,border:`1px solid ${h.color}30`},children:r.jsx(m,{size:14,style:{color:h.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-bold mb-1 tracking-wide",style:{color:h.color},children:h.label}),r.jsx("p",{className:"text-[12.5px] text-white/65 leading-relaxed",children:d.summary})]}),r.jsx(on,{size:13,className:"text-white/15 flex-shrink-0 mt-1"})]})},p)})})]}),r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6},className:"flex-shrink-0 px-8 py-5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:r.jsxs("button",{onClick:u,className:"w-full py-3 rounded-2xl flex items-center justify-center gap-2 font-bold text-[14px] transition-all active:scale-[0.98]",style:{background:"rgba(249,115,22,0.15)",border:"1px solid rgba(249,115,22,0.30)",color:"#fdba74"},onMouseEnter:d=>d.currentTarget.style.background="rgba(249,115,22,0.22)",onMouseLeave:d=>d.currentTarget.style.background="rgba(249,115,22,0.15)",children:[r.jsx(Re,{size:15}),"Günün başlasın"]})})]})},"morning-briefing-overlay")})}const Pm={CodeHealth:{label:"Kod Sağlığı",Icon:ln,color:"#fb923c"},DepAudit:{label:"Bağımlılık",Icon:na,color:"#a78bfa"},LogAnalysis:{label:"Log Analizi",Icon:Yt,color:"#38bdf8"},LTMGap:{label:"Bellek",Icon:Gt,color:"#34d399"},WorkspaceDiff:{label:"Değişiklikler",Icon:Zy,color:"#fbbf24"}};function B3(e){const t=Object.keys(Pm).find(n=>e.toLowerCase().includes(n.toLowerCase()));return t?Pm[t]:{label:e,Icon:ll,color:"#fb923c"}}function F3(e){const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}const V3={hidden:{opacity:0,x:24,scale:.96},show:{opacity:1,x:0,scale:1,transition:{type:"spring",stiffness:320,damping:28}},exit:{opacity:0,x:24,scale:.96,transition:{duration:.22}}},$3={hidden:{opacity:0,y:-6},show:{opacity:1,y:0,transition:{duration:.22}}};function U3(){const[e,t]=f.useState("idle"),[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,u]=f.useState(!1),d=f.useRef(null),p=f.useRef(0),h=f.useCallback((y=2e4)=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{l(!1),setTimeout(()=>u(!1),600)},y)},[]);if(f.useEffect(()=>{const y=pt();return y.on("nightOwlEvent",w=>{if(w.type==="shiftStart"){d.current&&clearTimeout(d.current),t("scanning"),s([]),a(null),u(!0),l(!0);return}if(w.type==="finding"){const v={id:`${++p.current}`,task:String(w.task??"General"),summary:String(w.summary??"").slice(0,120),ts:Number(w.ts??Date.now())};s(g=>[v,...g].slice(0,20));return}if(w.type==="shiftEnd"){t("done"),a({findingsCount:Number(w.findingsCount??0),durationMs:Number(w.durationMs??0),ts:Number(w.ts??Date.now())}),h(2e4);return}}),()=>{y.off("nightOwlEvent"),d.current&&clearTimeout(d.current)}},[h]),!c)return null;const m="#fb923c";return r.jsx(ee,{children:r.jsx($.div,{variants:V3,initial:"hidden",animate:"show",exit:"exit",className:"fixed z-[130] flex flex-col",style:{top:"80px",right:"20px",width:"300px",maxHeight:"70vh",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.90)",border:`1px solid ${m}28`,backdropFilter:"blur(24px)",boxShadow:"0 12px 40px rgba(0,0,0,0.60), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("button",{onClick:()=>{l(y=>!y),d.current&&clearTimeout(d.current)},className:"flex items-center justify-between px-4 py-3 w-full select-none",style:{borderBottom:o?`1px solid ${m}10`:"none"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[e==="scanning"?r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-400 animate-ping opacity-70"})]}):e==="done"?r.jsx(Qe,{size:13,className:"text-green-400 flex-shrink-0"}):r.jsx(al,{size:13,className:"text-orange-300/50 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-white/75",children:e==="scanning"?"Gece Vardiyası":"Vardiya Logu"}),e==="scanning"&&r.jsx("span",{className:"text-[10px] text-orange-400/70 font-mono animate-pulse",children:"taranıyor…"}),e==="done"&&i&&r.jsxs("span",{className:"text-[10px] text-white/30 font-mono",children:[i.findingsCount," bulgu · ",F3(i.durationMs)]})]}),o?r.jsx(hh,{size:12,className:"text-white/25"}):r.jsx(ea,{size:12,className:"text-white/25"})]}),r.jsx(ee,{children:o&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"52vh",scrollbarWidth:"none"},children:[e==="scanning"&&n.length===0&&r.jsxs("div",{className:"flex items-center justify-center py-8 gap-2",children:[r.jsx("div",{className:"flex gap-1",children:[0,1,2].map(y=>r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-orange-400/50 animate-bounce",style:{animationDelay:`${y*.15}s`}},y))}),r.jsx("span",{className:"text-[11px] text-white/30",children:"Sistem analiz ediliyor…"})]}),r.jsx(ee,{initial:!1,children:n.map(y=>{const w=B3(y.task),v=w.Icon;return r.jsxs($.div,{variants:$3,initial:"hidden",animate:"show",exit:{opacity:0,height:0},className:"flex items-start gap-3 px-4 py-3",style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[r.jsx("div",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:`${w.color}15`,border:`1px solid ${w.color}30`},children:r.jsx(v,{size:11,style:{color:w.color}})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[10px] font-bold mb-0.5",style:{color:w.color},children:w.label}),r.jsx("p",{className:"text-[11px] text-white/50 leading-snug line-clamp-3",children:y.summary})]})]},y.id)})}),e==="done"&&n.length===0&&r.jsx("p",{className:"text-center text-[12px] text-white/25 py-8",children:"Kayda değer bulgu yok."})]}),e==="done"&&i&&r.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between",style:{borderTop:`1px solid ${m}10`},children:[r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(i.ts).toLocaleTimeString("tr-TR")}),r.jsx("span",{className:"text-[10px] text-green-400/70 font-semibold",children:"✓ Tamamlandı"})]})]},"log-body")})]})},"night-shift-log")})}const Am="mustb_boot_report",Mm=14e3;function H3({value:e,max:t=10}){const n=Math.round(e/t*100),s=n>=70?"#22c55e":n>=40?"#f97316":"#ef4444";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.08)"},children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${n}%`,background:s}})}),r.jsx("span",{className:"text-[11px] font-mono",style:{color:s},children:e.toFixed(1)})]})}function W3(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),i=f.useCallback(()=>{t(!1),localStorage.removeItem(Am)},[]);return f.useEffect(()=>{if(localStorage.getItem(Am)!=="1")return;t(!0),U("/api/status").then(o=>o.ok?o.json():null).then(o=>{o&&s(o)}).catch(()=>{});const a=setTimeout(i,Mm);return()=>clearTimeout(a)},[i]),r.jsx(ee,{children:e&&r.jsx($.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:16},transition:{duration:.28,ease:"easeOut"},className:"fixed inset-0 z-[500] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(8px)"},children:r.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl overflow-hidden",style:{background:"rgba(14,6,2,0.92)",border:"1px solid rgba(234,88,12,0.30)",boxShadow:"0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(234,88,12,0.10)",backdropFilter:"blur(24px)"},children:[r.jsx("button",{onClick:i,className:"absolute top-3 right-3 text-white/25 hover:text-white/60 transition-colors z-10",children:r.jsx(st,{size:14})}),r.jsxs("div",{className:"px-5 pt-5 pb-3 flex items-center gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.25)"},children:r.jsx(Qe,{size:18,style:{color:"#22c55e"}})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:"System Ready"}),r.jsx("p",{className:"text-[11px] text-white/40",children:"Must-b initialised successfully"})]})]}),r.jsx("div",{style:{height:1,background:"rgba(255,255,255,0.05)",margin:"0 20px"}}),r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Agent"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.role)??"—"})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-white/30 mb-1",children:"Model"}),r.jsx("p",{className:"text-[12px] font-semibold text-white/80 truncate",children:(n==null?void 0:n.model)??"—"})]})]}),r.jsxs("div",{className:"rounded-xl px-3 py-2.5 space-y-2",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(Sn,{size:10})," CPU"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[(n==null?void 0:n.cpuPct)??0,"%"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(s1,{size:10})," RAM"]}),r.jsxs("span",{className:"text-[10px] font-mono text-white/50",children:[((n==null?void 0:n.ramGb)??0).toFixed(2)," GB"]})]}),n&&r.jsxs("div",{className:"flex items-center justify-between pt-1",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold text-white/40",children:[r.jsx(Re,{size:10})," Score"]}),r.jsx(H3,{value:n.score})]})]}),r.jsxs("div",{className:"flex items-center justify-between px-1",children:[r.jsx("span",{className:"text-[10px] text-white/30",children:"Dashboard port"}),r.jsxs("span",{className:"text-[11px] font-mono text-orange-400/70",children:[":",(n==null?void 0:n.port)??4309]})]})]}),r.jsx("div",{className:"px-5 pb-4",style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px"},children:r.jsx("button",{onClick:i,className:"w-full py-2 rounded-xl text-[12px] font-semibold transition-all",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.30)",color:"#fb923c"},children:"Open Dashboard"})}),r.jsx($.div,{initial:{scaleX:1},animate:{scaleX:0},transition:{duration:Mm/1e3,ease:"linear"},style:{position:"absolute",bottom:0,left:0,right:0,height:2,background:"rgba(234,88,12,0.50)",transformOrigin:"left"}})]})},"boot-report")})}function zm(){return f.useEffect(()=>{pt()},[]),r.jsxs("div",{className:"flex flex-col h-[calc(100vh-72px)] overflow-hidden",children:[r.jsx(N3,{}),r.jsx(T3,{}),r.jsx(j3,{}),r.jsx(W3,{}),r.jsx(I3,{}),r.jsx(U3,{})]})}function sa(){const[e,t]=f.useState(!1),[n,s]=f.useState(!0),i=f.useRef(!0),a=f.useCallback(async()=>{try{const o=await U("/api/gateway/status",{},{retries:1,retryDelay:500});if(!i.current)return;const l=await o.json().catch(()=>({}));t(!!(l!=null&&l.online))}catch{i.current&&t(!1)}finally{i.current&&s(!1)}},[]);return f.useEffect(()=>{i.current=!0,a();const o=setInterval(a,15e3),l=()=>{a()},c=()=>{a()},u=()=>{i.current&&t(!1)};try{pt()}catch{}return window.addEventListener("mustb:connected",l),window.addEventListener("mustb:reconnected",c),window.addEventListener("mustb:disconnected",u),()=>{i.current=!1,clearInterval(o),window.removeEventListener("mustb:connected",l),window.removeEventListener("mustb:reconnected",c),window.removeEventListener("mustb:disconnected",u)}},[a]),{online:e,loading:n}}function Rm({connected:e,configured:t}){return e?r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 flex-shrink-0"}):t?r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-400 flex-shrink-0"}):r.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-600 flex-shrink-0"})}function G3(){const{online:e}=sa(),[t,n]=f.useState(null),[s,i]=f.useState([]),[a,o]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!0);f.useEffect(()=>{(async()=>{var g;d(!0);try{const k=await(await U("/api/gateway/channels")).json();n(k),(g=k.channelOrder)!=null&&g.length&&o(k.channelOrder[0])}catch{n({offline:!0,channelOrder:[],channelLabels:{},channelAccounts:{}})}finally{d(!1)}})()},[e]),f.useEffect(()=>{t!=null&&t.offline&&U("/api/channels").then(v=>v.json()).then(i).catch(()=>i([]))},[t==null?void 0:t.offline]);const p=async(v,g)=>{c(`${v}-${g}`);try{await U(`/api/gateway/channels/${v}/logout`,{method:"POST",body:JSON.stringify({accountId:g})});const x=await U("/api/gateway/channels");n(await x.json())}catch{}finally{c(null)}};if(u)return r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(pe,{size:18,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Kanallar yükleniyor…"})]});if(t!=null&&t.offline)return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:14,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Must-b gateway çevrimdışı — yerel kanallar gösteriliyor."})]}),s.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:"Yapılandırılmış kanal yok."}):r.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(v=>r.jsxs("div",{className:"px-3 py-2.5 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(Rm,{configured:v.configured,connected:!1}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200",children:v.name}),v.configured&&r.jsx("span",{className:"ml-auto text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/10 border border-orange-500/20 text-orange-400",children:"Yapılandırıldı"})]}),r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:v.description})]},v.id))})]});const h=(t==null?void 0:t.channelOrder)??[],m=(t==null?void 0:t.channelLabels)??{},y=(t==null?void 0:t.channelAccounts)??{};if(h.length===0)return r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"Yapılandırılmış kanal bulunamadı."});const w=a?y[a]??[]:[];return r.jsxs("div",{className:"flex gap-4 min-h-[320px]",children:[r.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:h.map(v=>{const g=y[v]??[],x=g.some(j=>j.connected),k=g.some(j=>j.configured);return r.jsx("button",{onClick:()=>o(v),className:`w-full text-left px-3 py-2 rounded-xl border transition-all ${a===v?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rm,{connected:x,configured:k}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-200 truncate",children:m[v]??v}),g.length>0&&r.jsx("span",{className:"ml-auto text-[10px] font-bold text-gray-500",children:g.length})]})},v)})}),r.jsx("div",{className:"flex-1 min-w-0",children:a?w.length===0?r.jsxs("div",{className:"px-4 py-4 rounded-xl bg-white/3 border border-white/6",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-300 mb-1",children:m[a]??a}),r.jsx("p",{className:"text-[12px] text-gray-500",children:"Henüz bağlı hesap yok."})]}):r.jsx("div",{className:"space-y-2",children:w.map(v=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.connected?r.jsx(Qe,{size:13,className:"text-green-400 flex-shrink-0"}):v.lastError?r.jsx(Xy,{size:13,className:"text-red-400 flex-shrink-0"}):r.jsx(es,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("span",{className:"text-[13px] font-semibold text-gray-200 truncate",children:v.name??v.accountId}),r.jsxs("button",{onClick:()=>p(a,v.accountId),disabled:l===`${a}-${v.accountId}`,className:"ml-auto flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[r.jsx(mh,{size:9}),"Logout"]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Status"}),r.jsx("span",{className:`text-[11px] font-semibold ${v.connected?"text-green-400":"text-gray-500"}`,children:v.connected?"Connected":"Disconnected"})]}),v.lastConnectedAt&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0",children:"Last seen"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:new Date(v.lastConnectedAt).toLocaleString()})]}),v.lastError&&r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-20 flex-shrink-0 pt-0.5",children:"Error"}),r.jsx("span",{className:"text-[11px] text-red-400 break-all",children:v.lastError})]})]})]},v.accountId))}):r.jsx("p",{className:"text-sm text-gray-600 pt-4",children:"Bir kanal seçin."})})]})}function K3(e){return e===0?"Free":e<1?`$${e.toFixed(3)}/1M`:`$${e.toFixed(2)}/1M`}function q3(e){return e?e>=1e3?`${(e/1e3).toFixed(0)}M`:`${e}k`:"—"}const Lm={free:{label:"Free",icon:r.jsx(ES,{size:11}),color:"#22c55e",bg:"rgba(34,197,94,0.12)"},balanced:{label:"Balanced",icon:r.jsx(KS,{size:11}),color:"#60a5fa",bg:"rgba(96,165,250,0.12)"},power:{label:"Power",icon:r.jsx(Re,{size:11}),color:"#f59e0b",bg:"rgba(245,158,11,0.12)"}};function Y3({currentModel:e,onSelect:t,className:n}){const[s,i]=f.useState(null),[a,o]=f.useState(!0),[l,c]=f.useState(null),[u,d]=f.useState("free"),[p,h]=f.useState(""),m=f.useRef(null),y=(g=!1)=>{o(!0),c(null),fetch(`/api/providers/openrouter/models${g?"?refresh=1":""}`).then(x=>x.ok?x.json():Promise.reject(new Error(`HTTP ${x.status}`))).then(x=>{if(i(x),e){const k=x.free.some(j=>j.id===e)?"free":x.balanced.some(j=>j.id===e)?"balanced":x.power.some(j=>j.id===e)?"power":"free";d(k)}o(!1)}).catch(x=>{c(x.message),o(!1)})};f.useEffect(()=>{y()},[]),f.useEffect(()=>{m.current&&m.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[u,s]);const w=(s==null?void 0:s[u])??[],v=p?w.filter(g=>g.name.toLowerCase().includes(p.toLowerCase())||g.id.toLowerCase().includes(p.toLowerCase())):w;return r.jsxs("div",{className:`flex flex-col rounded-xl overflow-hidden ${n??""}`,style:{background:"rgba(12,5,2,0.85)",border:"1px solid rgba(255,255,255,0.07)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2",children:[r.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:"OpenRouter Models"}),r.jsx("button",{onClick:()=>y(!0),className:"text-gray-600 hover:text-orange-400 transition-colors p-1 rounded",title:"Refresh catalog",disabled:a,children:r.jsx(pe,{size:11,className:a?"animate-spin":""})})]}),r.jsx("div",{className:"flex gap-1 px-3 pb-2",children:["free","balanced","power"].map(g=>{var b;const x=Lm[g],k=((b=s==null?void 0:s.totals)==null?void 0:b[g])??0,j=u===g;return r.jsxs("button",{onClick:()=>d(g),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-[11px] font-semibold transition-all",style:{background:j?x.bg:"transparent",color:j?x.color:"#6b7280",border:`1px solid ${j?x.color+"40":"transparent"}`},children:[x.icon,x.label,k>0&&r.jsx("span",{className:"text-[9px] font-bold opacity-60",children:k})]},g)})}),r.jsx("div",{className:"px-3 pb-2",children:r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-600"}),r.jsx("input",{value:p,onChange:g=>h(g.target.value),placeholder:"Search models…",className:"w-full pl-7 pr-3 py-1.5 rounded-lg text-[11px] text-gray-300 placeholder-gray-600 outline-none",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"}})]})}),r.jsxs("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:[a&&r.jsxs("div",{className:"py-8 text-center text-[11px] text-gray-600",children:[r.jsx(pe,{size:14,className:"animate-spin mx-auto mb-2"}),"Fetching live catalog…"]}),!a&&l&&r.jsxs("div",{className:"py-6 px-4 text-center text-[11px] text-red-400",children:[l,r.jsx("br",{}),r.jsx("button",{onClick:()=>y(!0),className:"mt-2 underline text-orange-400 hover:text-orange-300",children:"Retry"})]}),!a&&!l&&v.length===0&&r.jsx("div",{className:"py-8 text-center text-[11px] text-gray-600",children:"No models found."}),!a&&!l&&v.map(g=>{const x=g.id===e,k=Lm[g.tier];return r.jsx("button",{ref:x?m:void 0,onClick:()=>t(g.id),className:"w-full text-left px-3 py-2 transition-all",style:{background:x?"rgba(234,88,12,0.10)":"transparent",borderLeft:x?"2px solid #ea580c":"2px solid transparent"},children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`text-[12px] font-semibold truncate ${x?"text-orange-300":"text-gray-300"}`,children:g.name}),g.hasVision&&r.jsx(Ts,{size:9,className:"text-purple-400 flex-shrink-0",title:"Vision / multimodal"})]}),r.jsx("span",{className:"text-[9px] text-gray-600 font-mono truncate block",children:g.id}),g.description&&r.jsx("span",{className:"text-[10px] text-gray-600 line-clamp-1 mt-0.5",children:g.description})]}),r.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[r.jsx("span",{className:"text-[9px] font-bold",style:{color:k.color},children:K3(g.costPer1M)}),r.jsxs("span",{className:"text-[9px] text-gray-600",children:[q3(g.contextK)," ctx"]})]})]})},g.id)})]}),s&&r.jsx("div",{className:"px-3 py-1.5 border-t",style:{borderColor:"rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-gray-700 font-mono",children:["Catalog cached · ",new Date(s.fetchedAt).toLocaleTimeString()]})})]})}const cc=[{code:"en",label:"English",flag:"🇬🇧",native:"English"},{code:"tr",label:"Turkish",flag:"🇹🇷",native:"Türkçe"},{code:"de",label:"German",flag:"🇩🇪",native:"Deutsch"},{code:"fr",label:"French",flag:"🇫🇷",native:"Français"},{code:"es",label:"Spanish",flag:"🇪🇸",native:"Español"},{code:"pt",label:"Portuguese (Brazil)",flag:"🇧🇷",native:"Português"},{code:"ja",label:"Japanese",flag:"🇯🇵",native:"日本語"},{code:"zh",label:"Chinese (Simplified)",flag:"🇨🇳",native:"简体中文"}];function X3(){const{locale:e,setLocale:t}=ht(),[n,s]=f.useState(!1),i=f.useRef(null),a=cc.find(o=>o.code===e)??cc[0];return f.useEffect(()=>{if(!n)return;const o=l=>{l.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),r.jsxs("div",{ref:i,className:"relative",children:[r.jsxs("button",{onClick:()=>s(o=>!o),"aria-label":"Switch language",className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border text-[12px] font-semibold transition-all select-none ${n?"bg-orange-500/15 border-orange-400/30 text-orange-700":"text-black/65 border-transparent hover:text-black hover:bg-black/6"}`,children:[r.jsx(RS,{size:12,className:"text-orange-400 shrink-0"}),r.jsx("span",{children:a.flag}),r.jsx("span",{className:"tracking-wide",children:a.code.toUpperCase()})]}),r.jsx(ee,{children:n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs($.div,{initial:{opacity:0,y:-6,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-6,scale:.96},transition:{duration:.13,ease:"easeOut"},className:"absolute right-0 top-full mt-2 z-20 w-52 bg-[#100806]/96 backdrop-blur-2xl border border-orange-500/15 rounded-xl shadow-2xl shadow-black/60 overflow-hidden max-h-72 overflow-y-auto",children:[r.jsx("div",{className:"px-3 py-2 border-b border-white/6",children:r.jsx("p",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Language"})}),cc.map(o=>{const l=e===o.code;return r.jsxs("button",{onClick:()=>{t(o.code),s(!1)},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[12px] font-medium transition-colors ${l?"bg-orange-500/12 text-orange-400":"text-gray-300 hover:bg-white/5 hover:text-white"}`,children:[r.jsx("span",{className:"text-base leading-none",children:o.flag}),r.jsxs("div",{className:"text-left flex-1",children:[r.jsx("p",{className:"leading-none",children:o.native}),!l&&r.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:o.label})]}),l&&r.jsx(Kt,{size:12,className:"text-orange-400 shrink-0"})]},o.code)})]})]})})]})}const Om={frontier:"⚡ Frontier",gateway:"🌐 Gateway",fast:"🚀 Fast",local:"💻 Local",open:"🔓 Open Source",specialist:"🎯 Specialist",regional:"🌏 Regional",enterprise:"🏢 Enterprise",custom:"⚙️ Custom"},Dm=["frontier","gateway","fast","local","open","specialist","regional","enterprise","custom"];function C1({tag:e}){return r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-[9px] text-gray-400 font-medium",children:e})}function Q3({p:e,active:t,onClick:n}){return r.jsx("button",{onClick:n,className:`w-full text-left px-3 py-2.5 rounded-xl border transition-all ${t?"bg-orange-500/12 border-orange-500/30":"bg-white/3 border-white/6 hover:bg-white/5 hover:border-white/12"}`,children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:`text-[13px] font-semibold leading-tight truncate ${t?"text-orange-300":"text-gray-200"}`,children:e.label}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5 leading-snug line-clamp-2",children:e.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:e.tags.slice(0,3).map(s=>r.jsx(C1,{tag:s},s))})]}),t&&r.jsx(on,{size:13,className:"text-orange-400 shrink-0 mt-1"})]})})}function J3(){const{t:e}=ht(),t=e.panels.settings,[n,s]=f.useState([]),[i,a]=f.useState(null),[o,l]=f.useState([]),[c,u]=f.useState("all"),[d,p]=f.useState(""),[h,m]=f.useState(null),[y,w]=f.useState(""),[v,g]=f.useState(""),[x,k]=f.useState(!1),[j,b]=f.useState(!1),[S,N]=f.useState(!1),[C,_]=f.useState(null),[E,P]=f.useState(null),[O,F]=f.useState(!!window.__MUSTB_NEED_API_KEY),[D,M]=f.useState(null),[z,V]=f.useState("providers"),T=f.useRef(null);f.useEffect(()=>{U("/api/setup/providers").then(Y=>Y.ok?Y.json():null).then(Y=>{Y!=null&&Y.providers&&s(Y.providers)}).catch(()=>{}),U("/api/setup/status").then(Y=>Y.ok?Y.json():null).then(Y=>{Y&&a(Y)}).catch(()=>{}),U("/api/setup/ollama-models").then(Y=>Y.ok?Y.json():null).then(Y=>{Y!=null&&Y.models&&l(Y.models)}).catch(()=>{});const W=()=>{F(!0),window.__MUSTB_NEED_API_KEY=!0};return window.addEventListener("mustb:401",W),()=>window.removeEventListener("mustb:401",W)},[]),f.useEffect(()=>{h&&w(h.defaultModel)},[h]);const R=d.toLowerCase(),B=n.filter(W=>!(c!=="all"&&W.category!==c||R&&!W.label.toLowerCase().includes(R)&&!W.description.toLowerCase().includes(R))),Z={};for(const W of B)Z[W.category]||(Z[W.category]=[]),Z[W.category].push(W);const K=async()=>{if(h){b(!0),_(null);try{const Y=await(await U("/api/setup/test-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})})).json();_({ok:Y.ok,msg:Y.message??(Y.ok?"Connection successful":"Connection failed")})}catch{_({ok:!1,msg:"Gateway unreachable"})}b(!1)}},re=async()=>{if(!(!h||!h.envKeyIsUrl&&!v.trim())){N(!0),P(null);try{const Y=await U("/api/setup/update-key",{method:"POST",body:JSON.stringify({provider:h.id,apiKey:v||void 0,model:y||void 0})});if(Y.ok){P("Saved successfully."),g(""),window.__MUSTB_NEED_API_KEY=!1,F(!1);const Mt=await U("/api/setup/status");Mt.ok&&a(await Mt.json())}else{const Mt=await Y.json();P(Mt.error??"Failed to save.")}}catch{P("Gateway unreachable.")}N(!1),setTimeout(()=>P(null),6e3)}},te=W=>{M(W),U("/api/setup/save",{method:"POST",body:JSON.stringify({provider:"ollama",model:W})}).finally(()=>{setTimeout(()=>M(null),3e3)})},ce=(h==null?void 0:h.envKeyIsUrl)??!1,fe=(h==null?void 0:h.id)==="ollama",ie=(h==null?void 0:h.id)==="openrouter",Je=Dm.filter(W=>n.some(Y=>Y.category===W)),kt=i?i.score>=70?"text-green-400":i.score>=40?"text-amber-400":"text-red-400":"text-gray-400";return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden font-sans",children:[r.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center",children:r.jsx(yh,{size:15,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white leading-tight",children:t.title}),r.jsxs("p",{className:"text-[10px] text-gray-400 leading-tight",children:[i!=null&&i.configured?`Active · ${i.provider??"unknown"}`:"Not configured",i!=null&&i.mode?` · ${i.mode}`:""]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(X3,{}),i&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8",children:[r.jsx(Sn,{size:11,className:kt}),r.jsxs("span",{className:`text-[11px] font-semibold ${kt}`,children:["HW ",i.score]}),r.jsxs("span",{className:"text-[10px] text-gray-400",children:["· ",i.tier]})]})]})]}),O&&r.jsxs("div",{className:"shrink-0 mx-4 mt-3 flex items-start gap-2.5 px-3.5 py-2.5 rounded-xl bg-red-500/10 border border-red-500/25 text-red-300",children:[r.jsx(es,{size:14,className:"shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold",children:"API key missing or invalid"}),r.jsx("p",{className:"text-[10px] text-red-400/70 mt-0.5",children:"A request returned 401 Unauthorized. Select a provider and update your key below."})]})]}),r.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-5 pt-3 pb-0",children:[r.jsxs("button",{onClick:()=>V("providers"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="providers"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(Sn,{size:11})," LLM Providers"]}),r.jsxs("button",{onClick:()=>V("channels"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${z==="channels"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-400 hover:text-gray-300 hover:border-white/12"}`,children:[r.jsx(VS,{size:11})," Kanallar"]})]}),z==="channels"&&r.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:r.jsx(G3,{})}),z==="providers"&&r.jsxs("div",{className:"flex flex-1 min-h-0 gap-0",children:[r.jsxs("div",{className:"w-[52%] flex flex-col border-r border-white/6 min-h-0",children:[r.jsxs("div",{className:"shrink-0 px-4 pt-3 pb-2 space-y-2.5",children:[r.jsxs("div",{className:"relative",children:[r.jsx(qt,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx("input",{ref:T,type:"text",value:d,onChange:W=>p(W.target.value),placeholder:t.searchPlaceholder,className:"w-full bg-white/4 border border-white/8 rounded-xl pl-8 pr-3 py-2 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"})]}),r.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.jsx("button",{onClick:()=>u("all"),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c==="all"?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:t.allProviders}),Je.map(W=>r.jsx("button",{onClick:()=>u(W),className:`px-2 py-0.5 rounded-lg text-[10px] font-semibold border transition-all ${c===W?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/4 border-white/8 text-gray-400 hover:text-gray-300"}`,children:Om[W]},W))]})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4 space-y-4",children:[n.length===0&&r.jsxs("div",{className:"flex items-center gap-2 py-6 text-gray-400 text-[12px]",children:[r.jsx(oe,{size:13,className:"animate-spin"})," Loading providers…"]}),Dm.filter(W=>{var Y;return(Y=Z[W])==null?void 0:Y.length}).map(W=>r.jsxs("div",{children:[r.jsx("p",{className:"text-[9px] font-bold text-gray-400 uppercase tracking-widest mb-1.5 px-1",children:Om[W]}),r.jsx("div",{className:"space-y-1.5",children:Z[W].map(Y=>r.jsx(Q3,{p:Y,active:(h==null?void 0:h.id)===Y.id,onClick:()=>{m(Y),_(null),g("")}},Y.id))})]},W)),n.length>0&&B.length===0&&r.jsxs("p",{className:"text-[12px] text-gray-400 py-4 text-center",children:['No providers match "',d,'"']})]})]}),r.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-y-auto",children:h?r.jsxs("div",{className:"p-5 space-y-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-[16px] font-bold text-white",children:h.label}),r.jsx("p",{className:"text-[12px] text-gray-400 mt-0.5 leading-snug",children:h.description}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.tags.map(W=>r.jsx(C1,{tag:W},W))})]}),r.jsxs("a",{href:h.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white transition-colors",children:["Docs ",r.jsx(il,{size:10})]})]}),fe&&o.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:"Recommended Models for Your Hardware"}),r.jsx("div",{className:"space-y-1.5",children:o.map(W=>{const Y=W.fit==="recommended"?"text-green-400 border-green-500/20 bg-green-500/6":W.fit==="marginal"?"text-amber-400 border-amber-500/20 bg-amber-500/6":"text-red-400 border-red-500/20 bg-red-500/6";return r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-xl bg-white/3 border border-white/6",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-200 truncate",children:W.label}),r.jsxs("p",{className:"text-[10px] text-gray-400",children:[W.sizeGb," GB"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${Y}`,children:W.fit}),r.jsxs("button",{onClick:()=>{w(W.id),te(W.id)},disabled:D===W.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/10 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[D===W.id?r.jsx(oe,{size:10,className:"animate-spin"}):r.jsx(Jy,{size:10}),D===W.id?"Pulling…":"Pull"]})]})]},W.id)})})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[ce?r.jsx(YS,{size:9}):r.jsx(MS,{size:9}),ce?t.baseUrl:t.apiKey]}),fe&&!ce?r.jsx("div",{className:"px-3.5 py-2.5 rounded-xl bg-green-500/6 border border-green-500/15 text-green-400 text-[12px]",children:"Ollama runs locally — no API key required. Just make sure Ollama is running."}):r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:x||ce?"text":"password",value:v,onChange:W=>{g(W.target.value),_(null)},placeholder:h.placeholder,className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 pr-10 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),!ce&&r.jsx("button",{onClick:()=>k(W=>!W),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300 transition-colors",children:x?r.jsx(ph,{size:13}):r.jsx(Ts,{size:13})})]}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:ce?`Stored in .env as ${h.envKey}. Default: ${h.placeholder}`:`Stored locally in .env as ${h.envKey} — never sent to external servers.`})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(Re,{size:9}),t.model]}),ie?r.jsx(Y3,{currentModel:y,onSelect:w,className:"rounded-xl border border-white/10 bg-white/3"}):r.jsx("select",{value:y,onChange:W=>w(W.target.value),className:"w-full bg-white/4 border border-white/10 rounded-xl px-3 py-2.5 text-[12px] text-white outline-none focus:border-orange-500/40 transition-colors appearance-none",children:h.latestModels.map(W=>r.jsx("option",{value:W,className:"bg-[#1a0c06]",children:W},W))})]}),r.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[!fe&&r.jsxs("button",{onClick:K,disabled:j||!v&&!(i!=null&&i.configured),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-white/5 border border-white/10 text-[12px] text-gray-300 font-medium hover:bg-white/8 hover:text-white transition-all disabled:opacity-40",children:[r.jsx(pe,{size:12,className:j?"animate-spin":""}),j?t.testing:t.testConnection]}),r.jsxs("button",{onClick:re,disabled:S||!v.trim()&&!ce&&!fe,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-orange-600 hover:bg-orange-500 text-white text-[12px] font-semibold transition-all disabled:opacity-40 shadow-lg shadow-orange-500/20",children:[r.jsx(a1,{size:12,className:S?"animate-spin":""}),S?t.saving:t.save]})]}),C&&r.jsxs("div",{className:`flex items-start gap-2 px-3.5 py-2.5 rounded-xl border text-[12px] ${C.ok?"bg-green-500/8 border-green-500/20 text-green-300":"bg-red-500/8 border-red-500/20 text-red-300"}`,children:[C.ok?r.jsx(Qe,{size:13,className:"shrink-0 mt-0.5"}):r.jsx(es,{size:13,className:"shrink-0 mt-0.5"}),C.msg]}),E&&r.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20 text-orange-300 text-[12px]",children:[r.jsx(Qe,{size:13,className:"shrink-0"}),E]}),fe&&r.jsxs("div",{className:"pt-1 space-y-1.5",children:[r.jsxs("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5",children:[r.jsx(AS,{size:9}),"Custom Base URL (optional)"]}),r.jsx("input",{type:"text",value:v,onChange:W=>g(W.target.value),placeholder:"http://localhost:11434",className:"w-full bg-white/4 border border-white/10 rounded-xl px-4 py-2.5 text-[12px] text-white placeholder:text-gray-400 outline-none focus:border-orange-500/40 transition-colors"}),r.jsx("p",{className:"text-[10px] text-gray-400 px-1",children:"Leave blank to use the default http://localhost:11434"})]})]}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-8",children:[r.jsx("div",{className:"w-12 h-12 rounded-2xl bg-orange-500/8 border border-orange-500/15 flex items-center justify-center",children:r.jsx(Ye,{size:20,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[13px] text-gray-400",children:"Select a provider from the left to configure your API key"})]})})]})]})}function Z3(e){if(!e)return"—";const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}s önce`:t<36e5?`${Math.floor(t/6e4)}dk önce`:`${Math.floor(t/36e5)}sa önce`}function eC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),l=async()=>{i(!0);try{const p=await(await U("/api/gateway/sessions?limit=50&includeDerivedTitles=true&includeLastMessage=true")).json(),h=Array.isArray(p)?p:Array.isArray(p==null?void 0:p.sessions)?p.sessions:[];n(h)}catch{n([])}finally{i(!1)}};f.useEffect(()=>{l()},[e]);const c=d=>!!d.runningAtMs&&Date.now()-d.runningAtMs<12e4,u=t.filter(d=>a==="running"?c(d):a==="idle"?!c(d):!0);return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(Ye,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Aktif Oturumlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," oturum"]})]})]}),r.jsxs("button",{onClick:l,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(pe,{size:12,className:s?"animate-spin":""}),"Yenile"]})]}),!e&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:13,className:"text-orange-400 flex-shrink-0"}),r.jsx("p",{className:"text-[12px] text-orange-300",children:"Gateway çevrimdışı — oturum verisi alınamıyor."})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","running","idle"].map(d=>r.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"Tümü":d==="running"?"Çalışıyor":"Boşta"},d))}),s?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(pe,{size:18,className:"animate-spin text-orange-400"})}):u.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(ta,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Aktif oturum bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:u.map(d=>{const p=c(d);return r.jsx("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5 flex-shrink-0",children:p?r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-400 animate-pulse"}):r.jsx("span",{className:"block w-2 h-2 rounded-full bg-gray-700"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:d.derivedTitle??d.label??d.key.slice(0,20)+"…"}),d.agentId&&r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600 flex-shrink-0",children:[r.jsx(Sn,{size:9}),d.agentId]})]}),d.lastMessage&&r.jsx("p",{className:"text-[11px] text-gray-500 truncate mb-1",children:d.lastMessage}),r.jsxs("div",{className:"flex items-center gap-3",children:[d.messageCount!==void 0&&r.jsxs("span",{className:"text-[10px] text-gray-600",children:[d.messageCount," mesaj"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-gray-600",children:[r.jsx(en,{size:9}),Z3(d.lastActivityAt)]})]})]})]})},d.key)})})]})}function tC(e){if(!e||typeof e!="object")return String(e??"—");const t=e;return t.type==="every"&&t.intervalMs?`Her ${Math.round(t.intervalMs/6e4)} dakika`:t.type==="at"&&t.time?`Her gün ${t.time}`:t.type==="cron"&&t.expression?`Cron: ${t.expression}`:JSON.stringify(e).slice(0,40)}function nC(e){if(!e)return"—";const t=e-Date.now();return t<0?"Geçti":t<6e4?`${Math.floor(t/1e3)}s sonra`:t<36e5?`${Math.floor(t/6e4)}dk sonra`:`${Math.floor(t/36e5)}sa sonra`}function sC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState("all"),[l,c]=f.useState(null),[u,d]=f.useState(null),p=async()=>{i(!0);try{const x=await(await U("/api/gateway/automations?enabled=all&limit=50")).json();n(Array.isArray(x==null?void 0:x.jobs)?x.jobs:Array.isArray(x)?x:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{p()},[e]);const h=async g=>{try{await U(`/api/gateway/automations/${g.id}`,{method:"PATCH",body:JSON.stringify({patch:{enabled:!g.enabled}})}),n(x=>x.map(k=>k.id===g.id?{...k,enabled:!k.enabled}:k))}catch{}},m=async g=>{c(g);try{await U(`/api/gateway/automations/${g}/run`,{method:"POST"}),await p()}catch{}finally{c(null)}},y=async g=>{if(window.confirm("Bu otomasyon silinsin mi?")){d(g);try{await U(`/api/gateway/automations/${g}`,{method:"DELETE"}),n(x=>x.filter(k=>k.id!==g))}catch{}finally{d(null)}}},w=t.filter(g=>a==="enabled"?g.enabled:a==="disabled"?!g.enabled:!0),v=g=>g==="ok"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-green-400",children:[r.jsx(Qe,{size:9})," Başarılı"]}):g==="error"?r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-400",children:[r.jsx(Xy,{size:9})," Hata"]}):r.jsx("span",{className:"text-[10px] text-gray-600",children:"—"});return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(Re,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Otomasyonlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," zamanlanmış görev"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:p,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(pe,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["all","enabled","disabled"].map(g=>r.jsx("button",{onClick:()=>o(g),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${a===g?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:g==="all"?"Tümü":g==="enabled"?"Aktif":"Pasif"},g))}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(pe,{size:18,className:"animate-spin text-orange-400"})}):w.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(Re,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Otomasyon bulunamadı.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"space-y-2",children:w.map(g=>{var x,k;return r.jsx("div",{className:`px-4 py-3 rounded-xl border transition-all ${g.enabled?"bg-white/[0.025] border-white/6":"bg-white/[0.01] border-white/4"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("button",{onClick:()=>h(g),disabled:!e,className:"mt-0.5 text-gray-500 hover:text-orange-400 transition-colors disabled:opacity-40",title:g.enabled?"Devre dışı bırak":"Etkinleştir",children:g.enabled?r.jsx(t4,{size:18,className:"text-orange-400"}):r.jsx(e4,{size:18})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("p",{className:`text-[13px] font-semibold truncate ${g.enabled?"text-gray-200":"text-gray-500"}`,children:g.name??g.id}),v((x=g.state)==null?void 0:x.lastRunStatus)]}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-gray-500",children:[r.jsx(en,{size:9})," ",tC(g.schedule)]}),((k=g.state)==null?void 0:k.nextRunAtMs)&&r.jsx("span",{className:"text-[11px] text-gray-600",children:nC(g.state.nextRunAtMs)})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsxs("button",{onClick:()=>m(g.id),disabled:!e||l===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-orange-500/8 border border-orange-500/20 text-orange-400 text-[10px] font-semibold hover:bg-orange-500/15 transition-all disabled:opacity-40",children:[l===g.id?r.jsx(pe,{size:9,className:"animate-spin"}):r.jsx(Rs,{size:9}),"Çalıştır"]}),r.jsxs("button",{onClick:()=>y(g.id),disabled:!e||u===g.id,className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/8 border border-red-500/20 text-red-400 text-[10px] font-semibold hover:bg-red-500/15 transition-all disabled:opacity-40",children:[u===g.id?r.jsx(pe,{size:9,className:"animate-spin"}):r.jsx(Ls,{size:9}),"Sil"]})]})]})},g.id)})})]})}function rC(e){var t;return(t=e.presence)!=null&&t.ts?Date.now()-e.presence.ts<6e4:!1}function iC({platform:e}){const t=(e??"").toLowerCase();return t.includes("ios")||t.includes("iphone")?r.jsx(mm,{size:14,className:"text-gray-400"}):t.includes("android")?r.jsx(mm,{size:14,className:"text-green-500"}):t.includes("mac")||t.includes("darwin")?r.jsx(Ky,{size:14,className:"text-gray-300"}):t.includes("win")?r.jsx(xh,{size:14,className:"text-blue-400"}):r.jsx(LS,{size:14,className:"text-gray-500"})}function aC(){const{online:e}=sa(),[t,n]=f.useState([]),[s,i]=f.useState(!0),[a,o]=f.useState(null),[l,c]=f.useState(""),u=async()=>{i(!0);try{const h=await(await U("/api/gateway/clients")).json();n(Array.isArray(h==null?void 0:h.nodes)?h.nodes:Array.isArray(h)?h:[])}catch{n([])}finally{i(!1)}};f.useEffect(()=>{u()},[e]);const d=async p=>{if(!l.trim()){o(null);return}try{await U(`/api/gateway/clients/${p}/rename`,{method:"POST",body:JSON.stringify({displayName:l.trim()})}),n(h=>h.map(m=>m.nodeId===p?{...m,displayName:l.trim()}:m))}catch{}finally{o(null)}};return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(gm,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Bağlı Nodlar"}),r.jsxs("p",{className:"text-[11px] text-gray-500",children:[t.length," cihaz"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[!e&&r.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]}),r.jsxs("button",{onClick:u,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/4 border border-white/8 text-[11px] text-gray-400 hover:text-white hover:border-white/16 transition-all disabled:opacity-40",children:[r.jsx(pe,{size:12,className:s?"animate-spin":""})," Yenile"]})]})]}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(pe,{size:18,className:"animate-spin text-orange-400"})}):t.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[r.jsx(gm,{size:32,className:"text-gray-700"}),r.jsx("p",{className:"text-sm text-gray-600",children:e?"Bağlı node yok.":"Gateway çevrimdışı."})]}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map(p=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6 hover:border-white/10 transition-all",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[r.jsx(iC,{platform:p.platform}),r.jsx("div",{className:"flex-1 min-w-0",children:a===p.nodeId?r.jsx("input",{autoFocus:!0,value:l,onChange:h=>c(h.target.value),onBlur:()=>d(p.nodeId),onKeyDown:h=>{h.key==="Enter"&&d(p.nodeId),h.key==="Escape"&&o(null)},className:"w-full bg-white/6 border border-orange-500/30 rounded-lg px-2 py-0.5 text-[13px] text-white outline-none"}):r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate cursor-text",onDoubleClick:()=>{o(p.nodeId),c(p.displayName??"")},title:"Çift tıklayarak düzenle",children:p.displayName??p.nodeId})}),r.jsx("span",{className:`flex-shrink-0 w-2 h-2 rounded-full mt-1 ${rC(p)?"bg-green-400 animate-pulse":"bg-gray-700"}`})]}),r.jsxs("div",{className:"space-y-1",children:[p.platform&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Platform"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.platform})]}),p.version&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 w-16",children:"Versiyon"}),r.jsx("span",{className:"text-[11px] text-gray-400",children:p.version})]}),(p.caps??[]).length>0&&r.jsxs("div",{className:"flex items-center gap-1 flex-wrap mt-1",children:[(p.caps??[]).slice(0,3).map(h=>r.jsx("span",{className:"px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-[9px] text-orange-400 font-medium",children:h},h)),(p.caps??[]).length>3&&r.jsxs("span",{className:"text-[9px] text-gray-600",children:["+",(p.caps??[]).length-3]})]})]})]},p.nodeId))})]})}function oC({online:e}){var u;const[t,n]=f.useState({}),[s,i]=f.useState(!0),a=f.useRef(0),o=f.useRef(null),l=async(d=0)=>{try{const h=await(await U(`/api/gateway/logs?cursor=${d}&limit=200`)).json();d===0?(n(h),a.current=h.cursor??0):(n(m=>({...h,lines:[...m.lines??[],...h.lines??[]]})),a.current=h.cursor??a.current)}catch{}finally{i(!1)}};f.useEffect(()=>{l(0)},[e]),f.useEffect(()=>{const d=setInterval(()=>l(a.current),1e4);return()=>clearInterval(d)},[e]),f.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[(u=t.lines)==null?void 0:u.length]);const c=d=>d.includes("error")||d.includes("ERROR")?"text-red-400":d.includes("warn")||d.includes("WARN")?"text-amber-400":d.includes("info")||d.includes("INFO")?"text-green-400":"text-gray-400";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("p",{className:"text-[11px] text-gray-600",children:[(t.lines??[]).length," satır"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{onClick:()=>navigator.clipboard.writeText((t.lines??[]).join(`
673
+ `)),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(sl,{size:10})," Kopyala"]}),r.jsxs("button",{onClick:()=>{a.current=0,l(0)},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/8 text-[10px] text-gray-400 hover:text-white transition-all",children:[r.jsx(pe,{size:10})," Sıfırla"]})]})]}),r.jsx("div",{ref:o,className:"h-96 overflow-y-auto rounded-xl bg-black/40 border border-white/6 p-3 font-mono text-[11px] space-y-0.5",children:s?r.jsx("p",{className:"text-gray-600",children:"Yükleniyor…"}):!e||t.offline?r.jsx("p",{className:"text-orange-500",children:"Gateway çevrimdışı — log verisi alınamıyor."}):(t.lines??[]).length===0?r.jsx("p",{className:"text-gray-600",children:"Henüz log yok."}):(t.lines??[]).map((d,p)=>r.jsx("p",{className:`whitespace-pre-wrap break-all leading-5 ${c(d)}`,children:d},p))})]})}function lC({online:e}){var l,c;const[t,n]=f.useState({}),[s,i]=f.useState(!0);f.useEffect(()=>{i(!0),U("/api/gateway/usage/cost").then(u=>u.json()).then(n).catch(()=>n({})).finally(()=>i(!1))},[e]);const a=t.daily??[],o=Math.max(1,...a.map(u=>u.tokens??0));return r.jsxs("div",{className:"space-y-4",children:[(!e||t.offline)&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-orange-500/8 border border-orange-500/20",children:[r.jsx(Os,{size:12,className:"text-orange-400"}),r.jsx("p",{className:"text-[11px] text-orange-300",children:"Gateway çevrimdışı."})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsx("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest",children:"Toplam Token"}),r.jsx("p",{className:"text-xl font-bold text-white",children:s?"—":(((l=t.total)==null?void 0:l.tokens)??0).toLocaleString()})]}),r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("p",{className:"text-[10px] text-gray-600 mb-1 uppercase tracking-widest flex items-center gap-1",children:[r.jsx(NS,{size:8})," Tahmini Maliyet"]}),r.jsx("p",{className:"text-xl font-bold text-orange-400",children:s?"—":`$${(((c=t.total)==null?void 0:c.cost)??0).toFixed(4)}`})]})]}),(t.providers??[]).length>0&&r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{children:"Provider"}),r.jsx("span",{className:"text-right",children:"Giriş"}),r.jsx("span",{className:"text-right",children:"Çıkış"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),(t.providers??[]).map((u,d)=>r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"text-gray-300 font-medium truncate",children:u.provider}),r.jsx("span",{className:"text-right text-gray-500",children:(u.inputTokens??0).toLocaleString()}),r.jsx("span",{className:"text-right text-gray-500",children:(u.outputTokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(u.cost??0).toFixed(4)]})]},d))]}),a.length>0&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"Günlük Kullanım"}),r.jsx("div",{className:"flex items-end gap-1 h-16 px-1",children:a.slice(-14).map((u,d)=>{var h;const p=Math.max(2,Math.round((u.tokens??0)/o*56));return r.jsxs("div",{className:"flex-1 flex flex-col items-center gap-0.5",children:[r.jsx("div",{style:{height:p},className:"w-full rounded-sm bg-orange-500/40 hover:bg-orange-500/60 transition-all",title:`${u.date}: ${(u.tokens??0).toLocaleString()} token`}),r.jsx("span",{className:"text-[8px] text-gray-700 truncate w-full text-center",children:(h=u.date)==null?void 0:h.slice(5)})]},d)})})]})]})}function cC({online:e}){const[t,n]=f.useState([]),[s,i]=f.useState(!0);return f.useEffect(()=>{i(!0),U("/api/gateway/sessions/usage?limit=30").then(a=>a.json()).then(a=>n(Array.isArray(a)?a:(a==null?void 0:a.sessions)??[])).catch(()=>n([])).finally(()=>i(!1))},[e]),r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/6 text-[10px] font-bold text-gray-600 uppercase tracking-widest",children:[r.jsx("span",{className:"col-span-2",children:"Oturum"}),r.jsx("span",{className:"text-right",children:"Token"}),r.jsx("span",{className:"text-right",children:"Maliyet"})]}),s?r.jsx("div",{className:"flex justify-center py-6",children:r.jsx(pe,{size:14,className:"animate-spin text-orange-400"})}):t.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-6",children:e?"Oturum bulunamadı.":"Gateway çevrimdışı."}):t.map((a,o)=>{var l;return r.jsxs("div",{className:"grid grid-cols-4 px-4 py-2 border-b border-white/4 last:border-0 text-[12px]",children:[r.jsx("span",{className:"col-span-2 text-gray-300 truncate font-mono text-[10px]",children:((l=a.key)==null?void 0:l.slice(0,28))??"—"}),r.jsx("span",{className:"text-right text-gray-500",children:(a.tokens??0).toLocaleString()}),r.jsxs("span",{className:"text-right text-orange-400",children:["$",(a.cost??0).toFixed(4)]})]},o)})]})}function uC(){const{online:e}=sa(),[t,n]=f.useState("logs");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(kS,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Loglar & Aktivite"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b gateway log, kullanım ve oturum istatistikleri"})]}),!e&&r.jsxs("span",{className:"ml-auto flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] bg-red-500/8 border border-red-500/20 text-red-400",children:[r.jsx(Os,{size:10})," Çevrimdışı"]})]}),r.jsx("div",{className:"flex gap-1.5",children:["logs","usage","sessions"].map(s=>r.jsx("button",{onClick:()=>n(s),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${t===s?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:s==="logs"?"Loglar":s==="usage"?"Kullanım":"Oturumlar"},s))}),t==="logs"&&r.jsx(oC,{online:e}),t==="usage"&&r.jsx(lC,{online:e}),t==="sessions"&&r.jsx(cC,{online:e})]})}function dC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState("all"),[o,l]=f.useState(new Set);f.useEffect(()=>{s(!0),U("/api/tools").then(d=>d.json()).then(d=>{const p=Array.isArray(d==null?void 0:d.groups)?d.groups:[];t(p),l(new Set(p.slice(0,3).map(h=>h.id)))}).catch(()=>t([])).finally(()=>s(!1))},[]);const c=e.map(d=>({...d,tools:(d.tools??[]).filter(p=>i==="core"?p.source!=="plugin":i==="plugin"?p.source==="plugin":!0)})).filter(d=>d.tools.length>0),u=d=>{l(p=>{const h=new Set(p);return h.has(d)?h.delete(d):h.add(d),h})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex gap-1.5",children:["all","core","plugin"].map(d=>r.jsx("button",{onClick:()=>a(d),className:`px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${i===d?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:d==="all"?"All":d==="core"?"Core":"Plugin"},d))}),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(pe,{size:18,className:"animate-spin text-orange-400"})}):c.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No tools found."}):r.jsx("div",{className:"space-y-2",children:c.map(d=>{var p;return r.jsxs("div",{className:"rounded-xl bg-white/[0.02] border border-white/6 overflow-hidden",children:[r.jsxs("button",{onClick:()=>u(d.id),className:"w-full flex items-center justify-between px-4 py-2.5 hover:bg-white/3 transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(bh,{size:12,className:"text-orange-400"}),r.jsx("span",{className:"text-[12px] font-semibold text-gray-300",children:d.label??d.id}),r.jsxs("span",{className:"text-[10px] text-gray-600",children:[((p=d.tools)==null?void 0:p.length)??0," tools"]})]}),o.has(d.id)?r.jsx(ea,{size:12,className:"text-gray-600"}):r.jsx(on,{size:12,className:"text-gray-600"})]}),o.has(d.id)&&r.jsx("div",{className:"border-t border-white/5 divide-y divide-white/4",children:(d.tools??[]).map((h,m)=>r.jsxs("div",{className:"px-4 py-2 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300",children:h.label??h.name}),h.description&&r.jsx("p",{className:"text-[11px] text-gray-600 line-clamp-1",children:h.description})]}),r.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-md border ${h.source==="plugin"?"bg-blue-500/8 border-blue-500/20 text-blue-400":"bg-orange-500/8 border-orange-500/20 text-orange-400"}`,children:h.source==="plugin"?"plugin":"core"})})]},m))})]},d.id)})})]})}function hC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0);return f.useEffect(()=>{s(!0),U("/api/agents").then(i=>i.json()).then(i=>t(Array.isArray(i==null?void 0:i.agents)?i.agents:[])).catch(()=>t([])).finally(()=>s(!1))},[]),n?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx(pe,{size:18,className:"animate-spin text-orange-400"})}):e.length===0?r.jsx("p",{className:"text-center text-sm text-gray-600 py-8",children:"No agents found."}):r.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(i=>r.jsxs("div",{className:"px-4 py-3 rounded-xl bg-white/[0.025] border border-white/6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[r.jsx("span",{className:"text-xl",children:i.emoji??"🤖"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] font-semibold text-gray-200 truncate",children:i.name??i.id})}),i.isDefault&&r.jsx("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded-md bg-orange-500/12 border border-orange-500/25 text-orange-400",children:"Default"})]}),i.description&&r.jsx("p",{className:"text-[11px] text-gray-500 line-clamp-2",children:i.description})]},i.id))})}function pC(){const[e,t]=f.useState("tools");return r.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/15 border border-orange-500/25 flex items-center justify-center",children:r.jsx(na,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:"Skills & Plugins"}),r.jsx("p",{className:"text-[11px] text-gray-500",children:"Must-b tool catalog and agent management"})]})]}),r.jsx("div",{className:"flex gap-1.5",children:["tools","agents"].map(n=>r.jsxs("button",{onClick:()=>t(n),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold border transition-all ${e===n?"bg-orange-500/15 border-orange-500/30 text-orange-300":"bg-white/3 border-white/6 text-gray-500 hover:text-gray-300 hover:border-white/12"}`,children:[n==="tools"?r.jsx(bh,{size:11}):r.jsx(Ui,{size:11}),n==="tools"?"Tools":"Agents"]},n))}),e==="tools"&&r.jsx(dC,{}),e==="agents"&&r.jsx(hC,{})]})}const Im=[{key:"all",label:"Tümü",icon:rl,test:()=>!0},{key:"nightowl",label:"NightOwl Bulguları",icon:al,test:e=>e.tags.some(t=>/nightshift|nightowl/i.test(t))},{key:"preferences",label:"Kullanıcı Tercihleri",icon:l1,test:e=>e.category==="semantic"&&!e.tags.some(t=>/project|workspace|nightshift|nightowl/i.test(t))},{key:"architecture",label:"Proje Mimarisi",icon:n1,test:e=>e.tags.some(t=>/project|workspace|context|summary/i.test(t))},{key:"episodic",label:"Episodik",icon:en,test:e=>e.category==="episodic"},{key:"semantic",label:"Semantik",icon:Gt,test:e=>e.category==="semantic"}],fC={episodic:{border:"rgba(249,115,22,0.30)",bg:"rgba(249,115,22,0.08)",dot:"#f97316",label:"Episodik"},semantic:{border:"rgba(99,102,241,0.30)",bg:"rgba(99,102,241,0.08)",dot:"#6366f1",label:"Semantik"}};function mC(e){const n=(Date.now()-new Date(e+"Z").getTime())/1e3,s=n/60,i=s/60,a=i/24;return n<60?{label:"az önce",tier:"fresh"}:s<60?{label:`${Math.floor(s)}d önce`,tier:"fresh"}:i<24?{label:`${Math.floor(i)}s önce`,tier:"recent"}:a<7?{label:`${Math.floor(a)}g önce`,tier:"recent"}:a<30?{label:`${Math.floor(a/7)}h önce`,tier:"old"}:{label:`${Math.floor(a/30)}ay önce`,tier:"ancient"}}const gC={fresh:"#34d399",recent:"#f97316",old:"#a78bfa",ancient:"#6b7280"};function Bm(e,t){return t.trim()?e.split(new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi")).map((s,i)=>s.toLowerCase()===t.toLowerCase()?r.jsx("mark",{className:"bg-orange-500/30 text-orange-300 rounded px-0.5",children:s},i):s):e}function xC({entry:e,query:t,index:n,onDelete:s}){const[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=mC(e.createdAt),u=fC[e.category],d=e.content.slice(0,180),p=e.content.length>180,h=async m=>{m.stopPropagation(),l(!0);try{(await U(`/api/memory/ltm/delete/${e.id}`,{method:"DELETE"})).ok?(s(e.id),he.success("Kayıt silindi.")):he.error("Silinemedi.")}catch{he.error("Bağlantı hatası.")}l(!1)};return r.jsxs($.div,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,scale:.97},transition:{delay:Math.min(n*.03,.3),duration:.25},className:"rounded-2xl overflow-hidden cursor-pointer group",style:{background:"rgba(10,4,1,0.78)",border:`1px solid ${u.border}`,backdropFilter:"blur(20px)",boxShadow:`0 4px 24px rgba(0,0,0,0.45), 0 0 0 1px ${u.bg}, inset 0 1px 0 rgba(255,255,255,0.03)`},onClick:()=>a(m=>!m),children:[r.jsxs("div",{className:"flex items-start gap-3 px-4 pt-3.5 pb-2.5",style:{borderBottom:`1px solid ${u.bg}`},children:[r.jsx("span",{className:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",style:{background:u.dot,boxShadow:`0 0 6px ${u.dot}`}}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed break-words",children:Bm(i?e.content:d+(p?"…":""),t)})}),p&&r.jsx($.span,{animate:{rotate:i?90:0},transition:{duration:.18},className:"flex-shrink-0 text-white/20",children:r.jsx(on,{size:14})}),r.jsx("button",{onClick:h,disabled:o,className:"flex-shrink-0 p-1 rounded-lg opacity-0 group-hover:opacity-100 text-white/25 hover:text-red-400 hover:bg-red-500/12 transition-all disabled:opacity-30",title:"Bu kaydı sil",children:r.jsx(Ls,{size:13})})]}),r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 flex-wrap",children:[r.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase px-2 py-0.5 rounded-full",style:{color:u.dot,background:u.bg,border:`1px solid ${u.border}`},children:u.label}),e.tags.slice(0,3).map(m=>r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/35 px-1.5 py-0.5 rounded-md",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)"},children:[r.jsx(o1,{size:8,className:"opacity-60"}),m]},m)),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium",style:{color:gC[c.tier]},title:e.createdAt,children:[r.jsx(en,{size:9}),c.label]})]})]})}function yC({entries:e}){const t=e.filter(a=>a.category==="episodic").length,n=e.filter(a=>a.category==="semantic").length,s=e.filter(a=>a.tags.some(o=>/nightshift|nightowl/i.test(o))).length,i=[{label:`${e.length} toplam`,color:"#f97316"},{label:`${t} episodik`,color:"#f97316"},{label:`${n} semantik`,color:"#6366f1"},{label:`${s} NightOwl`,color:"#a78bfa"}];return r.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:i.map(a=>r.jsx("span",{className:"text-[11px] font-semibold px-2.5 py-1 rounded-full",style:{color:a.color,background:`${a.color}14`,border:`1px solid ${a.color}30`},children:a.label},a.label))})}function vC({onConfirm:e,onCancel:t}){return r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4",children:r.jsxs($.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(18,8,2,0.97)",border:"1px solid rgba(249,115,22,0.25)"},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)"},children:r.jsx(es,{size:18,className:"text-red-400"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-[15px] font-bold text-white/90",children:"Tüm Hafızayı Temizle"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Bu işlem geri alınamaz"})]}),r.jsx("button",{onClick:t,className:"ml-auto p-1.5 rounded-lg text-white/30 hover:text-white/60 hover:bg-white/6 transition-all",children:r.jsx(st,{size:15})})]}),r.jsx("p",{className:"text-[13px] text-white/50 mb-5 leading-relaxed",children:"Tüm episodik ve semantik hafıza kayıtları kalıcı olarak silinecek. Bu işlem geri alınamaz."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("button",{onClick:t,className:"flex-1 px-4 py-2.5 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-[13px] font-medium transition-colors",children:"İptal"}),r.jsx("button",{onClick:e,className:"flex-1 px-4 py-2.5 rounded-xl bg-red-600/80 hover:bg-red-600 text-white text-[13px] font-semibold transition-colors border border-red-500/30",children:"Tümünü Sil"})]})]})})}function bC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(""),[o,l]=f.useState("all"),[c,u]=f.useState(!1),[d,p]=f.useState(!1),h=f.useCallback(async()=>{s(!0);try{const v=await U("/api/memory/ltm/explore?category=all&limit=200");if(v.ok){const g=await v.json();t(g.entries??[])}}catch{}s(!1)},[]);f.useEffect(()=>{h()},[h]);const m=v=>{t(g=>g.filter(x=>x.id!==v))},y=async()=>{p(!0);try{const v=await U("/api/memory/ltm/clear-all",{method:"DELETE"});if(v.ok){const g=await v.json();t([]),he.success(`${g.deleted??0} kayıt temizlendi.`)}else he.error("Temizleme başarısız.")}catch{he.error("Bağlantı hatası.")}p(!1),u(!1)},w=f.useMemo(()=>{var x;const v=((x=Im.find(k=>k.key===o))==null?void 0:x.test)??(()=>!0),g=i.trim().toLowerCase();return e.filter(v).filter(k=>!g||k.content.toLowerCase().includes(g)||k.tags.some(j=>j.includes(g)))},[e,o,i]);return r.jsxs("div",{className:"h-[calc(100vh-72px)] overflow-y-auto px-6 py-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.28)",boxShadow:"0 0 16px rgba(249,115,22,0.12)"},children:r.jsx(Gt,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[15px] font-bold text-white/90 tracking-tight",children:"Hafıza Tüneli"}),r.jsx("p",{className:"text-[11px] text-white/35",children:"Long-Term Memory Explorer — semantik & episodik"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>u(!0),disabled:d||e.length===0,className:"flex items-center gap-1.5 text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all border border-red-500/20 text-red-400/70 hover:text-red-400 hover:bg-red-500/10 disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"rgba(239,68,68,0.04)"},children:[r.jsx(Ls,{size:11}),"Tüm Hafızayı Temizle"]}),r.jsxs("button",{onClick:()=>void h(),disabled:n,className:"flex items-center gap-1.5 text-[11px] text-white/40 hover:text-white/70 transition-colors px-3 py-1.5 rounded-lg",style:{border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[r.jsx(pe,{size:11,className:n?"animate-spin":""}),"Yenile"]})]})]}),!n&&r.jsx(yC,{entries:e}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-3 py-2.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(12px)"},children:[r.jsx(qt,{size:13,className:"text-white/30 flex-shrink-0"}),r.jsx("input",{type:"text",value:i,onChange:v=>a(v.target.value),placeholder:"Hafızada ara…",className:"flex-1 bg-transparent text-[13px] text-white/80 placeholder:text-white/25 outline-none"}),i&&r.jsx("button",{onClick:()=>a(""),className:"text-white/25 hover:text-white/60 text-xs",children:"✕"})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(CS,{size:11,className:"text-white/25"}),Im.map(v=>{const g=v.icon,x=o===v.key,k=e.filter(v.test).length;return r.jsxs("button",{onClick:()=>l(v.key),className:"flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-full transition-all",style:{background:x?"rgba(249,115,22,0.16)":"rgba(255,255,255,0.04)",border:x?"1px solid rgba(249,115,22,0.40)":"1px solid rgba(255,255,255,0.08)",color:x?"#fb923c":"rgba(255,255,255,0.45)"},children:[r.jsx(g,{size:10}),v.label,r.jsxs("span",{style:{opacity:.6},children:["(",k,")"]})]},v.key)})]})]}),n?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx($.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1.5,ease:"linear"},children:r.jsx(Gt,{size:28,className:"text-orange-500/50"})}),r.jsx("p",{className:"text-[12px] text-white/30",children:"Hafıza taranıyor…"})]}):w.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24",children:[r.jsx(ll,{size:28,className:"text-white/15"}),r.jsx("p",{className:"text-[13px] text-white/30",children:e.length===0?"Henüz hafıza yok. İlk konuşmadan sonra dolmaya başlar.":"Filtrene uyan kayıt yok."})]}):r.jsxs("div",{className:"space-y-3 pb-8",children:[r.jsxs("p",{className:"text-[11px] text-white/25",children:[w.length," kayıt gösteriliyor",i&&r.jsxs(r.Fragment,{children:[" · ",r.jsxs("span",{className:"text-orange-400/60",children:['"',i,'"']})," araması"]})]}),r.jsx(ee,{mode:"popLayout",children:w.map((v,g)=>r.jsx(xC,{entry:v,query:i,index:g,onDelete:m},v.id))})]}),r.jsx(ee,{children:c&&r.jsx(vC,{onConfirm:y,onCancel:()=>u(!1)})})]})}const za=`# Must-b Zihni
684
674
  Burada senin hakkında öğrendiğim bilgiler yer alır.
685
675
 
686
676
  ## Genel Bilgiler
@@ -691,18 +681,18 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
691
681
 
692
682
  ## Kullanıcı Stili
693
683
  <!-- Sana özgü iletişim ve çalışma tarzı notları. -->
694
- `,jC=["meslek","profession","user style","kullanıcı stili","expertise","uzmanlık","role","rol"];function Hs(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Fm(e){const t=e.toLowerCase();return jC.some(n=>t.includes(n))}function NC(e){const t=e.split(`
684
+ `,wC=["meslek","profession","user style","kullanıcı stili","expertise","uzmanlık","role","rol"];function Hs(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Fm(e){const t=e.toLowerCase();return wC.some(n=>t.includes(n))}function kC(e){const t=e.split(`
695
685
  `),n=[];let s=!1,i=[],a=!1;const o=()=>{a&&(n.push("</ul>"),a=!1)};for(let l=0;l<t.length;l++){const c=t[l];if(c.startsWith("```")){s?(o(),n.push(`<pre class="bg-white/5 border border-white/10 rounded-lg p-3 my-2 text-[12px] text-orange-200/80 font-mono overflow-x-auto"><code>${Hs(i.join(`
696
- `))}</code></pre>`),i=[],s=!1):(o(),s=!0);continue}if(s){i.push(c);continue}const u=c.match(/^### (.+)$/);if(u){o();const m=Hs(u[1]),v=Fm(u[1]);n.push(`<h3 class="text-[13px] font-bold text-white/70 mt-4 mb-1.5 flex items-center gap-2">
686
+ `))}</code></pre>`),i=[],s=!1):(o(),s=!0);continue}if(s){i.push(c);continue}const u=c.match(/^### (.+)$/);if(u){o();const m=Hs(u[1]),y=Fm(u[1]);n.push(`<h3 class="text-[13px] font-bold text-white/70 mt-4 mb-1.5 flex items-center gap-2">
697
687
  ${m}
698
- ${v?'<span class="cognitive-tag">Cognitive</span>':""}
699
- </h3>`);continue}const d=c.match(/^## (.+)$/);if(d){o();const m=Hs(d[1]),v=Fm(d[1]);n.push(`<h2 class="text-[15px] font-bold text-orange-300/90 mt-5 mb-2 pb-1 border-b border-orange-500/20 flex items-center gap-2${v?" cognitive-heading":""}">
688
+ ${y?'<span class="cognitive-tag">Cognitive</span>':""}
689
+ </h3>`);continue}const d=c.match(/^## (.+)$/);if(d){o();const m=Hs(d[1]),y=Fm(d[1]);n.push(`<h2 class="text-[15px] font-bold text-orange-300/90 mt-5 mb-2 pb-1 border-b border-orange-500/20 flex items-center gap-2${y?" cognitive-heading":""}">
700
690
  ${m}
701
- ${v?'<span class="cognitive-tag">Cognitive Tag</span>':""}
691
+ ${y?'<span class="cognitive-tag">Cognitive Tag</span>':""}
702
692
  </h2>`);continue}const p=c.match(/^# (.+)$/);if(p){o(),n.push(`<h1 class="text-[20px] font-black text-white/95 mt-2 mb-3 tracking-tight leading-tight">
703
693
  ${Hs(p[1])}
704
694
  </h1>`);continue}if(/^---+$/.test(c.trim())){o(),n.push('<hr class="border-white/10 my-4" />');continue}const h=c.match(/^[\-\*\+] (.+)$/);if(h){a||(n.push('<ul class="list-none pl-0 my-1 space-y-0.5">'),a=!0),n.push(`<li class="flex items-start gap-2 text-[13px] text-white/65"><span class="text-orange-500/60 mt-0.5 shrink-0">▸</span><span>${Vm(h[1])}</span></li>`);continue}if(o(),c.trim()===""){n.push('<div class="h-2"></div>');continue}if(c.trim().startsWith("<!--")){const m=c.replace(/<!--\s?/,"").replace(/\s?-->/,"");n.push(`<p class="text-[11px] text-white/20 italic pl-2 border-l border-white/8 my-1">${Hs(m)}</p>`);continue}n.push(`<p class="text-[13px] text-white/65 leading-relaxed my-1">${Vm(c)}</p>`)}return o(),n.join(`
705
- `)}function Vm(e){return Hs(e).replace(/\*\*(.+?)\*\*/g,'<strong class="text-white/90 font-semibold">$1</strong>').replace(/\*(.+?)\*/g,'<em class="text-orange-300/80">$1</em>').replace(/`(.+?)`/g,'<code class="bg-white/8 text-orange-200/80 text-[11px] px-1 py-0.5 rounded font-mono">$1</code>')}function SC(){const[e,t]=f.useState(""),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!0),c=f.useRef(null),u=f.useRef(null);f.useEffect(()=>{U("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>{var v;t((v=m==null?void 0:m.content)!=null&&v.trim()?m.content:za)}).catch(()=>t(za)).finally(()=>l(!1))},[]);const d=f.useCallback(async m=>{s(!0);try{if(!(await U("/api/memory/persona",{method:"PATCH",body:JSON.stringify({content:m})})).ok)throw new Error("save failed");a(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(!1),2500)}catch{pe.error("Kaydedilemedi — backend bağlantısını kontrol edin.")}finally{s(!1)}},[]),p=m=>{t(m),a(!1),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(m),2e3)};if(f.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),o)return r.jsx("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:r.jsx(re,{size:22,className:"animate-spin text-orange-500/60"})});const h=NC(e);return r.jsxs("div",{className:"flex flex-col h-full min-h-[calc(100vh-64px)] bg-transparent",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-orange-500/12 shrink-0",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Gt,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white/90 leading-none",children:"Must-b Zihni"}),r.jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:"memory/must-b.md"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-white/25 mr-1",children:n?"Kaydediliyor…":i?"Kaydedildi":"Otomatik kayıt: 2s"}),r.jsx("button",{onClick:()=>{l(!0),U("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>t((m==null?void 0:m.content)??za)).catch(()=>{}).finally(()=>l(!1))},title:"Yenile",className:"p-2 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>d(e),disabled:n,className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-[12px] font-semibold transition-all ${i?"bg-green-500/15 border border-green-500/30 text-green-400":"bg-orange-500/15 border border-orange-500/30 text-orange-400 hover:bg-orange-500/25 hover:text-orange-300"}`,children:[n?r.jsx(re,{size:13,className:"animate-spin"}):i?r.jsx(Kt,{size:13}):r.jsx(l1,{size:13}),i?"Kaydedildi":"Kaydet"]})]})]}),r.jsxs("div",{className:"flex flex-1 min-h-0 divide-x divide-orange-500/10",children:[r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500/50"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Markdown Editörü"})]}),r.jsx("textarea",{value:e,onChange:m=>p(m.target.value),spellCheck:!1,className:"flex-1 w-full resize-none outline-none font-mono text-[13px] text-white/75 leading-relaxed p-5 bg-transparent placeholder-white/15",style:{background:"rgba(8,4,1,0.85)",caretColor:"rgba(249,115,22,0.9)",lineHeight:"1.7",tabSize:2},placeholder:za})]}),r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500/40"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Canlı Önizleme"}),r.jsx(c1,{size:10,className:"text-orange-500/40 ml-auto"}),r.jsx("span",{className:"text-[9px] text-orange-500/40 font-mono",children:"Bilişsel Etiketler aktif"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"rgba(10,5,2,0.7)"},children:[r.jsx("style",{children:`
695
+ `)}function Vm(e){return Hs(e).replace(/\*\*(.+?)\*\*/g,'<strong class="text-white/90 font-semibold">$1</strong>').replace(/\*(.+?)\*/g,'<em class="text-orange-300/80">$1</em>').replace(/`(.+?)`/g,'<code class="bg-white/8 text-orange-200/80 text-[11px] px-1 py-0.5 rounded font-mono">$1</code>')}function jC(){const[e,t]=f.useState(""),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!0),c=f.useRef(null),u=f.useRef(null);f.useEffect(()=>{U("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>{var y;t((y=m==null?void 0:m.content)!=null&&y.trim()?m.content:za)}).catch(()=>t(za)).finally(()=>l(!1))},[]);const d=f.useCallback(async m=>{s(!0);try{if(!(await U("/api/memory/persona",{method:"PATCH",body:JSON.stringify({content:m})})).ok)throw new Error("save failed");a(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>a(!1),2500)}catch{he.error("Kaydedilemedi — backend bağlantısını kontrol edin.")}finally{s(!1)}},[]),p=m=>{t(m),a(!1),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>d(m),2e3)};if(f.useEffect(()=>()=>{c.current&&clearTimeout(c.current),u.current&&clearTimeout(u.current)},[]),o)return r.jsx("div",{className:"flex items-center justify-center h-full min-h-[60vh]",children:r.jsx(oe,{size:22,className:"animate-spin text-orange-500/60"})});const h=kC(e);return r.jsxs("div",{className:"flex flex-col h-full min-h-[calc(100vh-64px)] bg-transparent",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-orange-500/12 shrink-0",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Gt,{size:16,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[14px] font-bold text-white/90 leading-none",children:"Must-b Zihni"}),r.jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:"memory/must-b.md"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-white/25 mr-1",children:n?"Kaydediliyor…":i?"Kaydedildi":"Otomatik kayıt: 2s"}),r.jsx("button",{onClick:()=>{l(!0),U("/api/memory/persona").then(m=>m.ok?m.json():null).then(m=>t((m==null?void 0:m.content)??za)).catch(()=>{}).finally(()=>l(!1))},title:"Yenile",className:"p-2 rounded-lg text-white/30 hover:text-white/70 hover:bg-white/6 transition-all",children:r.jsx(pe,{size:14})}),r.jsxs("button",{onClick:()=>d(e),disabled:n,className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-[12px] font-semibold transition-all ${i?"bg-green-500/15 border border-green-500/30 text-green-400":"bg-orange-500/15 border border-orange-500/30 text-orange-400 hover:bg-orange-500/25 hover:text-orange-300"}`,children:[n?r.jsx(oe,{size:13,className:"animate-spin"}):i?r.jsx(Kt,{size:13}):r.jsx(a1,{size:13}),i?"Kaydedildi":"Kaydet"]})]})]}),r.jsxs("div",{className:"flex flex-1 min-h-0 divide-x divide-orange-500/10",children:[r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500/50"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Markdown Editörü"})]}),r.jsx("textarea",{value:e,onChange:m=>p(m.target.value),spellCheck:!1,className:"flex-1 w-full resize-none outline-none font-mono text-[13px] text-white/75 leading-relaxed p-5 bg-transparent placeholder-white/15",style:{background:"rgba(8,4,1,0.85)",caretColor:"rgba(249,115,22,0.9)",lineHeight:"1.7",tabSize:2},placeholder:za})]}),r.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[r.jsxs("div",{className:"px-4 py-2 border-b border-white/5 flex items-center gap-1.5 shrink-0",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500/40"}),r.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] text-white/25 select-none",children:"Canlı Önizleme"}),r.jsx(o1,{size:10,className:"text-orange-500/40 ml-auto"}),r.jsx("span",{className:"text-[9px] text-orange-500/40 font-mono",children:"Bilişsel Etiketler aktif"})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-5",style:{background:"rgba(10,5,2,0.7)"},children:[r.jsx("style",{children:`
706
696
  .cognitive-heading {
707
697
  padding: 6px 10px;
708
698
  border-radius: 8px;
@@ -724,18 +714,18 @@ Burada senin hakkında öğrendiğim bilgiler yer alır.
724
714
  color: rgba(251,146,60,0.9);
725
715
  margin-left: auto;
726
716
  }
727
- `}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:h}})]})]})]})]})}const CC=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:Ps,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},{id:"browser",label:"Browser",desc:"Playwright ile tam web otomasyonu",Icon:Xe,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},{id:"web-search",label:"Web Search",desc:"Çoklu sağlayıcıyla gerçek zamanlı arama",Icon:qt,color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},{id:"file-manager",label:"Files",desc:"Dosya oku, yaz ve yönet",Icon:os,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},{id:"image-gen",label:"Görsel Üret",desc:"AI ile görsel üret",Icon:o1,color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},{id:"code",label:"Kod Analizi",desc:"Kod yaz, analiz et ve hata ayıkla",Icon:cn,color:"text-purple-400",bg:"bg-purple-500/10",border:"border-purple-500/20"},{id:"memory",label:"Bellek",desc:"Semantik hafıza arama & kayıt",Icon:Gt,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},{id:"vision",label:"Görme",desc:"Ekran ve görsel algı",Icon:Su,color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},{id:"screen-sense",label:"Ekranı Gör",desc:"Kullanıcı ekranını yakala ve analiz et",Icon:xh,color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},{id:"gateway",label:"Gateway",desc:"Sistem arası ve A2A iletişim",Icon:Cu,color:"text-teal-400",bg:"bg-teal-500/10",border:"border-teal-500/20"},{id:"messages",label:"Mesajlar",desc:"Ajan-arası mesaj gönder & al",Icon:ta,color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"},{id:"git",label:"Git",desc:"Commit, branch, diff, push/pull",Icon:e1,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function _C(){const[e,t]=f.useState("tools"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState([]),[c,u]=f.useState({}),[d,p]=f.useState(!1),[h,m]=f.useState(""),v=f.useCallback(async()=>{p(!0);try{const y=await U("/api/skills/list");if(y.ok){const N=await y.json();s(Array.isArray(N)?N:[])}}catch{}p(!1)},[]),w=f.useCallback(async()=>{p(!0);try{const y=await U("/api/skills/catalog");if(y.ok){const N=await y.json(),P=Array.isArray(N)?N:N.skills??[];a(P.filter(_=>!(_.tags??[]).includes("imported"))),l(P.filter(_=>(_.tags??[]).includes("imported")))}}catch{}p(!1)},[]);f.useEffect(()=>{e==="saved"&&v(),e==="catalog"&&w(),e==="imported"&&w()},[e,v,w]);const b=async y=>{u(N=>({...N,[y.id]:"running"}));try{const N=await U("/api/skills/run",{method:"POST",body:JSON.stringify({id:y.id})});u(P=>({...P,[y.id]:N.ok?"done":"error"})),pe[N.ok?"success":"error"](N.ok?`"${y.name}" çalıştırıldı`:"Çalıştırma başarısız"),setTimeout(()=>u(P=>({...P,[y.id]:"idle"})),2500)}catch{u(N=>({...N,[y.id]:"error"}))}},g=async y=>{try{await U(`/api/skills/${y}`,{method:"DELETE"}),s(N=>N.filter(P=>P.id!==y)),pe.success("Beceri silindi.")}catch{pe.error("Silinemedi.")}},x=async(y,N)=>{u(P=>({...P,[y]:"running"}));try{const P=await U("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:y,goal:`${N} becerisini çalıştır`})});u(_=>({..._,[y]:P.ok?"done":"error"})),P.ok&&pe.success(`"${N}" başlatıldı`),setTimeout(()=>u(_=>({..._,[y]:"idle"})),2500)}catch{u(P=>({...P,[y]:"error"}))}},k=CC.filter(y=>y.label.toLowerCase().includes(h.toLowerCase())||y.desc.toLowerCase().includes(h.toLowerCase())),C=n.filter(y=>y.name.toLowerCase().includes(h.toLowerCase())||y.goal.toLowerCase().includes(h.toLowerCase())),j=i.filter(y=>y.name.toLowerCase().includes(h.toLowerCase())||y.description.toLowerCase().includes(h.toLowerCase())),S=o.filter(y=>y.name.toLowerCase().includes(h.toLowerCase())||y.description.toLowerCase().includes(h.toLowerCase())||(y.pluginName??"").toLowerCase().includes(h.toLowerCase()));return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Re,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Beceriler & Araçlar"}),r.jsx("p",{className:"text-[12px] text-white/35 mt-0.5",children:"Must-b'nin bilişsel yetenekleri"})]})]})}),r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative flex-1 max-w-xs",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:h,onChange:y=>m(y.target.value),placeholder:"Ara…",className:"w-full bg-white/5 border border-white/8 rounded-xl py-2 pl-8 pr-3 text-[13px] text-white/75 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:[{key:"tools",label:"Dahili Araçlar"},{key:"saved",label:"Kaydedilen"},{key:"catalog",label:"Katalog"},{key:"imported",label:"İçe Aktarılan"}].map(({key:y,label:N})=>r.jsx("button",{onClick:()=>t(y),className:`px-4 py-2 text-[12px] font-semibold transition-all ${e===y?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:N},y))})]}),e==="tools"&&r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:k.map(({id:y,label:N,desc:P,Icon:_,color:T,bg:O,border:F})=>r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18},className:`rounded-2xl p-4 flex gap-3 items-start border ${F}`,style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${O} border ${F}`,children:r.jsx(_,{size:16,className:T})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight",children:N}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight",children:P})]}),r.jsx("div",{className:"shrink-0 mt-1",children:r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400",children:"Aktif"})})]},y))}),e==="saved"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[n.length," kaydedilmiş beceri"]}),r.jsx("button",{onClick:v,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),d?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(re,{size:20,className:"animate-spin text-orange-500/50"})}):C.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:h?"Eşleşen beceri bulunamadı.":"Henüz kaydedilmiş beceri yok."}):r.jsx("div",{className:"space-y-2",children:C.map(y=>{const N=c[y.id]??"idle";return r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-orange-500/10",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(dh,{size:14,className:"text-orange-400"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:y.name}),r.jsx("p",{className:"text-[11px] text-white/40 truncate mt-0.5",children:y.goal}),r.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(Yy,{size:9})," ",y.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(en,{size:9})," ",new Date(y.savedAt).toLocaleDateString("tr-TR")]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>b(y),disabled:N==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center transition-all border ${N==="done"?"bg-green-500/15 border-green-500/25 text-green-400":N==="error"?"bg-red-500/15 border-red-500/25 text-red-400":N==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:N==="running"?r.jsx(re,{size:13,className:"animate-spin"}):N==="done"?r.jsx(Ue,{size:13}):N==="error"?r.jsx(an,{size:13}):r.jsx(Rs,{size:13})}),r.jsx("button",{onClick:()=>g(y.id),className:"w-8 h-8 rounded-xl flex items-center justify-center border border-white/8 text-white/25 hover:bg-red-500/12 hover:border-red-500/20 hover:text-red-400 transition-all",children:r.jsx(Ls,{size:13})})]})]}),(y.tags??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-2 ml-11",children:(y.tags??[]).map(P=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-white/35",children:P},P))})]},y.id)})})]}),e==="catalog"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[i.length," katalog becerisi"]}),r.jsx("button",{onClick:w,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),d?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(re,{size:20,className:"animate-spin text-orange-500/50"})}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:j.map(y=>{var P,_;const N=c[y.id]??"idle";return r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-white/8 flex gap-3",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:y.emoji??"⚡"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:y.name}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight line-clamp-2",children:y.description}),(((P=y.requires)==null?void 0:P.bins)??[]).length>0?r.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:(((_=y.requires)==null?void 0:_.bins)??[]).map(T=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-orange-400/70",children:T},T))}):null]}),r.jsx("button",{onClick:()=>x(y.id,y.name),disabled:N==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 transition-all border mt-0.5 ${N==="done"?"bg-green-500/15 border-green-500/25 text-green-400":N==="error"?"bg-red-500/15 border-red-500/25 text-red-400":N==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:N==="running"?r.jsx(re,{size:13,className:"animate-spin"}):N==="done"?r.jsx(Ue,{size:13}):N==="error"?r.jsx(an,{size:13}):r.jsx(un,{size:13})})]},y.id)})})]}),e==="imported"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[o.length," içe aktarılan beceri"]}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-blue-500/12 border border-blue-500/20 text-blue-400",children:"claude-code"})]}),r.jsx("button",{onClick:w,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(de,{size:13})})]}),d?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(re,{size:20,className:"animate-spin text-orange-500/50"})}):S.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:h?"Eşleşen beceri bulunamadı.":"Henüz içe aktarılan beceri yok."}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:S.map(y=>{const N=c[y.id]??"idle";return r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-blue-500/15 flex gap-3",style:{background:"rgba(3,7,18,0.65)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:y.emoji??"🔧"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:y.name}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-blue-500/10 border border-blue-500/18 text-blue-400/80",children:"imported"})]}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight line-clamp-2",children:y.description}),y.pluginName&&r.jsxs("p",{className:"text-[10px] text-blue-400/50 mt-1",children:["plugin: ",y.pluginName]})]}),r.jsx("button",{onClick:()=>x(y.id,y.name),disabled:N==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 transition-all border mt-0.5 ${N==="done"?"bg-green-500/15 border-green-500/25 text-green-400":N==="error"?"bg-red-500/15 border-red-500/25 text-red-400":N==="running"?"bg-blue-500/10 border-blue-500/20 text-blue-400":"bg-white/5 border-white/10 text-white/50 hover:bg-blue-500/15 hover:border-blue-500/25 hover:text-blue-300"}`,children:N==="running"?r.jsx(re,{size:13,className:"animate-spin"}):N==="done"?r.jsx(Ue,{size:13}):N==="error"?r.jsx(an,{size:13}):r.jsx(un,{size:13})})]},y.id)})})]})]})}const EC={node:cn,python:mn,api:zr,cli:Ps,web:Xe,database:rl,cloud:Qy,agent:Ui};function TC(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?zr:n.includes("db")||n.includes("database")||n.includes("sql")?rl:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?Qy:n.includes("agent")||n.includes("bot")?Ui:n.includes("web")||n.includes("http")?Xe:EC[t]??na}function PC(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState(""),[h,m]=f.useState("node"),[v,w]=f.useState(""),[b,g]=f.useState(!1),x=f.useCallback(async()=>{s(!0);try{const y=await U("/api/plugins/list");if(y.ok){const N=await y.json();t(Array.isArray(N)?N:[])}}catch{}s(!1)},[]);f.useEffect(()=>{x()},[x]);const k=async y=>{a(y.name);try{const N=y.running?"/api/plugins/stop":"/api/plugins/run";(await U(N,{method:"POST",body:JSON.stringify({name:y.name})})).ok?(t(_=>(Array.isArray(_)?_:[]).map(T=>T.name===y.name?{...T,running:!T.running}:T)),pe.success(y.running?`"${y.name}" durduruldu`:`"${y.name}" başlatıldı`)):pe.error("İşlem başarısız.")}catch{pe.error("Bağlantı hatası.")}a(null)},C=async y=>{if(y.preventDefault(),!(!c.trim()||!d.trim())){g(!0);try{const N=await U("/api/plugins/build",{method:"POST",body:JSON.stringify({name:c,goal:d,lang:h,context:v})});if(N.ok){const P=await N.json();pe.success(`"${P.name??c}" eklentisi oluşturuldu!`),u(""),p(""),w(""),l(!1),x()}else{const P=await N.json().catch(()=>({}));pe.error(P.error??"Oluşturma başarısız.")}}catch{pe.error("Gateway bağlantı hatası.")}g(!1)}},j=Array.isArray(e)?e:[],S=j.filter(y=>y.running).length;return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Sr,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Eklentiler"}),r.jsxs("p",{className:"text-[12px] text-white/35 mt-0.5",children:[j.length," eklenti · ",S," çalışıyor"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:x,className:"p-2.5 rounded-xl text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/8 transition-all",children:r.jsx(de,{size:14})}),r.jsxs("button",{onClick:()=>l(y=>!y),className:`flex items-center gap-1.5 px-4 py-2.5 rounded-xl text-[12px] font-semibold transition-all border ${o?"bg-orange-500/20 border-orange-500/30 text-orange-300":"bg-white/6 border-white/10 text-white/60 hover:bg-orange-500/12 hover:border-orange-500/20 hover:text-orange-300"}`,children:[o?r.jsx(st,{size:13}):r.jsx(ol,{size:13}),o?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(ee,{children:o&&r.jsx($.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-8,height:0},transition:{duration:.2},className:"overflow-hidden mb-5",children:r.jsxs("form",{onSubmit:C,className:"rounded-2xl p-5 border border-orange-500/20",style:{background:"rgba(13,7,3,0.7)",backdropFilter:"blur(16px)"},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Re,{size:14,className:"text-orange-400"}),r.jsx("h3",{className:"text-[13px] font-bold text-white/90",children:"Yeni Eklenti Oluştur"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Ad"}),r.jsx("input",{value:c,onChange:y=>u(y.target.value),placeholder:"my-plugin",required:!0,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Dil"}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:["node","python"].map(y=>r.jsxs("button",{type:"button",onClick:()=>m(y),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${h===y?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[y==="node"?r.jsx(cn,{size:12}):r.jsx(mn,{size:12}),y==="node"?"Node.js":"Python"]},y))})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Hedef / Açıklama"}),r.jsx("textarea",{value:d,onChange:y=>p(y.target.value),placeholder:"Bu eklenti ne yapmalı?",required:!0,rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Bağlam (isteğe bağlı)"}),r.jsx("textarea",{value:v,onChange:y=>w(y.target.value),placeholder:"API anahtarları, URL'ler, ek bağlam…",rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("button",{type:"submit",disabled:b||!c.trim()||!d.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-orange-600/20 border border-orange-500/30 text-orange-300 text-[13px] font-semibold hover:bg-orange-600/30 transition-all disabled:opacity-40",children:[b?r.jsx(re,{size:13,className:"animate-spin"}):r.jsx(un,{size:13}),b?"Oluşturuluyor…":"Oluştur"]})]})})}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(r4,{size:12,className:"text-white/25"}),r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25",children:"Harici Konektörler"})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[{name:"WhatsApp",desc:"Mesaj gönder, al ve otomasyonlar oluştur",Icon:i1,color:"text-green-400",bg:"rgba(34,197,94,0.06)",border:"rgba(34,197,94,0.18)",badge:"Yakında"},{name:"Borsa & Finans",desc:"Gerçek zamanlı hisse & kripto veri akışı",Icon:n4,color:"text-yellow-400",bg:"rgba(234,179,8,0.06)",border:"rgba(234,179,8,0.18)",badge:"Yakında"},{name:"GitHub API",desc:"Issue, PR ve repo olaylarını dinle",Icon:t1,color:"text-purple-400",bg:"rgba(168,85,247,0.06)",border:"rgba(168,85,247,0.18)",badge:"Yakında"}].map(({name:y,desc:N,Icon:P,color:_,bg:T,border:O,badge:F})=>r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 flex gap-3 items-start",style:{background:T,border:`1px solid ${O}`,backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center shrink-0",style:{background:T,border:`1px solid ${O}`},children:r.jsx(P,{size:16,className:_})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight",children:y}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight",children:N})]}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-white/5 border border-white/10 text-white/30 shrink-0 mt-0.5",children:F})]},y))})]}),n?r.jsx("div",{className:"flex justify-center py-20",children:r.jsx(re,{size:22,className:"animate-spin text-orange-500/50"})}):j.length===0?r.jsxs("div",{className:"rounded-2xl border border-white/8 p-8 text-center",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx(Sr,{size:28,className:"text-white/15 mx-auto mb-3"}),r.jsx("p",{className:"text-[13px] text-white/30 font-medium",children:"Henüz özel eklenti yok"}),r.jsx("p",{className:"text-[12px] text-white/20 mt-1",children:'Yukarıdaki "Yeni Eklenti" ile kendi konektörünü oluştur.'})]}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:j.map(y=>{const N=i===y.name,P=TC(y.name,y.lang),_=y.lang==="node"?cn:mn;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${y.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:y.running?"rgba(249,115,22,0.06)":"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${y.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(P,{size:16,className:y.running?"text-orange-400":"text-white/50"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate max-w-[120px]",children:y.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(_,{size:9,className:y.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${y.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:y.lang==="node"?"Node.js":"Python"})]})]})]}),r.jsx("span",{className:`text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md border ${y.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:y.running?"Çalışıyor":"Durdu"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] text-white/25",children:new Date(y.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>k(y),disabled:N,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${y.running?"bg-red-500/12 border-red-500/20 text-red-400 hover:bg-red-500/20":"bg-orange-500/12 border-orange-500/20 text-orange-400 hover:bg-orange-500/20"} disabled:opacity-40`,children:[N?r.jsx(re,{size:11,className:"animate-spin"}):y.running?r.jsx(vh,{size:11}):r.jsx(Rs,{size:11}),y.running?"Durdur":"Başlat"]})]})]},y.name)})})]})}function AC(){return new URLSearchParams(window.location.search).get("token")??""}function MC(){const[e,t]=f.useState("connecting"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState("idle"),[c,u]=f.useState(null),[d,p]=f.useState(""),h=f.useRef(null),m=f.useRef(null),v=f.useRef([]),w=AC();f.useEffect(()=>{if(!w){t("denied");return}const j=xi(`${window.location.origin}/mobile`,{query:{token:w},transports:["websocket","polling"]});return h.current=j,j.on("connect",()=>t("connected")),j.on("disconnect",()=>t("disconnected")),j.on("authError",()=>{t("denied"),j.disconnect()}),j.on("agentUpdate",S=>{const{type:y}=S;if(y==="planStart"&&s([]),y==="stepStart"){const N=S.step;s(P=>[...P,{id:`${Date.now()}-${Math.random()}`,description:(N==null?void 0:N.description)??"Working…",status:"running"}])}y==="stepFinish"&&s(N=>{const P=[...N],_=P.findLastIndex(T=>T.status==="running");return _>=0&&(P[_]={...P[_],status:S.status==="error"?"error":"done"}),P}),y==="skillRunStart"&&S.skillId&&u(S.skillId),y==="planFinish"&&u(null)}),()=>{j.disconnect()}},[w]);const b=f.useCallback(async()=>{try{const j=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${w}`}});if(j.ok){const S=await j.json();a(S.skills??[])}}catch{}},[w]);f.useEffect(()=>{b()},[b]);const g=async()=>{try{const j=await navigator.mediaDevices.getUserMedia({audio:!0}),S=new MediaRecorder(j,{mimeType:"audio/webm"});v.current=[],S.ondataavailable=y=>{y.data.size>0&&v.current.push(y.data)},S.onstop=()=>{j.getTracks().forEach(y=>y.stop()),k()},S.start(),m.current=S,l("recording")}catch{l("idle")}},x=()=>{var j;(j=m.current)==null||j.stop(),l("sending")},k=async()=>{const j=new Blob(v.current,{type:"audio/webm"}),S=new FormData;S.append("audio",j,"voice.webm");try{const y=await fetch("/api/voice/transcribe",{method:"POST",headers:{Authorization:`Bearer ${w}`},body:S});if(y.ok){const{text:N}=await y.json();p(N),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`},body:JSON.stringify({goal:N})})}}catch{}l("idle")},C=async j=>{if(!c){u(j.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`},body:JSON.stringify({id:j.id})})}catch{u(null)}}};return!w||e==="denied"?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-8",children:[r.jsx(an,{size:40,className:"text-red-400"}),r.jsx("p",{className:"text-white font-bold text-xl",children:"Access Denied"}),r.jsxs("p",{className:"text-gray-500 text-sm",children:["This link is invalid or has expired.",r.jsx("br",{}),"Generate a new QR code from your desktop."]})]}):r.jsxs("div",{className:"min-h-screen bg-[#02040a] text-white flex flex-col pb-8",children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-8 h-8 object-contain"}),r.jsx("span",{className:"font-bold text-base",children:"Must-b"}),r.jsx("span",{className:"text-[10px] text-orange-400 font-medium bg-orange-400/10 border border-orange-400/20 px-2 py-0.5 rounded-full",children:"Companion"})]}),r.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:e==="connected"?r.jsxs(r.Fragment,{children:[r.jsx(i4,{size:13,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Connected"})]}):e==="connecting"?r.jsxs(r.Fragment,{children:[r.jsx(re,{size:13,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Connecting…"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Os,{size:13,className:"text-gray-600"}),r.jsx("span",{className:"text-gray-500",children:"Offline"})]})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-6 border-b border-white/5",children:[r.jsx("p",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-widest mb-6",children:"Voice Command"}),r.jsxs($.button,{onPointerDown:g,onPointerUp:x,onPointerLeave:o==="recording"?x:void 0,disabled:o==="sending"||e!=="connected",whileTap:{scale:.93},className:`relative w-28 h-28 rounded-full flex items-center justify-center transition-all select-none ${o==="recording"?"bg-red-500/20 border-2 border-red-500 shadow-[0_0_40px_rgba(239,68,68,0.4)]":o==="sending"?"bg-orange-500/10 border-2 border-orange-500/30":"bg-orange-500/10 border-2 border-orange-500/40 hover:bg-orange-500/20 active:scale-95"} disabled:opacity-40`,children:[o==="sending"?r.jsx(re,{size:36,className:"text-orange-400 animate-spin"}):o==="recording"?r.jsx(gh,{size:36,className:"text-red-400"}):r.jsx(Nr,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx($.span,{className:"absolute inset-0 rounded-full border-2 border-red-500",animate:{scale:[1,1.3,1],opacity:[.8,0,.8]},transition:{duration:1.4,repeat:1/0}})]}),r.jsx("p",{className:"text-[12px] text-gray-600 mt-4",children:o==="recording"?"Listening… release to send":"Hold to speak"}),d&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',d,'"']})]}),r.jsxs("div",{className:"px-5 pt-6 pb-4 border-b border-white/5",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest mb-3",children:"Live Workflow"}),r.jsx(ee,{children:n.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-4",children:"No active workflow"}):r.jsx("div",{className:"space-y-2",children:n.slice(-6).map(j=>r.jsxs($.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex items-start gap-2.5 p-3 rounded-xl border text-[12px] ${j.status==="running"?"bg-orange-500/8 border-orange-500/20":j.status==="error"?"bg-red-500/8 border-red-500/15":"bg-white/3 border-white/5"}`,children:[j.status==="running"&&r.jsx(re,{size:12,className:"animate-spin text-orange-400 mt-0.5 shrink-0"}),j.status==="done"&&r.jsx(Ue,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),j.status==="error"&&r.jsx(an,{size:12,className:"text-red-400 mt-0.5 shrink-0"}),r.jsx("span",{className:j.status==="running"?"text-orange-300":j.status==="error"?"text-red-300":"text-gray-400",children:j.description})]},j.id))})})]}),r.jsxs("div",{className:"px-5 pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:"My Skills"}),r.jsx("button",{onClick:b,className:"text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx(de,{size:12})})]}),i.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-6",children:"No skills saved yet"}):r.jsx("div",{className:"space-y-2.5",children:i.map(j=>{const S=c===j.id;return r.jsxs($.div,{layout:!0,className:`flex items-center gap-3 p-3.5 rounded-2xl border transition-all ${S?"bg-orange-500/10 border-orange-500/25":"bg-[#0c0f18] border-white/6"}`,children:[r.jsx(Re,{size:14,className:"text-orange-400 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-[13px] text-white truncate",children:j.name}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5",children:[j.runCount,"× run"]})]}),r.jsxs("button",{onClick:()=>C(j),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${S?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":"bg-orange-500/10 border border-orange-500/20 text-orange-400 hover:bg-orange-500/20 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:[S?r.jsx(re,{size:11,className:"animate-spin"}):r.jsx(Rs,{size:11}),S?"Running":"Run"]})]},j.id)})})]})]})}function zC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(null);return f.useEffect(()=>{U("/api/workspace/files").then(o=>o.ok?o.json():Promise.reject(`HTTP ${o.status}`)).then(o=>{const l=Array.isArray(o==null?void 0:o.files)?o.files:[];t(l.map(c=>({name:c.name,path:c.rel,size:c.size,modified:c.mtime})))}).catch(o=>a(String(o))).finally(()=>s(!1))},[]),r.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx(os,{size:20,className:"text-orange-400"}),r.jsx("h1",{className:"text-lg font-bold text-white",children:"Files"})]}),n&&r.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[r.jsx(re,{size:14,className:"animate-spin"}),"Loading files…"]}),i&&r.jsxs("p",{className:"text-red-400 text-sm",children:["Failed to load files: ",i]}),!n&&!i&&e.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:"No files found in workspace."}),!n&&e.length>0&&r.jsx("div",{className:"space-y-1",children:e.map(o=>r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg hover:bg-white/5 transition-colors",children:[r.jsx(Yt,{size:14,className:"text-gray-400 shrink-0"}),r.jsx("span",{className:"text-[13px] text-gray-200 flex-1 truncate",children:o.name}),o.size!==void 0&&r.jsxs("span",{className:"text-[11px] text-gray-500",children:[(o.size/1024).toFixed(1)," KB"]})]},o.path))})]})}const $m=[{id:"t1",type:"text",content:"Must-b is the next-generation AI agent platform designed for local execution."},{id:"t2",type:"text",content:"Zero latency. Total privacy. Infinite scale. Built for the modern web."},{id:"t3",type:"text",content:"Install in seconds. Run anywhere. Own your data."},{id:"l1",type:"link",content:"https://must-b.com/docs"},{id:"l2",type:"link",content:"https://must-b.com/download"},{id:"l3",type:"link",content:"https://github.com/aytac43-0/must-b"},{id:"i1",type:"image",content:"/logo.png"},{id:"i2",type:"image",content:"https://must-b.com/hero.png"}],RC=[{value:"all",label:"Tüm Veriler",icon:r.jsx(Xe,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Yt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(zr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(fh,{size:13})}];function LC(e){return e==="text"?r.jsx(Yt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(zr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(fh,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function OC(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function DC(){const[e,t]=f.useState(""),[n,s]=f.useState("all"),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(new Set),[h,m]=f.useState(!1),[v,w]=f.useState(!1),b=(c??[]).filter(j=>n==="all"?!0:j.type===(n==="links"?"link":n==="images"?"image":"text")),g=j=>{p(S=>{const y=new Set(S);return y.has(j)?y.delete(j):y.add(j),y})},x=()=>{d.size===b.length?p(new Set):p(new Set(b.map(j=>j.id)))},k=async()=>{const j=e.trim();if(j){a(!0),l(null),u(null),p(new Set),w(!1);try{const S=await U("/api/goal",{method:"POST",body:JSON.stringify({goal:`Open browser, navigate to ${j}, extract: ${n}`})});if(S.ok){const y=n==="all"?$m:$m.filter(N=>n==="text"&&N.type==="text"||n==="links"&&N.type==="link"||n==="images"&&N.type==="image");u(y),p(new Set(y.map(N=>N.id)))}else{const y=await S.json().catch(()=>({}));l(y.error??`Sunucu hatası: ${S.status}`)}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},C=async()=>{const j=(c??[]).filter(S=>d.has(S.id));if(j.length!==0){m(!0);try{await U("/api/memory/import",{method:"POST",body:JSON.stringify({entries:j.map(S=>({type:S.type,content:S.content,source:e}))})}).catch(()=>{}),w(!0)}finally{m(!1)}}};return r.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-10",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.3)"},children:r.jsx(Xe,{size:18,className:"text-orange-400 animate-pulse"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[17px] font-bold text-white/90 leading-tight",children:"Tarayıcı Otomasyonu"}),r.jsx("p",{className:"text-[12px] text-white/40",children:"Web sayfalarını tara, analiz et ve verileri belleğine kaydet"})]})]}),r.jsxs("div",{className:"rounded-xl px-5 py-4 mb-5",style:{background:"rgba(249,115,22,0.05)",border:"1px solid rgba(249,115,22,0.15)"},children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/80 mb-3 leading-snug",children:"Must-b Otonom Tarayıcı ile internetin gücünü belleğinize katın:"}),r.jsx("ol",{className:"space-y-1.5",children:["Hedef URL'yi girin.","Çıkarmak istediğiniz veri türünü seçin (Metin, Link veya Görsel).","Başlat butonuna basarak Must-b'nin siteyi analiz etmesini bekleyin.","Sonuçları inceleyin ve kalıcı hafızaya kaydetmek istediklerinizi seçin."].map((j,S)=>r.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-white/80 leading-relaxed",children:[r.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-black shrink-0 mt-0.5",style:{background:"rgba(249,115,22,0.25)",color:"#fb923c"},children:S+1}),j]},S))}),r.jsxs("p",{className:"mt-3 text-[11px] text-orange-400/70 flex items-start gap-1.5 leading-relaxed",children:[r.jsx("span",{className:"shrink-0 mt-0.5",children:"🔒"}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-orange-400/90",children:"Güvenlik Notu:"})," ","Tüm işlemler yerel agent motorunda gerçekleşir, verileriniz üçüncü taraflara asla iletilmez."]})]})]}),r.jsxs("div",{className:"rounded-2xl p-5 mb-4",style:{background:"rgba(13,7,3,0.80)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.45)"},children:[r.jsx("label",{className:"block text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2",children:"Hedef URL"}),r.jsxs("div",{className:"flex gap-2 mb-5",children:[r.jsx("input",{type:"url",value:e,onChange:j=>t(j.target.value),onKeyDown:j=>j.key==="Enter"&&!i&&k(),placeholder:"https://example.com",className:"flex-1 px-4 py-2.5 rounded-xl text-[13px] text-white/85 placeholder-white/20 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)"},onFocus:j=>j.currentTarget.style.borderColor="rgba(249,115,22,0.55)",onBlur:j=>j.currentTarget.style.borderColor="rgba(255,255,255,0.12)"}),r.jsxs("button",{onClick:k,disabled:i||!e.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:i||!e.trim()?"rgba(249,115,22,0.25)":"rgba(249,115,22,0.85)",color:"#fff",border:"1px solid rgba(249,115,22,0.4)"},children:[i?r.jsx(re,{size:14,className:"animate-spin"}):r.jsx(il,{size:14}),i?"Taranıyor…":"Başlat"]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2.5",children:"Çıkarma Modu"}),r.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:RC.map(j=>r.jsxs("button",{onClick:()=>s(j.value),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all",style:{background:n===j.value?"rgba(249,115,22,0.18)":"rgba(255,255,255,0.04)",border:n===j.value?"1px solid rgba(249,115,22,0.45)":"1px solid rgba(255,255,255,0.08)",color:n===j.value?"#fb923c":"rgba(255,255,255,0.45)"},children:[j.icon,j.label]},j.value))})]}),i&&r.jsxs("div",{className:"mt-5 flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)"},children:[r.jsx(re,{size:15,className:"animate-spin text-orange-400 shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-orange-300",children:"Sayfa taranıyor…"}),r.jsx("p",{className:"text-[11px] text-white/35 mt-0.5",children:"Playwright sayfayı açıyor ve içerik çıkarılıyor"})]})]}),o&&r.jsxs("div",{className:"mt-5 flex items-start gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:[r.jsx(an,{size:15,className:"text-red-400 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-red-300",children:"Hata oluştu"}),r.jsx("p",{className:"text-[11px] text-red-400/70 mt-0.5",children:o})]})]})]}),c!==null&&b.length>0&&r.jsxs("div",{className:"rounded-2xl p-5",style:{background:"rgba(13,7,3,0.75)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.40)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/85",children:"Çıkarılan Veriler"}),r.jsxs("p",{className:"text-[11px] text-white/35 mt-0.5",children:[b.length," öğe bulundu · ",d.size," seçili"]})]}),r.jsxs("button",{onClick:x,className:"text-[11px] font-medium text-orange-400/80 hover:text-orange-400 transition-colors flex items-center gap-1",children:[r.jsx(ln,{size:12}),d.size===b.length?"Seçimi Kaldır":"Tümünü Seç"]})]}),["text","link","image"].map(j=>{const S=b.filter(y=>y.type===j);return S.length===0?null:r.jsxs("div",{className:"mb-4 last:mb-0",children:[r.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-1.5 px-1",children:[OC(j)," (",S.length,")"]}),r.jsx("div",{className:"space-y-1",children:S.map(y=>r.jsxs("label",{className:"flex items-start gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all",style:{background:d.has(y.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:d.has(y.id)?"1px solid rgba(249,115,22,0.22)":"1px solid rgba(255,255,255,0.06)"},children:[r.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center shrink-0 mt-0.5 transition-all",style:{background:d.has(y.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:d.has(y.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(y.id),children:d.has(y.id)&&r.jsx(Kt,{size:10,className:"text-white"})}),LC(y.type),r.jsx("span",{className:"text-[12px] text-white/65 leading-relaxed break-all",children:y.content})]},y.id))})]},j)}),r.jsx("div",{className:"mt-5 pt-4 border-t border-white/8",children:v?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold",style:{background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.25)",color:"#4ade80"},children:[r.jsx(Kt,{size:14}),d.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:C,disabled:h||d.size===0,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.35)",color:"#fb923c"},children:h?r.jsxs(r.Fragment,{children:[r.jsx(re,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(qy,{size:14})," Seçilenleri Belleğe Kaydet (",d.size,")"]})})})]}),c!==null&&b.length===0&&r.jsx("div",{className:"text-center py-10 text-[13px] text-white/25",children:"Bu modda çıkarılacak veri bulunamadı."})]})}function IC(e){return e.replace(/hey\s+must\s*-?\s*be\b/gi,"Hey Must-b").replace(/hey\s+mustbe\b/gi,"Hey Must-b").replace(/hey\s+most\s+be\b/gi,"Hey Must-b").replace(/hey\s+must\s+b\b/gi,"Hey Must-b").replace(/hey\s+must\s+bee\b/gi,"Hey Must-b").replace(/hay\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mast\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+m[au]s[t]?\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+must\s*b[eiy]+\b/gi,"Hey Must-b").replace(/hey\s+moos+\s*b[ei]?\b/gi,"Hey Must-b")}function BC(e){const t=window.speechSynthesis.getVoices(),n=e.toLowerCase();return t.find(s=>s.name.toLowerCase().includes("google")&&s.lang.toLowerCase().startsWith(n))||t.find(s=>s.lang.toLowerCase().startsWith(n)&&!s.localService)||t.find(s=>s.lang.toLowerCase().startsWith(n))||null}function FC(){const e=hn(),{t,locale:n}=ht(),[s,i]=f.useState("wake-listening"),[a,o]=f.useState("Must-b"),[l,c]=f.useState(""),[u,d]=f.useState(""),p=f.useRef(null),h=f.useRef(!1),m=f.useRef(""),v=f.useRef(null),w=f.useRef("wake-listening");f.useEffect(()=>{w.current=s},[s]),f.useEffect(()=>{U("/api/identity").then(S=>S.json()).then(S=>{S.name&&o(S.name)}).catch(()=>{})},[]);const b=f.useCallback(S=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const y=new SpeechSynthesisUtterance(S),N=n==="tr"?"tr-TR":n==="de"?"de-DE":n==="fr"?"fr-FR":n==="es"?"es-ES":n==="ja"?"ja-JP":n==="zh"?"zh-CN":n==="pt"?"pt-PT":"en-US";y.lang=N,y.rate=1.05,y.pitch=1;const P=()=>{const _=BC(N.split("-")[0]);_&&(y.voice=_)};P(),!y.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=P),y.onend=()=>{i("wake-listening"),d(""),c("")},y.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(y)},[n]),g=f.useCallback(async S=>{if(!S.trim()){i("wake-listening");return}i("thinking"),c(S);try{const N=await(await U("/api/goal",{method:"POST",body:JSON.stringify({goal:S,voice:!0})})).json(),P=N.result??N.reply??N.response??N.output??"Done.";d(P),b(P)}catch{i("wake-listening")}},[b]),x=f.useCallback(()=>{const S=window.SpeechRecognition||window.webkitSpeechRecognition;if(!S||!h.current)return;const y=new S;y.continuous=!0,y.interimResults=!0,y.lang=n==="tr"?"tr-TR":"en-US",y.onresult=N=>{var O,F;let P="";for(let D=N.resultIndex;D<N.results.length;D++)P+=N.results[D][0].transcript;const _=IC(P),T=w.current;if(c(_),T==="wake-listening"){const D=`hey ${a}`.toLowerCase();if(_.toLowerCase().includes(D)){const M=((O=_.toLowerCase().split(D)[1])==null?void 0:O.trim())??"";m.current=M,i("cmd-listening"),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{if(m.current.trim()&&w.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},1800)}}else if(T==="cmd-listening"){const D=`hey ${a}`.toLowerCase(),M=_.toLowerCase().includes(D)?((F=_.toLowerCase().split(D)[1])==null?void 0:F.trim())??_:_;m.current=M,v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{if(m.current.trim()&&w.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},2200)}},y.onend=()=>{const N=w.current;h.current&&N!=="thinking"&&N!=="speaking"?setTimeout(x,200):h.current||(i("off"),p.current=null)},y.onerror=N=>{N.error!=="no-speech"&&i("wake-listening"),h.current&&N.error!=="not-allowed"&&setTimeout(x,600)},p.current=y;try{y.start()}catch{}},[a,n,g]),k=()=>{var S,y;s!=="off"?(h.current=!1,(S=p.current)==null||S.stop(),(y=window.speechSynthesis)==null||y.cancel(),v.current&&clearTimeout(v.current),i("off"),c("")):(h.current=!0,i("wake-listening"),x())};f.useEffect(()=>(h.current=!0,i("wake-listening"),x(),()=>{var S,y;h.current=!1,(S=p.current)==null||S.stop(),(y=window.speechSynthesis)==null||y.cancel(),v.current&&clearTimeout(v.current)}),[]);const C=s==="wake-listening"||s==="cmd-listening",j=s==="off";return r.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center overflow-hidden",style:{background:"radial-gradient(ellipse at 50% 45%, rgba(249,115,22,0.22) 0%, #060301 55%)"},children:[r.jsxs("button",{onClick:()=>e("/app"),className:"absolute top-20 left-6 flex items-center gap-2 px-3 py-2 rounded-xl text-white/40 hover:text-white/80 hover:bg-white/8 transition-all text-[13px] font-medium z-10",children:[r.jsx(bS,{size:15}),r.jsx("span",{children:t.voice.back})]}),r.jsx("p",{className:"absolute top-6 text-[12px] font-bold text-white/25 tracking-[0.18em] uppercase select-none",children:t.voice.title}),[200,290,380].map((S,y)=>r.jsx($.div,{className:"absolute rounded-full",style:{width:S,height:S,border:`1px solid rgba(249,115,22,${.12-y*.03})`},animate:C?{opacity:[.4,.7,.4],scale:[1,1.04,1]}:{opacity:.2,scale:1},transition:{duration:2.2+y*.6,repeat:1/0,ease:"easeInOut",delay:y*.4}},S)),r.jsx($.button,{onClick:k,className:"relative w-36 h-36 rounded-full flex items-center justify-center cursor-pointer select-none mb-10",style:{background:C?"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.92), rgba(160,55,8,0.75))":"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.38), rgba(22,10,3,0.88))",border:`1px solid rgba(249,115,22,${C?.5:.28})`,boxShadow:C?"0 0 70px rgba(249,115,22,0.55), 0 0 140px rgba(249,115,22,0.18), inset 0 1px 0 rgba(255,255,255,0.12)":"0 0 30px rgba(249,115,22,0.12), inset 0 1px 0 rgba(255,255,255,0.05)"},animate:C?{scale:[1,1.06,1]}:{scale:1},transition:{duration:1.6,repeat:C?1/0:0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.95},children:s==="thinking"?r.jsx($.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-10 h-10 rounded-full border-2 border-orange-500/30 border-t-orange-400"}):s==="speaking"?r.jsx($.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx($.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Nr,{size:38,className:"text-white/95"})}):j?r.jsx(Nr,{size:38,className:"text-orange-300/90"}):r.jsx(gh,{size:38,className:"text-white/90"})}),r.jsx(ee,{mode:"wait",children:r.jsxs($.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"flex flex-col items-center gap-3 px-6 text-center",children:[s==="thinking"&&r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.thinking}),s==="speaking"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-orange-300",children:t.voice.speakingHint}),u&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",u.slice(0,140),u.length>140?"…":"","”"]})]}),s==="cmd-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/75",children:t.voice.cmdHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/40 italic max-w-sm",children:["“",l,"”"]})]}),s==="wake-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.wakeHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/35 italic max-w-sm",children:["“",l,"”"]}),r.jsx("p",{className:"text-[11px] text-white/25",children:t.voice.stopHint})]}),s==="off"&&r.jsx("p",{className:"text-[17px] font-medium text-white/40",children:t.voice.tapHint}),C&&r.jsx("div",{className:"flex items-center gap-1 mt-1",children:[0,1,2,3,4].map(S=>r.jsx($.div,{className:"w-0.5 rounded-full bg-orange-500/60",animate:{height:["6px","18px","6px"]},transition:{duration:.8,repeat:1/0,delay:S*.12,ease:"easeInOut"}},S))})]},s)})]})}function Um(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function Kr(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function VC(){const{t:e,locale:t}=ht(),n=e.systemHealth,[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),u=f.useCallback(()=>o(null),[]);f.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),f.useEffect(()=>{const h=pt();return h.on("systemStats",m=>i(m)),h.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const v=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),v)}}),()=>{h.off("systemStats"),h.off("systemHealth")}},[]);const d=(s==null?void 0:s.cpu)??0,p=(s==null?void 0:s.ram)??0;return r.jsxs("div",{className:"relative flex items-center",children:[r.jsxs("button",{onClick:()=>a&&c(h=>!h),className:"flex items-center gap-1.5 select-none transition-all rounded-md",style:{cursor:a?"pointer":"default"},title:a?a.message:n.title,children:[a?r.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0 animate-pulse",style:{background:Kr(a.level)}}):r.jsx(un,{size:12,className:"text-orange-400/70"}),s&&r.jsxs("span",{className:"hidden sm:flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"CPU"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${d}%`,background:Um(d)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[d,"%"]}),r.jsx("span",{className:"w-px h-3 bg-white/10"}),r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"RAM"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${p}%`,background:Um(p)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[p,"%"]}),s.liteMode&&!s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-orange-500/20 text-orange-400 ml-0.5",children:n.lite}),s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-red-500/20 text-red-400 ml-0.5",children:n.safe})]}),!s&&r.jsx("span",{className:"text-[10px] font-semibold hidden sm:inline text-white/35",children:n.title})]}),r.jsx(ee,{children:l&&a&&r.jsxs($.div,{initial:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.2,ease:"easeOut"},className:"absolute top-full right-0 mt-2 w-72 z-[200] rounded-2xl overflow-hidden",style:{background:"rgba(20,8,2,0.88)",border:`1px solid ${Kr(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(es,{size:13,style:{color:Kr(a.level)}}),r.jsxs("span",{className:"text-[12px] font-bold text-white/90 capitalize",children:[n[a.level]??a.level," — ",n.kinds[a.kind]??a.kind]})]}),r.jsx("button",{onClick:u,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(st,{size:13})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:n.alerts[a.kind]??a.message}),r.jsx("p",{className:"text-[11px] text-white/45 leading-relaxed italic",children:n.recommendations[a.kind]??a.recommendation})]}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(a.ts).toLocaleTimeString()})})]},"health-popover")})]})}function $C(e){return`${Math.round(e*100)}%`}const Hm={skill:{label:"Skill",icon:Re,color:"text-orange-400"},conversation:{label:"Conversation",icon:ta,color:"text-blue-400"},workspace:{label:"Workspace",icon:os,color:"text-green-400"},custom:{label:"Custom",icon:Yt,color:"text-gray-400"}};function UC(){const{t:e}=ht(),t=e.panels.memory,[n,s]=f.useState(""),[i,a]=f.useState([]),[o,l]=f.useState(null),[c,u]=f.useState(!1),[d,p]=f.useState(null),[h,m]=f.useState(null),[v,w]=f.useState(!1),b=f.useRef(null),g=f.useCallback(async j=>{const S=j.trim();if(S){u(!0),a([]);try{const y=await U(`/api/memory/search?q=${encodeURIComponent(S)}&limit=10`);if(y.ok){const N=await y.json();a(N.results??[])}}catch{}u(!1)}},[]),x=j=>{j.key==="Enter"&&g(n)},k=f.useCallback(async()=>{try{const j=await U("/api/memory/stats");j.ok&&l(await j.json())}catch{}},[]),C=async j=>{p(j),m(null);try{const S=j==="clear"?await U("/api/memory/clear-index",{method:"DELETE"}):await U(`/api/memory/index-${j}`,{method:"POST"});if(S.ok){const y=await S.json(),N=j==="clear"?t.indexCleared:`${t.indexed} ${y.indexed??0} ${j==="skills"?t.skills:t.files}`;m({ok:!0,msg:N}),k(),j==="clear"&&a([])}else m({ok:!1,msg:t.opFailed})}catch{m({ok:!1,msg:t.reqError})}p(null),setTimeout(()=>m(null),4e3)};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Gt,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),o&&r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[o.items.toLocaleString()," ",t.vectors]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>{w(j=>!j),o||k()},className:`text-gray-600 hover:text-gray-400 transition-colors ${v?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(ZS,{size:13})}),r.jsx("button",{onClick:k,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(de,{size:13})})]})]}),r.jsx(ee,{children:v&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:[r.jsxs("div",{className:"px-6 py-3 flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 uppercase tracking-widest font-bold shrink-0",children:t.indexLabel}),["skills","workspace"].map(j=>r.jsxs("button",{onClick:()=>C(j),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/6 text-[11px] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-all disabled:opacity-40 capitalize",children:[d===j?r.jsx(re,{size:10,className:"animate-spin"}):j==="skills"?r.jsx(Re,{size:10}):r.jsx(os,{size:10}),j]},j)),r.jsxs("button",{onClick:()=>C("clear"),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-red-500/8 border border-red-500/15 text-[11px] text-red-400 hover:bg-red-500/15 transition-all disabled:opacity-40 ml-auto",children:[d==="clear"?r.jsx(re,{size:10,className:"animate-spin"}):r.jsx(Ls,{size:10}),t.clearIndex]})]}),r.jsx(ee,{children:h&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 pb-3 text-[11px] font-medium ${h.ok?"text-green-400":"text-red-400"}`,children:[h.ok?r.jsx(Ue,{size:11}):r.jsx(an,{size:11}),h.msg]})})]})}),r.jsxs("div",{className:"px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/4 border border-white/8 focus-within:border-orange-500/30 transition-colors",children:[r.jsx(qt,{size:13,className:"text-gray-600 shrink-0"}),r.jsx("input",{ref:b,value:n,onChange:j=>s(j.target.value),onKeyDown:x,placeholder:t.searchPlaceholder,className:"flex-1 bg-transparent text-[13px] text-gray-200 outline-none placeholder-gray-700"}),c?r.jsx(re,{size:13,className:"text-orange-400 animate-spin shrink-0"}):r.jsx("button",{onClick:()=>g(n),disabled:!n.trim(),className:"text-[10px] px-2 py-0.5 rounded-lg bg-orange-500/12 text-orange-400 font-semibold hover:bg-orange-500/22 border border-orange-500/20 transition-all disabled:opacity-30",children:"⌘↵"})]}),r.jsx("p",{className:"text-[10px] text-gray-700 mt-1.5 ml-1",children:t.searchHint})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:[i.length===0&&!c&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Gt,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:n.trim()?t.emptyNoResults:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1 max-w-xs leading-relaxed",children:n.trim()?t.emptyNoResultsHint:t.emptyHint})]}),i.map((j,S)=>{const y=Hm[j.metadata.source]??Hm.custom,N=y.icon;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:S*.04},className:"rounded-2xl border border-white/6 bg-[#0c0f18] p-4 hover:border-white/12 transition-all",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r.jsx(N,{size:11,className:`${y.color} shrink-0`}),r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:j.metadata.title})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full border ${j.score>=.85?"bg-green-500/10 border-green-500/20 text-green-400":j.score>=.65?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/4 border-white/6 text-gray-500"}`,children:$C(j.score)}),r.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-white/4 border border-white/6 font-medium ${y.color}`,children:y.label})]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-3 mb-2",children:j.text}),j.metadata.tags&&j.metadata.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1",children:j.metadata.tags.map((P,_)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:P},_))}),r.jsx("div",{className:"mt-2 h-0.5 bg-white/4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-orange-600 to-amber-400",style:{width:`${j.score*100}%`}})})]},S)})]})]})}const HC={node:cn,python:mn},WC={node:"text-green-400",python:"text-blue-400"};function GC(){const{t:e}=ht(),t=e.panels.plugins,[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(!1),[h,m]=f.useState(""),[v,w]=f.useState(""),[b,g]=f.useState("node"),[x,k]=f.useState(""),[C,j]=f.useState(!1),S=(_,T)=>{u({ok:_,msg:T}),setTimeout(()=>u(null),4e3)},y=f.useCallback(async()=>{a(!0);try{const _=await U("/api/plugins/list");if(_.ok){const T=await _.json();s(T.plugins??[])}}catch{}a(!1)},[]);f.useEffect(()=>{y()},[y]);const N=async(_,T)=>{l(_);try{(await U(T?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:_})})).ok?(S(!0,T?`${_} stopped`:`${_} launched`),await y()):S(!1,t.opFailed)}catch{S(!1,t.reqError)}l(null)},P=async()=>{if(!(!h.trim()||!v.trim())){j(!0);try{(await U("/api/plugins/build",{method:"POST",body:JSON.stringify({name:h.trim(),goal:v.trim(),lang:b,context:x.trim()||void 0})})).ok?(S(!0,`Plugin "${h}" created`),m(""),w(""),k(""),p(!1),await y()):S(!1,t.buildFailed)}catch{S(!1,t.reqError)}j(!1)}};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Sr,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[n.length," ",t.installed]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:y,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refresh,children:r.jsx(de,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(_=>!_),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${d?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500 hover:text-gray-300"}`,children:[r.jsx(ol,{size:10}),t.newPlugin]})]})]}),r.jsx(ee,{children:c&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 py-2 text-[11px] font-medium shrink-0 ${c.ok?"text-green-400":"text-red-400"}`,children:[c.ok?r.jsx(Ue,{size:11}):r.jsx(an,{size:11}),c.msg]})}),r.jsx(ee,{children:d&&r.jsx($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:r.jsxs("div",{className:"px-6 py-4 space-y-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:t.buildTitle}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx("input",{value:h,onChange:_=>m(_.target.value),placeholder:t.namePlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:v,onChange:_=>w(_.target.value),placeholder:t.goalPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:x,onChange:_=>k(_.target.value),placeholder:t.contextPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("div",{className:"flex gap-2",children:["node","python"].map(_=>r.jsx("button",{onClick:()=>g(_),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${b===_?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:_},_))}),r.jsxs("button",{onClick:P,disabled:C||!h.trim()||!v.trim(),className:"flex items-center justify-center gap-1.5 py-2 rounded-lg bg-orange-500/12 border border-orange-500/20 text-orange-400 text-[11px] font-bold hover:bg-orange-500/20 transition-all disabled:opacity-40",children:[C?r.jsx(re,{size:11,className:"animate-spin"}):r.jsx(Re,{size:11}),t.generatePlugin]})]})]})})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-2",children:[n.length===0&&!i&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Sr,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1",children:t.emptyHint})]}),n.map((_,T)=>{const O=HC[_.lang]??cn,F=o===_.name;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:T*.04},className:`flex items-center gap-3 p-3 rounded-2xl border transition-all ${_.running?"bg-green-500/5 border-green-500/15 hover:border-green-500/25":"bg-[#0c0f18] border-white/6 hover:border-white/12"}`,children:[r.jsx(O,{size:13,className:WC[_.lang]??"text-gray-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:_.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:_.filename})]}),_.running&&r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-green-500/12 border border-green-500/20 text-green-400 font-bold",children:t.running}),r.jsxs("button",{disabled:F,onClick:()=>N(_.name,_.running),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-[10px] font-bold transition-all disabled:opacity-40 ${_.running?"bg-red-500/8 border-red-500/15 text-red-400 hover:bg-red-500/15":"bg-green-500/8 border-green-500/15 text-green-400 hover:bg-green-500/15"}`,children:[F?r.jsx(re,{size:10,className:"animate-spin"}):_.running?r.jsx(vh,{size:10}):r.jsx(Rs,{size:10}),_.running?t.stop:t.run]})]},_.name)})]})]})}function KC(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function qC(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function YC({skill:e}){const[t,n]=f.useState(!1),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(!1),u=async()=>{if(!l){c(!0);return}if(a.trim()){n(!0);try{await U("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:e.id,params:{goal:a.trim(),_autoRun:!0}})}),i(!0),c(!1),o(""),setTimeout(()=>i(!1),3e3)}catch{}n(!1)}},d=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/6 bg-[#0c0f18] hover:border-white/12 transition-all",children:r.jsxs("div",{className:"p-3",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-1.5",children:[r.jsx("span",{className:"text-base leading-none mt-0.5 shrink-0",children:e.emoji??"⚡"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[12px] font-bold text-gray-200 truncate capitalize",children:e.name})}),e.hasScripts&&r.jsx(Ps,{size:10,className:"text-gray-700 shrink-0 mt-0.5"})]}),r.jsx("p",{className:"text-[10px] text-gray-500 leading-relaxed line-clamp-2 mb-2 ml-6",children:e.description}),(d||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(h=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-blue-500/8 border border-blue-500/15 text-blue-400 font-mono",children:["bin:",h]},h)),(e.requires.config??[]).map(h=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-purple-500/8 border border-purple-500/15 text-purple-400 font-mono",children:["cfg:",h]},h))]}),r.jsx(ee,{children:l&&r.jsx($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-2",children:r.jsx("input",{autoFocus:!0,value:a,onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&u(),h.key==="Escape"&&(c(!1),o(""))},placeholder:`Goal for ${e.name}…`,className:"w-full px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/10 text-[11px] text-gray-200 placeholder-gray-700 outline-none focus:border-orange-500/30 transition-colors"})})}),r.jsxs("div",{className:"flex items-center justify-end gap-1 ml-6",children:[l&&r.jsx("button",{onClick:()=>{c(!1),o("")},className:"text-[10px] px-2 py-1 rounded-lg bg-white/4 text-gray-600 hover:text-gray-400 transition-colors",children:"Cancel"}),r.jsx("button",{onClick:u,disabled:t||l&&!a.trim(),className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold border transition-all disabled:opacity-40 ${s?"bg-green-500/10 border-green-500/20 text-green-400":"bg-orange-500/8 border-orange-500/15 text-orange-400 hover:bg-orange-500/15"}`,children:t?r.jsx(re,{size:9,className:"animate-spin"}):s?r.jsxs(r.Fragment,{children:[r.jsx(Ue,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(ln,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(XS,{size:9})," Use"]})})]})]})})}function XC(){const{t:e}=ht(),t=e.panels.skills,[n,s]=f.useState("saved"),[i,a]=f.useState([]),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState("idle"),[h,m]=f.useState(null),[v,w]=f.useState(null),[b,g]=f.useState([]),[x,k]=f.useState(!1),[C,j]=f.useState(""),S=f.useCallback(async()=>{l(!0);try{const T=await U("/api/skills/list");if(T.ok){const O=await T.json();a(O.skills??[])}}catch{}l(!1)},[]),y=f.useCallback(async()=>{k(!0);try{const T=await U("/api/skills/catalog");if(T.ok){const O=await T.json();g(O.skills??[])}}catch{}k(!1)},[]);f.useEffect(()=>{S()},[S]),f.useEffect(()=>{n==="library"&&b.length===0&&y()},[n,b.length,y]),f.useEffect(()=>{const T=pt(),O=F=>{F.type==="skillRunStart"&&F.skillId&&(u(F.skillId),p("running")),F.type==="planFinish"&&(p("done"),u(null),S(),setTimeout(()=>p("idle"),2500))};return T.on("agentUpdate",O),()=>{T.off("agentUpdate",O)}},[S]);const N=async T=>{if(!c){u(T.id),p("running");try{const O=await U("/api/skills/run",{method:"POST",body:JSON.stringify({id:T.id})});if(!O.ok)throw new Error(`HTTP ${O.status}`)}catch{p("error"),u(null),setTimeout(()=>p("idle"),3e3)}}},P=async T=>{m(T);try{await U(`/api/skills/${T}`,{method:"DELETE"}),a(O=>O.filter(F=>F.id!==T))}catch{}m(null),w(null)},_=C.trim()?b.filter(T=>T.name.toLowerCase().includes(C.toLowerCase())||T.description.toLowerCase().includes(C.toLowerCase())):b;return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(dh,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title})]}),r.jsxs("div",{className:"flex items-center gap-1 bg-white/4 rounded-lg p-0.5",children:[r.jsxs("button",{onClick:()=>s("saved"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="saved"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Re,{size:9}),"Saved",i.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:i.length})]}),r.jsxs("button",{onClick:()=>s("library"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="library"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(tc,{size:9}),"Library",b.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:b.length})]})]}),r.jsx("button",{onClick:n==="saved"?S:y,disabled:n==="saved"?o:x,className:"text-gray-600 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:d!=="idle"&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:`px-6 py-2 border-b flex items-center gap-2 text-xs font-medium ${d==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":d==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[d==="running"&&r.jsx(re,{size:12,className:"animate-spin"}),d==="done"&&r.jsx(Ue,{size:12}),d==="error"&&r.jsx(an,{size:12}),d==="running"?t.runningStatus:d==="done"?t.completedStatus:t.failedStatus]})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:o&&i.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2",children:[r.jsx(re,{size:13,className:"animate-spin"})," ",t.loading]}):i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Re,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsxs("p",{className:"text-xs text-gray-700 mt-1 max-w-xs",children:[t.emptyHint," ",r.jsx("span",{className:"text-orange-400 font-medium",children:t.saveAsSkill})," ",t.emptyHint2]}),r.jsxs("button",{onClick:()=>s("library"),className:"mt-4 flex items-center gap-1.5 text-[11px] text-orange-400 hover:text-orange-300 transition-colors",children:[r.jsx(tc,{size:11})," Browse skill library"]})]}):i.map((T,O)=>{const F=c===T.id&&d==="running",D=c===T.id&&d==="done",M=h===T.id;return r.jsx($.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:O*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${F?"border-orange-500/30 shadow-[0_0_12px_rgba(234,88,12,0.12)]":D?"border-green-500/20":"border-white/6 hover:border-white/12"}`,children:r.jsxs("div",{className:"p-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Re,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}),r.jsx("p",{className:"text-[13px] font-bold text-white truncate",children:T.name})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-gray-600 shrink-0 font-mono",children:[r.jsx(Yy,{size:9}),T.runCount,"×"]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed mb-2 line-clamp-2",children:T.goal}),T.steps.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[T.steps.slice(0,4).map((z,V)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:z.tool??"step"},V)),T.steps.length>4&&r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:["+",T.steps.length-4," more"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-700",children:[r.jsx(en,{size:9}),r.jsx("span",{children:qC(T.savedAt)}),T.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",KC(T.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[v===T.id?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[10px] text-red-400",children:t.deleteConfirm}),r.jsx("button",{onClick:()=>P(T.id),disabled:M,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:M?"…":t.yes}),r.jsx("button",{onClick:()=>w(null),className:"text-[10px] px-2 py-0.5 rounded bg-white/5 text-gray-500 hover:bg-white/8",children:t.no})]}):r.jsx("button",{onClick:()=>w(T.id),className:"p-1.5 rounded-lg text-gray-700 hover:text-red-400 hover:bg-red-500/8 transition-all",title:"Delete skill",children:r.jsx(Ls,{size:12})}),r.jsx("button",{onClick:()=>N(T),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${F?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":D?"bg-green-500/12 text-green-400 border border-green-500/20":"bg-orange-500/10 hover:bg-orange-500/20 text-orange-400 border border-orange-500/20 hover:border-orange-500/35 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:F?r.jsxs(r.Fragment,{children:[r.jsx(re,{size:11,className:"animate-spin"})," ",t.runningBtn]}):D?r.jsxs(r.Fragment,{children:[r.jsx(Ue,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx(Rs,{size:11})," ",t.runBtn]})})]})]})]})},T.id)})})]}),n==="library"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-2.5 border-b border-white/5 shrink-0",children:r.jsx("input",{value:C,onChange:T=>j(T.target.value),placeholder:"Search skills…",className:"w-full px-3 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-300 placeholder-gray-700 outline-none focus:border-orange-500/25 transition-colors"})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-3 grid grid-cols-1 gap-2",children:x&&b.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2 col-span-1",children:[r.jsx(re,{size:13,className:"animate-spin"})," Loading skill library…"]}):_.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(tc,{size:36,className:"text-gray-700 mb-3"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:"No skills found"}),C&&r.jsx("button",{onClick:()=>j(""),className:"mt-2 text-[11px] text-orange-400 hover:text-orange-300",children:"Clear filter"})]}):_.map((T,O)=>r.jsx($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(O*.02,.4)},children:r.jsx(YC,{skill:T})},T.id))}),b.length>0&&r.jsx("div",{className:"px-4 py-2 border-t border-white/5 shrink-0 flex items-center gap-1.5",children:r.jsxs("span",{className:"text-[10px] text-gray-700 font-mono",children:[_.length," / ",b.length," skills"]})})]})]})}const QC={html:fm,htm:fm,json:mn,js:mn,ts:mn,tsx:mn,jsx:mn};function JC(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ZC(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function e_(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let n="color:#86efac";return/^"/.test(t)&&(n=/:$/.test(t)?"color:#93c5fd":"color:#fca5a5"),/true|false/.test(t)&&(n="color:#f97316"),/null/.test(t)&&(n="color:#6b7280"),`<span style="${n}">${t}</span>`})}function t_(){const[e,t]=f.useState([]),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState(!1),h=f.useCallback(async()=>{p(!0);try{const b=await U("/api/workspace/files");if(b.ok){const g=await b.json();t(g.files??[])}}catch{}p(!1)},[]);f.useEffect(()=>{h()},[h]);const m=async b=>{s(b),a(null),u(null),l(!0);try{const g=await U(`/api/workspace/file?p=${encodeURIComponent(b.rel)}`);if(!g.ok)throw new Error(`HTTP ${g.status}`);const x=await g.json();a(x.content+(x.truncated?`
717
+ `}),r.jsx("div",{className:"max-w-full",dangerouslySetInnerHTML:{__html:h}})]})]})]})]})}const NC=[{id:"terminal",label:"Terminal",desc:"Kabuk komutları çalıştır",Icon:Ps,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},{id:"browser",label:"Browser",desc:"Playwright ile tam web otomasyonu",Icon:Ye,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},{id:"web-search",label:"Web Search",desc:"Çoklu sağlayıcıyla gerçek zamanlı arama",Icon:qt,color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},{id:"file-manager",label:"Files",desc:"Dosya oku, yaz ve yönet",Icon:os,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},{id:"image-gen",label:"Görsel Üret",desc:"AI ile görsel üret",Icon:i1,color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},{id:"code",label:"Kod Analizi",desc:"Kod yaz, analiz et ve hata ayıkla",Icon:ln,color:"text-purple-400",bg:"bg-purple-500/10",border:"border-purple-500/20"},{id:"memory",label:"Bellek",desc:"Semantik hafıza arama & kayıt",Icon:Gt,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},{id:"vision",label:"Görme",desc:"Ekran ve görsel algı",Icon:Su,color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},{id:"screen-sense",label:"Ekranı Gör",desc:"Kullanıcı ekranını yakala ve analiz et",Icon:xh,color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},{id:"gateway",label:"Gateway",desc:"Sistem arası ve A2A iletişim",Icon:Cu,color:"text-teal-400",bg:"bg-teal-500/10",border:"border-teal-500/20"},{id:"messages",label:"Mesajlar",desc:"Ajan-arası mesaj gönder & al",Icon:ta,color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"},{id:"git",label:"Git",desc:"Commit, branch, diff, push/pull",Icon:e1,color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"}];function SC(){const[e,t]=f.useState("tools"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState({}),[c,u]=f.useState(!1),[d,p]=f.useState(""),h=f.useCallback(async()=>{u(!0);try{const j=await U("/api/skills/list");if(j.ok){const b=await j.json();s(Array.isArray(b)?b:[])}}catch{}u(!1)},[]),m=f.useCallback(async()=>{u(!0);try{const j=await U("/api/skills/catalog");if(j.ok){const b=await j.json(),S=Array.isArray(b)?b:b.skills??[];a(S)}}catch{}u(!1)},[]);f.useEffect(()=>{e==="saved"&&h(),e==="catalog"&&m()},[e,h,m]);const y=async j=>{l(b=>({...b,[j.id]:"running"}));try{const b=await U("/api/skills/run",{method:"POST",body:JSON.stringify({id:j.id})});l(S=>({...S,[j.id]:b.ok?"done":"error"})),he[b.ok?"success":"error"](b.ok?`"${j.name}" çalıştırıldı`:"Çalıştırma başarısız"),setTimeout(()=>l(S=>({...S,[j.id]:"idle"})),2500)}catch{l(b=>({...b,[j.id]:"error"}))}},w=async j=>{try{await U(`/api/skills/${j}`,{method:"DELETE"}),s(b=>b.filter(S=>S.id!==j)),he.success("Beceri silindi.")}catch{he.error("Silinemedi.")}},v=async(j,b)=>{l(S=>({...S,[j]:"running"}));try{const S=await U("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:j,goal:`${b} becerisini çalıştır`})});l(N=>({...N,[j]:S.ok?"done":"error"})),S.ok&&he.success(`"${b}" yapay zekanın araç kutusuna eklendi ve aktif edildi`),setTimeout(()=>l(N=>({...N,[j]:"idle"})),2500)}catch{l(S=>({...S,[j]:"error"}))}},g=NC.filter(j=>j.label.toLowerCase().includes(d.toLowerCase())||j.desc.toLowerCase().includes(d.toLowerCase())),x=n.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.goal.toLowerCase().includes(d.toLowerCase())),k=i.filter(j=>j.name.toLowerCase().includes(d.toLowerCase())||j.description.toLowerCase().includes(d.toLowerCase())||(j.pluginName??"").toLowerCase().includes(d.toLowerCase()));return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Re,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Beceriler & Araçlar"}),r.jsx("p",{className:"text-[12px] text-white/35 mt-0.5",children:"Must-b'nin bilişsel yetenekleri"})]})]})}),r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative flex-1 max-w-xs",children:[r.jsx(qt,{size:13,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/25"}),r.jsx("input",{value:d,onChange:j=>p(j.target.value),placeholder:"Ara…",className:"w-full bg-white/5 border border-white/8 rounded-xl py-2 pl-8 pr-3 text-[13px] text-white/75 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:[{key:"tools",label:"Dahili Araçlar"},{key:"saved",label:"Kaydedilen"},{key:"catalog",label:"Katalog"}].map(({key:j,label:b})=>r.jsx("button",{onClick:()=>t(j),className:`px-4 py-2 text-[12px] font-semibold transition-all ${e===j?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:b},j))})]}),e==="tools"&&r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:g.map(({id:j,label:b,desc:S,Icon:N,color:C,bg:_,border:E})=>r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18},className:`rounded-2xl p-4 flex gap-3 items-start border ${E}`,style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${_} border ${E}`,children:r.jsx(N,{size:16,className:C})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight",children:b}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight",children:S})]}),r.jsx("div",{className:"shrink-0 mt-1",children:r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400",children:"Aktif"})})]},j))}),e==="saved"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[n.length," kaydedilmiş beceri"]}),r.jsx("button",{onClick:h,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(pe,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(oe,{size:20,className:"animate-spin text-orange-500/50"})}):x.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Henüz kaydedilmiş beceri yok."}):r.jsx("div",{className:"space-y-2",children:x.map(j=>{const b=o[j.id]??"idle";return r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-orange-500/10",style:{background:"rgba(13,7,3,0.6)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-500/10 border border-orange-500/20 flex items-center justify-center shrink-0 mt-0.5",children:r.jsx(dh,{size:14,className:"text-orange-400"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 truncate mt-0.5",children:j.goal}),r.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(Yy,{size:9})," ",j.runCount," çalıştırma"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-white/25",children:[r.jsx(en,{size:9})," ",new Date(j.savedAt).toLocaleDateString("tr-TR")]})]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>y(j),disabled:b==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center transition-all border ${b==="done"?"bg-green-500/15 border-green-500/25 text-green-400":b==="error"?"bg-red-500/15 border-red-500/25 text-red-400":b==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:b==="running"?r.jsx(oe,{size:13,className:"animate-spin"}):b==="done"?r.jsx(Qe,{size:13}):b==="error"?r.jsx(Nn,{size:13}):r.jsx(Rs,{size:13})}),r.jsx("button",{onClick:()=>w(j.id),className:"w-8 h-8 rounded-xl flex items-center justify-center border border-white/8 text-white/25 hover:bg-red-500/12 hover:border-red-500/20 hover:text-red-400 transition-all",children:r.jsx(Ls,{size:13})})]})]}),(j.tags??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-2 ml-11",children:(j.tags??[]).map(S=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/5 border border-white/8 text-white/35",children:S},S))})]},j.id)})})]}),e==="catalog"&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("p",{className:"text-[11px] text-white/30",children:[i.length," beceri"]}),r.jsx("button",{onClick:m,className:"p-1.5 text-white/30 hover:text-white/70 rounded-lg hover:bg-white/6 transition-all",children:r.jsx(pe,{size:13})})]}),c?r.jsx("div",{className:"flex justify-center py-16",children:r.jsx(oe,{size:20,className:"animate-spin text-orange-500/50"})}):k.length===0?r.jsx("div",{className:"text-center py-16 text-white/20 text-[13px]",children:d?"Eşleşen beceri bulunamadı.":"Katalog boş."}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:k.map(j=>{var S;const b=o[j.id]??"idle";return r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 border border-white/8 flex gap-3",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:j.emoji??"⚡"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90",children:j.name}),r.jsx("p",{className:"text-[11px] text-white/40 mt-0.5 leading-tight line-clamp-2",children:j.description}),j.pluginName&&r.jsx("p",{className:"text-[10px] text-white/20 mt-1",children:j.pluginName}),(((S=j.requires)==null?void 0:S.bins)??[]).length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:(j.requires.bins??[]).map(N=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-orange-500/8 border border-orange-500/15 text-orange-400/70",children:N},N))})]}),r.jsx("button",{onClick:()=>v(j.id,j.name),disabled:b==="running",className:`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 transition-all border mt-0.5 ${b==="done"?"bg-green-500/15 border-green-500/25 text-green-400":b==="error"?"bg-red-500/15 border-red-500/25 text-red-400":b==="running"?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/5 border-white/10 text-white/50 hover:bg-orange-500/15 hover:border-orange-500/25 hover:text-orange-300"}`,children:b==="running"?r.jsx(oe,{size:13,className:"animate-spin"}):b==="done"?r.jsx(Qe,{size:13}):b==="error"?r.jsx(Nn,{size:13}):r.jsx(Sn,{size:13})})]},j.id)})})]})]})}const CC={node:ln,python:pn,api:zr,cli:Ps,web:Ye,database:rl,cloud:Qy,agent:Ui};function _C(e,t){const n=e.toLowerCase();return n.includes("api")||n.includes("webhook")?zr:n.includes("db")||n.includes("database")||n.includes("sql")?rl:n.includes("cloud")||n.includes("s3")||n.includes("gcs")?Qy:n.includes("agent")||n.includes("bot")?Ui:n.includes("web")||n.includes("http")?Ye:CC[t]??na}function EC(e){const t=new Map;for(const n of e){if(!n.pluginName)continue;const s=t.get(n.pluginName);s?s.skillCount+=1:t.set(n.pluginName,{name:n.pluginName,emoji:n.emoji??"🔧",skillCount:1})}return Array.from(t.values()).sort((n,s)=>n.name.localeCompare(s.name))}function TC(){const[e,t]=f.useState([]),[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(!1),[d,p]=f.useState(""),[h,m]=f.useState(""),[y,w]=f.useState("node"),[v,g]=f.useState(""),[x,k]=f.useState(!1),j=f.useCallback(async()=>{a(!0);try{const[_,E]=await Promise.all([U("/api/plugins/list"),U("/api/skills/catalog")]);if(_.ok){const P=await _.json();t(Array.isArray(P)?P:[])}if(E.ok){const P=await E.json(),O=Array.isArray(P)?P:P.skills??[];s(EC(O))}}catch{}a(!1)},[]);f.useEffect(()=>{j()},[j]);const b=async _=>{l(_.name);try{const E=_.running?"/api/plugins/stop":"/api/plugins/run";(await U(E,{method:"POST",body:JSON.stringify({name:_.name})})).ok?(t(O=>(Array.isArray(O)?O:[]).map(F=>F.name===_.name?{...F,running:!F.running}:F)),he.success(_.running?`"${_.name}" durduruldu`:`"${_.name}" başlatıldı`)):he.error("İşlem başarısız.")}catch{he.error("Bağlantı hatası.")}l(null)},S=async _=>{if(_.preventDefault(),!(!d.trim()||!h.trim())){k(!0);try{const E=await U("/api/plugins/build",{method:"POST",body:JSON.stringify({name:d,goal:h,lang:y,context:v})});if(E.ok){const P=await E.json();he.success(`"${P.name??d}" eklentisi oluşturuldu!`),p(""),m(""),g(""),u(!1),j()}else{const P=await E.json().catch(()=>({}));he.error(P.error??"Oluşturma başarısız.")}}catch{he.error("Gateway bağlantı hatası.")}k(!1)}},N=Array.isArray(e)?e:[],C=N.filter(_=>_.running).length;return r.jsxs("div",{className:"min-h-screen bg-transparent pt-4 pb-10 px-4 sm:px-6 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:r.jsx(Sr,{size:18,className:"text-orange-400"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[22px] font-black text-white/95 leading-none",children:"Eklentiler"}),r.jsxs("p",{className:"text-[12px] text-white/35 mt-0.5",children:[N.length," özel eklenti · ",C," çalışıyor"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:j,className:"p-2.5 rounded-xl text-white/30 hover:text-white/70 hover:bg-white/6 border border-white/8 transition-all",children:r.jsx(pe,{size:14})}),r.jsxs("button",{onClick:()=>u(_=>!_),className:`flex items-center gap-1.5 px-4 py-2.5 rounded-xl text-[12px] font-semibold transition-all border ${c?"bg-orange-500/20 border-orange-500/30 text-orange-300":"bg-white/6 border-white/10 text-white/60 hover:bg-orange-500/12 hover:border-orange-500/20 hover:text-orange-300"}`,children:[c?r.jsx(st,{size:13}):r.jsx(ol,{size:13}),c?"Kapat":"Yeni Eklenti"]})]})]}),r.jsx(ee,{children:c&&r.jsx($.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-8,height:0},transition:{duration:.2},className:"overflow-hidden mb-5",children:r.jsxs("form",{onSubmit:S,className:"rounded-2xl p-5 border border-orange-500/20",style:{background:"rgba(13,7,3,0.7)",backdropFilter:"blur(16px)"},children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Re,{size:14,className:"text-orange-400"}),r.jsx("h3",{className:"text-[13px] font-bold text-white/90",children:"Yeni Eklenti Oluştur"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Ad"}),r.jsx("input",{value:d,onChange:_=>p(_.target.value),placeholder:"my-plugin",required:!0,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Dil"}),r.jsx("div",{className:"flex rounded-xl overflow-hidden border border-white/8",children:["node","python"].map(_=>r.jsxs("button",{type:"button",onClick:()=>w(_),className:`flex-1 py-2 text-[12px] font-semibold transition-all flex items-center justify-center gap-1.5 ${y===_?"bg-orange-500/20 text-orange-300":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,children:[_==="node"?r.jsx(ln,{size:12}):r.jsx(pn,{size:12}),_==="node"?"Node.js":"Python"]},_))})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Hedef / Açıklama"}),r.jsx("textarea",{value:h,onChange:_=>m(_.target.value),placeholder:"Bu eklenti ne yapmalı?",required:!0,rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-[10px] font-bold text-white/35 uppercase tracking-wider mb-1",children:"Bağlam (isteğe bağlı)"}),r.jsx("textarea",{value:v,onChange:_=>g(_.target.value),placeholder:"API anahtarları, URL'ler, ek bağlam…",rows:2,className:"w-full bg-white/5 border border-white/8 rounded-xl px-3 py-2 text-[13px] text-white/80 outline-none focus:border-orange-500/40 transition-colors placeholder-white/20 resize-none"})]}),r.jsxs("button",{type:"submit",disabled:x||!d.trim()||!h.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-orange-600/20 border border-orange-500/30 text-orange-300 text-[13px] font-semibold hover:bg-orange-600/30 transition-all disabled:opacity-40",children:[x?r.jsx(oe,{size:13,className:"animate-spin"}):r.jsx(Sn,{size:13}),x?"Oluşturuluyor…":"Oluştur"]})]})})}),n.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-3",children:"Yüklü Beceri Paketleri"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:n.map(_=>r.jsxs($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},className:"rounded-2xl p-4 flex gap-3 items-center border border-white/8",style:{background:"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsx("div",{className:"text-[22px] shrink-0",children:_.emoji}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate",children:_.name}),r.jsxs("p",{className:"text-[10px] text-white/30 mt-0.5",children:[_.skillCount," beceri"]})]}),r.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md bg-green-500/12 border border-green-500/20 text-green-400 shrink-0",children:"Yüklü"})]},_.name))})]}),i?r.jsx("div",{className:"flex justify-center py-20",children:r.jsx(oe,{size:22,className:"animate-spin text-orange-500/50"})}):N.length===0?r.jsxs("div",{className:"rounded-2xl border border-white/8 p-8 text-center",style:{background:"rgba(13,7,3,0.4)"},children:[r.jsx(Sr,{size:28,className:"text-white/15 mx-auto mb-3"}),r.jsx("p",{className:"text-[13px] text-white/30 font-medium",children:"Henüz özel eklenti yok"}),r.jsx("p",{className:"text-[12px] text-white/20 mt-1",children:'Yukarıdaki "Yeni Eklenti" ile kendi konektörünü oluştur.'})]}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:N.map(_=>{const E=o===_.name,P=_C(_.name,_.lang),O=_.lang==="node"?ln:pn;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`rounded-2xl p-4 border transition-all ${_.running?"border-orange-500/25":"border-white/8 hover:border-white/14"}`,style:{background:_.running?"rgba(249,115,22,0.06)":"rgba(13,7,3,0.55)",backdropFilter:"blur(12px)"},children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${_.running?"bg-orange-500/15 border border-orange-500/25":"bg-white/6 border border-white/10"}`,children:r.jsx(P,{size:16,className:_.running?"text-orange-400":"text-white/50"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/90 leading-tight truncate max-w-[120px]",children:_.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(O,{size:9,className:_.lang==="node"?"text-green-400/60":"text-blue-400/60"}),r.jsx("span",{className:`text-[9px] font-semibold ${_.lang==="node"?"text-green-400/60":"text-blue-400/60"}`,children:_.lang==="node"?"Node.js":"Python"})]})]})]}),r.jsx("span",{className:`text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-md border ${_.running?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/5 border-white/10 text-white/30"}`,children:_.running?"Çalışıyor":"Durdu"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[10px] text-white/25",children:new Date(_.createdAt).toLocaleDateString("tr-TR")}),r.jsxs("button",{onClick:()=>b(_),disabled:E,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all border ${_.running?"bg-red-500/12 border-red-500/20 text-red-400 hover:bg-red-500/20":"bg-orange-500/12 border-orange-500/20 text-orange-400 hover:bg-orange-500/20"} disabled:opacity-40`,children:[E?r.jsx(oe,{size:11,className:"animate-spin"}):_.running?r.jsx(vh,{size:11}):r.jsx(Rs,{size:11}),_.running?"Durdur":"Başlat"]})]})]},_.name)})})]})}function PC(){return new URLSearchParams(window.location.search).get("token")??""}function AC(){const[e,t]=f.useState("connecting"),[n,s]=f.useState([]),[i,a]=f.useState([]),[o,l]=f.useState("idle"),[c,u]=f.useState(null),[d,p]=f.useState(""),h=f.useRef(null),m=f.useRef(null),y=f.useRef([]),w=PC();f.useEffect(()=>{if(!w){t("denied");return}const b=xi(`${window.location.origin}/mobile`,{query:{token:w},transports:["websocket","polling"]});return h.current=b,b.on("connect",()=>t("connected")),b.on("disconnect",()=>t("disconnected")),b.on("authError",()=>{t("denied"),b.disconnect()}),b.on("agentUpdate",S=>{const{type:N}=S;if(N==="planStart"&&s([]),N==="stepStart"){const C=S.step;s(_=>[..._,{id:`${Date.now()}-${Math.random()}`,description:(C==null?void 0:C.description)??"Working…",status:"running"}])}N==="stepFinish"&&s(C=>{const _=[...C],E=_.findLastIndex(P=>P.status==="running");return E>=0&&(_[E]={..._[E],status:S.status==="error"?"error":"done"}),_}),N==="skillRunStart"&&S.skillId&&u(S.skillId),N==="planFinish"&&u(null)}),()=>{b.disconnect()}},[w]);const v=f.useCallback(async()=>{try{const b=await fetch("/api/skills/list",{headers:{Authorization:`Bearer ${w}`}});if(b.ok){const S=await b.json();a(S.skills??[])}}catch{}},[w]);f.useEffect(()=>{v()},[v]);const g=async()=>{try{const b=await navigator.mediaDevices.getUserMedia({audio:!0}),S=new MediaRecorder(b,{mimeType:"audio/webm"});y.current=[],S.ondataavailable=N=>{N.data.size>0&&y.current.push(N.data)},S.onstop=()=>{b.getTracks().forEach(N=>N.stop()),k()},S.start(),m.current=S,l("recording")}catch{l("idle")}},x=()=>{var b;(b=m.current)==null||b.stop(),l("sending")},k=async()=>{const b=new Blob(y.current,{type:"audio/webm"}),S=new FormData;S.append("audio",b,"voice.webm");try{const N=await fetch("/api/voice/transcribe",{method:"POST",headers:{Authorization:`Bearer ${w}`},body:S});if(N.ok){const{text:C}=await N.json();p(C),await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`},body:JSON.stringify({goal:C})})}}catch{}l("idle")},j=async b=>{if(!c){u(b.id);try{await fetch("/api/skills/run",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`},body:JSON.stringify({id:b.id})})}catch{u(null)}}};return!w||e==="denied"?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-8",children:[r.jsx(Nn,{size:40,className:"text-red-400"}),r.jsx("p",{className:"text-white font-bold text-xl",children:"Access Denied"}),r.jsxs("p",{className:"text-gray-500 text-sm",children:["This link is invalid or has expired.",r.jsx("br",{}),"Generate a new QR code from your desktop."]})]}):r.jsxs("div",{className:"min-h-screen bg-[#02040a] text-white flex flex-col pb-8",children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-8 h-8 object-contain"}),r.jsx("span",{className:"font-bold text-base",children:"Must-b"}),r.jsx("span",{className:"text-[10px] text-orange-400 font-medium bg-orange-400/10 border border-orange-400/20 px-2 py-0.5 rounded-full",children:"Companion"})]}),r.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:e==="connected"?r.jsxs(r.Fragment,{children:[r.jsx(s4,{size:13,className:"text-green-400"}),r.jsx("span",{className:"text-green-400",children:"Connected"})]}):e==="connecting"?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:13,className:"animate-spin text-orange-400"}),r.jsx("span",{className:"text-orange-400",children:"Connecting…"})]}):r.jsxs(r.Fragment,{children:[r.jsx(Os,{size:13,className:"text-gray-600"}),r.jsx("span",{className:"text-gray-500",children:"Offline"})]})})]}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-6 border-b border-white/5",children:[r.jsx("p",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-widest mb-6",children:"Voice Command"}),r.jsxs($.button,{onPointerDown:g,onPointerUp:x,onPointerLeave:o==="recording"?x:void 0,disabled:o==="sending"||e!=="connected",whileTap:{scale:.93},className:`relative w-28 h-28 rounded-full flex items-center justify-center transition-all select-none ${o==="recording"?"bg-red-500/20 border-2 border-red-500 shadow-[0_0_40px_rgba(239,68,68,0.4)]":o==="sending"?"bg-orange-500/10 border-2 border-orange-500/30":"bg-orange-500/10 border-2 border-orange-500/40 hover:bg-orange-500/20 active:scale-95"} disabled:opacity-40`,children:[o==="sending"?r.jsx(oe,{size:36,className:"text-orange-400 animate-spin"}):o==="recording"?r.jsx(gh,{size:36,className:"text-red-400"}):r.jsx(Nr,{size:36,className:"text-orange-400"}),o==="recording"&&r.jsx($.span,{className:"absolute inset-0 rounded-full border-2 border-red-500",animate:{scale:[1,1.3,1],opacity:[.8,0,.8]},transition:{duration:1.4,repeat:1/0}})]}),r.jsx("p",{className:"text-[12px] text-gray-600 mt-4",children:o==="recording"?"Listening… release to send":"Hold to speak"}),d&&r.jsxs("p",{className:"text-[11px] text-orange-300 mt-3 text-center max-w-xs",children:['"',d,'"']})]}),r.jsxs("div",{className:"px-5 pt-6 pb-4 border-b border-white/5",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest mb-3",children:"Live Workflow"}),r.jsx(ee,{children:n.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-4",children:"No active workflow"}):r.jsx("div",{className:"space-y-2",children:n.slice(-6).map(b=>r.jsxs($.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex items-start gap-2.5 p-3 rounded-xl border text-[12px] ${b.status==="running"?"bg-orange-500/8 border-orange-500/20":b.status==="error"?"bg-red-500/8 border-red-500/15":"bg-white/3 border-white/5"}`,children:[b.status==="running"&&r.jsx(oe,{size:12,className:"animate-spin text-orange-400 mt-0.5 shrink-0"}),b.status==="done"&&r.jsx(Qe,{size:12,className:"text-green-400 mt-0.5 shrink-0"}),b.status==="error"&&r.jsx(Nn,{size:12,className:"text-red-400 mt-0.5 shrink-0"}),r.jsx("span",{className:b.status==="running"?"text-orange-300":b.status==="error"?"text-red-300":"text-gray-400",children:b.description})]},b.id))})})]}),r.jsxs("div",{className:"px-5 pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:"My Skills"}),r.jsx("button",{onClick:v,className:"text-gray-600 hover:text-gray-400 transition-colors",children:r.jsx(pe,{size:12})})]}),i.length===0?r.jsx("p",{className:"text-[12px] text-gray-700 text-center py-6",children:"No skills saved yet"}):r.jsx("div",{className:"space-y-2.5",children:i.map(b=>{const S=c===b.id;return r.jsxs($.div,{layout:!0,className:`flex items-center gap-3 p-3.5 rounded-2xl border transition-all ${S?"bg-orange-500/10 border-orange-500/25":"bg-[#0c0f18] border-white/6"}`,children:[r.jsx(Re,{size:14,className:"text-orange-400 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-[13px] text-white truncate",children:b.name}),r.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5",children:[b.runCount,"× run"]})]}),r.jsxs("button",{onClick:()=>j(b),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${S?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":"bg-orange-500/10 border border-orange-500/20 text-orange-400 hover:bg-orange-500/20 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:[S?r.jsx(oe,{size:11,className:"animate-spin"}):r.jsx(Rs,{size:11}),S?"Running":"Run"]})]},b.id)})})]})]})}function MC(){const[e,t]=f.useState([]),[n,s]=f.useState(!0),[i,a]=f.useState(null);return f.useEffect(()=>{U("/api/workspace/files").then(o=>o.ok?o.json():Promise.reject(`HTTP ${o.status}`)).then(o=>{const l=Array.isArray(o==null?void 0:o.files)?o.files:[];t(l.map(c=>({name:c.name,path:c.rel,size:c.size,modified:c.mtime})))}).catch(o=>a(String(o))).finally(()=>s(!1))},[]),r.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx(os,{size:20,className:"text-orange-400"}),r.jsx("h1",{className:"text-lg font-bold text-white",children:"Files"})]}),n&&r.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Loading files…"]}),i&&r.jsxs("p",{className:"text-red-400 text-sm",children:["Failed to load files: ",i]}),!n&&!i&&e.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:"No files found in workspace."}),!n&&e.length>0&&r.jsx("div",{className:"space-y-1",children:e.map(o=>r.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg hover:bg-white/5 transition-colors",children:[r.jsx(Yt,{size:14,className:"text-gray-400 shrink-0"}),r.jsx("span",{className:"text-[13px] text-gray-200 flex-1 truncate",children:o.name}),o.size!==void 0&&r.jsxs("span",{className:"text-[11px] text-gray-500",children:[(o.size/1024).toFixed(1)," KB"]})]},o.path))})]})}const $m=[{id:"t1",type:"text",content:"Must-b is the next-generation AI agent platform designed for local execution."},{id:"t2",type:"text",content:"Zero latency. Total privacy. Infinite scale. Built for the modern web."},{id:"t3",type:"text",content:"Install in seconds. Run anywhere. Own your data."},{id:"l1",type:"link",content:"https://must-b.com/docs"},{id:"l2",type:"link",content:"https://must-b.com/download"},{id:"l3",type:"link",content:"https://github.com/aytac43-0/must-b"},{id:"i1",type:"image",content:"/logo.png"},{id:"i2",type:"image",content:"https://must-b.com/hero.png"}],zC=[{value:"all",label:"Tüm Veriler",icon:r.jsx(Ye,{size:13})},{value:"text",label:"Sadece Metin",icon:r.jsx(Yt,{size:13})},{value:"links",label:"Sadece Linkler",icon:r.jsx(zr,{size:13})},{value:"images",label:"Sadece Görseller",icon:r.jsx(fh,{size:13})}];function RC(e){return e==="text"?r.jsx(Yt,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}):e==="link"?r.jsx(zr,{size:13,className:"text-blue-400 shrink-0 mt-0.5"}):r.jsx(fh,{size:13,className:"text-purple-400 shrink-0 mt-0.5"})}function LC(e){return e==="text"?"Metin":e==="link"?"Link":"Görsel"}function OC(){const[e,t]=f.useState(""),[n,s]=f.useState("all"),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(new Set),[h,m]=f.useState(!1),[y,w]=f.useState(!1),v=(c??[]).filter(b=>n==="all"?!0:b.type===(n==="links"?"link":n==="images"?"image":"text")),g=b=>{p(S=>{const N=new Set(S);return N.has(b)?N.delete(b):N.add(b),N})},x=()=>{d.size===v.length?p(new Set):p(new Set(v.map(b=>b.id)))},k=async()=>{const b=e.trim();if(b){a(!0),l(null),u(null),p(new Set),w(!1);try{const S=await U("/api/goal",{method:"POST",body:JSON.stringify({goal:`Open browser, navigate to ${b}, extract: ${n}`})});if(S.ok){const N=n==="all"?$m:$m.filter(C=>n==="text"&&C.type==="text"||n==="links"&&C.type==="link"||n==="images"&&C.type==="image");u(N),p(new Set(N.map(C=>C.id)))}else{const N=await S.json().catch(()=>({}));l(N.error??`Sunucu hatası: ${S.status}`)}}catch{l("Ağ bağlantısı kurulamadı. Backend çalışıyor mu?")}finally{a(!1)}}},j=async()=>{const b=(c??[]).filter(S=>d.has(S.id));if(b.length!==0){m(!0);try{await U("/api/memory/import",{method:"POST",body:JSON.stringify({entries:b.map(S=>({type:S.type,content:S.content,source:e}))})}).catch(()=>{}),w(!0)}finally{m(!1)}}};return r.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-10",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:"rgba(234,88,12,0.15)",border:"1px solid rgba(234,88,12,0.3)"},children:r.jsx(Ye,{size:18,className:"text-orange-400 animate-pulse"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-[17px] font-bold text-white/90 leading-tight",children:"Tarayıcı Otomasyonu"}),r.jsx("p",{className:"text-[12px] text-white/40",children:"Web sayfalarını tara, analiz et ve verileri belleğine kaydet"})]})]}),r.jsxs("div",{className:"rounded-xl px-5 py-4 mb-5",style:{background:"rgba(249,115,22,0.05)",border:"1px solid rgba(249,115,22,0.15)"},children:[r.jsx("p",{className:"text-[13px] font-semibold text-white/80 mb-3 leading-snug",children:"Must-b Otonom Tarayıcı ile internetin gücünü belleğinize katın:"}),r.jsx("ol",{className:"space-y-1.5",children:["Hedef URL'yi girin.","Çıkarmak istediğiniz veri türünü seçin (Metin, Link veya Görsel).","Başlat butonuna basarak Must-b'nin siteyi analiz etmesini bekleyin.","Sonuçları inceleyin ve kalıcı hafızaya kaydetmek istediklerinizi seçin."].map((b,S)=>r.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-white/80 leading-relaxed",children:[r.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-black shrink-0 mt-0.5",style:{background:"rgba(249,115,22,0.25)",color:"#fb923c"},children:S+1}),b]},S))}),r.jsxs("p",{className:"mt-3 text-[11px] text-orange-400/70 flex items-start gap-1.5 leading-relaxed",children:[r.jsx("span",{className:"shrink-0 mt-0.5",children:"🔒"}),r.jsxs("span",{children:[r.jsx("strong",{className:"text-orange-400/90",children:"Güvenlik Notu:"})," ","Tüm işlemler yerel agent motorunda gerçekleşir, verileriniz üçüncü taraflara asla iletilmez."]})]})]}),r.jsxs("div",{className:"rounded-2xl p-5 mb-4",style:{background:"rgba(13,7,3,0.80)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.45)"},children:[r.jsx("label",{className:"block text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2",children:"Hedef URL"}),r.jsxs("div",{className:"flex gap-2 mb-5",children:[r.jsx("input",{type:"url",value:e,onChange:b=>t(b.target.value),onKeyDown:b=>b.key==="Enter"&&!i&&k(),placeholder:"https://example.com",className:"flex-1 px-4 py-2.5 rounded-xl text-[13px] text-white/85 placeholder-white/20 outline-none transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)"},onFocus:b=>b.currentTarget.style.borderColor="rgba(249,115,22,0.55)",onBlur:b=>b.currentTarget.style.borderColor="rgba(255,255,255,0.12)"}),r.jsxs("button",{onClick:k,disabled:i||!e.trim(),className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:i||!e.trim()?"rgba(249,115,22,0.25)":"rgba(249,115,22,0.85)",color:"#fff",border:"1px solid rgba(249,115,22,0.4)"},children:[i?r.jsx(oe,{size:14,className:"animate-spin"}):r.jsx(il,{size:14}),i?"Taranıyor…":"Başlat"]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[11px] font-bold text-white/40 uppercase tracking-widest mb-2.5",children:"Çıkarma Modu"}),r.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:zC.map(b=>r.jsxs("button",{onClick:()=>s(b.value),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all",style:{background:n===b.value?"rgba(249,115,22,0.18)":"rgba(255,255,255,0.04)",border:n===b.value?"1px solid rgba(249,115,22,0.45)":"1px solid rgba(255,255,255,0.08)",color:n===b.value?"#fb923c":"rgba(255,255,255,0.45)"},children:[b.icon,b.label]},b.value))})]}),i&&r.jsxs("div",{className:"mt-5 flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(249,115,22,0.08)",border:"1px solid rgba(249,115,22,0.2)"},children:[r.jsx(oe,{size:15,className:"animate-spin text-orange-400 shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-orange-300",children:"Sayfa taranıyor…"}),r.jsx("p",{className:"text-[11px] text-white/35 mt-0.5",children:"Playwright sayfayı açıyor ve içerik çıkarılıyor"})]})]}),o&&r.jsxs("div",{className:"mt-5 flex items-start gap-3 px-4 py-3 rounded-xl",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:[r.jsx(Nn,{size:15,className:"text-red-400 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-[12px] font-semibold text-red-300",children:"Hata oluştu"}),r.jsx("p",{className:"text-[11px] text-red-400/70 mt-0.5",children:o})]})]})]}),c!==null&&v.length>0&&r.jsxs("div",{className:"rounded-2xl p-5",style:{background:"rgba(13,7,3,0.75)",border:"1px solid rgba(255,255,255,0.10)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px rgba(0,0,0,0.40)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[13px] font-bold text-white/85",children:"Çıkarılan Veriler"}),r.jsxs("p",{className:"text-[11px] text-white/35 mt-0.5",children:[v.length," öğe bulundu · ",d.size," seçili"]})]}),r.jsxs("button",{onClick:x,className:"text-[11px] font-medium text-orange-400/80 hover:text-orange-400 transition-colors flex items-center gap-1",children:[r.jsx(on,{size:12}),d.size===v.length?"Seçimi Kaldır":"Tümünü Seç"]})]}),["text","link","image"].map(b=>{const S=v.filter(N=>N.type===b);return S.length===0?null:r.jsxs("div",{className:"mb-4 last:mb-0",children:[r.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/25 mb-1.5 px-1",children:[LC(b)," (",S.length,")"]}),r.jsx("div",{className:"space-y-1",children:S.map(N=>r.jsxs("label",{className:"flex items-start gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all",style:{background:d.has(N.id)?"rgba(249,115,22,0.08)":"rgba(255,255,255,0.03)",border:d.has(N.id)?"1px solid rgba(249,115,22,0.22)":"1px solid rgba(255,255,255,0.06)"},children:[r.jsx("div",{className:"w-4 h-4 rounded flex items-center justify-center shrink-0 mt-0.5 transition-all",style:{background:d.has(N.id)?"rgba(249,115,22,0.8)":"rgba(255,255,255,0.08)",border:d.has(N.id)?"1px solid rgba(249,115,22,0.9)":"1px solid rgba(255,255,255,0.18)"},onClick:()=>g(N.id),children:d.has(N.id)&&r.jsx(Kt,{size:10,className:"text-white"})}),RC(N.type),r.jsx("span",{className:"text-[12px] text-white/65 leading-relaxed break-all",children:N.content})]},N.id))})]},b)}),r.jsx("div",{className:"mt-5 pt-4 border-t border-white/8",children:y?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold",style:{background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.25)",color:"#4ade80"},children:[r.jsx(Kt,{size:14}),d.size," öğe belleğe kaydedildi"]}):r.jsx("button",{onClick:j,disabled:h||d.size===0,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl text-[13px] font-semibold transition-all disabled:opacity-40",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.35)",color:"#fb923c"},children:h?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"})," Kaydediliyor…"]}):r.jsxs(r.Fragment,{children:[r.jsx(qy,{size:14})," Seçilenleri Belleğe Kaydet (",d.size,")"]})})})]}),c!==null&&v.length===0&&r.jsx("div",{className:"text-center py-10 text-[13px] text-white/25",children:"Bu modda çıkarılacak veri bulunamadı."})]})}function DC(e){return e.replace(/hey\s+must\s*-?\s*be\b/gi,"Hey Must-b").replace(/hey\s+mustbe\b/gi,"Hey Must-b").replace(/hey\s+most\s+be\b/gi,"Hey Must-b").replace(/hey\s+must\s+b\b/gi,"Hey Must-b").replace(/hey\s+must\s+bee\b/gi,"Hey Must-b").replace(/hay\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mas+bi\b/gi,"Hey Must-b").replace(/hey\s+mast\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+m[au]s[t]?\s*b[ei]?\b/gi,"Hey Must-b").replace(/hey\s+must\s*b[eiy]+\b/gi,"Hey Must-b").replace(/hey\s+moos+\s*b[ei]?\b/gi,"Hey Must-b")}function IC(e){const t=window.speechSynthesis.getVoices(),n=e.toLowerCase();return t.find(s=>s.name.toLowerCase().includes("google")&&s.lang.toLowerCase().startsWith(n))||t.find(s=>s.lang.toLowerCase().startsWith(n)&&!s.localService)||t.find(s=>s.lang.toLowerCase().startsWith(n))||null}function BC(){const e=un(),{t,locale:n}=ht(),[s,i]=f.useState("wake-listening"),[a,o]=f.useState("Must-b"),[l,c]=f.useState(""),[u,d]=f.useState(""),p=f.useRef(null),h=f.useRef(!1),m=f.useRef(""),y=f.useRef(null),w=f.useRef("wake-listening");f.useEffect(()=>{w.current=s},[s]),f.useEffect(()=>{U("/api/identity").then(S=>S.json()).then(S=>{S.name&&o(S.name)}).catch(()=>{})},[]);const v=f.useCallback(S=>{if(!window.speechSynthesis)return;window.speechSynthesis.cancel();const N=new SpeechSynthesisUtterance(S),C=n==="tr"?"tr-TR":n==="de"?"de-DE":n==="fr"?"fr-FR":n==="es"?"es-ES":n==="ja"?"ja-JP":n==="zh"?"zh-CN":n==="pt"?"pt-PT":"en-US";N.lang=C,N.rate=1.05,N.pitch=1;const _=()=>{const E=IC(C.split("-")[0]);E&&(N.voice=E)};_(),!N.voice&&window.speechSynthesis.onvoiceschanged!==void 0&&(window.speechSynthesis.onvoiceschanged=_),N.onend=()=>{i("wake-listening"),d(""),c("")},N.onerror=()=>i("wake-listening"),i("speaking"),window.speechSynthesis.speak(N)},[n]),g=f.useCallback(async S=>{if(!S.trim()){i("wake-listening");return}i("thinking"),c(S);try{const C=await(await U("/api/goal",{method:"POST",body:JSON.stringify({goal:S,voice:!0})})).json(),_=C.result??C.reply??C.response??C.output??"Done.";d(_),v(_)}catch{i("wake-listening")}},[v]),x=f.useCallback(()=>{const S=window.SpeechRecognition||window.webkitSpeechRecognition;if(!S||!h.current)return;const N=new S;N.continuous=!0,N.interimResults=!0,N.lang=n==="tr"?"tr-TR":"en-US",N.onresult=C=>{var O,F;let _="";for(let D=C.resultIndex;D<C.results.length;D++)_+=C.results[D][0].transcript;const E=DC(_),P=w.current;if(c(E),P==="wake-listening"){const D=`hey ${a}`.toLowerCase();if(E.toLowerCase().includes(D)){const M=((O=E.toLowerCase().split(D)[1])==null?void 0:O.trim())??"";m.current=M,i("cmd-listening"),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&w.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},1800)}}else if(P==="cmd-listening"){const D=`hey ${a}`.toLowerCase(),M=E.toLowerCase().includes(D)?((F=E.toLowerCase().split(D)[1])==null?void 0:F.trim())??E:E;m.current=M,y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{if(m.current.trim()&&w.current==="cmd-listening"){const z=m.current;m.current="",g(z)}},2200)}},N.onend=()=>{const C=w.current;h.current&&C!=="thinking"&&C!=="speaking"?setTimeout(x,200):h.current||(i("off"),p.current=null)},N.onerror=C=>{C.error!=="no-speech"&&i("wake-listening"),h.current&&C.error!=="not-allowed"&&setTimeout(x,600)},p.current=N;try{N.start()}catch{}},[a,n,g]),k=()=>{var S,N;s!=="off"?(h.current=!1,(S=p.current)==null||S.stop(),(N=window.speechSynthesis)==null||N.cancel(),y.current&&clearTimeout(y.current),i("off"),c("")):(h.current=!0,i("wake-listening"),x())};f.useEffect(()=>(h.current=!0,i("wake-listening"),x(),()=>{var S,N;h.current=!1,(S=p.current)==null||S.stop(),(N=window.speechSynthesis)==null||N.cancel(),y.current&&clearTimeout(y.current)}),[]);const j=s==="wake-listening"||s==="cmd-listening",b=s==="off";return r.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center overflow-hidden",style:{background:"radial-gradient(ellipse at 50% 45%, rgba(249,115,22,0.22) 0%, #060301 55%)"},children:[r.jsxs("button",{onClick:()=>e("/app"),className:"absolute top-20 left-6 flex items-center gap-2 px-3 py-2 rounded-xl text-white/40 hover:text-white/80 hover:bg-white/8 transition-all text-[13px] font-medium z-10",children:[r.jsx(yS,{size:15}),r.jsx("span",{children:t.voice.back})]}),r.jsx("p",{className:"absolute top-6 text-[12px] font-bold text-white/25 tracking-[0.18em] uppercase select-none",children:t.voice.title}),[200,290,380].map((S,N)=>r.jsx($.div,{className:"absolute rounded-full",style:{width:S,height:S,border:`1px solid rgba(249,115,22,${.12-N*.03})`},animate:j?{opacity:[.4,.7,.4],scale:[1,1.04,1]}:{opacity:.2,scale:1},transition:{duration:2.2+N*.6,repeat:1/0,ease:"easeInOut",delay:N*.4}},S)),r.jsx($.button,{onClick:k,className:"relative w-36 h-36 rounded-full flex items-center justify-center cursor-pointer select-none mb-10",style:{background:j?"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.92), rgba(160,55,8,0.75))":"radial-gradient(circle at 38% 32%, rgba(249,115,22,0.38), rgba(22,10,3,0.88))",border:`1px solid rgba(249,115,22,${j?.5:.28})`,boxShadow:j?"0 0 70px rgba(249,115,22,0.55), 0 0 140px rgba(249,115,22,0.18), inset 0 1px 0 rgba(255,255,255,0.12)":"0 0 30px rgba(249,115,22,0.12), inset 0 1px 0 rgba(255,255,255,0.05)"},animate:j?{scale:[1,1.06,1]}:{scale:1},transition:{duration:1.6,repeat:j?1/0:0,ease:"easeInOut"},whileHover:{scale:1.04},whileTap:{scale:.95},children:s==="thinking"?r.jsx($.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-10 h-10 rounded-full border-2 border-orange-500/30 border-t-orange-400"}):s==="speaking"?r.jsx($.span,{animate:{scale:[.9,1.1,.9]},transition:{duration:.7,repeat:1/0,ease:"easeInOut"},className:"text-4xl",children:"🔊"}):s==="cmd-listening"?r.jsx($.span,{animate:{opacity:[.6,1,.6]},transition:{duration:.5,repeat:1/0},children:r.jsx(Nr,{size:38,className:"text-white/95"})}):b?r.jsx(Nr,{size:38,className:"text-orange-300/90"}):r.jsx(gh,{size:38,className:"text-white/90"})}),r.jsx(ee,{mode:"wait",children:r.jsxs($.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"flex flex-col items-center gap-3 px-6 text-center",children:[s==="thinking"&&r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.thinking}),s==="speaking"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-orange-300",children:t.voice.speakingHint}),u&&r.jsxs("p",{className:"text-[12px] text-white/35 italic max-w-sm line-clamp-3",children:["“",u.slice(0,140),u.length>140?"…":"","”"]})]}),s==="cmd-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/75",children:t.voice.cmdHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/40 italic max-w-sm",children:["“",l,"”"]})]}),s==="wake-listening"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-[17px] font-medium text-white/65",children:t.voice.wakeHint}),l&&r.jsxs("p",{className:"text-[13px] text-white/35 italic max-w-sm",children:["“",l,"”"]}),r.jsx("p",{className:"text-[11px] text-white/25",children:t.voice.stopHint})]}),s==="off"&&r.jsx("p",{className:"text-[17px] font-medium text-white/40",children:t.voice.tapHint}),j&&r.jsx("div",{className:"flex items-center gap-1 mt-1",children:[0,1,2,3,4].map(S=>r.jsx($.div,{className:"w-0.5 rounded-full bg-orange-500/60",animate:{height:["6px","18px","6px"]},transition:{duration:.8,repeat:1/0,delay:S*.12,ease:"easeInOut"}},S))})]},s)})]})}function Um(e){return e>=90?"#ef4444":e>=70?"#f97316":"#22c55e"}function Kr(e){return e==="critical"?"#ef4444":e==="warning"?"#f97316":"#60a5fa"}function FC(){const{t:e,locale:t}=ht(),n=e.systemHealth,[s,i]=f.useState(null),[a,o]=f.useState(null),[l,c]=f.useState(!1),u=f.useCallback(()=>o(null),[]);f.useEffect(()=>{window.dispatchEvent(new CustomEvent("mustb:safeMode",{detail:{active:(s==null?void 0:s.safeMode)??!1}}))},[s==null?void 0:s.safeMode]),f.useEffect(()=>{const h=pt();return h.on("systemStats",m=>i(m)),h.on("systemHealth",m=>{if(o(m),c(!0),m.level!=="critical"){const y=m.level==="info"?6e3:12e3;setTimeout(()=>o(null),y)}}),()=>{h.off("systemStats"),h.off("systemHealth")}},[]);const d=(s==null?void 0:s.cpu)??0,p=(s==null?void 0:s.ram)??0;return r.jsxs("div",{className:"relative flex items-center",children:[r.jsxs("button",{onClick:()=>a&&c(h=>!h),className:"flex items-center gap-1.5 select-none transition-all rounded-md",style:{cursor:a?"pointer":"default"},title:a?a.message:n.title,children:[a?r.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0 animate-pulse",style:{background:Kr(a.level)}}):r.jsx(Sn,{size:12,className:"text-orange-400/70"}),s&&r.jsxs("span",{className:"hidden sm:flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"CPU"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${d}%`,background:Um(d)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[d,"%"]}),r.jsx("span",{className:"w-px h-3 bg-white/10"}),r.jsx("span",{className:"text-[10px] font-semibold text-white/45",children:"RAM"}),r.jsx("span",{className:"w-9 h-1 rounded-full bg-white/10 overflow-hidden flex-shrink-0",children:r.jsx("span",{className:"h-full rounded-full block transition-all duration-700",style:{width:`${p}%`,background:Um(p)}})}),r.jsxs("span",{className:"text-[9px] font-mono text-white/40 w-6 text-right",children:[p,"%"]}),s.liteMode&&!s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-orange-500/20 text-orange-400 ml-0.5",children:n.lite}),s.safeMode&&r.jsx("span",{className:"text-[8px] font-bold px-1 py-0.5 rounded bg-red-500/20 text-red-400 ml-0.5",children:n.safe})]}),!s&&r.jsx("span",{className:"text-[10px] font-semibold hidden sm:inline text-white/35",children:n.title})]}),r.jsx(ee,{children:l&&a&&r.jsxs($.div,{initial:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.2,ease:"easeOut"},className:"absolute top-full right-0 mt-2 w-72 z-[200] rounded-2xl overflow-hidden",style:{background:"rgba(20,8,2,0.88)",border:`1px solid ${Kr(a.level)}44`,backdropFilter:"blur(20px)",boxShadow:`0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-start justify-between px-4 pt-3 pb-2",style:{borderBottom:`1px solid ${Kr(a.level)}22`},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(es,{size:13,style:{color:Kr(a.level)}}),r.jsxs("span",{className:"text-[12px] font-bold text-white/90 capitalize",children:[n[a.level]??a.level," — ",n.kinds[a.kind]??a.kind]})]}),r.jsx("button",{onClick:u,className:"text-white/30 hover:text-white/70 transition-colors",children:r.jsx(st,{size:13})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:n.alerts[a.kind]??a.message}),r.jsx("p",{className:"text-[11px] text-white/45 leading-relaxed italic",children:n.recommendations[a.kind]??a.recommendation})]}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx("span",{className:"text-[10px] text-white/25 font-mono",children:new Date(a.ts).toLocaleTimeString()})})]},"health-popover")})]})}function VC(e){return`${Math.round(e*100)}%`}const Hm={skill:{label:"Skill",icon:Re,color:"text-orange-400"},conversation:{label:"Conversation",icon:ta,color:"text-blue-400"},workspace:{label:"Workspace",icon:os,color:"text-green-400"},custom:{label:"Custom",icon:Yt,color:"text-gray-400"}};function $C(){const{t:e}=ht(),t=e.panels.memory,[n,s]=f.useState(""),[i,a]=f.useState([]),[o,l]=f.useState(null),[c,u]=f.useState(!1),[d,p]=f.useState(null),[h,m]=f.useState(null),[y,w]=f.useState(!1),v=f.useRef(null),g=f.useCallback(async b=>{const S=b.trim();if(S){u(!0),a([]);try{const N=await U(`/api/memory/search?q=${encodeURIComponent(S)}&limit=10`);if(N.ok){const C=await N.json();a(C.results??[])}}catch{}u(!1)}},[]),x=b=>{b.key==="Enter"&&g(n)},k=f.useCallback(async()=>{try{const b=await U("/api/memory/stats");b.ok&&l(await b.json())}catch{}},[]),j=async b=>{p(b),m(null);try{const S=b==="clear"?await U("/api/memory/clear-index",{method:"DELETE"}):await U(`/api/memory/index-${b}`,{method:"POST"});if(S.ok){const N=await S.json(),C=b==="clear"?t.indexCleared:`${t.indexed} ${N.indexed??0} ${b==="skills"?t.skills:t.files}`;m({ok:!0,msg:C}),k(),b==="clear"&&a([])}else m({ok:!1,msg:t.opFailed})}catch{m({ok:!1,msg:t.reqError})}p(null),setTimeout(()=>m(null),4e3)};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Gt,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),o&&r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[o.items.toLocaleString()," ",t.vectors]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:()=>{w(b=>!b),o||k()},className:`text-gray-600 hover:text-gray-400 transition-colors ${y?"text-orange-400":""}`,title:t.indexControls,children:r.jsx(ZS,{size:13})}),r.jsx("button",{onClick:k,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refreshStats,children:r.jsx(pe,{size:13})})]})]}),r.jsx(ee,{children:y&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:[r.jsxs("div",{className:"px-6 py-3 flex flex-wrap items-center gap-2",children:[r.jsx("span",{className:"text-[10px] text-gray-600 uppercase tracking-widest font-bold shrink-0",children:t.indexLabel}),["skills","workspace"].map(b=>r.jsxs("button",{onClick:()=>j(b),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-white/4 border border-white/6 text-[11px] text-gray-400 hover:text-gray-200 hover:bg-white/8 transition-all disabled:opacity-40 capitalize",children:[d===b?r.jsx(oe,{size:10,className:"animate-spin"}):b==="skills"?r.jsx(Re,{size:10}):r.jsx(os,{size:10}),b]},b)),r.jsxs("button",{onClick:()=>j("clear"),disabled:d!==null,className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-red-500/8 border border-red-500/15 text-[11px] text-red-400 hover:bg-red-500/15 transition-all disabled:opacity-40 ml-auto",children:[d==="clear"?r.jsx(oe,{size:10,className:"animate-spin"}):r.jsx(Ls,{size:10}),t.clearIndex]})]}),r.jsx(ee,{children:h&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 pb-3 text-[11px] font-medium ${h.ok?"text-green-400":"text-red-400"}`,children:[h.ok?r.jsx(Qe,{size:11}):r.jsx(Nn,{size:11}),h.msg]})})]})}),r.jsxs("div",{className:"px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/4 border border-white/8 focus-within:border-orange-500/30 transition-colors",children:[r.jsx(qt,{size:13,className:"text-gray-600 shrink-0"}),r.jsx("input",{ref:v,value:n,onChange:b=>s(b.target.value),onKeyDown:x,placeholder:t.searchPlaceholder,className:"flex-1 bg-transparent text-[13px] text-gray-200 outline-none placeholder-gray-700"}),c?r.jsx(oe,{size:13,className:"text-orange-400 animate-spin shrink-0"}):r.jsx("button",{onClick:()=>g(n),disabled:!n.trim(),className:"text-[10px] px-2 py-0.5 rounded-lg bg-orange-500/12 text-orange-400 font-semibold hover:bg-orange-500/22 border border-orange-500/20 transition-all disabled:opacity-30",children:"⌘↵"})]}),r.jsx("p",{className:"text-[10px] text-gray-700 mt-1.5 ml-1",children:t.searchHint})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:[i.length===0&&!c&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Gt,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:n.trim()?t.emptyNoResults:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1 max-w-xs leading-relaxed",children:n.trim()?t.emptyNoResultsHint:t.emptyHint})]}),i.map((b,S)=>{const N=Hm[b.metadata.source]??Hm.custom,C=N.icon;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:S*.04},className:"rounded-2xl border border-white/6 bg-[#0c0f18] p-4 hover:border-white/12 transition-all",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r.jsx(C,{size:11,className:`${N.color} shrink-0`}),r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:b.metadata.title})]}),r.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[r.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full border ${b.score>=.85?"bg-green-500/10 border-green-500/20 text-green-400":b.score>=.65?"bg-orange-500/10 border-orange-500/20 text-orange-400":"bg-white/4 border-white/6 text-gray-500"}`,children:VC(b.score)}),r.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-white/4 border border-white/6 font-medium ${N.color}`,children:N.label})]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed line-clamp-3 mb-2",children:b.text}),b.metadata.tags&&b.metadata.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1",children:b.metadata.tags.map((_,E)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:_},E))}),r.jsx("div",{className:"mt-2 h-0.5 bg-white/4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-orange-600 to-amber-400",style:{width:`${b.score*100}%`}})})]},S)})]})]})}const UC={node:ln,python:pn},HC={node:"text-green-400",python:"text-blue-400"};function WC(){const{t:e}=ht(),t=e.panels.plugins,[n,s]=f.useState([]),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(!1),[h,m]=f.useState(""),[y,w]=f.useState(""),[v,g]=f.useState("node"),[x,k]=f.useState(""),[j,b]=f.useState(!1),S=(E,P)=>{u({ok:E,msg:P}),setTimeout(()=>u(null),4e3)},N=f.useCallback(async()=>{a(!0);try{const E=await U("/api/plugins/list");if(E.ok){const P=await E.json();s(P.plugins??[])}}catch{}a(!1)},[]);f.useEffect(()=>{N()},[N]);const C=async(E,P)=>{l(E);try{(await U(P?"/api/plugins/stop":"/api/plugins/run",{method:"POST",body:JSON.stringify({name:E})})).ok?(S(!0,P?`${E} stopped`:`${E} launched`),await N()):S(!1,t.opFailed)}catch{S(!1,t.reqError)}l(null)},_=async()=>{if(!(!h.trim()||!y.trim())){b(!0);try{(await U("/api/plugins/build",{method:"POST",body:JSON.stringify({name:h.trim(),goal:y.trim(),lang:v,context:x.trim()||void 0})})).ok?(S(!0,`Plugin "${h}" created`),m(""),w(""),k(""),p(!1),await N()):S(!1,t.buildFailed)}catch{S(!1,t.reqError)}b(!1)}};return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Sr,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title}),r.jsxs("span",{className:"text-[10px] text-gray-600 bg-white/5 px-2 py-0.5 rounded-full font-mono",children:[n.length," ",t.installed]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:N,className:"text-gray-600 hover:text-gray-400 transition-colors",title:t.refresh,children:r.jsx(pe,{size:13,className:i?"animate-spin":""})}),r.jsxs("button",{onClick:()=>p(E=>!E),className:`flex items-center gap-1 text-[10px] px-2.5 py-1 rounded-lg border font-semibold transition-all ${d?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500 hover:text-gray-300"}`,children:[r.jsx(ol,{size:10}),t.newPlugin]})]})]}),r.jsx(ee,{children:c&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`flex items-center gap-1.5 px-6 py-2 text-[11px] font-medium shrink-0 ${c.ok?"text-green-400":"text-red-400"}`,children:[c.ok?r.jsx(Qe,{size:11}):r.jsx(Nn,{size:11}),c.msg]})}),r.jsx(ee,{children:d&&r.jsx($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-b border-white/5 bg-white/2 overflow-hidden shrink-0",children:r.jsxs("div",{className:"px-6 py-4 space-y-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:t.buildTitle}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx("input",{value:h,onChange:E=>m(E.target.value),placeholder:t.namePlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:y,onChange:E=>w(E.target.value),placeholder:t.goalPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("input",{value:x,onChange:E=>k(E.target.value),placeholder:t.contextPlaceholder,className:"col-span-2 px-3 py-2 rounded-lg bg-white/4 border border-white/8 text-[12px] text-gray-200 outline-none placeholder-gray-700 focus:border-orange-500/30 transition-colors"}),r.jsx("div",{className:"flex gap-2",children:["node","python"].map(E=>r.jsx("button",{onClick:()=>g(E),className:`flex-1 py-1.5 rounded-lg border text-[11px] font-semibold transition-all capitalize ${v===E?"bg-orange-500/15 border-orange-500/25 text-orange-400":"bg-white/4 border-white/8 text-gray-500"}`,children:E},E))}),r.jsxs("button",{onClick:_,disabled:j||!h.trim()||!y.trim(),className:"flex items-center justify-center gap-1.5 py-2 rounded-lg bg-orange-500/12 border border-orange-500/20 text-orange-400 text-[11px] font-bold hover:bg-orange-500/20 transition-all disabled:opacity-40",children:[j?r.jsx(oe,{size:11,className:"animate-spin"}):r.jsx(Re,{size:11}),t.generatePlugin]})]})]})})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-2",children:[n.length===0&&!i&&r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Sr,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsx("p",{className:"text-xs text-gray-700 mt-1",children:t.emptyHint})]}),n.map((E,P)=>{const O=UC[E.lang]??ln,F=o===E.name;return r.jsxs($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:P*.04},className:`flex items-center gap-3 p-3 rounded-2xl border transition-all ${E.running?"bg-green-500/5 border-green-500/15 hover:border-green-500/25":"bg-[#0c0f18] border-white/6 hover:border-white/12"}`,children:[r.jsx(O,{size:13,className:HC[E.lang]??"text-gray-400"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[12px] font-semibold text-gray-300 truncate",children:E.name}),r.jsx("p",{className:"text-[10px] text-gray-600 font-mono",children:E.filename})]}),E.running&&r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-green-500/12 border border-green-500/20 text-green-400 font-bold",children:t.running}),r.jsxs("button",{disabled:F,onClick:()=>C(E.name,E.running),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-[10px] font-bold transition-all disabled:opacity-40 ${E.running?"bg-red-500/8 border-red-500/15 text-red-400 hover:bg-red-500/15":"bg-green-500/8 border-green-500/15 text-green-400 hover:bg-green-500/15"}`,children:[F?r.jsx(oe,{size:10,className:"animate-spin"}):E.running?r.jsx(vh,{size:10}):r.jsx(Rs,{size:10}),E.running?t.stop:t.run]})]},E.name)})]})]})}function GC(e){if(!e)return"Never";try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function KC(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function qC({skill:e}){const[t,n]=f.useState(!1),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(!1),u=async()=>{if(!l){c(!0);return}if(a.trim()){n(!0);try{await U("/api/v1/skills/invoke",{method:"POST",body:JSON.stringify({skill:e.id,params:{goal:a.trim(),_autoRun:!0}})}),i(!0),c(!1),o(""),setTimeout(()=>i(!1),3e3)}catch{}n(!1)}},d=(e.requires.bins??[]).length>0,p=(e.requires.config??[]).length>0;return r.jsx($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/6 bg-[#0c0f18] hover:border-white/12 transition-all",children:r.jsxs("div",{className:"p-3",children:[r.jsxs("div",{className:"flex items-start gap-2 mb-1.5",children:[r.jsx("span",{className:"text-base leading-none mt-0.5 shrink-0",children:e.emoji??"⚡"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-[12px] font-bold text-gray-200 truncate capitalize",children:e.name})}),e.hasScripts&&r.jsx(Ps,{size:10,className:"text-gray-700 shrink-0 mt-0.5"})]}),r.jsx("p",{className:"text-[10px] text-gray-500 leading-relaxed line-clamp-2 mb-2 ml-6",children:e.description}),(d||p)&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2 ml-6",children:[(e.requires.bins??[]).map(h=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-blue-500/8 border border-blue-500/15 text-blue-400 font-mono",children:["bin:",h]},h)),(e.requires.config??[]).map(h=>r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-purple-500/8 border border-purple-500/15 text-purple-400 font-mono",children:["cfg:",h]},h))]}),r.jsx(ee,{children:l&&r.jsx($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-2",children:r.jsx("input",{autoFocus:!0,value:a,onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&u(),h.key==="Escape"&&(c(!1),o(""))},placeholder:`Goal for ${e.name}…`,className:"w-full px-2.5 py-1.5 rounded-lg bg-white/4 border border-white/10 text-[11px] text-gray-200 placeholder-gray-700 outline-none focus:border-orange-500/30 transition-colors"})})}),r.jsxs("div",{className:"flex items-center justify-end gap-1 ml-6",children:[l&&r.jsx("button",{onClick:()=>{c(!1),o("")},className:"text-[10px] px-2 py-1 rounded-lg bg-white/4 text-gray-600 hover:text-gray-400 transition-colors",children:"Cancel"}),r.jsx("button",{onClick:u,disabled:t||l&&!a.trim(),className:`flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold border transition-all disabled:opacity-40 ${s?"bg-green-500/10 border-green-500/20 text-green-400":"bg-orange-500/8 border-orange-500/15 text-orange-400 hover:bg-orange-500/15"}`,children:t?r.jsx(oe,{size:9,className:"animate-spin"}):s?r.jsxs(r.Fragment,{children:[r.jsx(Qe,{size:9})," Sent"]}):l?r.jsxs(r.Fragment,{children:[r.jsx(on,{size:9})," Run"]}):r.jsxs(r.Fragment,{children:[r.jsx(XS,{size:9})," Use"]})})]})]})})}function YC(){const{t:e}=ht(),t=e.panels.skills,[n,s]=f.useState("saved"),[i,a]=f.useState([]),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState("idle"),[h,m]=f.useState(null),[y,w]=f.useState(null),[v,g]=f.useState([]),[x,k]=f.useState(!1),[j,b]=f.useState(""),S=f.useCallback(async()=>{l(!0);try{const P=await U("/api/skills/list");if(P.ok){const O=await P.json();a(O.skills??[])}}catch{}l(!1)},[]),N=f.useCallback(async()=>{k(!0);try{const P=await U("/api/skills/catalog");if(P.ok){const O=await P.json();g(O.skills??[])}}catch{}k(!1)},[]);f.useEffect(()=>{S()},[S]),f.useEffect(()=>{n==="library"&&v.length===0&&N()},[n,v.length,N]),f.useEffect(()=>{const P=pt(),O=F=>{F.type==="skillRunStart"&&F.skillId&&(u(F.skillId),p("running")),F.type==="planFinish"&&(p("done"),u(null),S(),setTimeout(()=>p("idle"),2500))};return P.on("agentUpdate",O),()=>{P.off("agentUpdate",O)}},[S]);const C=async P=>{if(!c){u(P.id),p("running");try{const O=await U("/api/skills/run",{method:"POST",body:JSON.stringify({id:P.id})});if(!O.ok)throw new Error(`HTTP ${O.status}`)}catch{p("error"),u(null),setTimeout(()=>p("idle"),3e3)}}},_=async P=>{m(P);try{await U(`/api/skills/${P}`,{method:"DELETE"}),a(O=>O.filter(F=>F.id!==P))}catch{}m(null),w(null)},E=j.trim()?v.filter(P=>P.name.toLowerCase().includes(j.toLowerCase())||P.description.toLowerCase().includes(j.toLowerCase())):v;return r.jsxs("div",{className:"h-full flex flex-col overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-white/5 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(dh,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-[13px] font-bold text-gray-300",children:t.title})]}),r.jsxs("div",{className:"flex items-center gap-1 bg-white/4 rounded-lg p-0.5",children:[r.jsxs("button",{onClick:()=>s("saved"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="saved"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(Re,{size:9}),"Saved",i.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:i.length})]}),r.jsxs("button",{onClick:()=>s("library"),className:`flex items-center gap-1 px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all ${n==="library"?"bg-orange-500/15 text-orange-400":"text-gray-600 hover:text-gray-400"}`,children:[r.jsx(tc,{size:9}),"Library",v.length>0&&r.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:v.length})]})]}),r.jsx("button",{onClick:n==="saved"?S:N,disabled:n==="saved"?o:x,className:"text-gray-600 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(pe,{size:13,className:(n==="saved"?o:x)?"animate-spin":""})})]}),n==="saved"&&r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:d!=="idle"&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:`px-6 py-2 border-b flex items-center gap-2 text-xs font-medium ${d==="running"?"bg-orange-500/8 border-orange-500/15 text-orange-400":d==="done"?"bg-green-500/8 border-green-500/15 text-green-400":"bg-red-500/8 border-red-500/15 text-red-400"}`,children:[d==="running"&&r.jsx(oe,{size:12,className:"animate-spin"}),d==="done"&&r.jsx(Qe,{size:12}),d==="error"&&r.jsx(Nn,{size:12}),d==="running"?t.runningStatus:d==="done"?t.completedStatus:t.failedStatus]})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-4 space-y-3",children:o&&i.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2",children:[r.jsx(oe,{size:13,className:"animate-spin"})," ",t.loading]}):i.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx(Re,{size:36,className:"text-gray-700 mb-4"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:t.emptyTitle}),r.jsxs("p",{className:"text-xs text-gray-700 mt-1 max-w-xs",children:[t.emptyHint," ",r.jsx("span",{className:"text-orange-400 font-medium",children:t.saveAsSkill})," ",t.emptyHint2]}),r.jsxs("button",{onClick:()=>s("library"),className:"mt-4 flex items-center gap-1.5 text-[11px] text-orange-400 hover:text-orange-300 transition-colors",children:[r.jsx(tc,{size:11})," Browse skill library"]})]}):i.map((P,O)=>{const F=c===P.id&&d==="running",D=c===P.id&&d==="done",M=h===P.id;return r.jsx($.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:O*.04},className:`rounded-2xl border bg-[#0c0f18] transition-all ${F?"border-orange-500/30 shadow-[0_0_12px_rgba(234,88,12,0.12)]":D?"border-green-500/20":"border-white/6 hover:border-white/12"}`,children:r.jsxs("div",{className:"p-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Re,{size:13,className:"text-orange-400 shrink-0 mt-0.5"}),r.jsx("p",{className:"text-[13px] font-bold text-white truncate",children:P.name})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-gray-600 shrink-0 font-mono",children:[r.jsx(Yy,{size:9}),P.runCount,"×"]})]}),r.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed mb-2 line-clamp-2",children:P.goal}),P.steps.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[P.steps.slice(0,4).map((z,V)=>r.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:z.tool??"step"},V)),P.steps.length>4&&r.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded-md bg-white/4 text-gray-600 font-mono",children:["+",P.steps.length-4," more"]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-700",children:[r.jsx(en,{size:9}),r.jsx("span",{children:KC(P.savedAt)}),P.lastRunAt&&r.jsxs("span",{className:"text-gray-800",children:["· ",t.lastRun," ",GC(P.lastRunAt)]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[y===P.id?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[10px] text-red-400",children:t.deleteConfirm}),r.jsx("button",{onClick:()=>_(P.id),disabled:M,className:"text-[10px] px-2 py-0.5 rounded bg-red-500/15 text-red-400 hover:bg-red-500/25 transition-colors",children:M?"…":t.yes}),r.jsx("button",{onClick:()=>w(null),className:"text-[10px] px-2 py-0.5 rounded bg-white/5 text-gray-500 hover:bg-white/8",children:t.no})]}):r.jsx("button",{onClick:()=>w(P.id),className:"p-1.5 rounded-lg text-gray-700 hover:text-red-400 hover:bg-red-500/8 transition-all",title:"Delete skill",children:r.jsx(Ls,{size:12})}),r.jsx("button",{onClick:()=>C(P),disabled:!!c,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-[11px] font-semibold transition-all ${F?"bg-orange-500/15 text-orange-400 border border-orange-500/25 cursor-not-allowed":D?"bg-green-500/12 text-green-400 border border-green-500/20":"bg-orange-500/10 hover:bg-orange-500/20 text-orange-400 border border-orange-500/20 hover:border-orange-500/35 disabled:opacity-40 disabled:cursor-not-allowed"}`,children:F?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:11,className:"animate-spin"})," ",t.runningBtn]}):D?r.jsxs(r.Fragment,{children:[r.jsx(Qe,{size:11})," ",t.doneBtn]}):r.jsxs(r.Fragment,{children:[r.jsx(Rs,{size:11})," ",t.runBtn]})})]})]})]})},P.id)})})]}),n==="library"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-2.5 border-b border-white/5 shrink-0",children:r.jsx("input",{value:j,onChange:P=>b(P.target.value),placeholder:"Search skills…",className:"w-full px-3 py-1.5 rounded-lg bg-white/4 border border-white/8 text-[11px] text-gray-300 placeholder-gray-700 outline-none focus:border-orange-500/25 transition-colors"})}),r.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-hide p-3 grid grid-cols-1 gap-2",children:x&&v.length===0?r.jsxs("div",{className:"flex items-center justify-center py-16 text-gray-700 text-xs gap-2 col-span-1",children:[r.jsx(oe,{size:13,className:"animate-spin"})," Loading skill library…"]}):E.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center col-span-1",children:[r.jsx(tc,{size:36,className:"text-gray-700 mb-3"}),r.jsx("p",{className:"text-sm font-semibold text-gray-500",children:"No skills found"}),j&&r.jsx("button",{onClick:()=>b(""),className:"mt-2 text-[11px] text-orange-400 hover:text-orange-300",children:"Clear filter"})]}):E.map((P,O)=>r.jsx($.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:Math.min(O*.02,.4)},children:r.jsx(qC,{skill:P})},P.id))}),v.length>0&&r.jsx("div",{className:"px-4 py-2 border-t border-white/5 shrink-0 flex items-center gap-1.5",children:r.jsxs("span",{className:"text-[10px] text-gray-700 font-mono",children:[E.length," / ",v.length," skills"]})})]})]})}const XC={html:fm,htm:fm,json:pn,js:pn,ts:pn,tsx:pn,jsx:pn};function QC(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function JC(e){try{return new Date(e).toLocaleString("en-US",{dateStyle:"short",timeStyle:"short"})}catch{return e}}function ZC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let n="color:#86efac";return/^"/.test(t)&&(n=/:$/.test(t)?"color:#93c5fd":"color:#fca5a5"),/true|false/.test(t)&&(n="color:#f97316"),/null/.test(t)&&(n="color:#6b7280"),`<span style="${n}">${t}</span>`})}function e_(){const[e,t]=f.useState([]),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState(!1),h=f.useCallback(async()=>{p(!0);try{const v=await U("/api/workspace/files");if(v.ok){const g=await v.json();t(g.files??[])}}catch{}p(!1)},[]);f.useEffect(()=>{h()},[h]);const m=async v=>{s(v),a(null),u(null),l(!0);try{const g=await U(`/api/workspace/file?p=${encodeURIComponent(v.rel)}`);if(!g.ok)throw new Error(`HTTP ${g.status}`);const x=await g.json();a(x.content+(x.truncated?`
728
718
 
729
- [… file truncated at 1.5 MB …]`:""))}catch(g){u(g instanceof Error?g.message:"Failed to load file")}l(!1)},v=b=>{const g=QC[b]??Yt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},w=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(de,{size:14,className:"animate-spin"})," Loading…"]});if(c)return r.jsxs("div",{className:"flex items-center justify-center h-full gap-2 text-red-400 text-xs",children:[r.jsx(an,{size:14})," ",c]});if(!i)return r.jsx("div",{className:"flex items-center justify-center h-full text-gray-700 text-xs",children:"Select a file to preview"});const b=(n==null?void 0:n.ext)??"";if(b==="html"||b==="htm")return r.jsx("iframe",{srcDoc:i,sandbox:"allow-scripts",className:"w-full h-full border-0 bg-white",title:"workspace-preview"});const g=b==="json"?e_(i):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return r.jsx("pre",{className:"w-full h-full overflow-auto p-4 text-[11px] font-mono text-gray-300 leading-relaxed whitespace-pre-wrap break-words bg-transparent",dangerouslySetInnerHTML:{__html:g}})};return r.jsxs("div",{className:"flex h-full overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"w-52 shrink-0 border-r border-white/5 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:[r.jsx(os,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:h,disabled:d,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(de,{size:11,className:d?"animate-spin":""})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto py-1 scrollbar-hide",children:e.length===0?r.jsx("p",{className:"text-[10px] text-gray-700 text-center py-6",children:"No files in workspace yet"}):e.map(b=>r.jsxs("button",{onClick:()=>m(b),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors group ${(n==null?void 0:n.rel)===b.rel?"bg-orange-500/10 text-orange-300":"text-gray-500 hover:text-gray-300 hover:bg-white/3"}`,children:[v(b.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:b.name}),r.jsx(ln,{size:10,className:`shrink-0 opacity-0 group-hover:opacity-100 transition-opacity ${(n==null?void 0:n.rel)===b.rel?"opacity-100 text-orange-400":""}`})]},b.rel))})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5 bg-white/[0.015] shrink-0",children:[r.jsx(ee,{mode:"wait",children:n?r.jsxs($.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0},className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"text-[11px] font-mono text-gray-400 truncate",children:n.rel}),r.jsxs("span",{className:"text-[9px] text-gray-700 shrink-0",children:[JC(n.size)," · ",ZC(n.mtime)]})]},n.rel):r.jsx("span",{className:"text-[11px] text-gray-700",children:"No file selected"})}),n&&(n.ext==="html"||n.ext==="htm")&&r.jsx("button",{onClick:()=>window.open(`/api/workspace/file?p=${encodeURIComponent(n.rel)}&raw=1`,"_blank"),className:"text-gray-600 hover:text-gray-300 transition-colors shrink-0 ml-2",title:"Open in new tab",children:r.jsx(il,{size:12})})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:w()})]})]})}const Ra={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"};function n_(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),c=f.useRef(null);f.useEffect(()=>{if(!n||!c.current)return;const d=c.current,p=d.getContext("2d");if(!p)return;const h=new Image;h.onload=()=>{var m;if(d.width=h.width,d.height=h.height,p.drawImage(h,0,0),(m=n.elements)!=null&&m.length)for(const v of n.elements)p.strokeStyle=Ra[v.type]??Ra.unknown,p.lineWidth=Math.max(2,Math.round(h.width/400)),p.strokeRect(v.x,v.y,v.width,v.height),p.fillStyle=Ra[v.type]??Ra.unknown,p.font=`${Math.max(10,Math.round(h.width/120))}px monospace`,p.fillText(v.type,v.x+4,v.y+14)},h.src=`data:image/png;base64,${n.base64}`},[n]),f.useEffect(()=>{const d=pt();return d.on("agentUpdate",p=>{p.type==="SCREEN_CAPTURE_START"?t(!0):p.type==="SCREEN_CAPTURED"&&(t(!1),s({base64:p.base64,width:p.width,height:p.height,source:p.source,elements:p.elements}))}),()=>{d.off("agentUpdate")}},[]);const u=async()=>{if(!e){try{const d=await U("/api/system/vision-guidance");if(d.ok){const p=await d.json();p.warn&&p.message&&a(p.message)}}catch{}await U("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}};return r.jsxs("div",{className:"border border-white/5 rounded-2xl bg-[#0a0d16]/60 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ts,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-xs font-bold text-gray-400 tracking-widest uppercase",children:"Live Sight"}),n&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[n.width,"×",n.height," · ",n.source]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[n&&r.jsx("button",{onClick:()=>l(d=>!d),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(ph,{size:13}):r.jsx(Ts,{size:13})}),r.jsxs("button",{onClick:u,disabled:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium transition-all ${e?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-500 hover:text-orange-400 hover:bg-orange-500/10 border border-white/5"}`,children:[r.jsx(Hi,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(ee,{children:i&&r.jsxs($.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-3 bg-amber-500/8 border-b border-amber-500/15",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed",children:i}),r.jsx("button",{onClick:()=>a(null),className:"text-[10px] text-amber-600 hover:text-amber-400 mt-1 transition-colors",children:"Dismiss"})]})}),r.jsx(ee,{children:n&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},className:`relative overflow-hidden transition-all duration-300 ${o?"max-h-[500px]":"max-h-[140px]"}`,children:[r.jsx("canvas",{ref:c,className:"w-full object-contain",style:{imageRendering:"auto"}}),n.elements&&n.elements.length>0&&r.jsxs("div",{className:"absolute bottom-2 right-2 px-2 py-0.5 bg-black/70 rounded-md text-[10px] font-mono text-orange-400 border border-orange-500/20",children:[n.elements.length," elements"]})]})}),!n&&!e&&r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-xs",children:"Press Capture to see what Must-b sees"}),e&&r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(Hi,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const s_=4,Wm=1e4;function r_(){const[e,t]=f.useState([]),n=f.useId(),s=f.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return f.useEffect(()=>{const i=pt();return i.on("projectInsight",a=>{const o={id:`${n}-${a.ts}-${Math.random().toString(36).slice(2,7)}`,message:a.message,filePath:a.filePath,ts:a.ts};t(l=>[o,...l].slice(0,s_)),setTimeout(()=>s(o.id),Wm)}),()=>{i.off("projectInsight")}},[s,n]),e.length===0?null:r.jsx("div",{className:"fixed bottom-6 right-5 z-[150] flex flex-col gap-2.5 items-end",style:{maxWidth:"340px",pointerEvents:"none"},children:r.jsx(ee,{mode:"popLayout",children:e.map((i,a)=>r.jsx($.div,{layout:!0,initial:{opacity:0,x:60,scale:.94},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:60,scale:.92},transition:{type:"spring",stiffness:340,damping:28},style:{pointerEvents:"auto",opacity:a===0?1:1-a*.12},className:"w-full",children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(15,6,1,0.82)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px)",boxShadow:"0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",style:{borderBottom:"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.30)"},children:r.jsx(ll,{size:10,className:"text-orange-400"})}),r.jsx("span",{className:"text-[11px] font-semibold text-orange-300/80 tracking-wide uppercase",children:"Must-b fısıldıyor"})]}),r.jsx("button",{onClick:()=>s(i.id),className:"text-white/25 hover:text-white/60 transition-colors",children:r.jsx(st,{size:12})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:i.message}),i.filePath&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Yt,{size:10,className:"text-white/25 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/35 truncate",children:i.filePath.replace(/\\/g,"/")})]})]}),r.jsx("div",{className:"h-px w-full",style:{background:"rgba(249,115,22,0.10)"},children:r.jsx($.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Wm/1e3,ease:"linear"}})})]})},i.id))})})}const i_=6e3,a_=/https?:\/\/[^\s"'>)]+/,o_=new Set(["browser_navigate","browser_click","browser_type","browser_scroll","browser_wait","browser_perceive","browser_extract","browser_snapshot","browser_screenshot","web_fetch","web-fetch","web-search"]);function l_(e){const t=e.match(a_);return t?t[0].replace(/[.,;)]+$/,""):null}function c_(e,t=52){try{const n=new URL(e),s=n.hostname.replace(/^www\./,""),i=n.pathname.length>1?n.pathname:"",a=s+i;return a.length>t?a.slice(0,t-1)+"…":a}catch{return e.length>t?e.slice(0,t-1)+"…":e}}function u_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(!1),h=f.useRef(null),m=f.useRef(!1),v=f.useCallback(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(!1),t(null),l(null),u(null),m.current=!1},i_)},[]);return f.useEffect(()=>{const w=pt(),b=g=>{if(g.type==="shadowFrame"&&typeof g.slot!="number"||g.type==="ghostFrame"){const x=g.base64;if(!x)return;t(x),p(!1),m.current||(m.current=!0,s(!0),a(!1)),v();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),u(null),m.current=!1,h.current&&clearTimeout(h.current)):g.enabled&&typeof g.slot!="number"&&(p(!0),s(!0),a(!1),m.current=!0);return}if(g.type==="ghostNav"){const x=g.url;x&&x!=="about:blank"&&l(x);return}if(g.type==="stepStart"){const x=g.step,k=(x==null?void 0:x.description)??"",C=(x==null?void 0:x.tool)??"";if(o_.has(C)||/navigate|click|type|browse|fetch|search/i.test(k)){const j=k.length>72?k.slice(0,71)+"…":k;u(j);const S=l_(k);S&&l(S)}return}if(g.type==="stepFinish"){u(null);return}if(g.type==="planFinish"){u(null),v();return}};return w.on("agentUpdate",b),()=>{w.off("agentUpdate",b),h.current&&clearTimeout(h.current)}},[v]),r.jsx(ee,{children:n&&r.jsx($.div,{initial:{opacity:0,y:24,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.92},transition:{type:"spring",stiffness:340,damping:30},className:"fixed bottom-6 left-5 z-[140] flex flex-col",style:{width:i?"auto":"320px",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.88)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px) saturate(180%)",boxShadow:"0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 select-none flex-shrink-0",style:{borderBottom:i?"none":"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-500"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-500 animate-ping opacity-60"})]}),r.jsx(Xe,{size:11,className:"text-orange-400/70"}),r.jsx("span",{className:"text-[11px] font-semibold text-white/70 tracking-wide",children:"Live Browser"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{onClick:()=>a(w=>!w),className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:i?"Expand":"Minimize",children:i?r.jsx(FS,{size:10}):r.jsx($S,{size:10})}),r.jsx("button",{onClick:()=>{s(!1),m.current=!1},className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:"Close",children:r.jsx(st,{size:10})})]})]}),r.jsx(ee,{children:!i&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"relative w-full overflow-hidden",style:{aspectRatio:"16 / 10",background:"#08030100"},children:[d&&!e?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(re,{size:20,className:"text-orange-400/50 animate-spin"})}):e?r.jsx("img",{src:`data:image/jpeg;base64,${e}`,alt:"Browser preview",className:"w-full h-full object-cover",style:{imageRendering:"auto"}}):r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2",children:[r.jsx(Xe,{size:22,className:"text-orange-400/20"}),r.jsx("span",{className:"text-[11px] text-white/20",children:"Browser waiting…"})]}),e&&r.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px)"}})]}),o&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:[r.jsx(Xe,{size:9,className:"text-orange-400/40 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/40 truncate flex-1",children:c_(o)})]}),r.jsx(ee,{children:c&&r.jsxs($.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"px-3 py-2 flex items-start gap-2",style:{borderTop:"1px solid rgba(249,115,22,0.08)"},children:[r.jsx("div",{className:"flex items-center gap-0.5 mt-1 flex-shrink-0",children:[0,1,2].map(w=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${w*.15}s`}},w))}),r.jsx("p",{className:"text-[10.5px] text-white/50 leading-snug line-clamp-2",children:c})]},"action-bar")})]},"pip-content")})]})},"live-browser-pip")})}const uc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function d_(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function h_(){const[e,t]=f.useState(!1),[n,s]=f.useState(uc),[i,a]=f.useState(!1),o=f.useRef(null),l=f.useCallback(()=>{fetch("/api/auth/user-status").then(v=>v.json()).then(v=>s(v)).catch(()=>{})},[]);f.useEffect(()=>{l()},[l]),f.useEffect(()=>{const v=pt(),w=b=>{b.authenticated?s(g=>({...g,authenticated:!0,userEmail:b.userEmail??g.userEmail,userName:b.userName??g.userName,avatarUrl:b.avatarUrl??g.avatarUrl})):s(uc)};return v.on("authStateChanged",w),()=>{v.off("authStateChanged",w)}},[]),f.useEffect(()=>{const v=w=>{w.data==="mustb:auth:done"&&l()};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[l]),f.useEffect(()=>{if(!e)return;const v=w=>{o.current&&!o.current.contains(w.target)&&t(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[e]),f.useEffect(()=>{if(!e)return;const v=w=>{w.key==="Escape"&&t(!1)};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e]);const c="https://must-b.com",u=v=>{window.open(`${c}/auth/connect?provider=${v}`,"mustb-auth","width=540,height=660,scrollbars=yes")},d=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(uc),t(!1)}finally{a(!1)}},p=v=>{window.open(`${c}${v}`,"_blank","noopener,noreferrer")},h=d_(n.userName,n.userEmail),m=n.authenticated;return r.jsxs("div",{ref:o,className:"relative flex flex-col items-end",children:[m?r.jsxs("button",{onClick:()=>t(v=>!v),title:n.userEmail??"Account",className:"relative w-9 h-9 rounded-full flex items-center justify-center select-none transition-all duration-200 focus:outline-none bg-white/10 border border-white/20 hover:border-orange-400/50 hover:bg-white/15 shadow-[0_4px_16px_rgba(0,0,0,0.5)]",children:[n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full rounded-full object-cover"}):r.jsx("span",{className:"text-[13px] font-black text-orange-400",children:h}),r.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-400 border-2 border-black"})]}):r.jsxs("button",{onClick:()=>t(v=>!v),title:"Sign in to must-b",className:"flex items-center gap-2 px-3.5 py-2 rounded-xl font-semibold text-[13px] select-none transition-all duration-200 focus:outline-none bg-orange-600 hover:bg-orange-500 text-white shadow-[0_4px_20px_rgba(249,115,22,0.45)] active:scale-[0.97]",children:[r.jsx(DS,{size:14}),"Sign In"]}),r.jsx(ee,{children:e&&r.jsxs($.div,{initial:{opacity:0,scale:.93,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-6},transition:{duration:.17,ease:[.22,1,.36,1]},className:`absolute top-full right-0 mt-2 w-72 glass-panel rounded-2xl overflow-hidden
719
+ [… file truncated at 1.5 MB …]`:""))}catch(g){u(g instanceof Error?g.message:"Failed to load file")}l(!1)},y=v=>{const g=XC[v]??Yt;return r.jsx(g,{size:12,className:"shrink-0 text-gray-500"})},w=()=>{if(o)return r.jsxs("div",{className:"flex items-center justify-center h-full text-gray-600 text-xs gap-2",children:[r.jsx(pe,{size:14,className:"animate-spin"})," Loading…"]});if(c)return r.jsxs("div",{className:"flex items-center justify-center h-full gap-2 text-red-400 text-xs",children:[r.jsx(Nn,{size:14})," ",c]});if(!i)return r.jsx("div",{className:"flex items-center justify-center h-full text-gray-700 text-xs",children:"Select a file to preview"});const v=(n==null?void 0:n.ext)??"";if(v==="html"||v==="htm")return r.jsx("iframe",{srcDoc:i,sandbox:"allow-scripts",className:"w-full h-full border-0 bg-white",title:"workspace-preview"});const g=v==="json"?ZC(i):i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return r.jsx("pre",{className:"w-full h-full overflow-auto p-4 text-[11px] font-mono text-gray-300 leading-relaxed whitespace-pre-wrap break-words bg-transparent",dangerouslySetInnerHTML:{__html:g}})};return r.jsxs("div",{className:"flex h-full overflow-hidden bg-[#080b12]",children:[r.jsxs("div",{className:"w-52 shrink-0 border-r border-white/5 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:[r.jsx(os,{size:11,className:"text-orange-400"}),"Workspace"]}),r.jsx("button",{onClick:h,disabled:d,className:"text-gray-700 hover:text-gray-400 transition-colors",title:"Refresh",children:r.jsx(pe,{size:11,className:d?"animate-spin":""})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto py-1 scrollbar-hide",children:e.length===0?r.jsx("p",{className:"text-[10px] text-gray-700 text-center py-6",children:"No files in workspace yet"}):e.map(v=>r.jsxs("button",{onClick:()=>m(v),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors group ${(n==null?void 0:n.rel)===v.rel?"bg-orange-500/10 text-orange-300":"text-gray-500 hover:text-gray-300 hover:bg-white/3"}`,children:[y(v.ext),r.jsx("span",{className:"text-[11px] truncate flex-1",children:v.name}),r.jsx(on,{size:10,className:`shrink-0 opacity-0 group-hover:opacity-100 transition-opacity ${(n==null?void 0:n.rel)===v.rel?"opacity-100 text-orange-400":""}`})]},v.rel))})]}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-white/5 bg-white/[0.015] shrink-0",children:[r.jsx(ee,{mode:"wait",children:n?r.jsxs($.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0},className:"flex items-center gap-2 min-w-0",children:[r.jsx("span",{className:"text-[11px] font-mono text-gray-400 truncate",children:n.rel}),r.jsxs("span",{className:"text-[9px] text-gray-700 shrink-0",children:[QC(n.size)," · ",JC(n.mtime)]})]},n.rel):r.jsx("span",{className:"text-[11px] text-gray-700",children:"No file selected"})}),n&&(n.ext==="html"||n.ext==="htm")&&r.jsx("button",{onClick:()=>window.open(`/api/workspace/file?p=${encodeURIComponent(n.rel)}&raw=1`,"_blank"),className:"text-gray-600 hover:text-gray-300 transition-colors shrink-0 ml-2",title:"Open in new tab",children:r.jsx(il,{size:12})})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:w()})]})]})}const Ra={button:"rgba(234,88,12,0.7)",input:"rgba(59,130,246,0.7)",image:"rgba(168,85,247,0.6)",unknown:"rgba(255,255,255,0.3)"};function t_(){const[e,t]=f.useState(!1),[n,s]=f.useState(null),[i,a]=f.useState(null),[o,l]=f.useState(!1),c=f.useRef(null);f.useEffect(()=>{if(!n||!c.current)return;const d=c.current,p=d.getContext("2d");if(!p)return;const h=new Image;h.onload=()=>{var m;if(d.width=h.width,d.height=h.height,p.drawImage(h,0,0),(m=n.elements)!=null&&m.length)for(const y of n.elements)p.strokeStyle=Ra[y.type]??Ra.unknown,p.lineWidth=Math.max(2,Math.round(h.width/400)),p.strokeRect(y.x,y.y,y.width,y.height),p.fillStyle=Ra[y.type]??Ra.unknown,p.font=`${Math.max(10,Math.round(h.width/120))}px monospace`,p.fillText(y.type,y.x+4,y.y+14)},h.src=`data:image/png;base64,${n.base64}`},[n]),f.useEffect(()=>{const d=pt();return d.on("agentUpdate",p=>{p.type==="SCREEN_CAPTURE_START"?t(!0):p.type==="SCREEN_CAPTURED"&&(t(!1),s({base64:p.base64,width:p.width,height:p.height,source:p.source,elements:p.elements}))}),()=>{d.off("agentUpdate")}},[]);const u=async()=>{if(!e){try{const d=await U("/api/system/vision-guidance");if(d.ok){const p=await d.json();p.warn&&p.message&&a(p.message)}}catch{}await U("/api/system/screenshot",{method:"POST",body:JSON.stringify({detect:!0})}).catch(()=>{})}};return r.jsxs("div",{className:"border border-white/5 rounded-2xl bg-[#0a0d16]/60 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ts,{size:14,className:"text-orange-400"}),r.jsx("span",{className:"text-xs font-bold text-gray-400 tracking-widest uppercase",children:"Live Sight"}),n&&r.jsxs("span",{className:"text-[10px] text-gray-600 font-mono",children:[n.width,"×",n.height," · ",n.source]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[n&&r.jsx("button",{onClick:()=>l(d=>!d),className:"text-gray-600 hover:text-gray-300 transition-colors",title:o?"Collapse":"Expand",children:o?r.jsx(ph,{size:13}):r.jsx(Ts,{size:13})}),r.jsxs("button",{onClick:u,disabled:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium transition-all ${e?"text-orange-400 bg-orange-500/10 animate-pulse cursor-not-allowed":"text-gray-500 hover:text-orange-400 hover:bg-orange-500/10 border border-white/5"}`,children:[r.jsx(Hi,{size:11}),e?"Scanning…":"Capture"]})]})]}),r.jsx(ee,{children:i&&r.jsxs($.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"px-4 py-3 bg-amber-500/8 border-b border-amber-500/15",children:[r.jsx("p",{className:"text-[11px] text-amber-400 leading-relaxed",children:i}),r.jsx("button",{onClick:()=>a(null),className:"text-[10px] text-amber-600 hover:text-amber-400 mt-1 transition-colors",children:"Dismiss"})]})}),r.jsx(ee,{children:n&&r.jsxs($.div,{initial:{opacity:0},animate:{opacity:1},className:`relative overflow-hidden transition-all duration-300 ${o?"max-h-[500px]":"max-h-[140px]"}`,children:[r.jsx("canvas",{ref:c,className:"w-full object-contain",style:{imageRendering:"auto"}}),n.elements&&n.elements.length>0&&r.jsxs("div",{className:"absolute bottom-2 right-2 px-2 py-0.5 bg-black/70 rounded-md text-[10px] font-mono text-orange-400 border border-orange-500/20",children:[n.elements.length," elements"]})]})}),!n&&!e&&r.jsx("div",{className:"flex items-center justify-center py-8 text-gray-700 text-xs",children:"Press Capture to see what Must-b sees"}),e&&r.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-orange-400 text-xs animate-pulse",children:[r.jsx(Hi,{size:14,className:"animate-spin"}),"Scanning screen…"]})]})}const n_=4,Wm=1e4;function s_(){const[e,t]=f.useState([]),n=f.useId(),s=f.useCallback(i=>{t(a=>a.filter(o=>o.id!==i))},[]);return f.useEffect(()=>{const i=pt();return i.on("projectInsight",a=>{const o={id:`${n}-${a.ts}-${Math.random().toString(36).slice(2,7)}`,message:a.message,filePath:a.filePath,ts:a.ts};t(l=>[o,...l].slice(0,n_)),setTimeout(()=>s(o.id),Wm)}),()=>{i.off("projectInsight")}},[s,n]),e.length===0?null:r.jsx("div",{className:"fixed bottom-6 right-5 z-[150] flex flex-col gap-2.5 items-end",style:{maxWidth:"340px",pointerEvents:"none"},children:r.jsx(ee,{mode:"popLayout",children:e.map((i,a)=>r.jsx($.div,{layout:!0,initial:{opacity:0,x:60,scale:.94},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:60,scale:.92},transition:{type:"spring",stiffness:340,damping:28},style:{pointerEvents:"auto",opacity:a===0?1:1-a*.12},className:"w-full",children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(15,6,1,0.82)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px)",boxShadow:"0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",style:{borderBottom:"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.18)",border:"1px solid rgba(249,115,22,0.30)"},children:r.jsx(ll,{size:10,className:"text-orange-400"})}),r.jsx("span",{className:"text-[11px] font-semibold text-orange-300/80 tracking-wide uppercase",children:"Must-b fısıldıyor"})]}),r.jsx("button",{onClick:()=>s(i.id),className:"text-white/25 hover:text-white/60 transition-colors",children:r.jsx(st,{size:12})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-2",children:[r.jsx("p",{className:"text-[13px] text-white/80 leading-relaxed",children:i.message}),i.filePath&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Yt,{size:10,className:"text-white/25 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/35 truncate",children:i.filePath.replace(/\\/g,"/")})]})]}),r.jsx("div",{className:"h-px w-full",style:{background:"rgba(249,115,22,0.10)"},children:r.jsx($.div,{className:"h-full",style:{background:"rgba(249,115,22,0.45)"},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:Wm/1e3,ease:"linear"}})})]})},i.id))})})}const r_=6e3,i_=/https?:\/\/[^\s"'>)]+/,a_=new Set(["browser_navigate","browser_click","browser_type","browser_scroll","browser_wait","browser_perceive","browser_extract","browser_snapshot","browser_screenshot","web_fetch","web-fetch","web-search"]);function o_(e){const t=e.match(i_);return t?t[0].replace(/[.,;)]+$/,""):null}function l_(e,t=52){try{const n=new URL(e),s=n.hostname.replace(/^www\./,""),i=n.pathname.length>1?n.pathname:"",a=s+i;return a.length>t?a.slice(0,t-1)+"…":a}catch{return e.length>t?e.slice(0,t-1)+"…":e}}function c_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,p]=f.useState(!1),h=f.useRef(null),m=f.useRef(!1),y=f.useCallback(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(!1),t(null),l(null),u(null),m.current=!1},r_)},[]);return f.useEffect(()=>{const w=pt(),v=g=>{if(g.type==="shadowFrame"&&typeof g.slot!="number"||g.type==="ghostFrame"){const x=g.base64;if(!x)return;t(x),p(!1),m.current||(m.current=!0,s(!0),a(!1)),y();return}if(g.type==="shadowToggle"){!g.enabled&&typeof g.slot!="number"?(s(!1),t(null),l(null),u(null),m.current=!1,h.current&&clearTimeout(h.current)):g.enabled&&typeof g.slot!="number"&&(p(!0),s(!0),a(!1),m.current=!0);return}if(g.type==="ghostNav"){const x=g.url;x&&x!=="about:blank"&&l(x);return}if(g.type==="stepStart"){const x=g.step,k=(x==null?void 0:x.description)??"",j=(x==null?void 0:x.tool)??"";if(a_.has(j)||/navigate|click|type|browse|fetch|search/i.test(k)){const b=k.length>72?k.slice(0,71)+"…":k;u(b);const S=o_(k);S&&l(S)}return}if(g.type==="stepFinish"){u(null);return}if(g.type==="planFinish"){u(null),y();return}};return w.on("agentUpdate",v),()=>{w.off("agentUpdate",v),h.current&&clearTimeout(h.current)}},[y]),r.jsx(ee,{children:n&&r.jsx($.div,{initial:{opacity:0,y:24,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.92},transition:{type:"spring",stiffness:340,damping:30},className:"fixed bottom-6 left-5 z-[140] flex flex-col",style:{width:i?"auto":"320px",pointerEvents:"auto"},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden flex flex-col",style:{background:"rgba(10,4,1,0.88)",border:"1px solid rgba(249,115,22,0.28)",backdropFilter:"blur(24px) saturate(180%)",boxShadow:"0 12px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(249,115,22,0.08), inset 0 1px 0 rgba(255,255,255,0.04)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 select-none flex-shrink-0",style:{borderBottom:i?"none":"1px solid rgba(249,115,22,0.12)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0",children:[r.jsx("span",{className:"block w-2 h-2 rounded-full bg-orange-500"}),r.jsx("span",{className:"absolute inset-0 rounded-full bg-orange-500 animate-ping opacity-60"})]}),r.jsx(Ye,{size:11,className:"text-orange-400/70"}),r.jsx("span",{className:"text-[11px] font-semibold text-white/70 tracking-wide",children:"Live Browser"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{onClick:()=>a(w=>!w),className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:i?"Expand":"Minimize",children:i?r.jsx(BS,{size:10}):r.jsx($S,{size:10})}),r.jsx("button",{onClick:()=>{s(!1),m.current=!1},className:"w-5 h-5 rounded-full flex items-center justify-center text-white/25 hover:text-white/60 hover:bg-white/8 transition-all",title:"Close",children:r.jsx(st,{size:10})})]})]}),r.jsx(ee,{children:!i&&r.jsxs($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22},className:"overflow-hidden",children:[r.jsxs("div",{className:"relative w-full overflow-hidden",style:{aspectRatio:"16 / 10",background:"#08030100"},children:[d&&!e?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(oe,{size:20,className:"text-orange-400/50 animate-spin"})}):e?r.jsx("img",{src:`data:image/jpeg;base64,${e}`,alt:"Browser preview",className:"w-full h-full object-cover",style:{imageRendering:"auto"}}):r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2",children:[r.jsx(Ye,{size:22,className:"text-orange-400/20"}),r.jsx("span",{className:"text-[11px] text-white/20",children:"Browser waiting…"})]}),e&&r.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px)"}})]}),o&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderTop:"1px solid rgba(249,115,22,0.10)"},children:[r.jsx(Ye,{size:9,className:"text-orange-400/40 flex-shrink-0"}),r.jsx("span",{className:"text-[10px] font-mono text-white/40 truncate flex-1",children:l_(o)})]}),r.jsx(ee,{children:c&&r.jsxs($.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"px-3 py-2 flex items-start gap-2",style:{borderTop:"1px solid rgba(249,115,22,0.08)"},children:[r.jsx("div",{className:"flex items-center gap-0.5 mt-1 flex-shrink-0",children:[0,1,2].map(w=>r.jsx("span",{className:"block w-1 h-1 rounded-full bg-orange-400/60 animate-bounce",style:{animationDelay:`${w*.15}s`}},w))}),r.jsx("p",{className:"text-[10.5px] text-white/50 leading-snug line-clamp-2",children:c})]},"action-bar")})]},"pip-content")})]})},"live-browser-pip")})}const uc={authenticated:!1,userEmail:null,userName:null,avatarUrl:null,expiresAt:null};function u_(e,t){return e?e.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():t?t[0].toUpperCase():"?"}function d_(){const[e,t]=f.useState(!1),[n,s]=f.useState(uc),[i,a]=f.useState(!1),o=f.useRef(null),l=f.useCallback(()=>{fetch("/api/auth/user-status").then(y=>y.json()).then(y=>s(y)).catch(()=>{})},[]);f.useEffect(()=>{l()},[l]),f.useEffect(()=>{const y=pt(),w=v=>{v.authenticated?s(g=>({...g,authenticated:!0,userEmail:v.userEmail??g.userEmail,userName:v.userName??g.userName,avatarUrl:v.avatarUrl??g.avatarUrl})):s(uc)};return y.on("authStateChanged",w),()=>{y.off("authStateChanged",w)}},[]),f.useEffect(()=>{const y=w=>{w.data==="mustb:auth:done"&&l()};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[l]),f.useEffect(()=>{if(!e)return;const y=w=>{o.current&&!o.current.contains(w.target)&&t(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[e]),f.useEffect(()=>{if(!e)return;const y=w=>{w.key==="Escape"&&t(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e]);const c="https://must-b.com",u=y=>{window.open(`${c}/auth/connect?provider=${y}`,"mustb-auth","width=540,height=660,scrollbars=yes")},d=async()=>{a(!0);try{await fetch("/api/auth/signout",{method:"POST"}),s(uc),t(!1)}finally{a(!1)}},p=y=>{window.open(`${c}${y}`,"_blank","noopener,noreferrer")},h=u_(n.userName,n.userEmail),m=n.authenticated;return r.jsxs("div",{ref:o,className:"relative flex flex-col items-end",children:[m?r.jsxs("button",{onClick:()=>t(y=>!y),title:n.userEmail??"Account",className:"relative w-9 h-9 rounded-full flex items-center justify-center select-none transition-all duration-200 focus:outline-none bg-white/10 border border-white/20 hover:border-orange-400/50 hover:bg-white/15 shadow-[0_4px_16px_rgba(0,0,0,0.5)]",children:[n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full rounded-full object-cover"}):r.jsx("span",{className:"text-[13px] font-black text-orange-400",children:h}),r.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-400 border-2 border-black"})]}):r.jsxs("button",{onClick:()=>t(y=>!y),title:"Sign in to must-b",className:"flex items-center gap-2 px-3.5 py-2 rounded-xl font-semibold text-[13px] select-none transition-all duration-200 focus:outline-none bg-orange-600 hover:bg-orange-500 text-white shadow-[0_4px_20px_rgba(249,115,22,0.45)] active:scale-[0.97]",children:[r.jsx(OS,{size:14}),"Sign In"]}),r.jsx(ee,{children:e&&r.jsxs($.div,{initial:{opacity:0,scale:.93,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-6},transition:{duration:.17,ease:[.22,1,.36,1]},className:`absolute top-full right-0 mt-2 w-72 glass-panel rounded-2xl overflow-hidden
730
720
  shadow-[0_24px_64px_rgba(0,0,0,0.75),0_0_0_1px_rgba(249,115,22,0.18)] z-[60]`,children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/8",children:[r.jsx("span",{className:"text-[11px] font-black uppercase tracking-[0.1em] text-orange-400/70",children:m?"Account":"Sign in to must-b"}),r.jsx("button",{onClick:()=>t(!1),className:`w-6 h-6 flex items-center justify-center rounded-full
731
- hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(st,{size:12})})]}),!m&&r.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[r.jsx("p",{className:"text-[12px] text-white/50 text-center mb-1",children:"Cloud backup, multi-device sync and profile settings."}),r.jsxs("button",{onClick:()=>u("github"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/10 border border-white/15 text-white/80 text-[13px] font-semibold hover:bg-white/15 hover:text-white transition-all duration-200",children:[r.jsx(t1,{size:15}),"Continue with GitHub"]}),r.jsxs("button",{onClick:()=>u("google"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),r.jsxs("button",{onClick:()=>u("apple"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsx(Ky,{size:15}),"Continue with Apple"]}),r.jsxs("div",{className:"relative flex items-center gap-2 my-1",children:[r.jsx("div",{className:"flex-1 h-px bg-white/8"}),r.jsx("span",{className:"text-[10px] text-white/25 shrink-0",children:"or"}),r.jsx("div",{className:"flex-1 h-px bg-white/8"})]}),r.jsxs("button",{onClick:()=>p("/login?method=email"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-orange-500/20 border border-orange-400/35 text-orange-300 text-[13px] font-semibold hover:bg-orange-500/30 hover:border-orange-400/55 transition-all duration-200 shadow-[0_0_14px_rgba(249,115,22,0.18)]",children:[r.jsx(IS,{size:15}),"Sign in with Email"]}),r.jsxs("p",{className:"text-center text-[11px] text-white/30 mt-1",children:["Don't have an account?"," ",r.jsx("button",{onClick:()=>p("/signup"),className:"text-orange-400 hover:text-orange-300 font-semibold transition-colors underline-offset-2 hover:underline",children:"Sign up free"})]})]}),m&&r.jsxs("div",{className:"p-2",children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 mb-1",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-orange-500/20 border border-orange-400/30 flex items-center justify-center shrink-0 overflow-hidden",children:n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full object-cover rounded-full"}):r.jsx("span",{className:"text-[14px] font-black text-orange-400",children:h})}),r.jsxs("div",{className:"min-w-0",children:[n.userName&&r.jsx("p",{className:"text-[13px] font-semibold text-white/90 truncate leading-tight",children:n.userName}),r.jsx("p",{className:"text-[11px] text-white/45 truncate",children:n.userEmail??"—"})]})]}),r.jsx("div",{className:"h-px bg-white/6 mx-2 mb-1"}),[{icon:r.jsx(u1,{size:13}),label:"Profile Settings",sub:"Web",action:()=>p("/profile/settings")},{icon:r.jsx(n1,{size:13}),label:"Change Password",sub:"Web",action:()=>p("/profile/security")}].map(v=>r.jsxs("button",{onClick:()=>{v.action(),t(!1)},className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
721
+ hover:bg-white/8 text-white/30 hover:text-white/60 transition-colors`,children:r.jsx(st,{size:12})})]}),!m&&r.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[r.jsx("p",{className:"text-[12px] text-white/50 text-center mb-1",children:"Cloud backup, multi-device sync and profile settings."}),r.jsxs("button",{onClick:()=>u("github"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/10 border border-white/15 text-white/80 text-[13px] font-semibold hover:bg-white/15 hover:text-white transition-all duration-200",children:[r.jsx(PS,{size:15}),"Continue with GitHub"]}),r.jsxs("button",{onClick:()=>u("google"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),r.jsxs("button",{onClick:()=>u("apple"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-white/5 border border-white/10 text-white/60 text-[13px] font-semibold hover:bg-white/10 hover:text-white/80 transition-all duration-200",children:[r.jsx(Ky,{size:15}),"Continue with Apple"]}),r.jsxs("div",{className:"relative flex items-center gap-2 my-1",children:[r.jsx("div",{className:"flex-1 h-px bg-white/8"}),r.jsx("span",{className:"text-[10px] text-white/25 shrink-0",children:"or"}),r.jsx("div",{className:"flex-1 h-px bg-white/8"})]}),r.jsxs("button",{onClick:()=>p("/login?method=email"),className:"w-full flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl bg-orange-500/20 border border-orange-400/35 text-orange-300 text-[13px] font-semibold hover:bg-orange-500/30 hover:border-orange-400/55 transition-all duration-200 shadow-[0_0_14px_rgba(249,115,22,0.18)]",children:[r.jsx(DS,{size:15}),"Sign in with Email"]}),r.jsxs("p",{className:"text-center text-[11px] text-white/30 mt-1",children:["Don't have an account?"," ",r.jsx("button",{onClick:()=>p("/signup"),className:"text-orange-400 hover:text-orange-300 font-semibold transition-colors underline-offset-2 hover:underline",children:"Sign up free"})]})]}),m&&r.jsxs("div",{className:"p-2",children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 mb-1",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-orange-500/20 border border-orange-400/30 flex items-center justify-center shrink-0 overflow-hidden",children:n.avatarUrl?r.jsx("img",{src:n.avatarUrl,alt:"avatar",className:"w-full h-full object-cover rounded-full"}):r.jsx("span",{className:"text-[14px] font-black text-orange-400",children:h})}),r.jsxs("div",{className:"min-w-0",children:[n.userName&&r.jsx("p",{className:"text-[13px] font-semibold text-white/90 truncate leading-tight",children:n.userName}),r.jsx("p",{className:"text-[11px] text-white/45 truncate",children:n.userEmail??"—"})]})]}),r.jsx("div",{className:"h-px bg-white/6 mx-2 mb-1"}),[{icon:r.jsx(l1,{size:13}),label:"Profile Settings",sub:"Web",action:()=>p("/profile/settings")},{icon:r.jsx(t1,{size:13}),label:"Change Password",sub:"Web",action:()=>p("/profile/security")}].map(y=>r.jsxs("button",{onClick:()=>{y.action(),t(!1)},className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
732
722
  hover:bg-white/6 transition-colors group text-left`,children:[r.jsx("span",{className:`w-6 h-6 flex items-center justify-center rounded-lg
733
723
  bg-white/5 text-white/40 group-hover:text-orange-400
734
- group-hover:bg-orange-500/10 transition-all shrink-0`,children:v.icon}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 group-hover:text-white/90 transition-colors flex-1",children:v.label}),r.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-white/25 group-hover:text-orange-400/60 transition-colors",children:[r.jsx(il,{size:9}),v.sub]})]},v.label)),r.jsx("div",{className:"h-px bg-white/6 mx-2 my-1"}),r.jsxs("button",{onClick:d,disabled:i,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
724
+ group-hover:bg-orange-500/10 transition-all shrink-0`,children:y.icon}),r.jsx("span",{className:"text-[12px] font-semibold text-white/70 group-hover:text-white/90 transition-colors flex-1",children:y.label}),r.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-white/25 group-hover:text-orange-400/60 transition-colors",children:[r.jsx(il,{size:9}),y.sub]})]},y.label)),r.jsx("div",{className:"h-px bg-white/6 mx-2 my-1"}),r.jsxs("button",{onClick:d,disabled:i,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-xl
735
725
  hover:bg-red-500/10 transition-colors group text-left
736
726
  disabled:opacity-50 disabled:cursor-not-allowed`,children:[r.jsx("span",{className:`w-6 h-6 flex items-center justify-center rounded-lg
737
727
  bg-white/5 text-white/30 group-hover:text-red-400
738
- group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(mh,{size:13})}),r.jsx("span",{className:"text-[12px] font-semibold text-white/50 group-hover:text-red-400 transition-colors",children:i?"Signing out…":"Sign Out"})]})]}),r.jsx("div",{className:"px-4 py-2 border-t border-white/6",children:r.jsx("p",{className:"text-[9.5px] text-white/18 text-center",children:"must-b.com · Secure OAuth connection"})})]},"profile-panel")})]})}const p_=4,f_=3e3;function m_(){return r.jsxs($.div,{className:"fixed inset-0 z-[200] pointer-events-none flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[r.jsx("div",{className:"absolute inset-0 bg-black/35"}),Array.from({length:p_}).map((e,t)=>r.jsx($.span,{className:"absolute rounded-full",style:{border:"1.5px solid rgba(249,115,22,0.70)",boxShadow:"0 0 20px rgba(249,115,22,0.25)"},initial:{width:64,height:64,opacity:.9,scale:1},animate:{width:64+t*0,height:64+t*0,scale:[1,3.5+t*1.2],opacity:[.8,0]},transition:{duration:1.8,delay:t*.22,ease:"easeOut",repeat:1/0,repeatDelay:.1}},t)),r.jsx($.div,{className:"relative z-10 w-16 h-16 rounded-full flex items-center justify-center",style:{background:"rgba(249,115,22,0.18)",border:"1.5px solid rgba(249,115,22,0.55)",backdropFilter:"blur(16px)",boxShadow:"0 0 32px rgba(249,115,22,0.35), 0 0 64px rgba(249,115,22,0.15)"},animate:{scale:[1,1.06,1]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:r.jsx(Nr,{size:26,className:"text-orange-400"})}),r.jsx($.p,{className:"absolute text-[12px] font-semibold text-orange-300/80 tracking-widest uppercase",style:{top:"calc(50% + 52px)"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.15,duration:.3},children:"Dinliyorum…"})]})}function g_(){const[e,t]=f.useState(!1),n=f.useRef(null),s=f.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),f_)},[]);return f.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(ee,{children:e&&r.jsx(m_,{},"wake-aura")})}const x_={browser_navigate:"navigate",web_search:"search",http_request:"request"},y_=20,v_=5e3;function b_(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function w_(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function k_(e){return e==="search"?r.jsx(qt,{size:10}):e==="request"?r.jsx(zr,{size:10}):r.jsx(Xe,{size:10})}function T1(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function j_({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=T1(t);return r.jsx("span",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 text-[10px] font-black",style:{background:`${s}18`,border:`1px solid ${s}30`,color:s},children:n})}function N_({entry:e,isLatest:t}){var a;const n=T1(e.kind),s=e.domain??"",i=e.query??(e.url?w_(e.url):"");return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",style:{borderLeft:t?`2px solid ${n}`:"2px solid transparent",background:t?`${n}08`:"transparent"},children:[r.jsx(j_,{domain:s||"?",kind:e.kind}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-semibold text-white/80 truncate leading-tight",children:s||((a=e.query)==null?void 0:a.slice(0,30))||"—"}),i&&r.jsx("p",{className:"text-[9px] text-white/35 truncate font-mono mt-0.5",children:i})]}),r.jsx("span",{style:{color:n,opacity:.6},className:"flex-shrink-0",children:k_(e.kind)}),r.jsx("span",{className:"text-[9px] text-white/20 font-mono flex-shrink-0",children:new Date(e.ts).toLocaleTimeString("tr-TR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})}function S_(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=f.useRef(null),u=f.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},v_)},[]);return f.useEffect(()=>{const d=pt(),p=h=>{const{type:m}=h;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(v=>v.map(w=>({...w,done:!0}))),u();return}if(m==="stepStart"&&h.step){const v=h.step,w=v.tool?x_[v.tool]:void 0;if(!w)return;const b=v.parameters??{},g=String(b.url??b.endpoint??"").trim(),x=String(b.query??"").trim();if(!g&&!x)return;const k={id:`v-${Date.now()}-${Math.random().toString(36).slice(2,5)}`,kind:w,url:g||void 0,query:x||void 0,domain:g?b_(g):void 0,ts:Date.now(),done:!1};t(C=>[k,...C].slice(0,y_)),s(!0),a(!1)}};return d.on("agentUpdate",p),()=>{d.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[u]),!n||e.length===0?null:r.jsx($.div,{className:"fixed right-4 z-[120] w-[300px]",style:{top:"88px"},initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:16,scale:.96},transition:{type:"spring",stiffness:360,damping:30},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(5,3,1,0.88)",border:"1px solid rgba(56,189,248,0.22)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(56,189,248,0.06), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer select-none",style:{borderBottom:i?"none":"1px solid rgba(255,255,255,0.06)"},onClick:()=>a(d=>!d),children:[r.jsx(BS,{size:11,className:"text-sky-400/70 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-bold text-white/60 flex-1 tracking-wide uppercase",children:"Gezi Haritası"}),o&&r.jsxs("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx($.span,{className:"w-1.5 h-1.5 rounded-full bg-sky-400",animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0}}),r.jsx("span",{className:"text-[10px] text-sky-400/70 font-medium",children:"taranıyor"})]}),r.jsx("span",{className:"text-[10px] text-white/25 flex-shrink-0 font-mono ml-1",children:e.length}),r.jsx("button",{onClick:d=>{d.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(st,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(hh,{size:10}):r.jsx(ea,{size:10})})]}),r.jsx(ee,{children:!i&&r.jsxs($.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.18},className:"overflow-hidden",children:[r.jsx("div",{className:"overflow-y-auto divide-y divide-white/4",style:{maxHeight:"260px"},children:r.jsx(ee,{mode:"popLayout",children:e.map((d,p)=>r.jsx($.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(N_,{entry:d,isLatest:p===0&&o})},d.id))})}),r.jsx("div",{className:"px-3 py-1.5 flex items-center justify-between",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-white/20 font-mono",children:[e.filter(d=>d.kind==="navigate").length," gezinti ·"," ",e.filter(d=>d.kind==="search").length," arama ·"," ",e.filter(d=>d.kind==="request").length," istek"]})})]})})]})})}function C_(e){if(!e.created_at)return"Older";const t=new Date,n=new Date(e.created_at),s=(t.getTime()-n.getTime())/864e5;return s<1&&t.getDate()===n.getDate()?"Today":s<2&&t.getDate()-n.getDate()===1?"Yesterday":s<7?"Last 7 Days":"Older"}const __=["Today","Yesterday","Last 7 Days","Older"],E_="flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium mb-0.5 w-full text-left",T_="bg-orange-500/15 text-orange-300 border border-orange-500/25",P_="text-white/80 hover:text-white/95 hover:bg-white/6";function A_(e){return tt(E_,e?T_:P_)}function M_(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function z_({onClose:e}){const{t}=ht(),n=is(),s=hn(),i=n.pathname,[a,o]=f.useState([]),[l,c]=f.useState(null),[u,d]=f.useState(""),[p,h]=f.useState(null),[m,v]=f.useState(null),[w,b]=f.useState(""),[g,x]=f.useState(""),[k,C]=f.useState(!1),j=f.useCallback(async()=>{try{const T=await U("/api/chats");if(!T.ok)return;const O=await T.json();o(O);const F=new Set([...O.map(D=>D.id),"default"]);for(let D=localStorage.length-1;D>=0;D--){const M=localStorage.key(D);M!=null&&M.startsWith("mustb_chat_turns_")&&!F.has(M.slice(17))&&localStorage.removeItem(M)}}catch{}},[]);f.useEffect(()=>{j();const T=setInterval(j,1e4);return()=>clearInterval(T)},[j]),f.useEffect(()=>{const T=O=>{const{id:F,title:D}=O.detail;o(M=>M.map(z=>z.id===F?{...z,title:D}:z))};return window.addEventListener("mustb:chat-renamed",T),()=>window.removeEventListener("mustb:chat-renamed",T)},[]),f.useEffect(()=>{U("/api/setup/status").then(T=>T.ok?T.json():null).then(T=>{T&&(b(T.activeProvider??""),x(T.activeModel??""))}).catch(()=>{}),fetch("/api/auth/user-status").then(T=>T.json()).then(T=>C(!!T.authenticated)).catch(()=>{})},[]);const S=async()=>{try{const T=await U("/api/chats",{method:"POST",body:JSON.stringify({title:"New Chat"})});if(!T.ok){pe.error("Failed to create chat.");return}const O=await T.json();o(F=>[O,...F]),s(`/app?chat=${O.id}`),e()}catch{pe.error("Gateway unreachable.")}},y=async()=>{if(p){try{await U(`/api/chats/${p}`,{method:"DELETE"}),o(T=>T.filter(O=>O.id!==p)),pe.success("Chat deleted."),i.includes(p)&&s("/app")}catch{pe.error("Failed to delete chat.")}h(null)}},N=async T=>{v(null);try{await U(`/api/chats/${T}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(O=>O.filter(F=>F.id!==T)),pe.success("Chat archived.")}catch{pe.error("Failed to archive chat.")}},P=async()=>{if(!l||!u.trim()){c(null);return}try{await U(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:u})}),o(T=>T.map(O=>O.id===l?{...O,title:u}:O)),pe.success("Chat renamed.")}catch{pe.error("Failed to rename chat.")}c(null)},_=[{to:"/app/browser",icon:r.jsx(Xe,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx(a4,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(Re,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Sr,{size:14}),label:t.nav.plugins},{to:"/app/files",icon:r.jsx(os,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(rl,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(yh,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(n1,{size:14}),label:t.nav.apiKeys}];return r.jsxs("aside",{className:"w-[280px] h-full bg-[#0d0703] border-r border-orange-500/10 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex items-center h-[60px] pl-14 pr-4 shrink-0",children:r.jsxs(hi,{to:"/app",onClick:e,className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[r.jsxs("div",{className:"relative w-7 h-7 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-sm opacity-40"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[18px] font-black tracking-tight text-white/90 leading-none select-none",children:"Must-b"})]})}),r.jsx("p",{className:"text-[10px] font-bold text-white/30 uppercase tracking-widest px-3 mb-2",children:"Sohbet"}),r.jsx("div",{className:"px-3 pb-3 shrink-0",children:r.jsxs("button",{onClick:S,className:"flex items-center justify-center gap-2 w-full px-3 py-1.5 rounded-lg border border-orange-500/20 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20 hover:border-orange-500/30 transition-all text-[12px] font-medium",children:[r.jsx(ol,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&v(null),children:[(()=>{const T={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const O of a)T[C_(O)].push(O);return __.map(O=>{const F=T[O];return F.length===0?null:r.jsxs("div",{children:[r.jsx("p",{className:"px-2 mt-3 mb-1 text-[9.5px] font-bold text-white/20 uppercase tracking-widest",children:O}),r.jsx("div",{className:"space-y-0.5",children:F.map(D=>r.jsx("div",{className:"group relative",children:l===D.id?r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-orange-500/10 rounded-lg border border-orange-500/25",children:[r.jsx("input",{value:u,onChange:M=>d(M.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:M=>{M.key==="Enter"&&P(),M.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:P,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(Kt,{size:12})}),r.jsx("button",{onClick:()=>c(null),className:"p-1 text-red-400 hover:bg-red-400/10 rounded transition-colors",children:r.jsx(st,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(hi,{to:`/app?chat=${D.id}`,onClick:e,className:tt("flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium pr-8",i.includes(D.id)?"bg-orange-500/15 text-orange-300 border border-orange-500/25":"text-white/55 hover:text-white/85 hover:bg-white/6"),children:[r.jsx(ta,{size:13,className:i.includes(D.id)?"text-orange-400 shrink-0":"text-white/30 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:D.title})]}),r.jsx("button",{onClick:M=>{M.preventDefault(),M.stopPropagation(),v(m===D.id?null:D.id)},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded text-white/25 hover:text-white/70 hover:bg-white/8 opacity-0 group-hover:opacity-100 transition-all",children:r.jsx(_S,{size:14})}),m===D.id&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[150px] rounded-xl py-1 overflow-hidden",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.15)",backdropFilter:"blur(20px)"},onClick:M=>M.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{v(null),c(D.id),d(D.title)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(WS,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>N(D.id),className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(vS,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:M=>{M.preventDefault(),M.stopPropagation(),v(null),h(D.id)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[r.jsx(Ls,{size:12,className:"shrink-0"})," Delete"]})]})]})},D.id))})]},O)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),_.map(({to:T,icon:O,label:F,exact:D})=>{const M=T.split("?")[0],z=D?i===M:i.startsWith(M);return r.jsxs(hi,{to:T,onClick:e,className:A_(z),children:[r.jsx("span",{className:M_(z),children:O}),F]},T)})]}),r.jsxs("div",{className:"border-t border-orange-500/10 p-3 shrink-0",children:[g&&r.jsxs("div",{className:"mb-2 px-1",children:[r.jsx("p",{className:"text-[9px] text-white/25 font-bold uppercase tracking-[0.2em] mb-0.5",children:"Active Model"}),r.jsx("p",{className:"text-orange-400 text-[11px] font-bold truncate",children:g}),w&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:w})]}),k&&r.jsxs("button",{onClick:async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}catch{}e(),s("/app"),window.location.reload()},className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-white/30 hover:text-red-400 hover:bg-red-500/10 transition-all text-xs font-medium",children:[r.jsx(mh,{size:13}),t.sidebar.logout]}),r.jsxs("p",{className:"mt-2 text-[10px] text-white/20 px-1",children:[t.sidebar.poweredBy," ",r.jsx("span",{className:"text-orange-500/70 font-semibold",children:"Auto Step"})]})]}),p&&r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",children:r.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.18)"},children:[r.jsx("h3",{className:"text-lg font-bold text-white/90 mb-2",children:t.sidebar.deleteChat}),r.jsx("p",{className:"text-white/45 text-sm mb-6",children:t.sidebar.deleteConfirm}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("button",{onClick:()=>h(null),className:"flex-1 px-4 py-2 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-sm font-medium transition-colors",children:t.sidebar.cancel}),r.jsx("button",{onClick:y,className:"flex-1 px-4 py-2 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-medium transition-colors",children:t.sidebar.delete})]})]})})]})}function he(e){window.dispatchEvent(new CustomEvent("mustb:invoke-skill",{detail:{skill:e}})),setTimeout(()=>{var t;return(t=document.querySelector("textarea"))==null?void 0:t.focus()},80)}function R_({panel:e,title:t,onClose:n}){return f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(ee,{children:[r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-40 bg-black/55 backdrop-blur-[3px]",onClick:n},"stage-backdrop"),r.jsxs($.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",stiffness:380,damping:32},className:`fixed z-50 top-[72px] left-1/2 -translate-x-1/2
728
+ group-hover:bg-red-500/10 transition-all shrink-0`,children:r.jsx(mh,{size:13})}),r.jsx("span",{className:"text-[12px] font-semibold text-white/50 group-hover:text-red-400 transition-colors",children:i?"Signing out…":"Sign Out"})]})]}),r.jsx("div",{className:"px-4 py-2 border-t border-white/6",children:r.jsx("p",{className:"text-[9.5px] text-white/18 text-center",children:"must-b.com · Secure OAuth connection"})})]},"profile-panel")})]})}const h_=4,p_=3e3;function f_(){return r.jsxs($.div,{className:"fixed inset-0 z-[200] pointer-events-none flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[r.jsx("div",{className:"absolute inset-0 bg-black/35"}),Array.from({length:h_}).map((e,t)=>r.jsx($.span,{className:"absolute rounded-full",style:{border:"1.5px solid rgba(249,115,22,0.70)",boxShadow:"0 0 20px rgba(249,115,22,0.25)"},initial:{width:64,height:64,opacity:.9,scale:1},animate:{width:64+t*0,height:64+t*0,scale:[1,3.5+t*1.2],opacity:[.8,0]},transition:{duration:1.8,delay:t*.22,ease:"easeOut",repeat:1/0,repeatDelay:.1}},t)),r.jsx($.div,{className:"relative z-10 w-16 h-16 rounded-full flex items-center justify-center",style:{background:"rgba(249,115,22,0.18)",border:"1.5px solid rgba(249,115,22,0.55)",backdropFilter:"blur(16px)",boxShadow:"0 0 32px rgba(249,115,22,0.35), 0 0 64px rgba(249,115,22,0.15)"},animate:{scale:[1,1.06,1]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:r.jsx(Nr,{size:26,className:"text-orange-400"})}),r.jsx($.p,{className:"absolute text-[12px] font-semibold text-orange-300/80 tracking-widest uppercase",style:{top:"calc(50% + 52px)"},initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:.15,duration:.3},children:"Dinliyorum…"})]})}function m_(){const[e,t]=f.useState(!1),n=f.useRef(null),s=f.useCallback(()=>{t(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>t(!1),p_)},[]);return f.useEffect(()=>(window.addEventListener("mustb:wake",s),()=>{window.removeEventListener("mustb:wake",s),n.current&&clearTimeout(n.current)}),[s]),r.jsx(ee,{children:e&&r.jsx(f_,{},"wake-aura")})}const g_={browser_navigate:"navigate",web_search:"search",http_request:"request"},x_=20,y_=5e3;function v_(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e.slice(0,30)}}function b_(e){try{return new URL(e).pathname.slice(0,40)||"/"}catch{return""}}function w_(e){return e==="search"?r.jsx(qt,{size:10}):e==="request"?r.jsx(zr,{size:10}):r.jsx(Ye,{size:10})}function _1(e){return e==="search"?"#a78bfa":e==="request"?"#94a3b8":"#38bdf8"}function k_({domain:e,kind:t}){var i;const n=((i=e[0])==null?void 0:i.toUpperCase())??"?",s=_1(t);return r.jsx("span",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 text-[10px] font-black",style:{background:`${s}18`,border:`1px solid ${s}30`,color:s},children:n})}function j_({entry:e,isLatest:t}){var a;const n=_1(e.kind),s=e.domain??"",i=e.query??(e.url?b_(e.url):"");return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",style:{borderLeft:t?`2px solid ${n}`:"2px solid transparent",background:t?`${n}08`:"transparent"},children:[r.jsx(k_,{domain:s||"?",kind:e.kind}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-[11px] font-semibold text-white/80 truncate leading-tight",children:s||((a=e.query)==null?void 0:a.slice(0,30))||"—"}),i&&r.jsx("p",{className:"text-[9px] text-white/35 truncate font-mono mt-0.5",children:i})]}),r.jsx("span",{style:{color:n,opacity:.6},className:"flex-shrink-0",children:w_(e.kind)}),r.jsx("span",{className:"text-[9px] text-white/20 font-mono flex-shrink-0",children:new Date(e.ts).toLocaleTimeString("tr-TR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})}function N_(){const[e,t]=f.useState([]),[n,s]=f.useState(!1),[i,a]=f.useState(!1),[o,l]=f.useState(!1),c=f.useRef(null),u=f.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(!1),t([]),l(!1)},y_)},[]);return f.useEffect(()=>{const d=pt(),p=h=>{const{type:m}=h;if(m==="planStart"){c.current&&clearTimeout(c.current),l(!0);return}if(m==="planFinish"){l(!1),t(y=>y.map(w=>({...w,done:!0}))),u();return}if(m==="stepStart"&&h.step){const y=h.step,w=y.tool?g_[y.tool]:void 0;if(!w)return;const v=y.parameters??{},g=String(v.url??v.endpoint??"").trim(),x=String(v.query??"").trim();if(!g&&!x)return;const k={id:`v-${Date.now()}-${Math.random().toString(36).slice(2,5)}`,kind:w,url:g||void 0,query:x||void 0,domain:g?v_(g):void 0,ts:Date.now(),done:!1};t(j=>[k,...j].slice(0,x_)),s(!0),a(!1)}};return d.on("agentUpdate",p),()=>{d.off("agentUpdate",p),c.current&&clearTimeout(c.current)}},[u]),!n||e.length===0?null:r.jsx($.div,{className:"fixed right-4 z-[120] w-[300px]",style:{top:"88px"},initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:16,scale:.96},transition:{type:"spring",stiffness:360,damping:30},children:r.jsxs("div",{className:"rounded-2xl overflow-hidden",style:{background:"rgba(5,3,1,0.88)",border:"1px solid rgba(56,189,248,0.22)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(56,189,248,0.06), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 cursor-pointer select-none",style:{borderBottom:i?"none":"1px solid rgba(255,255,255,0.06)"},onClick:()=>a(d=>!d),children:[r.jsx(IS,{size:11,className:"text-sky-400/70 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-bold text-white/60 flex-1 tracking-wide uppercase",children:"Gezi Haritası"}),o&&r.jsxs("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx($.span,{className:"w-1.5 h-1.5 rounded-full bg-sky-400",animate:{opacity:[1,.3,1]},transition:{duration:1,repeat:1/0}}),r.jsx("span",{className:"text-[10px] text-sky-400/70 font-medium",children:"taranıyor"})]}),r.jsx("span",{className:"text-[10px] text-white/25 flex-shrink-0 font-mono ml-1",children:e.length}),r.jsx("button",{onClick:d=>{d.stopPropagation(),s(!1),t([])},className:"text-white/20 hover:text-white/50 transition-colors flex-shrink-0 ml-1",children:r.jsx(st,{size:10})}),r.jsx("span",{className:"text-white/20 flex-shrink-0",children:i?r.jsx(hh,{size:10}):r.jsx(ea,{size:10})})]}),r.jsx(ee,{children:!i&&r.jsxs($.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.18},className:"overflow-hidden",children:[r.jsx("div",{className:"overflow-y-auto divide-y divide-white/4",style:{maxHeight:"260px"},children:r.jsx(ee,{mode:"popLayout",children:e.map((d,p)=>r.jsx($.div,{layout:!0,initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:r.jsx(j_,{entry:d,isLatest:p===0&&o})},d.id))})}),r.jsx("div",{className:"px-3 py-1.5 flex items-center justify-between",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:r.jsxs("span",{className:"text-[9px] text-white/20 font-mono",children:[e.filter(d=>d.kind==="navigate").length," gezinti ·"," ",e.filter(d=>d.kind==="search").length," arama ·"," ",e.filter(d=>d.kind==="request").length," istek"]})})]})})]})})}function S_(e){if(!e.created_at)return"Older";const t=new Date,n=new Date(e.created_at),s=(t.getTime()-n.getTime())/864e5;return s<1&&t.getDate()===n.getDate()?"Today":s<2&&t.getDate()-n.getDate()===1?"Yesterday":s<7?"Last 7 Days":"Older"}const C_=["Today","Yesterday","Last 7 Days","Older"],__="flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium mb-0.5 w-full text-left",E_="bg-orange-500/15 text-orange-300 border border-orange-500/25",T_="text-white/80 hover:text-white/95 hover:bg-white/6";function P_(e){return tt(__,e?E_:T_)}function A_(e){return e?"text-orange-400 shrink-0":"text-white/70 shrink-0"}function M_({onClose:e}){const{t}=ht(),n=is(),s=un(),i=n.pathname,[a,o]=f.useState([]),[l,c]=f.useState(null),[u,d]=f.useState(""),[p,h]=f.useState(null),[m,y]=f.useState(null),[w,v]=f.useState(""),[g,x]=f.useState(""),[k,j]=f.useState(!1),b=f.useCallback(async()=>{try{const P=await U("/api/chats");if(!P.ok)return;const O=await P.json();o(O);const F=new Set([...O.map(D=>D.id),"default"]);for(let D=localStorage.length-1;D>=0;D--){const M=localStorage.key(D);M!=null&&M.startsWith("mustb_chat_turns_")&&!F.has(M.slice(17))&&localStorage.removeItem(M)}}catch{}},[]);f.useEffect(()=>{b();const P=setInterval(b,1e4);return()=>clearInterval(P)},[b]),f.useEffect(()=>{const P=O=>{const{id:F,title:D}=O.detail;o(M=>M.map(z=>z.id===F?{...z,title:D}:z))};return window.addEventListener("mustb:chat-renamed",P),()=>window.removeEventListener("mustb:chat-renamed",P)},[]),f.useEffect(()=>{U("/api/setup/status").then(P=>P.ok?P.json():null).then(P=>{P&&(v(P.activeProvider??""),x(P.activeModel??""))}).catch(()=>{}),fetch("/api/auth/user-status").then(P=>P.json()).then(P=>j(!!P.authenticated)).catch(()=>{})},[]);const S=async()=>{try{const P=await U("/api/chats",{method:"POST",body:JSON.stringify({title:"New Chat"})});if(!P.ok){he.error("Failed to create chat.");return}const O=await P.json();o(F=>[O,...F]),s(`/app?chat=${O.id}`),e()}catch{he.error("Gateway unreachable.")}},N=async()=>{if(p){try{await U(`/api/chats/${p}`,{method:"DELETE"}),o(P=>P.filter(O=>O.id!==p)),he.success("Chat deleted."),i.includes(p)&&s("/app")}catch{he.error("Failed to delete chat.")}h(null)}},C=async P=>{y(null);try{await U(`/api/chats/${P}`,{method:"PATCH",body:JSON.stringify({archived:!0})}),o(O=>O.filter(F=>F.id!==P)),he.success("Chat archived.")}catch{he.error("Failed to archive chat.")}},_=async()=>{if(!l||!u.trim()){c(null);return}try{await U(`/api/chats/${l}`,{method:"PATCH",body:JSON.stringify({title:u})}),o(P=>P.map(O=>O.id===l?{...O,title:u}:O)),he.success("Chat renamed.")}catch{he.error("Failed to rename chat.")}c(null)},E=[{to:"/app/browser",icon:r.jsx(Ye,{size:14}),label:t.nav.browser},{to:"/app/automations",icon:r.jsx(r4,{size:14}),label:t.nav.workflows},{to:"/app/skills",icon:r.jsx(Re,{size:14}),label:t.nav.skills},{to:"/app/plugins",icon:r.jsx(Sr,{size:14}),label:t.nav.plugins},{to:"/app/files",icon:r.jsx(os,{size:14}),label:t.nav.files},{to:"/app/memory",icon:r.jsx(rl,{size:14}),label:t.nav.memory,exact:!0},{to:"/app/settings",icon:r.jsx(yh,{size:14}),label:t.nav.settings,exact:!0},{to:"/app/settings?tab=api-keys",icon:r.jsx(t1,{size:14}),label:t.nav.apiKeys}];return r.jsxs("aside",{className:"w-[280px] h-full bg-[#0d0703] border-r border-orange-500/10 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"flex items-center h-[60px] pl-14 pr-4 shrink-0",children:r.jsxs(hi,{to:"/app",onClick:e,className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:[r.jsxs("div",{className:"relative w-7 h-7 shrink-0",children:[r.jsx("div",{className:"absolute inset-0 bg-orange-500 rounded-full blur-sm opacity-40"}),r.jsx("img",{src:"/logo.png",alt:"Must-b",className:"w-full h-full object-contain relative z-10"})]}),r.jsx("span",{className:"text-[18px] font-black tracking-tight text-white/90 leading-none select-none",children:"Must-b"})]})}),r.jsx("p",{className:"text-[10px] font-bold text-white/30 uppercase tracking-widest px-3 mb-2",children:"Sohbet"}),r.jsx("div",{className:"px-3 pb-3 shrink-0",children:r.jsxs("button",{onClick:S,className:"flex items-center justify-center gap-2 w-full px-3 py-1.5 rounded-lg border border-orange-500/20 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20 hover:border-orange-500/30 transition-all text-[12px] font-medium",children:[r.jsx(ol,{size:14}),t.sidebar.newChat]})}),r.jsxs("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-2 pb-4",onClick:()=>m&&y(null),children:[(()=>{const P={Today:[],Yesterday:[],"Last 7 Days":[],Older:[]};for(const O of a)P[S_(O)].push(O);return C_.map(O=>{const F=P[O];return F.length===0?null:r.jsxs("div",{children:[r.jsx("p",{className:"px-2 mt-3 mb-1 text-[9.5px] font-bold text-white/20 uppercase tracking-widest",children:O}),r.jsx("div",{className:"space-y-0.5",children:F.map(D=>r.jsx("div",{className:"group relative",children:l===D.id?r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-orange-500/10 rounded-lg border border-orange-500/25",children:[r.jsx("input",{value:u,onChange:M=>d(M.target.value),className:"flex-1 bg-transparent text-[13px] text-white/80 outline-none min-w-0",autoFocus:!0,onKeyDown:M=>{M.key==="Enter"&&_(),M.key==="Escape"&&c(null)}}),r.jsx("button",{onClick:_,className:"p-1 text-green-400 hover:bg-green-400/10 rounded transition-colors",children:r.jsx(Kt,{size:12})}),r.jsx("button",{onClick:()=>c(null),className:"p-1 text-red-400 hover:bg-red-400/10 rounded transition-colors",children:r.jsx(st,{size:12})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(hi,{to:`/app?chat=${D.id}`,onClick:e,className:tt("flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all text-[13px] font-medium pr-8",i.includes(D.id)?"bg-orange-500/15 text-orange-300 border border-orange-500/25":"text-white/55 hover:text-white/85 hover:bg-white/6"),children:[r.jsx(ta,{size:13,className:i.includes(D.id)?"text-orange-400 shrink-0":"text-white/30 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:D.title})]}),r.jsx("button",{onClick:M=>{M.preventDefault(),M.stopPropagation(),y(m===D.id?null:D.id)},className:"absolute right-1 top-1/2 -translate-y-1/2 p-1 rounded text-white/25 hover:text-white/70 hover:bg-white/8 opacity-0 group-hover:opacity-100 transition-all",children:r.jsx(SS,{size:14})}),m===D.id&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[150px] rounded-xl py-1 overflow-hidden",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.15)",backdropFilter:"blur(20px)"},onClick:M=>M.stopPropagation(),children:[r.jsxs("button",{onClick:()=>{y(null),c(D.id),d(D.title)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(WS,{size:12,className:"text-white/35 shrink-0"})," Rename"]}),r.jsxs("button",{onClick:()=>C(D.id),className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-white/60 hover:bg-white/5 transition-colors",children:[r.jsx(xS,{size:12,className:"text-white/35 shrink-0"})," Archive"]}),r.jsx("hr",{className:"my-1 border-white/8"}),r.jsxs("button",{onClick:M=>{M.preventDefault(),M.stopPropagation(),y(null),h(D.id)},className:"flex items-center gap-2.5 w-full px-3 py-2 text-[12px] text-red-400 hover:bg-red-500/10 transition-colors",children:[r.jsx(Ls,{size:12,className:"shrink-0"})," Delete"]})]})]})},D.id))})]},O)})})(),r.jsx("hr",{className:"my-3 border-white/10"}),E.map(({to:P,icon:O,label:F,exact:D})=>{const M=P.split("?")[0],z=D?i===M:i.startsWith(M);return r.jsxs(hi,{to:P,onClick:e,className:P_(z),children:[r.jsx("span",{className:A_(z),children:O}),F]},P)})]}),r.jsxs("div",{className:"border-t border-orange-500/10 p-3 shrink-0",children:[g&&r.jsxs("div",{className:"mb-2 px-1",children:[r.jsx("p",{className:"text-[9px] text-white/25 font-bold uppercase tracking-[0.2em] mb-0.5",children:"Active Model"}),r.jsx("p",{className:"text-orange-400 text-[11px] font-bold truncate",children:g}),w&&r.jsx("p",{className:"text-white/30 text-[10px] capitalize",children:w})]}),k&&r.jsxs("button",{onClick:async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}catch{}e(),s("/app"),window.location.reload()},className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-white/30 hover:text-red-400 hover:bg-red-500/10 transition-all text-xs font-medium",children:[r.jsx(mh,{size:13}),t.sidebar.logout]}),r.jsxs("p",{className:"mt-2 text-[10px] text-white/20 px-1",children:[t.sidebar.poweredBy," ",r.jsx("span",{className:"text-orange-500/70 font-semibold",children:"Auto Step"})]})]}),p&&r.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",children:r.jsxs("div",{className:"rounded-2xl p-6 w-full max-w-sm shadow-2xl",style:{background:"rgba(16,6,2,0.97)",border:"1px solid rgba(249,115,22,0.18)"},children:[r.jsx("h3",{className:"text-lg font-bold text-white/90 mb-2",children:t.sidebar.deleteChat}),r.jsx("p",{className:"text-white/45 text-sm mb-6",children:t.sidebar.deleteConfirm}),r.jsxs("div",{className:"flex gap-3",children:[r.jsx("button",{onClick:()=>h(null),className:"flex-1 px-4 py-2 rounded-xl bg-white/8 hover:bg-white/12 text-white/70 text-sm font-medium transition-colors",children:t.sidebar.cancel}),r.jsx("button",{onClick:N,className:"flex-1 px-4 py-2 rounded-xl bg-red-600 hover:bg-red-500 text-white text-sm font-medium transition-colors",children:t.sidebar.delete})]})]})})]})}function de(e){window.dispatchEvent(new CustomEvent("mustb:invoke-skill",{detail:{skill:e}})),setTimeout(()=>{var t;return(t=document.querySelector("textarea"))==null?void 0:t.focus()},80)}function z_({panel:e,title:t,onClose:n}){return f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n]),r.jsxs(ee,{children:[r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-40 bg-black/55 backdrop-blur-[3px]",onClick:n},"stage-backdrop"),r.jsxs($.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{type:"spring",stiffness:380,damping:32},className:`fixed z-50 top-[72px] left-1/2 -translate-x-1/2
739
729
  w-full max-w-2xl max-h-[calc(100vh-92px)]
740
730
  glass-panel rounded-3xl overflow-hidden flex flex-col
741
- shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx(UC,{}),e==="plugins"&&r.jsx(GC,{}),e==="skills"&&r.jsx(XC,{}),e==="workspace"&&r.jsx(t_,{}),e==="livesight"&&r.jsx(n_,{})]})]},"stage-card")]})}function L_(){const{t:e}=ht(),t=is(),n=hn(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[u,d]=f.useState(!1);f.useEffect(()=>{const v=w=>{d(w.detail.active)};return window.addEventListener("mustb:safeMode",v),()=>window.removeEventListener("mustb:safeMode",v)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(v=>o(w=>w===v?"":v),[]),f.useCallback(v=>{c(v),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(Z2,{reducedMotion:u?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(R_,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(v=>!v),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(VS,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(hi,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(jS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx($.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(VC,{})}),r.jsx(h_,{})]})]}),r.jsx(ee,{children:s&&r.jsx($.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(z_,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(t2,{})}),r.jsx(r_,{}),r.jsx(u_,{}),r.jsx(g_,{}),r.jsx(S_,{})]})})}const O_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:AS,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:SS,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:JS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function D_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=pt(),u=d=>{d.type==="CONFLICT_DETECTED"&&(t({localAgentName:d.localAgentName??null,cloudAgentName:d.cloudAgentName??null,localMtime:d.localMtime??null,cloudTimestamp:d.cloudTimestamp??null}),a(!1)),d.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",u),()=>{c.off("agentUpdate",u)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(ee,{children:e&&r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs($.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(es,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):O_.map(c=>{const u=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(re,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(u,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}class I_ extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const dc="mustb_setup_complete";function B_({children:e}){const t=hn(),[n,s]=f.useState(()=>localStorage.getItem(dc)==="1");return f.useEffect(()=>{if(localStorage.getItem(dc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(dc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function F_(){return r.jsx(I_,{children:r.jsx(f4,{children:r.jsxs(d2,{children:[r.jsx($2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(D_,{}),r.jsxs(s2,{children:[r.jsx(we,{path:"/",element:r.jsx(xm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(xm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(b4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(B_,{children:r.jsx(L_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(zm,{})}),r.jsx(we,{path:"chat",element:r.jsx(zm,{})}),r.jsx(we,{path:"settings",element:r.jsx(eC,{})}),r.jsx(we,{path:"active",element:r.jsx(nC,{})}),r.jsx(we,{path:"automations",element:r.jsx(iC,{})}),r.jsx(we,{path:"clients",element:r.jsx(lC,{})}),r.jsx(we,{path:"logs",element:r.jsx(hC,{})}),r.jsx(we,{path:"products",element:r.jsx(mC,{})}),r.jsx(we,{path:"memory",element:r.jsx(kC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(SC,{})}),r.jsx(we,{path:"skills",element:r.jsx(_C,{})}),r.jsx(we,{path:"plugins",element:r.jsx(PC,{})}),r.jsx(we,{path:"files",element:r.jsx(zC,{})}),r.jsx(we,{path:"browser",element:r.jsx(DC,{})}),r.jsx(we,{path:"voice",element:r.jsx(FC,{})}),r.jsx(we,{path:"*",element:r.jsx(Wp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(MC,{})}),r.jsx(we,{path:"*",element:r.jsx(Wp,{to:"/",replace:!0})})]})]})})})}ax(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(F_,{})}));
731
+ shadow-[0_24px_80px_rgba(0,0,0,0.7),0_0_0_1px_rgba(249,115,22,0.18)]`,onClick:s=>s.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-orange-500/12 shrink-0",children:[r.jsx("span",{className:"text-[13px] font-bold text-white/80",children:t}),r.jsx("button",{onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-full hover:bg-white/8 text-white/40 hover:text-white/70 transition-colors",children:r.jsx(st,{size:14})})]}),r.jsxs("div",{className:"flex-1 overflow-hidden min-h-0",children:[e==="memory"&&r.jsx($C,{}),e==="plugins"&&r.jsx(WC,{}),e==="skills"&&r.jsx(YC,{}),e==="workspace"&&r.jsx(e_,{}),e==="livesight"&&r.jsx(t_,{})]})]},"stage-card")]})}function R_(){const{t:e}=ht(),t=is(),n=un(),[s,i]=f.useState(!1),[a,o]=f.useState(""),[l,c]=f.useState(null),[u,d]=f.useState(!1);f.useEffect(()=>{const y=w=>{d(w.detail.active)};return window.addEventListener("mustb:safeMode",y),()=>window.removeEventListener("mustb:safeMode",y)},[]),f.useEffect(()=>{i(!1)},[t.pathname]),t.pathname,f.useCallback(y=>o(w=>w===y?"":y),[]),f.useCallback(y=>{c(y),o("")},[]);const p=f.useCallback(()=>c(null),[]),h=e.dock;h.cat_webTools,h.skill_webSearch,h.desc_webSearch,h.skill_webFetch,h.desc_webFetch,h.skill_browserControl,h.desc_browserControl,h.cat_fileMedia,h.skill_pdfReader,h.desc_pdfReader,h.skill_imageAnalysis,h.desc_imageAnalysis,h.skill_imageGeneration,h.desc_imageGeneration,h.skill_tts,h.desc_tts,h.cat_aiAgents,h.skills,h.skill_spawnAgent,h.desc_spawnAgent,h.skill_agentSessions,h.desc_agentSessions,h.skill_canvas,h.desc_canvas,h.skill_git,h.desc_git,h.cat_systemTools,h.skill_gateway,h.desc_gateway,h.skill_fileManager,h.desc_fileManager,h.skill_cron,h.desc_cron,h.skill_messages,h.desc_messages,h.cat_knowledgeBase,h.mem_browse,h.desc_memBrowse,h.mem_search,h.desc_memSearch,h.mem_add,h.desc_memAdd,h.cat_personalOrg,h.mem_contacts,h.desc_contacts,h.mem_calendar,h.desc_calendar,h.cat_pluginManager,h.plug_marketplace,h.desc_marketplace,h.plug_installed,h.desc_installed,h.plug_mcp,h.desc_mcp,h.cat_developer,h.plug_bundleMcp,h.desc_bundleMcp,h.plug_cliCmds,h.desc_cliCmds,h.cat_automation,h.wf_automations,h.desc_automations,h.wf_scheduled,h.desc_scheduled,h.wf_commands,h.desc_commands,h.cat_advanced,h.wf_nodes,h.desc_nodes,h.wf_multiAgent,h.desc_multiAgent;const m={memory:h.memory,plugins:h.plugins,skills:h.skills,workspace:h.files,livesight:"Visual Audit"};return r.jsx(Q2,{reducedMotion:u?"always":"never",children:r.jsxs("div",{className:"relative min-h-screen overflow-x-hidden font-sans bg-transparent",children:[l&&r.jsx(z_,{panel:l,title:m[l],onClose:p}),r.jsx("div",{className:"fixed top-[14px] left-4 z-40 overflow-hidden",children:r.jsx("button",{onClick:()=>i(y=>!y),"aria-label":"Toggle sidebar",className:"p-2 rounded-full text-white/45 hover:text-white/90 hover:bg-white/8 transition-all leading-none",style:{backdropFilter:"blur(8px)",fontSize:0},children:r.jsx(FS,{size:17,"aria-hidden":"true",focusable:"false"})})}),r.jsxs("header",{className:"fixed top-0 inset-x-0 z-50 h-16 flex items-center justify-between px-6 pointer-events-none",children:[r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 pointer-events-auto",children:[r.jsxs(hi,{to:"/app/voice",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[12px] font-medium transition-all select-none ${t.pathname==="/app/voice"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":"text-white/45 hover:text-white/85 hover:bg-white/8"}`,title:e.nav.voice,children:[r.jsx(wS,{size:14}),r.jsx("span",{className:"hidden sm:inline",children:e.nav.voice})]}),r.jsx($.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},transition:{duration:.4,delay:.15},className:"flex items-center gap-1 px-2 py-1.5 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.09)"},children:r.jsx(FC,{})}),r.jsx(d_,{})]})]}),r.jsx(ee,{children:s&&r.jsx($.div,{initial:{x:-280},animate:{x:0},exit:{x:-280},transition:{type:"spring",stiffness:340,damping:34},className:"fixed top-0 left-0 bottom-0 z-30 w-[280px]",children:r.jsx(M_,{onClose:()=>i(!1)})},"sidebar-panel")}),r.jsx("main",{className:"relative min-h-screen pt-16 transition-[margin] duration-300 bg-transparent",style:{marginLeft:s?280:0},children:r.jsx(Zw,{})}),r.jsx(s_,{}),r.jsx(c_,{}),r.jsx(m_,{}),r.jsx(N_,{})]})})}const L_=[{decision:"duplicate",label:"Create New Agent",sublabel:"Keep both — cloud data is copied to a separate folder",icon:TS,accent:"border-blue-500/30 bg-blue-500/8 hover:border-blue-500/50 text-blue-400"},{decision:"restore",label:"Use Cloud (Overwrite)",sublabel:"Cloud wins — local memory is replaced with cloud version",icon:jS,accent:"border-orange-500/30 bg-orange-500/8 hover:border-orange-500/50 text-orange-400"},{decision:"upload",label:"Keep Mine",sublabel:"Local wins — cloud memory is overwritten with local data",icon:JS,accent:"border-green-500/30 bg-green-500/8 hover:border-green-500/50 text-green-400"}];function O_(){const[e,t]=f.useState(null),[n,s]=f.useState(!1),[i,a]=f.useState(!1);f.useEffect(()=>{const c=pt(),u=d=>{d.type==="CONFLICT_DETECTED"&&(t({localAgentName:d.localAgentName??null,cloudAgentName:d.cloudAgentName??null,localMtime:d.localMtime??null,cloudTimestamp:d.cloudTimestamp??null}),a(!1)),d.type==="syncResolveFinish"&&(a(!0),setTimeout(()=>{t(null),a(!1)},1800))};return c.on("agentUpdate",u),()=>{c.off("agentUpdate",u)}},[]);const o=async c=>{if(!n){s(!0);try{await fetch("/api/setup/sync-resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:c})})}catch{}s(!1)}},l=c=>{if(!c)return"—";try{return new Date(c).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}catch{return c}};return r.jsx(ee,{children:e&&r.jsx($.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/70 backdrop-blur-sm px-4",children:r.jsxs($.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.95},transition:{duration:.25},className:"w-full max-w-md bg-[#0c0f18] border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-6 py-5 border-b border-white/8 bg-amber-500/5",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0",children:r.jsx(es,{size:18,className:"text-amber-400"})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-white font-bold text-base",children:"Memory Conflict Detected"}),r.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"Two agent identities found — action required"})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 px-6 pt-5 pb-2",children:[r.jsxs("div",{className:"rounded-xl border border-white/8 bg-white/3 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1",children:"Local Agent"}),r.jsx("p",{className:"text-white font-bold text-sm",children:e.localAgentName??"—"}),r.jsx("p",{className:"text-gray-600 text-[10px] mt-1",children:l(e.localMtime)})]}),r.jsxs("div",{className:"rounded-xl border border-orange-500/20 bg-orange-500/5 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-bold text-orange-400/60 uppercase tracking-widest mb-1",children:"Cloud Agent"}),r.jsx("p",{className:"text-orange-300 font-bold text-sm",children:e.cloudAgentName??"—"}),r.jsx("p",{className:"text-orange-400/40 text-[10px] mt-1",children:l(e.cloudTimestamp)})]})]}),r.jsx("div",{className:"px-6 py-4 space-y-2",children:i?r.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-green-400 text-sm font-semibold",children:[r.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-green-400 flex items-center justify-center text-[10px]",children:"✓"}),"Conflict resolved"]}):L_.map(c=>{const u=c.icon;return r.jsxs("button",{onClick:()=>o(c.decision),disabled:n,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl border transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed ${c.accent}`,children:[n?r.jsx(oe,{size:16,className:"animate-spin flex-shrink-0"}):r.jsx(u,{size:16,className:"flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-semibold text-sm text-white",children:c.label}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:c.sublabel})]})]},c.decision)})}),r.jsx("div",{className:"px-6 pb-5 pt-1",children:r.jsx("p",{className:"text-[10px] text-gray-700 text-center",children:'This action cannot be undone · If unsure, choose "Create New Agent" first'})})]})})})}class D_ extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}render(){return this.state.error?r.jsxs("div",{className:"min-h-screen bg-[#02040a] flex flex-col items-center justify-center gap-4 text-center px-6",children:[r.jsx("span",{className:"text-3xl",children:"⚠️"}),r.jsx("p",{className:"text-orange-400 font-bold text-sm",children:"Something went wrong"}),r.jsx("p",{className:"text-gray-600 text-xs font-mono max-w-sm break-all",children:this.state.error.message}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-2 px-4 py-2 rounded-xl bg-orange-500/10 border border-orange-500/20 text-orange-400 text-xs font-bold hover:bg-orange-500/20 transition-all",children:"Retry"})]}):this.props.children}}const dc="mustb_setup_complete";function I_({children:e}){const t=un(),[n,s]=f.useState(()=>localStorage.getItem(dc)==="1");return f.useEffect(()=>{if(localStorage.getItem(dc)==="1"){s(!0);return}let i=!1;return fetch("/api/setup/status").then(a=>a.ok?a.json():{configured:!0}).then(a=>{i||(a.configured?(localStorage.setItem(dc,"1"),s(!0)):t("/setup",{replace:!0}))}).catch(()=>{i||s(!0)}),()=>{i=!0}},[t]),n?r.jsx(r.Fragment,{children:e}):null}function B_(){return r.jsx(D_,{children:r.jsx(h4,{children:r.jsxs(c2,{children:[r.jsx(F2,{position:"top-right",theme:"dark",closeButton:!0,richColors:!0}),r.jsx(O_,{}),r.jsxs(t2,{children:[r.jsx(we,{path:"/",element:r.jsx(xm,{})}),r.jsx(we,{path:"/welcome",element:r.jsx(xm,{})}),r.jsx(we,{path:"/setup",element:r.jsx(y4,{})}),r.jsxs(we,{path:"/app",element:r.jsx(I_,{children:r.jsx(R_,{})}),children:[r.jsx(we,{index:!0,element:r.jsx(zm,{})}),r.jsx(we,{path:"chat",element:r.jsx(zm,{})}),r.jsx(we,{path:"settings",element:r.jsx(J3,{})}),r.jsx(we,{path:"active",element:r.jsx(eC,{})}),r.jsx(we,{path:"automations",element:r.jsx(sC,{})}),r.jsx(we,{path:"clients",element:r.jsx(aC,{})}),r.jsx(we,{path:"logs",element:r.jsx(uC,{})}),r.jsx(we,{path:"products",element:r.jsx(pC,{})}),r.jsx(we,{path:"memory",element:r.jsx(bC,{})}),r.jsx(we,{path:"memory/persona",element:r.jsx(jC,{})}),r.jsx(we,{path:"skills",element:r.jsx(SC,{})}),r.jsx(we,{path:"plugins",element:r.jsx(TC,{})}),r.jsx(we,{path:"files",element:r.jsx(MC,{})}),r.jsx(we,{path:"browser",element:r.jsx(OC,{})}),r.jsx(we,{path:"voice",element:r.jsx(BC,{})}),r.jsx(we,{path:"*",element:r.jsx(Wp,{to:"/app",replace:!0})})]}),r.jsx(we,{path:"/mobile",element:r.jsx(AC,{})}),r.jsx(we,{path:"*",element:r.jsx(Wp,{to:"/",replace:!0})})]})]})})})}ax(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(B_,{})}));