levix-bot 4.3.1 → 4.5.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.
Files changed (47) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
  3. package/public/dashboard/assets/index-COI8zgqa.css +2 -0
  4. package/public/dashboard/assets/index-IZMBuNAZ.js +505 -0
  5. package/public/dashboard/index.html +2 -2
  6. package/public/dashboard.css +32 -0
  7. package/scheduler.cjs +66 -7
  8. package/src/bootstrap/panel.js +16 -4
  9. package/src/commands/pack.cjs +159 -0
  10. package/src/commands/packs.cjs +47 -0
  11. package/src/commands/send.cjs +1 -18
  12. package/src/commands/sticker.cjs +77 -232
  13. package/src/commands/stickers.cjs +100 -0
  14. package/src/commands/toimage.cjs +88 -0
  15. package/src/config/defaults.cjs +5 -0
  16. package/src/config/settings.cjs +10 -0
  17. package/src/core/events.js +15 -1
  18. package/src/core/session.js +7 -0
  19. package/src/db/db.cjs +387 -0
  20. package/src/db/store.cjs +746 -24
  21. package/src/handlers/command.handler.js +4 -0
  22. package/src/panel/feedback.cjs +43 -14
  23. package/src/routes/dashboard.api.esm.js +172 -20
  24. package/src/routes/stickers.api.esm.js +570 -0
  25. package/src/services/llmDiscovery.cjs +32 -10
  26. package/src/stickers/errors.cjs +239 -0
  27. package/src/stickers/ffmpeg.cjs +133 -0
  28. package/src/stickers/jobs.cjs +183 -0
  29. package/src/stickers/library.cjs +712 -0
  30. package/src/stickers/limits.cjs +60 -0
  31. package/src/stickers/media.cjs +748 -0
  32. package/src/stickers/options.cjs +128 -0
  33. package/src/stickers/owner.cjs +103 -0
  34. package/src/stickers/studio.cjs +473 -0
  35. package/src/stickers/uploads.cjs +263 -0
  36. package/src/stickers/webp.cjs +231 -0
  37. package/src/stickers/zip.cjs +107 -0
  38. package/src/utils/messageContent.cjs +30 -4
  39. package/src/utils/multipart.esm.js +81 -0
  40. package/src/utils/recurrence.cjs +189 -30
  41. package/src/utils/stickerBot.cjs +84 -0
  42. package/src/utils/storage.cjs +3 -0
  43. package/src/utils/storage.esm.js +3 -0
  44. package/views/login.ejs +39 -3
  45. package/views/setup.ejs +21 -0
  46. package/public/dashboard/assets/index-B6RhYFIy.js +0 -446
  47. package/public/dashboard/assets/index-vEwOcxiH.css +0 -2
@@ -0,0 +1,505 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function c(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=c(d);fetch(d.href,f)}})();function kf(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var bd={exports:{}},Ni={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var fg;function B2(){if(fg)return Ni;fg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(o,d,f){var h=null;if(f!==void 0&&(h=""+f),d.key!==void 0&&(h=""+d.key),"key"in d){f={};for(var x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:l,type:o,key:h,ref:d!==void 0?d:null,props:f}}return Ni.Fragment=i,Ni.jsx=c,Ni.jsxs=c,Ni}var mg;function H2(){return mg||(mg=1,bd.exports=B2()),bd.exports}var s=H2(),yd={exports:{}},De={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var hg;function q2(){if(hg)return De;hg=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),z=Symbol.iterator;function C(N){return N===null||typeof N!="object"?null:(N=z&&N[z]||N["@@iterator"],typeof N=="function"?N:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,A={};function q(N,E,le){this.props=N,this.context=E,this.refs=A,this.updater=le||w}q.prototype.isReactComponent={},q.prototype.setState=function(N,E){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,E,"setState")},q.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function W(){}W.prototype=q.prototype;function Z(N,E,le){this.props=N,this.context=E,this.refs=A,this.updater=le||w}var re=Z.prototype=new W;re.constructor=Z,O(re,q.prototype),re.isPureReactComponent=!0;var F=Array.isArray;function M(){}var k={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function X(N,E,le){var se=le.ref;return{$$typeof:l,type:N,key:E,ref:se!==void 0?se:null,props:le}}function ie(N,E){return X(N.type,E,N.props)}function oe(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}function ce(N){var E={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(le){return E[le]})}var $=/\/+/g;function Y(N,E){return typeof N=="object"&&N!==null&&N.key!=null?ce(""+N.key):E.toString(36)}function P(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(M,M):(N.status="pending",N.then(function(E){N.status==="pending"&&(N.status="fulfilled",N.value=E)},function(E){N.status==="pending"&&(N.status="rejected",N.reason=E)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function J(N,E,le,se,ye){var ge=typeof N;(ge==="undefined"||ge==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(ge){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case l:case i:de=!0;break;case y:return de=N._init,J(de(N._payload),E,le,se,ye)}}if(de)return ye=ye(N),de=se===""?"."+Y(N,0):se,F(ye)?(le="",de!=null&&(le=de.replace($,"$&/")+"/"),J(ye,E,le,"",function(it){return it})):ye!=null&&(oe(ye)&&(ye=ie(ye,le+(ye.key==null||N&&N.key===ye.key?"":(""+ye.key).replace($,"$&/")+"/")+de)),E.push(ye)),1;de=0;var fe=se===""?".":se+":";if(F(N))for(var xe=0;xe<N.length;xe++)se=N[xe],ge=fe+Y(se,xe),de+=J(se,E,le,ge,ye);else if(xe=C(N),typeof xe=="function")for(N=xe.call(N),xe=0;!(se=N.next()).done;)se=se.value,ge=fe+Y(se,xe++),de+=J(se,E,le,ge,ye);else if(ge==="object"){if(typeof N.then=="function")return J(P(N),E,le,se,ye);throw E=String(N),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return de}function ue(N,E,le){if(N==null)return N;var se=[],ye=0;return J(N,se,"","",function(ge){return E.call(le,ge,ye++)}),se}function Ne(N){if(N._status===-1){var E=N._result,le=E();le.then(function(se){(N._status===0||N._status===-1)&&(N._status=1,N._result=se,le.status===void 0&&(le.status="fulfilled",le.value=se))},function(se){(N._status===0||N._status===-1)&&(N._status=2,N._result=se,le.status===void 0&&(le.status="rejected",le.reason=se))}),N._status===-1&&(N._status=0,N._result=le)}if(N._status===1)return N._result.default;throw N._result}var D=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function ae(N){var E=k.T,le={};le.types=E!==null?E.types:null,k.T=le;try{var se=N(),ye=k.S;ye!==null&&ye(le,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(M,D)}catch(ge){D(ge)}finally{E!==null&&le.types!==null&&(E.types=le.types),k.T=E}}function ke(N){var E=k.T;if(E!==null){var le=E.types;le===null?E.types=[N]:le.indexOf(N)===-1&&le.push(N)}else ae(ke.bind(null,N))}var Ce={map:ue,forEach:function(N,E,le){ue(N,function(){E.apply(this,arguments)},le)},count:function(N){var E=0;return ue(N,function(){E++}),E},toArray:function(N){return ue(N,function(E){return E})||[]},only:function(N){if(!oe(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return De.Activity=b,De.Children=Ce,De.Component=q,De.Fragment=c,De.Profiler=d,De.PureComponent=Z,De.StrictMode=o,De.Suspense=p,De.ViewTransition=j,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,De.__COMPILER_RUNTIME={__proto__:null,c:function(N){return k.H.useMemoCache(N)}},De.addTransitionType=ke,De.cache=function(N){return function(){return N.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(N,E,le){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var se=O({},N.props),ye=N.key;if(E!=null)for(ge in E.key!==void 0&&(ye=""+E.key),E)!K.call(E,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&E.ref===void 0||(se[ge]=E[ge]);var ge=arguments.length-2;if(ge===1)se.children=le;else if(1<ge){for(var de=Array(ge),fe=0;fe<ge;fe++)de[fe]=arguments[fe+2];se.children=de}return X(N.type,ye,se)},De.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},De.createElement=function(N,E,le){var se,ye={},ge=null;if(E!=null)for(se in E.key!==void 0&&(ge=""+E.key),E)K.call(E,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ye[se]=E[se]);var de=arguments.length-2;if(de===1)ye.children=le;else if(1<de){for(var fe=Array(de),xe=0;xe<de;xe++)fe[xe]=arguments[xe+2];ye.children=fe}if(N&&N.defaultProps)for(se in de=N.defaultProps,de)ye[se]===void 0&&(ye[se]=de[se]);return X(N,ge,ye)},De.createRef=function(){return{current:null}},De.forwardRef=function(N){return{$$typeof:x,render:N}},De.isValidElement=oe,De.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:Ne}},De.memo=function(N,E){return{$$typeof:v,type:N,compare:E===void 0?null:E}},De.startTransition=ae,De.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},De.use=function(N){return k.H.use(N)},De.useActionState=function(N,E,le){return k.H.useActionState(N,E,le)},De.useCallback=function(N,E){return k.H.useCallback(N,E)},De.useContext=function(N){return k.H.useContext(N)},De.useDebugValue=function(){},De.useDeferredValue=function(N,E){return k.H.useDeferredValue(N,E)},De.useEffect=function(N,E){return k.H.useEffect(N,E)},De.useEffectEvent=function(N){return k.H.useEffectEvent(N)},De.useId=function(){return k.H.useId()},De.useImperativeHandle=function(N,E,le){return k.H.useImperativeHandle(N,E,le)},De.useInsertionEffect=function(N,E){return k.H.useInsertionEffect(N,E)},De.useLayoutEffect=function(N,E){return k.H.useLayoutEffect(N,E)},De.useMemo=function(N,E){return k.H.useMemo(N,E)},De.useOptimistic=function(N,E){return k.H.useOptimistic(N,E)},De.useReducer=function(N,E,le){return k.H.useReducer(N,E,le)},De.useRef=function(N){return k.H.useRef(N)},De.useState=function(N){return k.H.useState(N)},De.useSyncExternalStore=function(N,E,le){return k.H.useSyncExternalStore(N,E,le)},De.useTransition=function(){return k.H.useTransition()},De.version="19.3.0",De}var pg;function _f(){return pg||(pg=1,yd.exports=q2()),yd.exports}var S=_f();const Sl=kf(S);var vd={exports:{}},ji={},Nd={exports:{}},jd={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var xg;function G2(){return xg||(xg=1,(function(l){function i(P,J){var ue=P.length;P.push(J);e:for(;0<ue;){var Ne=ue-1>>>1,D=P[Ne];if(0<d(D,J))P[Ne]=J,P[ue]=D,ue=Ne;else break e}}function c(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var J=P[0],ue=P.pop();if(ue!==J){P[0]=ue;e:for(var Ne=0,D=P.length,ae=D>>>1;Ne<ae;){var ke=2*(Ne+1)-1,Ce=P[ke],N=ke+1,E=P[N];if(0>d(Ce,ue))N<D&&0>d(E,Ce)?(P[Ne]=E,P[N]=ue,Ne=N):(P[Ne]=Ce,P[ke]=ue,Ne=ke);else if(N<D&&0>d(E,ue))P[Ne]=E,P[N]=ue,Ne=N;else break e}}return J}function d(P,J){var ue=P.sortIndex-J.sortIndex;return ue!==0?ue:P.id-J.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var h=Date,x=h.now();l.unstable_now=function(){return h.now()-x}}var p=[],v=[],y=1,b=null,j=3,z=!1,C=!1,w=!1,O=!1,A=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function Z(P){for(var J=c(v);J!==null;){if(J.callback===null)o(v);else if(J.startTime<=P)o(v),J.sortIndex=J.expirationTime,i(p,J);else break;J=c(v)}}function re(P){if(w=!1,Z(P),!C)if(c(p)!==null)C=!0,F||(F=!0,oe());else{var J=c(v);J!==null&&Y(re,J.startTime-P)}}var F=!1,M=-1,k=5,K=-1;function X(){return O?!0:!(l.unstable_now()-K<k)}function ie(){if(O=!1,F){var P=l.unstable_now();K=P;var J=!0;try{e:{C=!1,w&&(w=!1,q(M),M=-1),z=!0;var ue=j;try{t:{for(Z(P),b=c(p);b!==null&&!(b.expirationTime>P&&X());){var Ne=b.callback;if(typeof Ne=="function"){b.callback=null,j=b.priorityLevel;var D=Ne(b.expirationTime<=P);if(P=l.unstable_now(),typeof D=="function"){b.callback=D,Z(P),J=!0;break t}b===c(p)&&o(p),Z(P)}else o(p);b=c(p)}if(b!==null)J=!0;else{var ae=c(v);ae!==null&&Y(re,ae.startTime-P),J=!1}}break e}finally{b=null,j=ue,z=!1}J=void 0}}finally{J?oe():F=!1}}}var oe;if(typeof W=="function")oe=function(){W(ie)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,$=ce.port2;ce.port1.onmessage=ie,oe=function(){$.postMessage(null)}}else oe=function(){A(ie,0)};function Y(P,J){M=A(function(){P(l.unstable_now())},J)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(P){P.callback=null},l.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<P?Math.floor(1e3/P):5},l.unstable_getCurrentPriorityLevel=function(){return j},l.unstable_next=function(P){switch(j){case 1:case 2:case 3:var J=3;break;default:J=j}var ue=j;j=J;try{return P()}finally{j=ue}},l.unstable_requestPaint=function(){O=!0},l.unstable_runWithPriority=function(P,J){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ue=j;j=P;try{return J()}finally{j=ue}},l.unstable_scheduleCallback=function(P,J,ue){var Ne=l.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Ne+ue:Ne):ue=Ne,P){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=ue+D,P={id:y++,callback:J,priorityLevel:P,startTime:ue,expirationTime:D,sortIndex:-1},ue>Ne?(P.sortIndex=ue,i(v,P),c(p)===null&&P===c(v)&&(w?(q(M),M=-1):w=!0,Y(re,ue-Ne))):(P.sortIndex=D,i(p,P),C||z||(C=!0,F||(F=!0,oe()))),P},l.unstable_shouldYield=X,l.unstable_wrapCallback=function(P){var J=j;return function(){var ue=j;j=J;try{return P.apply(this,arguments)}finally{j=ue}}}})(jd)),jd}var gg;function P2(){return gg||(gg=1,Nd.exports=G2()),Nd.exports}var Sd={exports:{}},qt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bg;function V2(){if(bg)return qt;bg=1;var l=_f();function i(y){var b="https://react.dev/errors/"+y;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)b+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+y+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var o={d:{f:c,r:function(){throw Error(i(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function x(y,b,j){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:z==null?null:z===h?h:""+z,children:y,containerInfo:b,implementation:j}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,qt.browser=function(y){return{$$typeof:f,_reason:y}},qt.createPortal=function(y,b){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(i(299));return x(y,b,null,j)},qt.flushSync=function(y){var b=p.T,j=o.p;try{if(p.T=null,o.p=2,y)return y()}finally{p.T=b,o.p=j,o.d.f()}},qt.preconnect=function(y,b){typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,o.d.C(y,b))},qt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},qt.preinit=function(y,b){if(typeof y=="string"&&b&&typeof b.as=="string"){var j=b.as,z=v(j,b.crossOrigin),C=typeof b.integrity=="string"?b.integrity:void 0,w=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;j==="style"?o.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:z,integrity:C,fetchPriority:w}):j==="script"&&o.d.X(y,{crossOrigin:z,integrity:C,fetchPriority:w,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},qt.preinitModule=function(y,b){if(typeof y=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var j=v(b.as,b.crossOrigin);o.d.M(y,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&o.d.M(y)},qt.preload=function(y,b){if(typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var j=b.as,z=v(j,b.crossOrigin);o.d.L(y,j,{crossOrigin:z,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},qt.preloadModule=function(y,b){if(typeof y=="string")if(b){var j=v(b.as,b.crossOrigin);o.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else o.d.m(y)},qt.requestFormReset=function(y){o.d.r(y)},qt.unstable_batchedUpdates=function(y,b){return y(b)},qt.useFormState=function(y,b,j){return p.H.useFormState(y,b,j)},qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},qt.version="19.3.0",qt}var yg;function Y2(){if(yg)return Sd.exports;yg=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Sd.exports=V2(),Sd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var vg;function I2(){if(vg)return ji;vg=1;var l=P2(),i=_f(),c=Y2();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function h(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 x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var u=r.alternate;if(u===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===u.child){for(u=r.child;u;){if(u===n)return p(r),e;if(u===a)return p(r),t;u=u.sibling}throw Error(o(188))}if(n.return!==a.return)n=r,a=u;else{for(var m=!1,g=r.child;g;){if(g===n){m=!0,n=r,a=u;break}if(g===a){m=!0,a=r,n=u;break}g=g.sibling}if(!m){for(g=u.child;g;){if(g===n){m=!0,n=u,a=r;break}if(g===a){m=!0,a=u,n=r;break}g=g.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function b(e,t,n,a,r,u){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,r,u)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&b(e.child,t,n,a,r,u))return!0;e=e.sibling}return!1}function j(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function z(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function C(e){var t=[null,null],n=j(e);return n===null||w(t,e,n.child,{foundSelf:!1}),t}function w(e,t,n,a){for(;n!==null;){if(n===t)a.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(a.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&w(e,t,n.child,a))return!0;n=n.sibling}return!1}function O(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var A=null,q=null;function W(e,t,n){return e===n?!0:e===t?(A=e,!0):!1}function Z(e,t,n){return e===n?(q=e,!1):e===t?(q!==null&&(A=e),!0):!1}function re(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function F(e,t,n){for(var a=0,r=e;r;r=n(r))a++;r=0;for(var u=t;u;u=n(u))r++;for(;0<a-r;)e=n(e),a--;for(;0<r-a;)t=n(t),r--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var M=Object.assign,k=Symbol.for("react.element"),K=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),ke=Symbol.for("react.legacy_hidden"),Ce=Symbol.for("react.memo_cache_sentinel"),N=Symbol.for("react.view_transition"),E=Symbol.for("react.recoverable"),le=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=le&&e[le]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ie:return"Fragment";case ce:return"Profiler";case oe:return"StrictMode";case J:return"Suspense";case ue:return"SuspenseList";case ae:return"Activity";case N:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case Y:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ne:return t=e.displayName||null,t!==null?t:ge(e.type)||"Memo";case D:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var de=Array.isArray,fe=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it={pending:!1,data:null,method:null,action:null},ne=[],Oe=-1;function Le(e){return{current:e}}function Re(e){0>Oe||(e.current=ne[Oe],ne[Oe]=null,Oe--)}function Te(e,t){Oe++,ne[Oe]=e.current,e.current=t}var bt=Le(null),Pt=Le(null),pt=Le(null),wt=Le(null);function bn(e,t){switch(Te(pt,t),Te(Pt,e),Te(bt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Nx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Nx(t),e=jx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Re(bt),Te(bt,e)}function me(){Re(bt),Re(Pt),Re(pt)}function _e(e){var t=e.memoizedState;t!==null&&(ps._currentValue=t.memoizedState,Te(wt,e)),t=bt.current;var n=jx(t,e.type);t!==n&&(Te(Pt,e),Te(bt,n))}function rt(e){Pt.current===e&&(Re(bt),Re(Pt)),wt.current===e&&(Re(wt),ps._currentValue=it)}var Vt,$t;function Et(e){if(Vt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vt=t&&t[1]||"",$t=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Vt+e+$t}var Wt=!1;function I(e,t){if(!e||Wt)return"";Wt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(he){var R=he}Reflect.construct(e,[],te)}else{try{te.call()}catch(he){R=he}te=!1;try{var G=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),te=!0,new e}finally{te&&(G!==void 0?Object.defineProperty(e.prototype,"props",G):delete e.prototype.props)}}}else{try{throw Error()}catch(he){R=he}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(he){if(he&&R&&typeof he.stack=="string")return[he.stack,R.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),m=u[0],g=u[1];if(m&&g){var _=m.split(`
44
+ `),B=g.split(`
45
+ `);for(r=a=0;a<_.length&&!_[a].includes("DetermineComponentFrameRoot");)a++;for(;r<B.length&&!B[r].includes("DetermineComponentFrameRoot");)r++;if(a===_.length||r===B.length)for(a=_.length-1,r=B.length-1;1<=a&&0<=r&&_[a]!==B[r];)r--;for(;1<=a&&0<=r;a--,r--)if(_[a]!==B[r]){if(a!==1||r!==1)do if(a--,r--,0>r||_[a]!==B[r]){var V=`
46
+ `+_[a].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=a&&0<=r);break}}}finally{Wt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Et(n):""}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return Et(e.type);case 16:return Et("Lazy");case 13:return e.child!==t&&t!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return I(e.type,!1);case 11:return I(e.type.render,!1);case 1:return I(e.type,!0);case 31:return Et("Activity");case 30:return Et("ViewTransition");default:return""}}function L(e){try{var t="",n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var Se=Object.prototype.hasOwnProperty,Ge=l.unstable_scheduleCallback,at=l.unstable_cancelCallback,xt=l.unstable_shouldYield,Xe=l.unstable_requestPaint,Fe=l.unstable_now,rn=l.unstable_getCurrentPriorityLevel,Yf=l.unstable_ImmediatePriority,If=l.unstable_UserBlockingPriority,Gi=l.unstable_NormalPriority,Ky=l.unstable_LowPriority,Kf=l.unstable_IdlePriority,Qy=l.log,Xy=l.unstable_setDisableYieldValue,Es=null,on=null;function ga(e){if(typeof Qy=="function"&&Xy(e),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Es,e)}catch{}}var cn=Math.clz32?Math.clz32:Jy,Fy=Math.log,Zy=Math.LN2;function Jy(e){return e>>>=0,e===0?32:31-(Fy(e)/Zy|0)|0}var Pi=256,Vi=262144,Yi=4194304;function Ja(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ii(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,u=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~u,a!==0?r=Ja(a):(m&=g,m!==0?r=Ja(m):n||(n=g&~e,n!==0&&(r=Ja(n))))):(g=a&~u,g!==0?r=Ja(g):m!==0?r=Ja(m):n||(n=a&~e,n!==0&&(r=Ja(n)))),r===0?0:t!==0&&t!==r&&(t&u)===0&&(u=r&-r,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:r}function As(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qf(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-cn(n),r=1<<a;t|=e[a],n&=~r}return t}function $y(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xf(){var e=Yi;return Yi<<=1,(Yi&62914560)===0&&(Yi=4194304),e}function Io(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ts(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wy(e,t,n,a,r,u){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,_=e.expirationTimes,B=e.hiddenUpdates;for(n=m&~n;0<n;){var V=31-cn(n),te=1<<V;g[V]=0,_[V]=-1;var R=B[V];if(R!==null)for(B[V]=null,V=0;V<R.length;V++){var G=R[V];G!==null&&(G.lane&=-536870913)}n&=~te}a!==0&&Ff(e,a,0),u!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=u&~(m&~t))}function Ff(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-cn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Zf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-cn(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function Jf(e,t){var n=t&-t;return n=(n&42)!==0?1:Ko(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ko(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $f(){var e=xe.p;return e!==0?e:(e=window.event,e===void 0?32:sg(e.type))}function Wf(e,t){var n=xe.p;try{return xe.p=e,t()}finally{xe.p=n}}var $n=Math.random().toString(36).slice(2),Dt="__reactFiber$"+$n,en="__reactProps$"+$n,Al="__reactContainer$"+$n,em="__reactEvents$"+$n,e1="__reactListeners$"+$n,t1="__reactHandles$"+$n,tm="__reactResources$"+$n,zs="__reactMarker$"+$n,Ki="__reactLoad$"+$n;function Qi(e){delete e[Dt],delete e[en],delete e[e1],delete e[t1]}function $a(e){var t;if(t=e[Dt])return t;for(var n=e.parentNode;n;){if(t=n[Al]||n[Dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Hx(e);e!==null;){if(n=e[Dt])return n;e=Hx(e)}return t}e=n,n=e.parentNode}return null}function Tl(e){if(e=e[Dt]||e[Al]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ms(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function zl(e){var t=e[tm];return t||(t=e[tm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[zs]=!0}function nm(e){e[Ki]=void 0}var am=new Set,lm={};function Wa(e,t){Ml(e,t),Ml(e+"Capture",t)}function Ml(e,t){for(lm[e]=t,e=0;e<t.length;e++)am.add(t[e])}var n1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sm={},im={};function a1(e){return Se.call(im,e)?!0:Se.call(sm,e)?!1:n1.test(e)?im[e]=!0:(sm[e]=!0,!1)}var Ze=!1;function rm(){var e=Ze;return Ze=!1,e}function Xi(e,t,n){if(a1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Fi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Wn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,a)}}function un(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function om(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function l1(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,u.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xo(e){if(!e._valueTracker){var t=om(e)?"checked":"value";e._valueTracker=l1(e,t,""+e[t])}}function cm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=om(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var s1=/[\n"\\]/g;function yn(e){return e.replace(s1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fo(e,t,n,a,r,u,m,g){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+un(t)):e.value!==""+un(t)&&(e.value=""+un(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Zo(e,un(e.value)):Zo(e,un(t)):n!=null?Zo(e,un(n)):a!=null&&e.removeAttribute("value"),r==null&&u!=null&&(e.defaultChecked=!!u),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+un(g):e.removeAttribute("name")}function um(e,t,n,a,r,u,m,g){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Xo(e);return}n=n!=null?""+un(n):"",t=t!=null?""+un(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Xo(e)}function Zo(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Ol(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+un(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function dm(e,t,n){if(t!=null&&(t=""+un(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+un(n):""}function fm(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(o(92));if(de(a)){if(1<a.length)throw Error(o(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=un(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Xo(e)}function Dl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var i1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mm(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||i1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function hm(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",Ze=!0);for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&(mm(e,r,a),Ze=!0)}else for(var u in t)t.hasOwnProperty(u)&&mm(e,u,t[u])}function Jo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var r1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),o1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zi(e){return o1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ln(){}var $o=null;function Wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rl=null,Ll=null;function pm(e){var t=Tl(e);if(t&&(e=t.stateNode)){var n=e[en]||null;e:switch(e=t.stateNode,t.type){case"input":if(Fo(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+yn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[en]||null;if(!r)throw Error(o(90));Fo(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&cm(a)}break e;case"textarea":dm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ol(e,!!n.multiple,t,!1)}}}var ec=!1;function xm(e,t,n){if(ec)return e(t,n);ec=!0;try{var a=e(t);return a}finally{if(ec=!1,(Rl!==null||Ll!==null)&&(Zr(),Rl&&(t=Rl,e=Ll,Ll=Rl=null,pm(t),e)))for(t=0;t<e.length;t++)pm(e[t])}}function Os(e,t){var n=e.stateNode;if(n===null)return null;var a=n[en]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tc=!1;if(ea)try{var Ds={};Object.defineProperty(Ds,"passive",{get:function(){tc=!0}}),window.addEventListener("test",Ds,Ds),window.removeEventListener("test",Ds,Ds)}catch{tc=!1}var ba=null,nc=null,Ji=null;function gm(){if(Ji)return Ji;var e,t=nc,n=t.length,a,r="value"in ba?ba.value:ba.textContent,u=r.length;for(e=0;e<n&&t[e]===r[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===r[u-a];a++);return Ji=r.slice(e,1<a?1-a:void 0)}function $i(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 Wi(){return!0}function bm(){return!1}function Qt(e){function t(n,a,r,u,m){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=u,this.target=m,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(u):u[g]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Wi:bm,this.isPropagationStopped=bm,this}return M(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=Wi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wi)},persist:function(){},isPersistent:Wi}),t}var ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},er=Qt(ya),Rs=M({},ya,{view:0,detail:0}),c1=Qt(Rs),ac,lc,Ls,tr=M({},Rs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ic,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!==Ls&&(Ls&&e.type==="mousemove"?(ac=e.screenX-Ls.screenX,lc=e.screenY-Ls.screenY):lc=ac=0,Ls=e),ac)},movementY:function(e){return"movementY"in e?e.movementY:lc}}),ym=Qt(tr),u1=M({},tr,{dataTransfer:0}),d1=Qt(u1),f1=M({},Rs,{relatedTarget:0}),sc=Qt(f1),m1=M({},ya,{animationName:0,elapsedTime:0,pseudoElement:0}),h1=Qt(m1),p1=M({},ya,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),x1=Qt(p1),g1=M({},ya,{data:0}),vm=Qt(g1),b1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y1={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"},v1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=v1[e])?!!t[e]:!1}function ic(){return N1}var j1=M({},Rs,{key:function(e){if(e.key){var t=b1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?y1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ic,charCode:function(e){return e.type==="keypress"?$i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S1=Qt(j1),w1=M({},tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nm=Qt(w1),k1=M({},ya,{submitter:0}),_1=Qt(k1),C1=M({},Rs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ic}),E1=Qt(C1),A1=M({},ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),T1=Qt(A1),z1=M({},tr,{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}),M1=Qt(z1),O1=M({},ya,{newState:0,oldState:0,source:0}),D1=Qt(O1),R1=[9,13,27,32],rc=ea&&"CompositionEvent"in window,Us=null;ea&&"documentMode"in document&&(Us=document.documentMode);var L1=ea&&"TextEvent"in window&&!Us,jm=ea&&(!rc||Us&&8<Us&&11>=Us),Sm=" ",wm=!1;function km(e,t){switch(e){case"keyup":return R1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _m(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ul=!1;function U1(e,t){switch(e){case"compositionend":return _m(t);case"keypress":return t.which!==32?null:(wm=!0,Sm);case"textInput":return e=t.data,e===Sm&&wm?null:e;default:return null}}function B1(e,t){if(Ul)return e==="compositionend"||!rc&&km(e,t)?(e=gm(),Ji=nc=ba=null,Ul=!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 jm&&t.locale!=="ko"?null:t.data;default:return null}}var H1={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 Cm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H1[e.type]:t==="textarea"}function Em(e,t,n,a){Rl?Ll?Ll.push(a):Ll=[a]:Rl=a,t=no(t,"onChange"),0<t.length&&(n=new er("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Bs=null,Hs=null;function q1(e){px(e,0)}function nr(e){var t=Ms(e);if(cm(t))return e}function Am(e,t){if(e==="change")return t}var Tm=!1;if(ea){var oc;if(ea){var cc="oninput"in document;if(!cc){var zm=document.createElement("div");zm.setAttribute("oninput","return;"),cc=typeof zm.oninput=="function"}oc=cc}else oc=!1;Tm=oc&&(!document.documentMode||9<document.documentMode)}function Mm(){Bs&&(Bs.detachEvent("onpropertychange",Om),Hs=Bs=null)}function Om(e){if(e.propertyName==="value"&&nr(Hs)){var t=[];Em(t,Hs,e,Wo(e)),xm(q1,t)}}function G1(e,t,n){e==="focusin"?(Mm(),Bs=t,Hs=n,Bs.attachEvent("onpropertychange",Om)):e==="focusout"&&Mm()}function P1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nr(Hs)}function V1(e,t){if(e==="click")return nr(t)}function Y1(e,t){if(e==="input"||e==="change")return nr(t)}function I1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:I1;function qs(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Se.call(t,r)||!dn(e[r],t[r]))return!1}return!0}function uc(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 Dm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rm(e,t){var n=Dm(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dm(n)}}function Lm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Um(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uc(e.document)}return t}function dc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var K1=ea&&"documentMode"in document&&11>=document.documentMode,Bl=null,fc=null,Gs=null,mc=!1;function Bm(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mc||Bl==null||Bl!==uc(a)||(a=Bl,"selectionStart"in a&&dc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Gs&&qs(Gs,a)||(Gs=a,a=no(fc,"onSelect"),0<a.length&&(t=new er("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Bl)))}function el(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hl={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},hc={},Hm={};ea&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function tl(e){if(hc[e])return hc[e];if(!Hl[e])return e;var t=Hl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hm)return hc[e]=t[n];return e}var qm=tl("animationend"),Gm=tl("animationiteration"),Pm=tl("animationstart"),Q1=tl("transitionrun"),X1=tl("transitionstart"),F1=tl("transitioncancel"),Vm=tl("transitionend"),Ym=new Map,pc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");pc.push("scrollEnd");function An(e,t){Ym.set(e,t),Wa(t,[e])}var Z1=0;function ta(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=On.identifierPrefix;var n=Z1++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Im(e){if(e==null||typeof e=="string")return e;var t=null,n=ss;if(n!==null)for(var a=0;a<n.length;a++){var r=e[n[a]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function na(e,t){return e=Im(e),t=Im(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ar=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],ql=0,xc=0;function lr(){for(var e=ql,t=xc=ql=0;t<e;){var n=vn[t];vn[t++]=null;var a=vn[t];vn[t++]=null;var r=vn[t];vn[t++]=null;var u=vn[t];if(vn[t++]=null,a!==null&&r!==null){var m=a.pending;m===null?r.next=r:(r.next=m.next,m.next=r),a.pending=r}u!==0&&Km(n,r,u)}}function sr(e,t,n,a){vn[ql++]=e,vn[ql++]=t,vn[ql++]=n,vn[ql++]=a,xc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function gc(e,t,n,a){return sr(e,t,n,a),ir(e)}function nl(e,t){return sr(e,null,null,t),ir(e)}function Km(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(r=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,r&&t!==null&&(r=31-cn(n),e=u.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),u):null}function ir(e){if(50<ci)throw ci=0,Fr=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gl={};function J1(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,n,a){return new J1(e,t,n,a)}function bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aa(e,t){var n=e.alternate;return n===null?(n=tn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Qm(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function rr(e,t,n,a,r,u){var m=0;if(a=e,typeof a=="function")bc(a)&&(m=1);else if(typeof a=="string")m=k2(e,n,bt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case ae:return e=tn(31,n,t,r),e.elementType=ae,e.lanes=u,e;case ie:return al(n.children,r,u,t);case oe:m=8,r|=24;break;case ce:return e=tn(12,n,t,r|2),e.elementType=ce,e.lanes=u,e;case J:return e=tn(13,n,t,r),e.elementType=J,e.lanes=u,e;case ue:return e=tn(19,n,t,r),e.elementType=ue,e.lanes=u,e;case ke:case N:return e=r|32,e=tn(30,n,t,e),e.elementType=N,e.lanes=u,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Y:m=10;break e;case $:m=9;break e;case P:m=11;break e;case Ne:m=14;break e;case D:m=16,a=null;break e}m=29,n=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=tn(m,n,t,r),t.elementType=e,t.type=a,t.lanes=u,t}function al(e,t,n,a){return e=tn(7,e,a,t),e.lanes=n,e}function yc(e,t,n){return e=tn(6,e,null,t),e.lanes=n,e}function Xm(e){var t=tn(18,null,null,0);return t.stateNode=e,t}function vc(e,t,n){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fm=new WeakMap;function Nn(e,t){if(typeof e=="object"&&e!==null){var n=Fm.get(e);return n!==void 0?n:(t={value:e,source:t,stack:L(t)},Fm.set(e,t),t)}return{value:e,source:t,stack:L(t)}}var Pl=[],Vl=0,or=null,Ps=0,jn=[],Sn=0,va=null,Un=1,Bn="";function la(e,t){Pl[Vl++]=Ps,Pl[Vl++]=or,or=e,Ps=t}function Zm(e,t,n){jn[Sn++]=Un,jn[Sn++]=Bn,jn[Sn++]=va,va=e;var a=Un;e=Bn;var r=32-cn(a)-1;a&=~(1<<r),n+=1;var u=32-cn(t)+r;if(30<u){var m=r-r%5;u=(a&(1<<m)-1).toString(32),a>>=m,r-=m,Un=1<<32-cn(t)+r|n<<r|a,Bn=u+e}else Un=1<<u|n<<r|a,Bn=e}function cr(e){e.return!==null&&(la(e,1),Zm(e,1,0))}function Nc(e){for(;e===or;)or=Pl[--Vl],Pl[Vl]=null,Ps=Pl[--Vl],Pl[Vl]=null;for(;e===va;)va=jn[--Sn],jn[Sn]=null,Bn=jn[--Sn],jn[Sn]=null,Un=jn[--Sn],jn[Sn]=null}function Jm(e,t){jn[Sn++]=Un,jn[Sn++]=Bn,jn[Sn++]=va,Un=t.id,Bn=t.overflow,va=e}var Tt=null,ot=null,He=!1,Na=null,wn=!1,jc=Error(o(519));function ja(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vs(Nn(t,e)),jc}function $m(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Dt]=e,t[en]=a,n){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(n=0;n<di.length;n++)Ve(di[n],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),um(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),fm(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||yx(t.textContent,n)?(a.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),a.onScroll!=null&&Ve("scroll",t),a.onScrollEnd!=null&&Ve("scrollend",t),a.onClick!=null&&(t.onclick=Ln),t=!0):t=!1,t||ja(e,!0)}function ur(e){for(Tt=e.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:Tt=Tt.return}}function Yl(e){if(e!==Tt)return!1;if(!He)return ur(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||$u(e.type,e.memoizedProps)),n=!n),n&&ot&&ja(e),ur(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ot=Bx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ot=Bx(e)}else t===27?(t=ot,Ba(e.type)?(e=rd,rd=null,ot=e):ot=t):ot=Tt?_n(e.stateNode.nextSibling):null;return!0}function ll(){ot=Tt=null,He=!1}function Sc(){var e=Na;return e!==null&&(ln===null?ln=e:ln.push.apply(ln,e),Na=null),e}function Vs(e){Na===null?Na=[e]:Na.push(e)}var wc=Le(null),sl=null,sa=null;function Sa(e,t,n){Te(wc,t._currentValue),t._currentValue=n}function ia(e){e._currentValue=wc.current,Re(wc)}function dr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function kc(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var u=r.dependencies;if(u!==null){var m=r.child;u=u.firstContext;e:for(;u!==null;){var g=u;u=r;for(var _=0;_<t.length;_++)if(g.context===t[_]){u.lanes|=n,g=u.alternate,g!==null&&(g.lanes|=n),dr(u.return,n,e),a||(m=null);break e}u=g.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(o(341));m.lanes|=n,u=m.alternate,u!==null&&(u.lanes|=n),dr(m,n,e),m=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,m=r.alternate,m!==null&&(m.lanes|=n),dr(r.return,n,e),m=r.child,m=m!==null?m.sibling:null):m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function il(e,t,n,a){e=null;for(var r=t,u=!1;r!==null;){if(!u){if((r.flags&524288)!==0)u=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var g=r.type;dn(r.pendingProps.value,m.value)||(e!==null?e.push(g):e=[g])}}else if(r===wt.current){if(m=r.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(ps):e=[ps])}r=r.return}return e!==null&&kc(t,e,n,a),t.flags|=262144,e!==null}function fr(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rl(e){sl=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return Wm(sl,e)}function mr(e,t){return sl===null&&rl(e),Wm(e,t)}function Wm(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(o(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var $1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},W1=l.unstable_scheduleCallback,ev=l.unstable_NormalPriority,yt={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new $1,data:new Map,refCount:0}}function Ys(e){e.refCount--,e.refCount===0&&W1(ev,function(){e.controller.abort()})}function eh(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];n.indexOf(a)===-1&&n.push(a)}}}var Is=null;function tv(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ks=null,Cc=0,ol=0,Il=null;function nv(e,t){if(Ks===null){var n=Ks=[];Cc=0,ol=Vu(),Il={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Cc++,t.then(th,th),t}function th(){if(--Cc===0&&(Is=null,Ks!==null)){Il!==null&&(Il.status="fulfilled");var e=Ks;Ks=null,ol=0,Il=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function av(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var nh=fe.S;fe.S=function(e,t){if(Xp=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&nv(e,t),Is!==null)for(var n=cs;n!==null;)eh(n,Is),n=n.next;if(n=e.types,n!==null){for(var a=cs;a!==null;)eh(a,n),a=a.next;if(ol!==0){a=Is,a===null&&(a=Is=[]);for(var r=0;r<n.length;r++){var u=n[r];a.indexOf(u)===-1&&a.push(u)}}}nh!==null&&nh(e,t)};var cl=Le(null);function Ec(){var e=cl.current;return e!==null?e:st.pooledCache}function hr(e,t){t===null?Te(cl,cl.current):Te(cl,t.pool)}function ah(){var e=Ec();return e===null?null:{parent:yt._currentValue,pool:e}}var Kl=Error(o(460)),Ac=Error(o(474)),pr=Error(o(542)),xr={then:function(){}};function lh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ln,Ln),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(Ln,Ln);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e}throw dl=t,Kl}}function ul(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(dl=n,Kl):n}}var dl=null;function ih(){if(dl===null)throw Error(o(459));var e=dl;return dl=null,e}function rh(e){if(e===Kl||e===pr)throw Error(o(483))}var Ql=null,Qs=0;function gr(e){var t=Qs;return Qs+=1,Ql===null&&(Ql=[]),sh(Ql,e,t)}function wa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function br(e,t){throw t.$$typeof===k?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function oh(e){function t(U,T){if(e){var H=U.deletions;H===null?(U.deletions=[T],U.flags|=16):H.push(T)}}function n(U,T){if(!e)return null;for(;T!==null;)t(U,T),T=T.sibling;return null}function a(U){for(var T=new Map;U!==null;)U.key===null?T.set(U.index,U):T.set(U.key,U),U=U.sibling;return T}function r(U,T){return U=aa(U,T),U.index=0,U.sibling=null,U}function u(U,T,H){return U.index=H,e?(H=U.alternate,H!==null?(H=H.index,H<T?(U.flags|=2,T):H):(U.flags|=134217730,T)):(U.flags|=1048576,T)}function m(U){return e&&U.alternate===null&&(U.flags|=134217730),U}function g(U,T,H,ee){return T===null||T.tag!==6?(T=yc(H,U.mode,ee),T.return=U,T):(T=r(T,H),T.return=U,T)}function _(U,T,H,ee){var be=H.type;return be===ie?(U=V(U,T,H.props.children,ee,H.key),wa(U,H),U):T!==null&&(T.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===D&&ul(be)===T.type)?(T=r(T,H.props),wa(T,H),T.return=U,T):(T=rr(H.type,H.key,H.props,null,U.mode,ee),wa(T,H),T.return=U,T)}function B(U,T,H,ee){return T===null||T.tag!==4||T.stateNode.containerInfo!==H.containerInfo||T.stateNode.implementation!==H.implementation?(T=vc(H,U.mode,ee),T.return=U,T):(T=r(T,H.children||[]),T.return=U,T)}function V(U,T,H,ee,be){return T===null||T.tag!==7?(T=al(H,U.mode,ee,be),T.return=U,T):(T=r(T,H),T.return=U,T)}function te(U,T,H){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=yc(""+T,U.mode,H),T.return=U,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case K:return H=rr(T.type,T.key,T.props,null,U.mode,H),wa(H,T),H.return=U,H;case X:return T=vc(T,U.mode,H),T.return=U,T;case D:return T=ul(T),te(U,T,H)}if(de(T)||se(T))return T=al(T,U.mode,H,null),T.return=U,T;if(typeof T.then=="function")return te(U,gr(T),H);if(T.$$typeof===Y)return te(U,mr(U,T),H);br(U,T)}return null}function R(U,T,H,ee){var be=T!==null?T.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return be!==null?null:g(U,T,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case K:return H.key===be?_(U,T,H,ee):null;case X:return H.key===be?B(U,T,H,ee):null;case D:return H=ul(H),R(U,T,H,ee)}if(de(H)||se(H))return be!==null?null:V(U,T,H,ee,null);if(typeof H.then=="function")return R(U,T,gr(H),ee);if(H.$$typeof===Y)return R(U,T,mr(U,H),ee);br(U,H)}return null}function G(U,T,H,ee,be){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return U=U.get(H)||null,g(T,U,""+ee,be);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:return U=U.get(ee.key===null?H:ee.key)||null,_(T,U,ee,be);case X:return U=U.get(ee.key===null?H:ee.key)||null,B(T,U,ee,be);case D:return ee=ul(ee),G(U,T,H,ee,be)}if(de(ee)||se(ee))return U=U.get(H)||null,V(T,U,ee,be,null);if(typeof ee.then=="function")return G(U,T,H,gr(ee),be);if(ee.$$typeof===Y)return G(U,T,H,mr(T,ee),be);br(T,ee)}return null}function he(U,T,H,ee){for(var be=null,Ie=null,Ee=T,ze=T=0,jt=null;Ee!==null&&ze<H.length;ze++){Ee.index>ze?(jt=Ee,Ee=null):jt=Ee.sibling;var Qe=R(U,Ee,H[ze],ee);if(Qe===null){Ee===null&&(Ee=jt);break}e&&Ee&&Qe.alternate===null&&t(U,Ee),T=u(Qe,T,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe,Ee=jt}if(ze===H.length)return n(U,Ee),He&&la(U,ze),be;if(Ee===null){for(;ze<H.length;ze++)Ee=te(U,H[ze],ee),Ee!==null&&(T=u(Ee,T,ze),Ie===null?be=Ee:Ie.sibling=Ee,Ie=Ee);return He&&la(U,ze),be}for(Ee=a(Ee);ze<H.length;ze++)jt=G(Ee,U,ze,H[ze],ee),jt!==null&&(e&&(Qe=jt.alternate,Qe!==null&&Ee.delete(Qe.key===null?ze:Qe.key)),T=u(jt,T,ze),Ie===null?be=jt:Ie.sibling=jt,Ie=jt);return e&&Ee.forEach(function(Va){return t(U,Va)}),He&&la(U,ze),be}function we(U,T,H,ee){if(H==null)throw Error(o(151));for(var be=null,Ie=null,Ee=T,ze=T=0,jt=null,Qe=H.next();Ee!==null&&!Qe.done;ze++,Qe=H.next()){Ee.index>ze?(jt=Ee,Ee=null):jt=Ee.sibling;var Va=R(U,Ee,Qe.value,ee);if(Va===null){Ee===null&&(Ee=jt);break}e&&Ee&&Va.alternate===null&&t(U,Ee),T=u(Va,T,ze),Ie===null?be=Va:Ie.sibling=Va,Ie=Va,Ee=jt}if(Qe.done)return n(U,Ee),He&&la(U,ze),be;if(Ee===null){for(;!Qe.done;ze++,Qe=H.next())Qe=te(U,Qe.value,ee),Qe!==null&&(T=u(Qe,T,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe);return He&&la(U,ze),be}for(Ee=a(Ee);!Qe.done;ze++,Qe=H.next())Qe=G(Ee,U,ze,Qe.value,ee),Qe!==null&&(e&&(jt=Qe.alternate,jt!==null&&Ee.delete(jt.key===null?ze:jt.key)),T=u(Qe,T,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe);return e&&Ee.forEach(function(U2){return t(U,U2)}),He&&la(U,ze),be}function Be(U,T,H,ee){if(typeof H=="object"&&H!==null&&H.type===ie&&H.key===null&&H.props.ref===void 0&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case K:e:{for(var be=H.key;T!==null;){if(T.key===be){if(be=H.type,be===ie){if(T.tag===7){n(U,T.sibling),ee=r(T,H.props.children),wa(ee,H),ee.return=U,U=ee;break e}}else if(T.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===D&&ul(be)===T.type){n(U,T.sibling),ee=r(T,H.props),wa(ee,H),ee.return=U,U=ee;break e}n(U,T);break}else t(U,T);T=T.sibling}H.type===ie?(ee=al(H.props.children,U.mode,ee,H.key),wa(ee,H),ee.return=U,U=ee):(ee=rr(H.type,H.key,H.props,null,U.mode,ee),wa(ee,H),ee.return=U,U=ee)}return m(U);case X:e:{for(be=H.key;T!==null;){if(T.key===be)if(T.tag===4&&T.stateNode.containerInfo===H.containerInfo&&T.stateNode.implementation===H.implementation){n(U,T.sibling),ee=r(T,H.children||[]),ee.return=U,U=ee;break e}else{n(U,T);break}else t(U,T);T=T.sibling}ee=vc(H,U.mode,ee),ee.return=U,U=ee}return m(U);case D:return H=ul(H),Be(U,T,H,ee)}if(de(H))return he(U,T,H,ee);if(se(H)){if(be=se(H),typeof be!="function")throw Error(o(150));return H=be.call(H),we(U,T,H,ee)}if(typeof H.then=="function")return Be(U,T,gr(H),ee);if(H.$$typeof===Y)return Be(U,T,mr(U,H),ee);br(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,T!==null&&T.tag===6?(n(U,T.sibling),ee=r(T,H),ee.return=U,U=ee):(n(U,T),ee=yc(H,U.mode,ee),ee.return=U,U=ee),m(U)):n(U,T)}return function(U,T,H,ee){try{Qs=0;var be=Be(U,T,H,ee);return Ql=null,be}catch(Ee){if(Ee===Kl||Ee===pr)throw Ee;var Ie=tn(29,Ee,null,U.mode);return Ie.lanes=ee,Ie.return=U,Ie}finally{}}}var fl=oh(!0),ch=oh(!1),ka=!1;function Tc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ca(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Je&2)!==0){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=ir(e),Km(e,null,n),t}return sr(e,a,t,n),ir(e)}function Xs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Zf(e,n)}}function Mc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?r=u=m:u=u.next=m,n=n.next}while(n!==null);u===null?r=u=t:u=u.next=t}else r=u=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Oc=!1;function Fs(){if(Oc){var e=Il;if(e!==null)throw e}}function Zs(e,t,n,a){Oc=!1;var r=e.updateQueue;ka=!1;var u=r.firstBaseUpdate,m=r.lastBaseUpdate,g=r.shared.pending;if(g!==null){r.shared.pending=null;var _=g,B=_.next;_.next=null,m===null?u=B:m.next=B,m=_;var V=e.alternate;V!==null&&(V=V.updateQueue,g=V.lastBaseUpdate,g!==m&&(g===null?V.firstBaseUpdate=B:g.next=B,V.lastBaseUpdate=_))}if(u!==null){var te=r.baseState;m=0,V=B=_=null,g=u;do{var R=g.lane&-536870913,G=R!==g.lane;if(G?(Ye&R)===R:(a&R)===R){R!==0&&R===ol&&(Oc=!0),V!==null&&(V=V.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var he=e,we=g;R=t;var Be=n;switch(we.tag){case 1:if(he=we.payload,typeof he=="function"){te=he.call(Be,te,R);break e}te=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=we.payload,R=typeof he=="function"?he.call(Be,te,R):he,R==null)break e;te=M({},te,R);break e;case 2:ka=!0}}R=g.callback,R!==null&&(e.flags|=64,G&&(e.flags|=8192),G=r.callbacks,G===null?r.callbacks=[R]:G.push(R))}else G={lane:R,tag:g.tag,payload:g.payload,callback:g.callback,next:null},V===null?(B=V=G,_=te):V=V.next=G,m|=R;if(g=g.next,g===null){if(g=r.shared.pending,g===null)break;G=g,g=G.next,G.next=null,r.lastBaseUpdate=G,r.shared.pending=null}}while(!0);V===null&&(_=te),r.baseState=_,r.firstBaseUpdate=B,r.lastBaseUpdate=V,u===null&&(r.shared.lanes=0),Da|=m,e.lanes=m,e.memoizedState=te}}function uh(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function dh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)uh(n[e],t)}var Ea=Le(null),yr=Le(0);function fh(e,t){e=da,Te(yr,e),Te(Ea,t),da=e|t.baseLanes}function Dc(){Te(yr,da),Te(Ea,Ea.current)}function Rc(){da=yr.current,Re(Ea),Re(yr)}var Lt=Le(null),Yt=null;function Aa(e){var t=e.alternate;Te(Ut,Ut.current&1),Te(Lt,e),Yt===null&&(t===null||Ea.current!==null||t.memoizedState!==null)&&(Yt=e)}function Lc(e){Te(Ut,Ut.current),Te(Lt,e),Yt===null&&(Yt=e)}function mh(e){e.tag===22?(Te(Ut,Ut.current),Te(Lt,e),Yt===null&&(Yt=e)):Ta()}function Ta(){Te(Ut,Ut.current),Te(Lt,Lt.current)}function fn(e){Re(Lt),Yt===e&&(Yt=null),Re(Ut)}var Ut=Le(0);function Js(e,t){Te(Lt,Lt.current),Te(Ut,t)}function Uc(e){Re(Ut),Re(Lt),Yt===e&&(Yt=null)}function vr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sd(n)||id(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ra=0,Ue=null,lt=null,vt=null,Nr=!1,Xl=!1,ml=!1,jr=0,$s=0,Fl=null,lv=0;function mt(){throw Error(o(321))}function Bc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function Hc(e,t,n,a,r,u){return ra=u,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?Zh:Jh,ml=!1,u=n(a,r),ml=!1,Xl&&(u=ph(t,n,a,r)),hh(e),u}function hh(e){fe.H=Ar;var t=lt!==null&&lt.next!==null;if(ra=0,vt=lt=Ue=null,Nr=!1,$s=0,Fl=null,t)throw Error(o(300));e===null||Nt||(e=e.dependencies,e!==null&&fr(e)&&(Nt=!0))}function ph(e,t,n,a){Ue=e;var r=0;do{if(Xl&&(Fl=null),$s=0,Xl=!1,25<=r)throw Error(o(301));if(r+=1,vt=lt=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}fe.H=fv,u=t(n,a)}while(Xl);return u}function sv(){var e=fe.H,t=e.useState()[0];return t=typeof t.then=="function"?Ws(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Ue.flags|=1024),t}function qc(){var e=jr!==0;return jr=0,e}function Gc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Pc(e){if(Nr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Nr=!1}ra=0,vt=lt=Ue=null,Xl=!1,$s=jr=0,Fl=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ue.memoizedState=vt=e:vt=vt.next=e,vt}function gt(){if(lt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=vt===null?Ue.memoizedState:vt.next;if(t!==null)vt=t,lt=e;else{if(e===null)throw Ue.alternate===null?Error(o(467)):Error(o(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},vt===null?Ue.memoizedState=vt=e:vt=vt.next=e}return vt}function Sr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(e){var t=$s;return $s+=1,Fl===null&&(Fl=[]),e=sh(Fl,e,t),t=Ue,(vt===null?t.memoizedState:vt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?Zh:Jh),e}function wr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ws(e);if(e.$$typeof===E)return;if(e.$$typeof===Y)return Rt(e)}throw Error(o(438,String(e)))}function Vc(e){var t=null,n=Ue.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Ue.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Sr(),Ue.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=Ce;return t.index++,n}function oa(e,t){return typeof t=="function"?t(e):t}function kr(e){var t=gt();return Yc(t,lt,e)}function Yc(e,t,n){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=n;var r=e.baseQueue,u=a.pending;if(u!==null){if(r!==null){var m=r.next;r.next=u.next,u.next=m}t.baseQueue=r=u,a.pending=null}if(u=e.baseState,r===null)e.memoizedState=u;else{t=r.next;var g=m=null,_=null,B=t,V=!1;do{var te=B.lane&-536870913;if(te!==B.lane?(Ye&te)===te:(ra&te)===te){var R=B.revertLane;if(R===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),te===ol&&(V=!0);else if((ra&R)===R){B=B.next,R===ol&&(V=!0);continue}else te={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},_===null?(g=_=te,m=u):_=_.next=te,Ue.lanes|=R,Da|=R;te=B.action,ml&&n(u,te),u=B.hasEagerState?B.eagerState:n(u,te)}else R={lane:te,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},_===null?(g=_=R,m=u):_=_.next=R,Ue.lanes|=te,Da|=te;B=B.next}while(B!==null&&B!==t);if(_===null?m=u:_.next=g,!dn(u,e.memoizedState)&&(Nt=!0,V&&(n=Il,n!==null)))throw n;e.memoizedState=u,e.baseState=m,e.baseQueue=_,a.lastRenderedState=u}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ic(e){var t=gt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,u=t.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do u=e(u,m.action),m=m.next;while(m!==r);dn(u,t.memoizedState)||(Nt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function xh(e,t,n){var a=Ue,r=gt(),u=He;if(u){if(n===void 0)throw Error(o(407));n=n()}else n=t();var m=!dn((lt||r).memoizedState,n);if(m&&(r.memoizedState=n,Nt=!0),r=r.queue,Xc(yh.bind(null,a,r,e),[e]),e=r.getSnapshot!==t||m||vt!==null&&(vt.memoizedState.tag&1)!==0,Zl(e?9:8,{destroy:void 0},bh.bind(null,a,r,n,t),null),e){if(a.flags|=2048,st===null)throw Error(o(349));u||(ra&127)!==0||gh(a,t,n)}return n}function gh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ue.updateQueue,t===null?(t=Sr(),Ue.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bh(e,t,n,a){t.value=n,t.getSnapshot=a,vh(t)&&Nh(e)}function yh(e,t,n){return n(function(){vh(t)&&Nh(e)})}function vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Nh(e){var t=nl(e,2);t!==null&&sn(t,e,2)}function Kc(e){var t=Xt();if(typeof e=="function"){var n=e;if(e=n(),ml){ga(!0);try{n()}finally{ga(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:e},t}function jh(e,t,n,a){return e.baseState=n,Yc(e,lt,typeof a=="function"?a:oa)}function iv(e,t,n,a,r){if(Er(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){u.listeners.push(m)}};fe.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,Sh(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Sh(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var u=fe.T,m={};m.types=u!==null?u.types:null,fe.T=m;try{var g=n(r,a),_=fe.S;_!==null&&_(m,g),wh(e,t,g)}catch(B){Qc(e,t,B)}finally{u!==null&&m.types!==null&&(u.types=m.types),fe.T=u}}else try{u=n(r,a),wh(e,t,u)}catch(B){Qc(e,t,B)}}function wh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){kh(e,t,a)},function(a){return Qc(e,t,a)}):kh(e,t,n)}function kh(e,t,n){t.status="fulfilled",t.value=n,_h(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sh(e,n)))}function Qc(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,_h(t),t=t.next;while(t!==a)}e.action=null}function _h(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function Eh(e,t){if(He){var n=st.formState;if(n!==null){e:{var a=Ue;if(He){if(ot){t:{for(var r=ot,u=wn;r.nodeType!==8;){if(!u){r=null;break t}if(r=_n(r.nextSibling),r===null){r=null;break t}}u=r.data,r=u==="F!"||u==="F"?r:null}if(r){ot=_n(r.nextSibling),a=r.data==="F!";break e}}ja(a)}a=!1}a&&(t=n[0])}}return n=Xt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},n.queue=a,n=Qh.bind(null,Ue,a),a.dispatch=n,a=Kc(!1),u=Wc.bind(null,Ue,!1,a.queue),a=Xt(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=iv.bind(null,Ue,r,u,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function Ah(e){var t=gt();return Th(t,lt,e)}function Th(e,t,n){if(t=Yc(e,t,Ch)[0],e=kr(oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ws(t)}catch(m){throw m===Kl?pr:m}else a=t;t=gt();var r=t.queue,u=r.dispatch;return n!==t.memoizedState&&(Ue.flags|=2048,Zl(9,{destroy:void 0},rv.bind(null,r,n),null)),[a,u,e]}function rv(e,t){e.action=t}function zh(e){var t=gt(),n=lt;if(n!==null)return Th(t,n,e);gt(),t=t.memoizedState,n=gt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Zl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=Sr(),Ue.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Mh(){return gt().memoizedState}function _r(e,t,n,a){var r=Xt();Ue.flags|=e,r.memoizedState=Zl(1|t,{destroy:void 0},n,a===void 0?null:a)}function Cr(e,t,n,a){var r=gt();a=a===void 0?null:a;var u=r.memoizedState.inst;lt!==null&&a!==null&&Bc(a,lt.memoizedState.deps)?r.memoizedState=Zl(t,u,n,a):(Ue.flags|=e,r.memoizedState=Zl(1|t,u,n,a))}function Oh(e,t){_r(8390656,8,e,t)}function Xc(e,t){Cr(2048,8,e,t)}function ov(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=Sr(),Ue.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Dh(e){var t=gt().memoizedState;return ov({ref:t,nextImpl:e}),function(){if((Je&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Rh(e,t){return Cr(4,2,e,t)}function Lh(e,t){return Cr(4,4,e,t)}function Uh(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bh(e,t,n){n=n!=null?n.concat([e]):null,Cr(4,4,Uh.bind(null,t,e),n)}function Fc(){}function Hh(e,t){var n=gt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Bc(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function qh(e,t){var n=gt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Bc(t,a[1]))return a[0];if(a=e(),ml){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[a,t],a}function Zc(e,t,n){return n===void 0||(ra&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Zp(),Ue.lanes|=e,Da|=e,n)}function Gh(e,t,n,a){return dn(n,t)?n:Ea.current!==null?(e=Zc(e,n,a),dn(e,t)||(Nt=!0),e):(ra&106)===0||(ra&1073741824)!==0&&(Ye&261930)===0?(Nt=!0,e.memoizedState=n):(e=Zp(),Ue.lanes|=e,Da|=e,t)}function Ph(e,t,n,a,r){var u=xe.p;xe.p=u!==0&&8>u?u:8;var m=fe.T,g={};g.types=m!==null?m.types:null,fe.T=g,Wc(e,!1,t,n);try{var _=r(),B=fe.S;if(B!==null&&B(g,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var V=av(_,a);ei(e,t,V,xn(e))}else ei(e,t,a,xn(e))}catch(te){ei(e,t,{then:function(){},status:"rejected",reason:te},xn())}finally{xe.p=u,m!==null&&g.types!==null&&(m.types=g.types),fe.T=m}}function cv(){}function Jc(e,t,n,a){if(e.tag!==5)throw Error(o(476));var r=Vh(e).queue;Ph(e,r,t,it,n===null?cv:function(){return Yh(e),n(a)})}function Vh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:it,baseState:it,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:it},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Yh(e){var t=Vh(e);t.next===null&&(t=e.alternate.memoizedState),ei(e,t.next.queue,{},xn())}function $c(){return Rt(ps)}function Ih(){return gt().memoizedState}function Kh(){return gt().memoizedState}function uv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xn();e=_a(n);var a=Ca(t,e,n);a!==null&&(sn(a,t,n),Xs(a,t,n)),t={cache:_c()},e.payload=t;return}t=t.return}}function dv(e,t,n){var a=xn();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Er(e)?Xh(t,n):(n=gc(e,t,n,a),n!==null&&(sn(n,e,a),Fh(n,t,a)))}function Qh(e,t,n){var a=xn();ei(e,t,n,a)}function ei(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Er(e))Xh(t,r);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var m=t.lastRenderedState,g=u(m,n);if(r.hasEagerState=!0,r.eagerState=g,dn(g,m))return sr(e,t,r,0),st===null&&lr(),!1}catch{}finally{}if(n=gc(e,t,r,a),n!==null)return sn(n,e,a),Fh(n,t,a),!0}return!1}function Wc(e,t,n,a){if(a={lane:2,revertLane:Vu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Er(e)){if(t)throw Error(o(479))}else t=gc(e,n,a,2),t!==null&&sn(t,e,2)}function Er(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Xh(e,t){Xl=Nr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Zf(e,n)}}var Ar={readContext:Rt,use:wr,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt,useEffectEvent:mt},Zh={readContext:Rt,use:wr,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Oh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,_r(4194308,4,Uh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _r(4194308,4,e,t)},useInsertionEffect:function(e,t){_r(4,2,e,t)},useMemo:function(e,t){var n=Xt();t=t===void 0?null:t;var a=e();if(ml){ga(!0);try{e()}finally{ga(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Xt();if(n!==void 0){var r=n(t);if(ml){ga(!0);try{n(t)}finally{ga(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=dv.bind(null,Ue,e),[a.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Kc(e);var t=e.queue,n=Qh.bind(null,Ue,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fc,useDeferredValue:function(e,t){var n=Xt();return Zc(n,e,t)},useTransition:function(){var e=Kc(!1);return e=Ph.bind(null,Ue,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Ue,r=Xt();if(He){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),st===null)throw Error(o(349));(Ye&127)!==0||gh(a,t,n)}r.memoizedState=n;var u={value:n,getSnapshot:t};return r.queue=u,Oh(yh.bind(null,a,u,e),[e]),a.flags|=2048,Zl(9,{destroy:void 0},bh.bind(null,a,u,n,t),null),n},useId:function(){var e=Xt(),t=st.identifierPrefix;if(He){var n=Bn,a=Un;n=(a&~(1<<32-cn(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=jr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=lv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$c,useFormState:Eh,useActionState:Eh,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Wc.bind(null,Ue,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vc,useCacheRefresh:function(){return Xt().memoizedState=uv.bind(null,Ue)},useEffectEvent:function(e){var t=Xt(),n={impl:e};return t.memoizedState=n,function(){if((Je&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Jh={readContext:Rt,use:wr,useCallback:Hh,useContext:Rt,useEffect:Xc,useImperativeHandle:Bh,useInsertionEffect:Rh,useLayoutEffect:Lh,useMemo:qh,useReducer:kr,useRef:Mh,useState:function(){return kr(oa)},useDebugValue:Fc,useDeferredValue:function(e,t){var n=gt();return Gh(n,lt.memoizedState,e,t)},useTransition:function(){var e=kr(oa)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ws(e),t]},useSyncExternalStore:xh,useId:Ih,useHostTransitionStatus:$c,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var n=gt();return jh(n,lt,e,t)},useMemoCache:Vc,useCacheRefresh:Kh,useEffectEvent:Dh},fv={readContext:Rt,use:wr,useCallback:Hh,useContext:Rt,useEffect:Xc,useImperativeHandle:Bh,useInsertionEffect:Rh,useLayoutEffect:Lh,useMemo:qh,useReducer:Ic,useRef:Mh,useState:function(){return Ic(oa)},useDebugValue:Fc,useDeferredValue:function(e,t){var n=gt();return lt===null?Zc(n,e,t):Gh(n,lt.memoizedState,e,t)},useTransition:function(){var e=Ic(oa)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Ws(e),t]},useSyncExternalStore:xh,useId:Ih,useHostTransitionStatus:$c,useFormState:zh,useActionState:zh,useOptimistic:function(e,t){var n=gt();return lt!==null?jh(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Vc,useCacheRefresh:Kh,useEffectEvent:Dh};function eu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=xn(),r=_a(a);r.payload=t,n!=null&&(r.callback=n),t=Ca(e,r,a),t!==null&&(sn(t,e,a),Xs(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=xn(),r=_a(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Ca(e,r,a),t!==null&&(sn(t,e,a),Xs(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xn(),a=_a(n);a.tag=2,t!=null&&(a.callback=t),t=Ca(e,a,n),t!==null&&(sn(t,e,n),Xs(t,e,n))}};function $h(e,t,n,a,r,u,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,m):t.prototype&&t.prototype.isPureReactComponent?!qs(n,a)||!qs(r,u):!0}function Wh(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&tu.enqueueReplaceState(t,t.state,null)}function hl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=M({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function ep(e){ar(e)}function tp(e){console.error(e)}function np(e){ar(e)}function Tr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ap(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function nu(e,t,n){return n=_a(n),n.tag=3,n.payload={element:null},n.callback=function(){Tr(e,t)},n}function lp(e){return e=_a(e),e.tag=3,e}function sp(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var u=a.value;e.payload=function(){return r(u)},e.callback=function(){ap(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){ap(t,n,a),typeof r!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function mv(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&il(t,n,r,!0),n=Lt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Yt===null?Jr():n.alternate===null&&ht===0&&(ht=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===xr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),qu(e,a,r)),!1;case 22:return n.flags|=65536,a===xr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),qu(e,a,r)),!1}throw Error(o(435,n.tag))}return qu(e,a,r),Jr(),!1}if(He)return t=Lt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==jc&&(e=Error(o(422),{cause:a}),Vs(Nn(e,n)))):(a!==jc&&(t=Error(o(423),{cause:a}),Vs(Nn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=Nn(a,n),r=nu(e.stateNode,a,r),Mc(e,r),ht!==4&&(ht=2)),!1;var u=Error(o(520),{cause:a});if(u=Nn(u,n),oi===null?oi=[u]:oi.push(u),ht!==4&&(ht=2),t===null)return!0;a=Nn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=nu(n.stateNode,a,e),Mc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ra===null||!Ra.has(u))))return n.flags|=65536,r&=-r,n.lanes|=r,r=lp(r),sp(r,e,n,a),Mc(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var au=Error(o(461)),Nt=!1;function kt(e,t,n,a){t.child=e===null?ch(t,null,n,a):fl(t,e.child,n,a)}function ip(e,t,n,a,r){n=n.render;var u=t.ref;if("ref"in a){var m={};for(var g in a)g!=="ref"&&(m[g]=a[g])}else m=a;return rl(t),a=Hc(e,t,n,m,u,r),g=qc(),e!==null&&!Nt?(Gc(e,t,r),ca(e,t,r)):(He&&g&&cr(t),t.flags|=1,kt(e,t,a,r),t.child)}function rp(e,t,n,a,r){if(e===null){var u=n.type;return typeof u=="function"&&!bc(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,op(e,t,u,a,r)):(e=rr(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!du(e,r)){var m=u.memoizedProps;if(n=n.compare,n=n!==null?n:qs,n(m,a)&&e.ref===t.ref)return ca(e,t,r)}return t.flags|=1,e=aa(u,a),e.ref=t.ref,e.return=t,t.child=e}function op(e,t,n,a,r){if(e!==null){var u=e.memoizedProps;if(qs(u,a)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=a=u,du(e,r))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,ca(e,t,r)}return lu(e,t,n,a,r)}function cp(e,t,n,a){var r=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~u}else a=0,t.child=null;return up(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hr(t,u!==null?u.cachePool:null),u!==null?fh(t,u):Dc(),mh(t);else return a=t.lanes=536870912,up(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(hr(t,u.cachePool),fh(t,u),Ta(),t.memoizedState=null):(e!==null&&hr(t,null),Dc(),Ta());return kt(e,t,r,n),t.child}function ti(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function up(e,t,n,a,r){var u=Ec();return u=u===null?null:{parent:yt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&hr(t,null),Dc(),mh(t),e!==null&&il(e,t,a,!0),t.childLanes=r,null}function zr(e,t){return t=Mr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dp(e,t,n){return fl(t,e.child,null,n),e=zr(t,t.pendingProps),e.flags|=2,fn(t),t.memoizedState=null,e}function hv(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(a.mode==="hidden")return e=zr(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ti(null,e);if(Lc(t),(e=ot)?(e=Ux(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:va!==null?{id:Un,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=Xm(e),n.return=t,t.child=n,Tt=t,ot=null)):e=null,e===null)throw ja(t);return t.lanes=536870912,null}return zr(t,a)}var u=e.memoizedState;if(u!==null){var m=u.dehydrated;if(Lc(t),r)if(t.flags&256)t.flags&=-257,t=dp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Nt||il(e,t,n,!1),r=(n&e.childLanes)!==0,Nt||r){if(Ea.current===null){if(a=st,a!==null&&(m=Jf(a,n),m!==0&&m!==u.retryLane))throw u.retryLane=m,nl(e,m),sn(a,e,m),au;Jr()}t=dp(e,t,n)}else e=u.treeContext,ot=_n(m.nextSibling),Tt=t,He=!0,Na=null,wn=!1,e!==null&&Jm(t,e),t=zr(t,a),t.flags|=134221824;return t}return e=aa(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Jl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lu(e,t,n,a,r){return rl(t),n=Hc(e,t,n,a,void 0,r),a=qc(),e!==null&&!Nt?(Gc(e,t,r),ca(e,t,r)):(He&&a&&cr(t),t.flags|=1,kt(e,t,n,r),t.child)}function fp(e,t,n,a,r,u){return rl(t),t.updateQueue=null,n=ph(t,a,n,r),hh(e),a=qc(),e!==null&&!Nt?(Gc(e,t,u),ca(e,t,u)):(He&&a&&cr(t),t.flags|=1,kt(e,t,n,u),t.child)}function mp(e,t,n,a,r){if(rl(t),t.stateNode===null){var u=Gl,m=n.contextType;typeof m=="object"&&m!==null&&(u=Rt(m)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=tu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Tc(t),m=n.contextType,u.context=typeof m=="object"&&m!==null?Rt(m):Gl,u.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(eu(t,n,m,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(m=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),m!==u.state&&tu.enqueueReplaceState(u,u.state,null),Zs(t,a,u,r),Fs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var g=t.memoizedProps,_=hl(n,g);u.props=_;var B=u.context,V=n.contextType;m=Gl,typeof V=="object"&&V!==null&&(m=Rt(V));var te=n.getDerivedStateFromProps;V=typeof te=="function"||typeof u.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,V||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g||B!==m)&&Wh(t,u,a,m),ka=!1;var R=t.memoizedState;u.state=R,Zs(t,a,u,r),Fs(),B=t.memoizedState,g||R!==B||ka?(typeof te=="function"&&(eu(t,n,te,a),B=t.memoizedState),(_=ka||$h(t,n,_,a,R,B,m))?(V||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=B),u.props=a,u.state=B,u.context=m,a=_):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,zc(e,t),m=t.memoizedProps,V=hl(n,m),u.props=V,te=t.pendingProps,R=u.context,B=n.contextType,_=Gl,typeof B=="object"&&B!==null&&(_=Rt(B)),g=n.getDerivedStateFromProps,(B=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==te||R!==_)&&Wh(t,u,a,_),ka=!1,R=t.memoizedState,u.state=R,Zs(t,a,u,r),Fs();var G=t.memoizedState;m!==te||R!==G||ka||e!==null&&e.dependencies!==null&&fr(e.dependencies)?(typeof g=="function"&&(eu(t,n,g,a),G=t.memoizedState),(V=ka||$h(t,n,V,a,R,G,_)||e!==null&&e.dependencies!==null&&fr(e.dependencies))?(B||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,G,_),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,G,_)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=G),u.props=a,u.state=G,u.context=_,a=V):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Jl(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=fl(t,e.child,null,r),t.child=fl(t,null,n,r)):kt(e,t,n,r),t.memoizedState=u.state,e=t.child):e=ca(e,t,r),e}function hp(e,t,n,a){return ll(),t.flags|=256,kt(e,t,n,a),t.child}var su={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function iu(e){return{baseLanes:e,cachePool:ah()}}function ru(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=pn),e}function pp(e,t,n){var a=t.pendingProps,r=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(Ut.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(r?Aa(t):Ta(),(e=ot)?(e=Ux(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:va!==null?{id:Un,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=Xm(e),n.return=t,t.child=n,Tt=t,ot=null)):e=null,e===null)throw ja(t);return id(e)?t.lanes=32:t.lanes=536870912,null}return u=a.children,a=a.fallback,r?(Ta(),r=t.mode,u=Mr({mode:"hidden",children:u},r),a=al(a,r,n,null),u.return=t,a.return=t,u.sibling=a,t.child=u,a=t.child,a.memoizedState=iu(n),a.childLanes=ru(e,m,n),t.memoizedState=su,ti(null,a)):(Aa(t),ou(t,u))}var g=e.memoizedState;if(g!==null){var _=g.dehydrated;if(_!==null)return pv(e,t,u,m,a,_,g,n)}return r?(Ta(),r=a.fallback,u=t.mode,g=e.child,_=g.sibling,a=aa(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&1206910976,_!==null?r=aa(_,r):(r=al(r,u,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,ti(null,a),a=t.child,r=e.child.memoizedState,r===null?r=iu(n):(u=r.cachePool,u!==null?(g=yt._currentValue,u=u.parent!==g?{parent:g,pool:g}:u):u=ah(),r={baseLanes:r.baseLanes|n,cachePool:u}),a.memoizedState=r,a.childLanes=ru(e,m,n),t.memoizedState=su,ti(e.child,a)):(Aa(t),n=e.child,e=n.sibling,n=aa(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function ou(e,t){return t=Mr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Mr(e,t){return e=tn(22,e,null,t),e.lanes=0,e}function Or(e,t,n){return fl(t,e.child,null,n),e=ou(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pv(e,t,n,a,r,u,m,g){if(n)return t.flags&256?(Aa(t),t.flags&=-257,Or(e,t,g)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,null):(Ta(),u=r.fallback,m=t.mode,r=Mr({mode:"visible",children:r.children},m),u=al(u,m,g,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,fl(t,e.child,null,g),r=t.child,r.memoizedState=iu(g),r.childLanes=ru(e,a,g),t.memoizedState=su,ti(null,r));if(Aa(t),id(u)){if(a=u.nextSibling&&u.nextSibling.dataset,a)var _=a.dgst;return a=_,a!==""&&(r=Error(o(419)),r.stack="",r.digest=a,Vs({value:r,source:null,stack:null})),Or(e,t,g)}if(Nt||il(e,t,g,!1),a=(g&e.childLanes)!==0,Nt||a){if(Ea.current!==null)return Or(e,t,g);if(a=st,a!==null&&(r=Jf(a,g),r!==0&&r!==m.retryLane))throw m.retryLane=r,nl(e,r),sn(a,e,r),au;return sd(u)||Jr(),Or(e,t,g)}return sd(u)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,ot=_n(u.nextSibling),Tt=t,He=!0,Na=null,wn=!1,e!==null&&Jm(t,e),t=ou(t,r.children),t.flags|=134221824,t)}function xp(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),dr(e.return,t,n)}function gp(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&vr(n)===null&&(t=e),e=e.sibling}return t}function Dr(e,t,n,a,r,u){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:u}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=r,m.treeForkCount=u)}function cu(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function uu(e,t,n){var a=t.pendingProps,r=a.revealOrder,u=a.tail;a=a.children;var m=Ut.current;if(t.flags&128)return Js(t,m),null;var g=(m&2)!==0;if(g?(m=m&1|2,t.flags|=128):m&=1,Js(t,m),r==="backwards"&&e!==null?(cu(e),kt(e,t,a,n),cu(e)):kt(e,t,a,n),a=He?Ps:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xp(e,n,t);else if(e.tag===19)xp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":n=gp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,cu(t)),Dr(t,!0,r,null,u,a);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&vr(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Dr(t,!0,n,null,u,a);break;case"together":Dr(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=gp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Dr(t,!1,r,n,u,a)}return t.child}function bp(e,t,n){var a=t.pendingProps;return Sa(t,t.type,a.value),kt(e,t,a.children,n),t.child}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Da|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(il(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=aa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=aa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function du(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fr(e)))}function xv(e,t,n){switch(t.tag){case 3:bn(t,t.stateNode.containerInfo),Sa(t,yt,e.memoizedState.cache),ll();break;case 27:case 5:_e(t);break;case 4:bn(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lc(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return Aa(t),t.flags|=128,null;a=il(e,t,n,!1);var r=t.child.childLanes;return a||(n&r)!==0?pp(e,t,n):(Aa(t),e=ca(e,t,n),e!==null?e.sibling:null)}Aa(t);break;case 19:if(t.flags&128)return uu(e,t,n);if(r=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(il(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return uu(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Js(t,Ut.current),a)break;return null;case 22:return t.lanes=0,cp(e,t,n,t.pendingProps);case 24:Sa(t,yt,e.memoizedState.cache)}return ca(e,t,n)}function yp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!du(e,n)&&(t.flags&128)===0)return Nt=!1,xv(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,He&&(t.flags&1048576)!==0&&Zm(t,Ps,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ul(t.elementType),t.type=e,typeof e=="function")bc(e)?(a=hl(e,a),t.tag=1,t=mp(null,t,e,a,n)):(t.tag=0,t=lu(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===P){t.tag=11,t=ip(null,t,e,a,n);break e}else if(r===Ne){t.tag=14,t=rp(null,t,e,a,n);break e}else if(r===Y){t.tag=10,t.type=e,t=bp(null,t,n);break e}}throw t=ge(e)||e,Error(o(306,t,""))}}return t;case 0:return lu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=hl(a,t.pendingProps),mp(e,t,a,r,n);case 3:e:{if(bn(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;r=u.element,zc(e,t),Zs(t,a,null,n);var m=t.memoizedState;if(a=m.cache,Sa(t,yt,a),a!==u.cache&&kc(t,[yt],n,!0),Fs(),a=m.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=hp(e,t,a,n);break e}else if(a!==r){r=Nn(Error(o(424)),t),Vs(r),t=hp(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ot=_n(e.firstChild),Tt=t,He=!0,Na=null,wn=!0,n=ch(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ll(),a===r){t=ca(e,t,n);break e}kt(e,t,a,n)}t=t.child}return t;case 26:return Jl(e,t),e===null?(n=Yx(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(t.stateNode=Sx(t.type,t.pendingProps,pt.current,t)):t.memoizedState=Yx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&He&&(a=t.stateNode=qx(t.type,t.pendingProps,pt.current),Tt=t,wn=!0,r=ot,Ba(t.type)?(rd=r,ot=_n(a.firstChild)):ot=r),kt(e,t,t.pendingProps.children,n),Jl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((r=a=ot)&&(a=u2(a,t.type,t.pendingProps,wn),a!==null?(t.stateNode=a,Tt=t,ot=_n(a.firstChild),wn=!1,r=!0):r=!1),r||ja(t)),_e(t),r=t.type,u=t.pendingProps,m=e!==null?e.memoizedProps:null,a=u.children,$u(r,u)?a=null:m!==null&&$u(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=Hc(e,t,sv,null,null,n),ps._currentValue=r),Jl(e,t),kt(e,t,a,n),t.child;case 6:return e===null&&He&&((e=n=ot)&&(n=d2(n,t.pendingProps,wn),n!==null?(t.stateNode=n,Tt=t,ot=null,e=!0):e=!1),e||ja(t)),null;case 13:return pp(e,t,n);case 4:return bn(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=fl(t,null,a,n):kt(e,t,a,n),t.child;case 11:return ip(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Jl(e,t),kt(e,t,a,n),t.child;case 8:return kt(e,t,t.pendingProps.children,n),t.child;case 12:return kt(e,t,t.pendingProps.children,n),t.child;case 10:return bp(e,t,n);case 9:return r=t.type._context,a=t.pendingProps.children,rl(t),r=Rt(r),a=a(r),t.flags|=1,kt(e,t,a,n),t.child;case 14:return rp(e,t,t.type,t.pendingProps,n);case 15:return op(e,t,t.type,t.pendingProps,n);case 19:return uu(e,t,n);case 31:return hv(e,t,n);case 22:return cp(e,t,n,t.pendingProps);case 24:return rl(t),a=Rt(yt),e===null?(r=Ec(),r===null&&(r=st,u=_c(),r.pooledCache=u,u.refCount++,u!==null&&(r.pooledCacheLanes|=n),r=u),t.memoizedState={parent:a,cache:r},Tc(t),Sa(t,yt,r)):((e.lanes&n)!==0&&(zc(e,t),Zs(t,null,null,n),Fs()),r=e.memoizedState,u=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Sa(t,yt,a)):(a=u.cache,Sa(t,yt,a),a!==r.cache&&kc(t,[yt],n,!0))),kt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:He&&cr(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Jl(e,t),kt(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ua(e){e.flags|=4}function fu(e,t,n,a,r){var u;if((u=(e.mode&32)!==0)&&(u=n===null?Xx(t,a):Xx(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),u){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(ex())e.flags|=8192;else throw dl=xr,Ac}else e.flags&=-16777217}function vp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fx(t))if(ex())e.flags|=8192;else throw dl=xr,Ac}function Rr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xf():536870912,e.lanes|=t,ns|=t)}function ni(e,t){if(!He)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&1206910976,a|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function gv(e,t,n){var a=t.pendingProps;switch(Nc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return ct(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ia(yt),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yl(t)?ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Sc())),ct(t),null;case 26:var r=t.type,u=t.memoizedState;return e===null?(ua(t),u!==null?(ct(t),vp(t,u)):(ct(t),fu(t,r,null,a,n))):u?u!==e.memoizedState?(ua(t),ct(t),vp(t,u)):(ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ua(t),ct(t),fu(t,r,e,a,n)),null;case 27:if(rt(t),n=pt.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ua(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return ct(t),t.subtreeFlags&=-33554433,null}e=bt.current,Yl(t)?$m(t):(e=qx(r,a,n),t.stateNode=e,ua(t))}return ct(t),t.subtreeFlags&=-33554433,null;case 5:if(rt(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ua(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return ct(t),t.subtreeFlags&=-33554433,null}if(u=bt.current,Yl(t))$m(t);else{var m=mi(pt.current);switch(u){case 1:u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":u=m.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?m.createElement(r,{is:a.is}):m.createElement(r)}}u[Dt]=t,u[en]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)u.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=u;e:switch(Ht(u,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ua(t)}}return ct(t),t.subtreeFlags&=-33554433,fu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ua(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=pt.current,Yl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Tt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||yx(e.nodeValue,n)),e||ja(t,!0)}else e=mi(e).createTextNode(a),e[Dt]=t,t.stateNode=e}return ct(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Yl(t),n!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Dt]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),e=!1}else n=Sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fn(t),t):(fn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return ct(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Yl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(o(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));r[Dt]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),r=!1}else r=Sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(fn(t),t):(fn(t),null)}return fn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rr(t,t.updateQueue),ct(t),null);case 4:return me(),e===null&&Qu(t.stateNode.containerInfo),t.flags|=67108864,ct(t),null;case 10:return ia(t.type),ct(t),null;case 19:if(Uc(t),a=t.memoizedState,a===null)return ct(t),null;if(r=(t.flags&128)!==0,u=a.rendering,u===null)if(r)ni(a,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=vr(e),u!==null){for(t.flags|=128,ni(a,!1),e=u.updateQueue,t.updateQueue=e,Rr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qm(n,e),n=n.sibling;return Js(t,Ut.current&1|2),He&&la(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Fe()>Qr&&(t.flags|=128,r=!0,ni(a,!1),t.lanes=4194304)}else{if(!r)if(e=vr(u),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Rr(t,e),ni(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!u.alternate&&!He)return ct(t),null}else 2*Fe()-a.renderingStartTime>Qr&&n!==536870912&&(t.flags|=128,r=!0,ni(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Fe(),e.sibling=null,u=Ut.current,u=r?u&1|2:u&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||He?Js(t,u):(n=u,Te(Lt,t),Te(Ut,n),Yt===null&&(Yt=t)),He&&la(t,a.treeForkCount),e}return ct(t),null;case 22:case 23:return fn(t),Rc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),n=t.updateQueue,n!==null&&Rr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Re(cl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ia(yt),ct(t),null;case 25:return null;case 30:return t.flags|=33554432,ct(t),null}throw Error(o(156,t.tag))}function bv(e,t){switch(Nc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ia(yt),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rt(t),null;case 31:if(t.memoizedState!==null){if(fn(t),t.alternate===null)throw Error(o(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return me(),null;case 10:return ia(t.type),null;case 22:case 23:return fn(t),Rc(),e!==null&&Re(cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ia(yt),null;case 25:return null;default:return null}}function Np(e,t){switch(Nc(t),t.tag){case 3:ia(yt),me();break;case 26:case 27:case 5:rt(t);break;case 4:me();break;case 31:t.memoizedState!==null&&fn(t);break;case 13:fn(t);break;case 19:Uc(t);break;case 10:ia(t.type);break;case 22:case 23:fn(t),Rc(),e!==null&&Re(cl);break;case 24:ia(yt)}}function ai(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var u=n.create,m=n.inst;a=u(),m.destroy=a}n=n.next}while(n!==r)}}catch(g){tt(t,t.return,g)}}function za(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var u=r.next;a=u;do{if((a.tag&e)===e){var m=a.inst,g=m.destroy;if(g!==void 0){m.destroy=void 0,r=t;var _=n,B=g;try{B()}catch(V){tt(r,_,V)}}}a=a.next}while(a!==u)}}catch(V){tt(t,t.return,V)}}function jp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dh(t,n)}catch(a){tt(e,e.return,a)}}}function Sp(e,t,n){n.props=hl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){tt(e,t,a)}}function Hn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var r=e.stateNode,u=ta(e.memoizedProps,r);(r.ref===null||r.ref.name!==u)&&(r.ref=Tx(u)),a=r.ref;break;case 7:if(e.stateNode===null){var m=new gn(e);b(e.child,!1,o2,m,void 0,void 0),e.stateNode=m}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(g){tt(e,t,g)}}function Bt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){tt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){tt(e,t,r)}else n.current=null}function Lr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Lx(e.stateNode,t[n])}function wp(e){for(var t=e.return;t!==null&&(hu(t)&&Lx(e.stateNode,t.stateNode),!mu(t));)t=t.return}function li(e){for(var t=e.return;t!==null&&(hu(t)&&c2(e.stateNode,t.stateNode),!mu(t));)t=t.return}function mu(e){return e.tag===5||e.tag===3||e.tag===27}function hu(e){return e&&e.tag===7&&e.stateNode!==null}function pu(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){tt(e,e.return,r)}}function xu(e,t,n){try{var a=e.stateNode;Yv(a,e.type,n,t),a[en]=t}catch(r){tt(e,e.return,r)}}function kp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ba(e.type)||e.tag===4}function gu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ba(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bu(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ln)),Lr(e,a),Ze=!0;else if(r!==4&&(r===27&&(Lr(e,a),a=null,Ba(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(bu(e,t,n,a),e=e.sibling;e!==null;)bu(e,t,n,a),e=e.sibling}function Ur(e,t,n,a){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),Lr(e,a),Ze=!0;else if(r!==4&&(r===27&&(Lr(e,a),a=null,Ba(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ur(e,t,n,a),e=e.sibling;e!==null;)Ur(e,t,n,a),e=e.sibling}function _p(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ht(t,a,n),t[Dt]=e,t[en]=n}catch(u){tt(e,e.return,u)}}var Br=!1,mn=null;function Cp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Br=!0)}var qn=null;function Ep(){var e=qn;return qn=null,e}var nn=0;function $l(e,t,n,a,r){return nn=0,Ap(e.child,t,n,a,r)}function Ap(e,t,n,a,r){for(var u=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(a!==null){var g=td(m);a.push(g),g.view&&(u=!0)}else u||td(m).view&&(u=!0);Br=!0,Ex(m,nn===0?t:t+"_"+nn,n),nn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||Ap(e.child,t,n,a,r)&&(u=!0));e=e.sibling}return u}function Gn(e,t){for(;e!==null;)e.tag===5?Ax(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Gn(e.child,t)),e=e.sibling}function Hr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var n=t.name;t=na(t.default,t.share),t!=="none"&&($l(e,n,t,null,!1)||Gn(e.child,!1))}e=e.sibling}}function yu(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,r=ta(a,n),u=na(a.default,n.paired?a.share:a.enter);u!=="none"?$l(e,r,u,null,!1)?(Hr(e),n.paired||t||is(e,a.onEnter)):Gn(e.child,!1):Hr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yu(e,t),e=e.sibling;else Hr(e)}function vu(e){if(mn!==null&&mn.size!==0){var t=mn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,a=n.name;if(a!=null&&a!=="auto"){var r=t.get(a);if(r!==void 0){var u=na(n.default,n.share);if(u!=="none"&&($l(e,a,u,null,!1)?(u=e.stateNode,r.paired=u,u.paired=r,is(e,n.onShare)):Gn(e.child,!1)),t.delete(a),t.size===0)break}}}vu(e)}e=e.sibling}}}function Nu(e){if(e.tag===30){var t=e.memoizedProps,n=ta(t,e.stateNode),a=mn!==null?mn.get(n):void 0,r=na(t.default,a!==void 0?t.share:t.exit);r!=="none"&&($l(e,n,r,null,!1)?a!==void 0?(r=e.stateNode,a.paired=r,r.paired=a,mn.delete(n),is(e,t.onShare)):is(e,t.onExit):Gn(e.child,!1)),mn!==null&&vu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nu(e),e=e.sibling;else mn!==null&&vu(e)}function Tp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ta(t,e.stateNode);t=na(t.default,t.update),e.flags&=-5,t!=="none"&&$l(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Tp(e);e=e.sibling}}function ju(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gn(e.child,!1))}ju(e)}e=e.sibling}}function qr(e){if(e.tag===30)e.stateNode.paired=null,Gn(e.child,!1),ju(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)qr(e),e=e.sibling;else ju(e)}function zp(e){for(e=e.child;e!==null;)e.tag===30?Gn(e.child,!1):(e.subtreeFlags&33554432)!==0&&zp(e),e=e.sibling}function Su(e,t,n,a,r,u,m){for(var g=!1;t!==null;){if(t.tag===5){var _=t.stateNode;if(u!==null&&nn<u.length){var B=u[nn],V=td(_);(B.view||V.view)&&(g=!0);var te;if(te=(e.flags&4)===0)if(V.clip)te=!0;else{te=B.rect;var R=V.rect;te=te.y!==R.y||te.x!==R.x||te.height!==R.height||te.width!==R.width}te&&(e.flags|=4),V.abs?V=!B.abs:(B=B.rect,V=V.rect,V=B.height!==V.height||B.width!==V.width),V&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Ex(_,nn===0?n:n+"_"+nn,r),g&&(e.flags&4)!==0||(qn===null&&(qn=[]),qn.push(_,nn===0?a:a+"_"+nn,t.memoizedProps)),nn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:Su(e,t.child,n,a,r,u,m)&&(g=!0));t=t.sibling}return g}function Mp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,r=ta(n,a),u=na(n.default,n.update),m;m=e.memoizedState,e.memoizedState=null,a=e;var g=e.child;nn=0,r=Su(a,g,r,r,u,m,!1),(e.flags&4)!==0&&r&&is(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Mp(e);e=e.sibling}}var zt=!1,$e=!1,Pn=!1,wu=!1,Op=typeof WeakSet=="function"?WeakSet:Set,Mt=null,Vn=!1,si=!1,Gr=!1,ku=!1;function yv(e,t,n){if(e=e.containerInfo,Zu=xs,e=Um(e),dc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var u=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var g=0,_=-1,B=-1,V=0,te=0,R=e,G=null;t:for(;;){for(var he;R!==a||u!==0&&R.nodeType!==3||(_=g+u),R!==m||r!==0&&R.nodeType!==3||(B=g+r),R.nodeType===3&&(g+=R.nodeValue.length),(he=R.firstChild)!==null;)G=R,R=he;for(;;){if(R===e)break t;if(G===a&&++V===u&&(_=g),G===m&&++te===r&&(B=g),(he=R.nextSibling)!==null)break;R=G,G=R.parentNode}R=he}a=_===-1||B===-1?null:{start:_,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ju={focusedElem:e,selectionRange:a},xs=!1,n=(n&335544064)===n,Mt=t,t=n?9270:1024;Mt!==null;){if(e=Mt,n&&(a=e.deletions,a!==null))for(u=0;u<a.length;u++)n&&Nu(a[u]);if(e.alternate===null&&(e.flags&2)!==0)n&&Cp(e),Pr(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&Nu(a),Pr(n);continue}else if(a!==null&&a.memoizedState!==null){n&&Cp(e),Pr(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,Mt=a):(n&&Tp(e),Pr(n))}}mn=null}function Pr(e){for(;Mt!==null;){var t=Mt,n=e,a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&a!==null){n=void 0,r=a.memoizedProps,a=a.memoizedState;var u=t.stateNode;try{var m=hl(t.type,r);n=u.getSnapshotBeforeUpdate(m,a),u.__reactInternalSnapshotBeforeUpdate=n}catch(g){tt(t,t.return,g)}}break;case 3:if((r&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)ld(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":ld(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&a!==null&&(n=ta(a.memoizedProps,a.stateNode),r=t.memoizedProps,r=na(r.default,r.update),r!=="none"&&$l(a,n,r,a.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(o(163))}if(a=t.sibling,a!==null){a.return=t.return,Mt=a;break}Mt=t.return}}function Dp(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Yn(e,n),a&4&&ai(5,n);break;case 1:if(Yn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){tt(n,n.return,m)}else{var r=hl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){tt(n,n.return,m)}}a&64&&jp(n),a&512&&Hn(n,n.return);break;case 3:if(Yn(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dh(e,t)}catch(m){tt(n,n.return,m)}}break;case 27:t===null&&a&4&&_p(n);case 26:case 5:Yn(e,n),t===null&&a&4&&pu(n),a&512&&Hn(n,n.return);break;case 12:Yn(e,n);break;case 31:Yn(e,n),a&4&&Bp(e,n);break;case 13:Yn(e,n),a&4&&Hp(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=zv.bind(null,n),f2(e,n))));break;case 22:if(a=n.memoizedState!==null||zt,!a){var u=t!==null&&t.memoizedState!==null||$e;t=zt,r=$e,zt=a,($e=u)&&!r?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),Mn(e,n,a)):Yn(e,n),zt=t,$e=r}break;case 30:Yn(e,n),a&512&&Hn(n,n.return);break;case 7:a&512&&Hn(n,n.return);default:Yn(e,n)}}function _u(e,t){for(e=e.child;e!==null;)Rp(e,t),e=e.sibling}function Rp(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var a=n.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var r=e.stateNode,u=e.memoizedProps.style,m=u!=null&&u.hasOwnProperty("display")?u.display:null;r.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(_){tt(e,e.return,_)}Cu(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ze=!0}catch(_){tt(e,e.return,_)}break;case 18:try{var g=e.stateNode;t?Cx(g,!0):Cx(e.stateNode,!1)}catch(_){tt(e,e.return,_)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function Cu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:Rp(n,a);break e;case 22:n.memoizedState===null&&Cu(n,a);break e;default:Cu(n,a)}}e=e.sibling}}function Lp(e){var t=e.alternate;t!==null&&(e.alternate=null,Lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var dt=null,an=!1;function Tn(e,t,n){for(n=n.child;n!==null;)Up(e,t,n),n=n.sibling}function Up(e,t,n){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Es,n)}catch{}switch(n.tag){case 26:$e||Bt(n,t),Tn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$e&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$e||Bt(n,t),li(n);var a=dt,r=an;Ba(n.type)&&(dt=n.stateNode,an=!1),Tn(e,t,n),Gx(n.stateNode,n.type,n.memoizedProps),dt=a,an=r;break;case 5:$e||Bt(n,t),li(n);case 6:if(n.tag===6&&li(n),a=dt,r=an,dt=null,Tn(e,t,n),dt=a,an=r,dt!==null)if(an)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(n.stateNode),Ze=!0}catch(u){tt(n,t,u)}else try{dt.removeChild(n.stateNode),Ze=!0}catch(u){tt(n,t,u)}break;case 18:dt!==null&&(an?(e=dt,_x(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),gs(e)):_x(dt,n.stateNode));break;case 4:a=dt,r=an,dt=n.stateNode.containerInfo,an=!0,Tn(e,t,n),dt=a,an=r;break;case 0:case 11:case 14:case 15:za(2,n,t),$e||za(4,n,t),Tn(e,t,n);break;case 1:$e||(Bt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Sp(n,t,a)),Tn(e,t,n);break;case 21:Tn(e,t,n);break;case 22:$e=(a=$e)||n.memoizedState!==null,Tn(e,t,n),$e=a;break;case 30:Bt(n,t),Tn(e,t,n);break;case 7:$e||Bt(n,t),Tn(e,t,n);break;default:Tn(e,t,n)}}function Bp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gs(e)}catch(n){tt(t,t.return,n)}}}function Hp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gs(e)}catch(n){tt(t,t.return,n)}}function vv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Op),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Op),t;default:throw Error(o(435,e.tag))}}function Vr(e,t){var n=vv(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=Mv.bind(null,e,a);a.then(r,r)}})}function Ft(e,t,n){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var u=a[r],m=e,g=t,_=g;e:for(;_!==null;){switch(_.tag){case 27:if(Ba(_.type)){dt=_.stateNode,an=!1;break e}break;case 5:dt=_.stateNode,an=!1;break e;case 3:case 4:dt=_.stateNode.containerInfo,an=!0;break e}_=_.return}if(dt===null)throw Error(o(160));Up(m,g,u),dt=null,an=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)qp(t,e,n),t=t.sibling}var zn=null;function qp(e,t,n){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var u=0;u<a.length;u++){var m=a[u];m.ref.impl=m.nextImpl}Ft(t,e,n),Zt(e),r&4&&(za(3,e,e.return),ai(3,e),za(5,e,e.return));break;case 1:Ft(t,e,n),Zt(e),r&512&&($e||a===null||Bt(a,a.return)),r&64&&zt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(u=zn,Ft(t,e,n),Zt(e),r&512&&($e||a===null||Bt(a,a.return)),r&4)if(r=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(zt)e.stateNode=Sx(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=u.ownerDocument||u;t:switch(t){case"title":a=r.getElementsByTagName("title")[0],(!a||a[zs]||a[Dt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(t),r.head.insertBefore(a,r.querySelector("head > title"))),Ht(a,t,n),a[Dt]=e,At(a),t=a;break e;case"link":if(u=Qx("link","href",r).get(t+(n.href||""))){for(m=0;m<u.length;m++)if(a=u[m],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){u.splice(m,1);break t}}a=r.createElement(t),Ht(a,t,n),r.head.appendChild(a);break;case"meta":if(u=Qx("meta","content",r).get(t+(n.content||""))){for(m=0;m<u.length;m++)if(a=u[m],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){u.splice(m,1);break t}}a=r.createElement(t),Ht(a,t,n),r.head.appendChild(a);break;default:throw Error(o(468,t))}a[Dt]=e,At(a),t=a}e.stateNode=t}else zt||dd(u,e.type,e.stateNode);else e.stateNode=Kx(u,n,e.memoizedProps);else r!==n?(r===null?(t=a.stateNode,t===null||$e||t.parentNode.removeChild(t)):r.count--,n===null?zt||dd(u,e.type,e.stateNode):Kx(u,n,e.memoizedProps)):n===null&&e.stateNode!==null&&xu(e,e.memoizedProps,a.memoizedProps);break;case 27:Ft(t,e,n),Zt(e),r&512&&($e||a===null||Bt(a,a.return)),a!==null&&r&4&&xu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(u=Pn,Pn=!1,Ft(t,e,n),Pn=u,Zt(e),r&512&&($e||a===null||Bt(a,a.return)),e.flags&32){t=e.stateNode;try{Dl(t,""),Ze=!0}catch(V){tt(e,e.return,V)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,xu(e,t,a!==null?a.memoizedProps:t)),r&1024&&(wu=!0);break;case 6:if(Ft(t,e,n),Zt(e),r&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ze=!0}catch(V){tt(e,e.return,V)}}break;case 3:if(Ze=!1,lo=null,u=zn,zn=hi(t.containerInfo),Ft(t,e,n),zn=u,Zt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{gs(t.containerInfo)}catch(V){tt(e,e.return,V)}wu&&(wu=!1,Gp(e)),Ze=!1;break;case 4:r=Pn,Pn=zt,a=rm(),u=zn,zn=hi(e.stateNode.containerInfo),Ft(t,e,n),Zt(e),zn=u,Ze&&si&&(Gr=!0),Ze=a,Pn=r;break;case 12:Ft(t,e,n),Zt(e);break;case 31:Ft(t,e,n),Zt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Vr(e,t)));break;case 13:Ft(t,e,n),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Kr=Fe()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Vr(e,t)));break;case 22:u=e.memoizedState!==null,m=a!==null&&a.memoizedState!==null;var g=zt,_=$e,B=Pn;zt=g||u,Pn=B||u,$e=_||m,Ft(t,e,n),$e=_,Pn=B,zt=g,Zt(e),r&8192&&(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,!u||a===null||m||zt||$e||(t=m||$e,n=zt,a=$e,zt=u||zt,$e=t,Ma(e,2),zt=n,$e=a),!u&&Pn||_u(e,u)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Vr(e,n))));break;case 19:Ft(t,e,n),Zt(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Vr(e,t)));break;case 30:r&512&&($e||a===null||Bt(a,a.return)),r=rm(),u=si,m=(n&335544064)===n,g=e.memoizedProps,si=m&&na(g.default,g.update)!=="none",Ft(t,e,n),Zt(e),m&&a!==null&&Ze&&(e.flags|=4),si=u,Ze=r;break;case 21:break;case 7:r&512&&($e||a===null||Bt(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:Ft(t,e,n),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(kp(a)){n=a;break}a=a.return}a=null;for(var r=e.return;r!==null;){if(hu(r)){var u=r.stateNode;a===null?a=[u]:a.push(u)}if(mu(r))break;r=r.return}var m=a;if(n==null)throw Error(o(160));switch(n.tag){case 27:var g=n.stateNode,_=gu(e);Ur(e,_,g,m);break;case 5:var B=n.stateNode;n.flags&32&&(Dl(B,""),n.flags&=-33);var V=gu(e);Ur(e,V,B,m);break;case 3:case 4:var te=n.stateNode.containerInfo,R=gu(e);bu(e,R,te,m);break;default:throw Error(o(161))}}catch(G){tt(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xs=!0,t.reset(),xs=!1),e=e.sibling}}function Wl(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pp(t,e),t=t.sibling;else Mp(t)}function Pp(e,t){var n=e.alternate;if(n===null)yu(e,!1);else switch(e.tag){case 3:if(ku=Vn=!1,Ep(),Wl(t,e),!Vn&&!Gr){if(e=qn,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var r=e[a+1];Ax(n,e[a+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),ku=!0}qn=null;break;case 5:Wl(t,e);break;case 4:a=Vn,Vn=!1,Wl(t,e),Vn&&(Gr=!0),Vn=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?yu(e,!1):Wl(t,e));break;case 30:a=Vn,r=Ep(),Vn=!1,Wl(t,e),Vn&&(e.flags|=4);var u=e.memoizedProps,m=e.stateNode;t=ta(u,m),m=ta(n.memoizedProps,m);var g=na(u.default,u.update);g==="none"?t=!1:(u=n.memoizedState,n.memoizedState=null,n=e.child,nn=0,t=Su(e,n,t,m,g,u,!0),nn!==(u===null?0:u.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(is(e,e.memoizedProps.onUpdate),qn=r):r!==null&&(r.push.apply(r,qn),qn=r),Vn=(e.flags&32)!==0?!0:a;break;default:Wl(t,e)}}function Yn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Dp(e,t.alternate,t),t=t.sibling}function Ma(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:za(4,n,n.return),Ma(n,a);break;case 1:Bt(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Sp(n,n.return,r),Ma(n,a);break;case 27:(a&2)!==0&&Gx(n.stateNode,n.type,n.memoizedProps);case 5:Bt(n,n.return),n.tag!==5&&n.tag!==27||li(n),Ma(n,a);break;case 6:li(n);break;case 26:Bt(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||$e||r.parentNode.removeChild(r),Ma(n,a);break;case 22:n.memoizedState===null&&Ma(n,a);break;case 30:Bt(n,n.return),Ma(n,a);break;case 7:Bt(n,n.return);default:Ma(n,a)}e=e.sibling}}function Mn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,r=e,u=t,m=u.flags,g=(n&1)!==0;switch(u.tag){case 0:case 11:case 15:Mn(r,u,n),ai(4,u);break;case 1:if(Mn(r,u,n),a=u,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(V){tt(a,a.return,V)}if(a=u,r=a.updateQueue,r!==null){var _=a.stateNode;try{var B=r.shared.hiddenCallbacks;if(B!==null)for(r.shared.hiddenCallbacks=null,r=0;r<B.length;r++)uh(B[r],_)}catch(V){tt(a,a.return,V)}}g&&m&64&&jp(u),Hn(u,u.return);break;case 27:(n&2)!==0&&_p(u);case 5:u.tag!==5&&u.tag!==27||wp(u),Mn(r,u,n),g&&a===null&&m&4&&pu(u),Hn(u,u.return);break;case 6:wp(u);break;case 26:_=u.stateNode,u.memoizedState!==null||_===null||zt||dd(hi(_.ownerDocument),u.type,_),Mn(r,u,n),g&&a===null&&m&4&&pu(u),Hn(u,u.return);break;case 12:Mn(r,u,n);break;case 31:Mn(r,u,n),g&&m&4&&Bp(r,u);break;case 13:Mn(r,u,n),g&&m&4&&Hp(r,u);break;case 22:u.memoizedState===null&&Mn(r,u,n),Hn(u,u.return);break;case 30:Mn(r,u,n),Hn(u,u.return);break;case 7:Hn(u,u.return);default:Mn(r,u,n)}t=t.sibling}}function Eu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ys(n))}function Au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ys(e))}function kn(e,t,n,a){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Vp(e,t,n,a),t=t.sibling;else r&&zp(t)}function Vp(e,t,n,a){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&qr(t);var u=t.flags;switch(t.tag){case 0:case 11:case 15:kn(e,t,n,a),u&2048&&ai(9,t);break;case 1:kn(e,t,n,a);break;case 3:kn(e,t,n,a),r&&ku&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),u&2048&&(u=null,t.alternate!==null&&(u=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==u&&(t.refCount++,u!=null&&Ys(u)));break;case 12:if(u&2048){kn(e,t,n,a),u=t.stateNode;try{var m=t.memoizedProps,g=m.id,_=m.onPostCommit;typeof _=="function"&&_(g,t.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(B){tt(t,t.return,B)}}else kn(e,t,n,a);break;case 31:kn(e,t,n,a);break;case 13:kn(e,t,n,a);break;case 23:break;case 22:m=t.stateNode,g=t.alternate,t.memoizedState!==null?(r&&g!==null&&g.memoizedState===null&&qr(g),m._visibility&2?kn(e,t,n,a):ii(e,t)):(r&&g!==null&&g.memoizedState!==null&&qr(t),m._visibility&2?kn(e,t,n,a):(m._visibility|=2,es(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),u&2048&&Eu(g,t);break;case 24:kn(e,t,n,a),u&2048&&Au(t.alternate,t);break;case 30:r&&(u=t.alternate,u!==null&&(Gn(u.child,!0),Gn(t.child,!0))),kn(e,t,n,a);break;default:kn(e,t,n,a)}}function es(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,m=t,g=n,_=a,B=m.flags;switch(m.tag){case 0:case 11:case 15:es(u,m,g,_,r),ai(8,m);break;case 23:break;case 22:var V=m.stateNode;m.memoizedState!==null?V._visibility&2?es(u,m,g,_,r):ii(u,m):(V._visibility|=2,es(u,m,g,_,r)),r&&B&2048&&Eu(m.alternate,m);break;case 24:es(u,m,g,_,r),r&&B&2048&&Au(m.alternate,m);break;default:es(u,m,g,_,r)}t=t.sibling}}function ii(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:ii(n,a),r&2048&&Eu(a.alternate,a);break;case 24:ii(n,a),r&2048&&Au(a.alternate,a);break;default:ii(n,a)}t=t.sibling}}var pl=8192;function xl(e,t,n){if(e.subtreeFlags&pl)for(e=e.child;e!==null;)Yp(e,t,n),e=e.sibling}function Yp(e,t,n){switch(e.tag){case 26:xl(e,t,n),e.flags&pl&&(e.memoizedState!==null?_2(n,zn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Jx(n,e)));break;case 5:xl(e,t,n),e.flags&pl&&(e=e.stateNode,(t&335544128)===t&&Jx(n,e));break;case 3:case 4:var a=zn;zn=hi(e.stateNode.containerInfo),xl(e,t,n),zn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=pl,pl=16777216,xl(e,t,n),pl=a):xl(e,t,n));break;case 30:if((e.flags&pl)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var r=e.stateNode;r.paired=null,mn===null&&(mn=new Map),mn.set(a,r)}xl(e,t,n);break;default:xl(e,t,n)}}function Ip(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ri(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Mt=a,Qp(a,e)}Ip(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kp(e),e=e.sibling}function Kp(e){switch(e.tag){case 0:case 11:case 15:ri(e),e.flags&2048&&za(9,e,e.return);break;case 3:ri(e);break;case 12:ri(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yr(e)):ri(e);break;default:ri(e)}}function Yr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Mt=a,Qp(a,e)}Ip(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:za(8,t,t.return),Yr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yr(t));break;default:Yr(t)}e=e.sibling}}function Qp(e,t){for(;Mt!==null;){var n=Mt;switch(n.tag){case 0:case 11:case 15:za(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ys(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Mt=a;else e:for(n=e;Mt!==null;){a=Mt;var r=a.sibling,u=a.return;if(Lp(a),a===n){Mt=null;break e}if(r!==null){r.return=u,Mt=r;break e}Mt=u}}}var Nv={getCacheForType:function(e){var t=Rt(yt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Rt(yt).controller.signal}},jv=typeof WeakMap=="function"?WeakMap:Map,Je=0,st=null,Pe=null,Ye=0,et=0,hn=null,Oa=!1,ts=!1,Tu=!1,da=0,ht=0,Da=0,gl=0,Ir=0,pn=0,ns=0,oi=null,ln=null,zu=!1,Kr=0,Xp=0,Qr=1/0,Xr=null,Ra=null,ft=0,On=null,bl=null,In=0,Mu=0,Ou=null,Fp=null,as=null,ls=null,ss=null,ci=0,Fr=null;function xn(){return(Je&2)!==0&&Ye!==0?Ye&-Ye:fe.T!==null?Vu():$f()}function Zp(){if(pn===0)if((Ye&536870912)===0||He){var e=Vi;Vi<<=1,(Vi&3932160)===0&&(Vi=262144),pn=e}else pn=536870912;return e=Lt.current,e!==null&&(e.flags|=32),pn}function is(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=Tx(ta(e.memoizedProps,n))),ls===null&&(ls=[]),ls.push(t.bind(null,a))}}function sn(e,t,n){(e===st&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(rs(e,0),La(e,Ye,pn,!1)),Ts(e,n),((Je&2)===0||e!==st)&&(e===st&&((Je&2)===0&&(gl|=n),ht===4&&La(e,Ye,pn,!1)),Kn(e))}function Jp(e,t,n){if((Je&6)!==0)throw Error(o(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||As(e,t),r=a?kv(e,t):Ru(e,t,!0),u=a;do{if(r===0){ts&&!a&&La(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Sv(n)){r=Ru(e,t,!1),u=!1;continue}if(r===2){if(u=t,e.errorRecoveryDisabledLanes&u)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var g=e;r=oi;var _=g.current.memoizedState.isDehydrated;if(_&&(rs(g,m).flags|=256),m=Ru(g,m,!1),m!==2&&m!==6){if(Tu&&!_){g.errorRecoveryDisabledLanes|=u,gl|=u,r=4;break e}u=ln,ln=r,u!==null&&(ln===null?ln=u:ln.push.apply(ln,u))}r=m}if(u=!1,r!==2)continue}}if(r===1){rs(e,0),La(e,t,0,!0);break}e:{switch(a=e,u=r,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:La(a,t,pn,!Oa);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(r=Kr+300-Fe(),10<r)){if(La(a,t,pn,!Oa),Ii(a,0,!0)!==0)break e;In=t,a.timeoutHandle=ed($p.bind(null,a,n,ln,Xr,zu,t,pn,gl,ns,Oa,u,"Throttled",-0,0),r);break e}$p(a,n,ln,Xr,zu,t,pn,gl,ns,Oa,u,null,-0,0)}}break}while(!0);Kn(e)}function $p(e,t,n,a,r,u,m,g,_,B,V,te,R,G){e.timeoutHandle=-1;var he=t.subtreeFlags,we=(u&335544064)===u;if(te=null,(we||he&8192||(he&16785408)===16785408)&&(te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ln},mn=null,Yp(t,u,te),we&&(he=te,we=e.containerInfo,we=(we.nodeType===9?we:we.ownerDocument).__reactViewTransition,we!=null&&(he.count++,he.waitingForViewTransition=!0,he=gi.bind(he),we.finished.then(he,he))),he=(u&62914560)===u?Kr-Fe():(u&4194048)===u?Xp-Fe():0,he=C2(te,he),he!==null)){In=u,e.cancelPendingCommit=he(ix.bind(null,e,t,u,n,a,r,m,g,_,B,V,te,null,R,G)),La(e,u,m,!B);return}ix(e,t,u,n,a,r,m,g,_,B,V,te)}function Sv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],u=r.getSnapshot;r=r.value;try{if(!dn(u(),r))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 La(e,t,n,a){t=Qf(e,t),t&=~Ir,t&=~gl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var u=31-cn(r),m=1<<u;a[u]=-1,r&=~m}n!==0&&Ff(e,n,t)}function Zr(){return(Je&6)===0?(ui(0),!1):!0}function Du(){if(Pe!==null){if(et===0)var e=Pe.return;else e=Pe,sa=sl=null,Pc(e),Ql=null,Qs=0,e=Pe;for(;e!==null;)Np(e.alternate,e),e=e.return;Pe=null}}function rs(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Qv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),In=0,Du(),st=e,Pe=n=aa(e.current,null),Ye=t,et=0,hn=null,Oa=!1,ts=As(e,t),Tu=!1,ns=pn=Ir=gl=Da=ht=0,ln=oi=null,zu=!1,da=Qf(e,t),lr(),n}function Wp(e,t){Ue=null,fe.H=Ar,t===Kl||t===pr?(t=ih(),et=3):t===Ac?(t=ih(),et=4):et=t===au?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,Pe===null&&(ht=1,Tr(e,Nn(t,e.current)))}function ex(){var e=Lt.current;return e===null?!0:(Ye&4194048)===Ye?Yt===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===Yt:!1}function tx(){var e=fe.H;return fe.H=Ar,e===null?Ar:e}function nx(){var e=fe.A;return fe.A=Nv,e}function Jr(){ht=4,Oa||(Ye&4194048)!==Ye&&Lt.current!==null||(ts=!0),(Da&134217727)===0&&(gl&134217727)===0||st===null||La(st,Ye,pn,!1)}function Ru(e,t,n){var a=Je;Je|=2;var r=tx(),u=nx();(st!==e||Ye!==t)&&(Xr=null,rs(e,t)),t=!1;var m=ht;e:do try{if(et!==0&&Pe!==null){var g=Pe,_=hn;switch(et){case 8:Du(),m=6;break e;case 3:case 2:case 9:case 6:Lt.current===null&&(t=!0);var B=et;if(et=0,hn=null,os(e,g,_,B),n&&ts){m=0;break e}break;default:B=et,et=0,hn=null,os(e,g,_,B)}}wv(),m=ht;break}catch(V){Wp(e,V)}while(!0);return t&&e.shellSuspendCounter++,sa=sl=null,Je=a,fe.H=r,fe.A=u,Pe===null&&(st=null,Ye=0,lr()),m}function wv(){for(;Pe!==null;)ax(Pe)}function kv(e,t){var n=Je;Je|=2;var a=tx(),r=nx();st!==e||Ye!==t?(Xr=null,Qr=Fe()+500,rs(e,t)):ts=As(e,t);e:do try{if(et!==0&&Pe!==null){t=Pe;var u=hn;t:switch(et){case 1:et=0,hn=null,os(e,t,u,1);break;case 2:case 9:if(lh(u)){et=0,hn=null,lx(t);break}t=function(){et!==2&&et!==9||st!==e||(et=7),Kn(e)},u.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:lh(u)?(et=0,hn=null,lx(t)):(et=0,hn=null,os(e,t,u,7));break;case 5:var m=null;switch(Pe.tag){case 26:m=Pe.memoizedState;case 5:case 27:var g=Pe;if(m?Fx(m):g.stateNode.complete){et=0,hn=null;var _=g.sibling;if(_!==null)Pe=_;else{var B=g.return;B!==null?(Pe=B,$r(B)):Pe=null}break t}}et=0,hn=null,os(e,t,u,5);break;case 6:et=0,hn=null,os(e,t,u,6);break;case 8:Du(),ht=6;break e;default:throw Error(o(462))}}_v();break}catch(V){Wp(e,V)}while(!0);return sa=sl=null,fe.H=a,fe.A=r,Je=n,Pe!==null?0:(st=null,Ye=0,lr(),ht)}function _v(){for(;Pe!==null&&!xt();)ax(Pe)}function ax(e){var t=yp(e.alternate,e,da);e.memoizedProps=e.pendingProps,t===null?$r(e):Pe=t}function lx(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fp(n,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=fp(n,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:Pc(t);var a=t;a===Tt&&(He?(ur(a),a.tag===5&&a.stateNode!=null&&(ot=a.stateNode)):(ur(a),He=!0));default:Np(n,t),t=Pe=Qm(t,da),t=yp(n,t,da)}e.memoizedProps=e.pendingProps,t===null?$r(e):Pe=t}function os(e,t,n,a){sa=sl=null,Pc(t),Ql=null,Qs=0;var r=t.return;try{if(mv(e,r,t,n,Ye)){ht=1,Tr(e,Nn(n,e.current)),Pe=null;return}}catch(u){if(r!==null)throw Pe=r,u;ht=1,Tr(e,Nn(n,e.current)),Pe=null;return}t.flags&32768?(He||a===1?e=!0:ts||(Ye&536870912)!==0?e=!1:(Oa=e=!0,(a===2||a===9||a===3||a===6)&&(a=Lt.current,a!==null&&a.tag===13&&(a.flags|=16384))),sx(t,e)):$r(t)}function $r(e){var t=e;do{if((t.flags&32768)!==0){sx(t,Oa);return}e=t.return;var n=gv(t.alternate,t,da);if(n!==null){Pe=n;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);ht===0&&(ht=5)}function sx(e,t){do{var n=bv(e.alternate,e);if(n!==null){n.flags&=32767,Pe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=n}while(e!==null);ht=6,Pe=null}function ix(e,t,n,a,r,u,m,g,_,B,V,te){e.cancelPendingCommit=null;do Wr();while(ft!==0);if((Je&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===st&&(Pe=st=null,Ye=0),bl=t,On=e,In=n,Ou=r,Fp=a,Cv(e,t,n,m,g,_,te)}}function Cv(e,t,n,a,r,u,m){var g=t.lanes|t.childLanes;if(Mu=g,g|=xc,Wy(e,n,g,a,r,u),ls=null,(n&335544064)===n?(ss=tv(e),a=10262):(ss=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,Ov(Gi,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),Br=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null,r=xe.p,xe.p=2,u=Je,Je|=4;try{yv(e,t,n)}finally{Je=u,xe.p=r,fe.T=a}}ft=1,Br?as=Wv(m,e.containerInfo,ss,Lu,Uu,Av,Bu,Hu,Ev):(Lu(),Uu(),Bu())}function Ev(e){if(ft!==0){var t=On.onRecoverableError;t(e,{componentStack:null})}}function Av(){ft===3&&(ft=0,Pp(bl,On),ft=4)}function Lu(){if(ft===1){ft=0;var e=On,t=bl,n=In,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var r=xe.p;xe.p=2;var u=Je;Je|=4;try{si=Gr=!1,qp(t,e,n),n=Ju;var m=Um(e.containerInfo),g=n.focusedElem,_=n.selectionRange;if(m!==g&&g&&g.ownerDocument&&Lm(g.ownerDocument.documentElement,g)){if(_!==null&&dc(g)){var B=_.start,V=_.end;if(V===void 0&&(V=B),"selectionStart"in g)g.selectionStart=B,g.selectionEnd=Math.min(V,g.value.length);else{var te=g.ownerDocument||document,R=te&&te.defaultView||window;if(R.getSelection){var G=R.getSelection(),he=g.textContent.length,we=Math.min(_.start,he),Be=_.end===void 0?we:Math.min(_.end,he);!G.extend&&we>Be&&(m=Be,Be=we,we=m);var U=Rm(g,we),T=Rm(g,Be);if(U&&T&&(G.rangeCount!==1||G.anchorNode!==U.node||G.anchorOffset!==U.offset||G.focusNode!==T.node||G.focusOffset!==T.offset)){var H=te.createRange();H.setStart(U.node,U.offset),G.removeAllRanges(),we>Be?(G.addRange(H),G.extend(T.node,T.offset)):(H.setEnd(T.node,T.offset),G.addRange(H))}}}}for(te=[],G=g;G=G.parentNode;)G.nodeType===1&&te.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<te.length;g++){var ee=te[g];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}xs=!!Zu,Ju=Zu=null}finally{Je=u,xe.p=r,fe.T=a}}e.current=t,ft=2}}function Uu(){if(ft===2){ft=0;var e=On,t=bl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=fe.T,fe.T=null;var a=xe.p;xe.p=2;var r=Je;Je|=4;try{Dp(e,t.alternate,t)}finally{Je=r,xe.p=a,fe.T=n}}ft=3}}function Bu(){if(ft===4||ft===3){ft=0;var e=as;as=null,Xe();var t=On,n=bl,a=In,r=Fp,u=(a&335544064)===a?10262:10256;if((n.subtreeFlags&u)!==0||(n.flags&u)!==0?ft=5:(ft=0,bl=On=null,rx(t,t.pendingLanes)),u=t.pendingLanes,u===0&&(Ra=null),Qo(a),n=n.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Es,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=fe.T,u=xe.p,xe.p=2,fe.T=null;try{for(var m=t.onRecoverableError,g=0;g<r.length;g++){var _=r[g];m(_.value,{componentStack:_.stack})}}finally{fe.T=n,xe.p=u}}if(r=ls,m=ss,ss=null,r!==null&&(ls=null,m===null&&(m=[]),e!==null))for(_=0;_<r.length;_++)n=(0,r[_])(m),n!==void 0&&e.finished.finally(n);(In&3)!==0&&Wr(),Kn(t),u=t.pendingLanes,(a&261930)!==0&&(u&42)!==0?t===Fr?ci++:(ci=0,Fr=t):(ci=0,Fr=null),ui(0)}}function rx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ys(t)))}function Wr(){return as!==null&&(as.skipTransition(),as=null),Lu(),Uu(),Bu(),Hu()}function Hu(){if(ft!==5)return!1;var e=On,t=Mu;Mu=0;var n=Qo(In),a=fe.T,r=xe.p;try{xe.p=32>n?32:n,fe.T=null,n=Ou,Ou=null;var u=On,m=In;if(ft=0,bl=On=null,In=0,(Je&6)!==0)throw Error(o(331));var g=Je;if(Je|=4,Kp(u.current),Vp(u,u.current,m,n),Je=g,ui(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Es,u)}catch{}return!0}finally{xe.p=r,fe.T=a,rx(e,t)}}function ox(e,t,n){t=Nn(n,t),t=nu(e.stateNode,t,2),e=Ca(e,t,2),e!==null&&(Ts(e,2),Kn(e))}function tt(e,t,n){if(e.tag===3)ox(e,e,n);else for(;t!==null;){if(t.tag===3){ox(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ra===null||!Ra.has(a))){e=Nn(n,e),n=lp(2),a=Ca(t,n,2),a!==null&&(sp(n,a,t,e),Ts(a,2),Kn(a));break}}t=t.return}}function qu(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new jv;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(Tu=!0,r.add(n),e=Tv.bind(null,e,t,n),t.then(e,e))}function Tv(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,st===e&&(Ye&n)===n&&((ht===4||ht===3&&(Ye&62914560)===Ye&&300>Fe()-Kr)&&(Je&2)===0?rs(e,0):Ir|=n,ns===Ye&&(ns=0)),Kn(e)}function cx(e,t){t===0&&(t=Xf()),e=nl(e,t),e!==null&&(Ts(e,t),Kn(e))}function zv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cx(e,n)}function Mv(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),cx(e,n)}function Ov(e,t){return Ge(e,t)}var cs=null,us=null,Gu=!1,eo=!1,Pu=!1,Ua=0;function Kn(e){e!==us&&e.next===null&&(us===null?cs=us=e:us=us.next=e),eo=!0,Gu||(Gu=!0,Rv())}function ui(e,t){if(!Pu&&eo){Pu=!0;do for(var n=!1,a=cs;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var u=0;else{var m=a.suspendedLanes,g=a.pingedLanes;u=(1<<31-cn(42|e)+1)-1,u&=r&~(m&~g),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,mx(a,u))}else u=Ye,u=Ii(a,a===st?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||As(a,u)||(n=!0,mx(a,u));a=a.next}while(n);Pu=!1}}function Dv(){ux()}function ux(){eo=Gu=!1;var e=0;Ua!==0&&Kv()&&(e=Ua);for(var t=Fe(),n=null,a=cs;a!==null;){var r=a.next,u=dx(a,t);u===0?(a.next=null,n===null?cs=r:n.next=r,r===null&&(us=n)):(n=a,(e!==0||(u&3)!==0)&&(eo=!0)),a=r}ft!==0&&ft!==5||ui(e),Ua!==0&&(Ua=0)}function dx(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var m=31-cn(u),g=1<<m,_=r[m];_===-1?((g&n)===0||(g&a)!==0)&&(r[m]=$y(g,t)):_<=t&&(e.expiredLanes|=g),u&=~g}if(t=st,n=Ye,n=Ii(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&at(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||As(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&at(a),Qo(n)){case 2:case 8:n=If;break;case 32:n=Gi;break;case 268435456:n=Kf;break;default:n=Gi}return a=fx.bind(null,e),n=Ge(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&at(a),e.callbackPriority=2,e.callbackNode=null,2}function fx(e,t){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wr()&&e.callbackNode!==n)return null;var a=Ye;return a=Ii(e,e===st?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Jp(e,a,t),dx(e,Fe()),e.callbackNode!=null&&e.callbackNode===n?fx.bind(null,e):null)}function mx(e,t){if(Wr())return null;Jp(e,t,!0)}function Rv(){Xv(function(){(Je&6)!==0?Ge(Yf,Dv):ux()})}function Vu(){if(Ua===0){var e=ol;e===0&&(e=Pi,Pi<<=1,(Pi&261888)===0&&(Pi=256)),Ua=e}return Ua}function hx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zi(e)}function Lv(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var u=hx((r[en]||null).action),m=a.submitter;m&&(t=(t=m[en]||null)?hx(t.formAction):m.getAttribute("formAction"),t!==null&&(u=t,m=null));var g=new er("action","action",null,a,r);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ua!==0){var _=new FormData(r,m);Jc(n,{pending:!0,data:_,method:r.method,action:u},null,_)}}else typeof u=="function"&&(g.preventDefault(),_=new FormData(r,m),Jc(n,{pending:!0,data:_,method:r.method,action:u},u,_))},currentTarget:r}]})}}for(var Yu=0;Yu<pc.length;Yu++){var Iu=pc[Yu],Uv=Iu.toLowerCase(),Bv=Iu[0].toUpperCase()+Iu.slice(1);An(Uv,"on"+Bv)}An(qm,"onAnimationEnd"),An(Gm,"onAnimationIteration"),An(Pm,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(Q1,"onTransitionRun"),An(X1,"onTransitionStart"),An(F1,"onTransitionCancel"),An(Vm,"onTransitionEnd"),Ml("onMouseEnter",["mouseout","mouseover"]),Ml("onMouseLeave",["mouseout","mouseover"]),Ml("onPointerEnter",["pointerout","pointerover"]),Ml("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var di="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(" "),Hv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(di));function px(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var m=a.length-1;0<=m;m--){var g=a[m],_=g.instance,B=g.currentTarget;if(g=g.listener,_!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=B;try{u(r)}catch(V){ar(V)}r.currentTarget=null,u=_}else for(m=0;m<a.length;m++){if(g=a[m],_=g.instance,B=g.currentTarget,g=g.listener,_!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=B;try{u(r)}catch(V){ar(V)}r.currentTarget=null,u=_}}}}function Ve(e,t){var n=t[em];n===void 0&&(n=t[em]=new Set);var a=e+"__bubble";n.has(a)||(xx(t,e,2,!1),n.add(a))}function Ku(e,t,n){var a=0;t&&(a|=4),xx(n,e,a,t)}var to="_reactListening"+Math.random().toString(36).slice(2);function Qu(e){if(!e[to]){e[to]=!0,am.forEach(function(n){n!=="selectionchange"&&(Hv.has(n)||Ku(n,!1,e),Ku(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[to]||(t[to]=!0,Ku("selectionchange",!1,t))}}function xx(e,t,n,a){switch(sg(t)){case 2:var r=z2;break;case 8:r=M2;break;default:r=md}n=r.bind(null,t,n,e),r=void 0,!tc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Xu(e,t,n,a,r){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var g=a.stateNode.containerInfo;if(g===r)break;if(m===4)for(m=a.return;m!==null;){var _=m.tag;if((_===3||_===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;g!==null;){if(m=$a(g),m===null)return;if(_=m.tag,_===5||_===6||_===26||_===27){a=u=m;continue e}g=g.parentNode}}a=a.return}xm(function(){var B=u,V=Wo(n),te=[];e:{var R=Ym.get(e);if(R!==void 0){var G=er,he=e;switch(e){case"keypress":if($i(n)===0)break e;case"keydown":case"keyup":G=S1;break;case"focusin":he="focus",G=sc;break;case"focusout":he="blur",G=sc;break;case"beforeblur":case"afterblur":G=sc;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":G=ym;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=d1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=E1;break;case qm:case Gm:case Pm:G=h1;break;case Vm:G=T1;break;case"scroll":case"scrollend":G=c1;break;case"wheel":G=M1;break;case"copy":case"cut":case"paste":G=x1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Nm;break;case"submit":G=_1;break;case"toggle":case"beforetoggle":G=D1}var we=(t&4)!==0,Be=!we&&(e==="scroll"||e==="scrollend"),U=we?R!==null?R+"Capture":null:R;we=[];for(var T=B,H;T!==null;){var ee=T;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||U===null||(ee=Os(T,U),ee!=null&&we.push(fi(T,ee,H))),Be)break;T=T.return}0<we.length&&(R=new G(R,he,null,n,V),te.push({event:R,listeners:we}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",G&&n!==$o&&(he=n.relatedTarget||n.fromElement)&&($a(he)||he[Al]))break e;(R||G)&&(he=V.window===V?V:(G=V.ownerDocument)?G.defaultView||G.parentWindow:window,R?(G=n.relatedTarget||n.toElement,R=B,G=G?$a(G):null,G!==null&&(Be=f(G),we=G.tag,G!==Be||we!==5&&we!==27&&we!==6)&&(G=null)):(R=null,G=B),R!==G&&(we=ym,ee="onMouseLeave",U="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(we=Nm,ee="onPointerLeave",U="onPointerEnter",T="pointer"),Be=R==null?he:Ms(R),H=G==null?he:Ms(G),he=new we(ee,T+"leave",R,n,V),he.target=Be,he.relatedTarget=H,ee=null,$a(V)===B&&(we=new we(U,T+"enter",G,n,V),we.target=H,we.relatedTarget=Be,ee=we),Be=ee,we=R&&G?F(R,G,qv):null,R!==null&&gx(te,he,R,we,!1),G!==null&&Be!==null&&gx(te,Be,G,we,!0)))}e:{if(R=B?Ms(B):window,G=R.nodeName&&R.nodeName.toLowerCase(),G==="select"||G==="input"&&R.type==="file")var be=Am;else if(Cm(R))if(Tm)be=Y1;else{be=P1;var Ie=G1}else G=R.nodeName,!G||G.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?B&&Jo(B.elementType)&&(be=Am):be=V1;if(be&&(be=be(e,B))){Em(te,be,n,V);break e}Ie&&Ie(e,R,B)}switch(Ie=B?Ms(B):window,e){case"focusin":(Cm(Ie)||Ie.contentEditable==="true")&&(Bl=Ie,fc=B,Gs=null);break;case"focusout":Gs=fc=Bl=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Bm(te,n,V);break;case"selectionchange":if(K1)break;case"keydown":case"keyup":Bm(te,n,V)}var Ee;if(rc)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ul?km(e,n)&&(ze="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ze="onCompositionStart");ze&&(jm&&n.locale!=="ko"&&(Ul||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ul&&(Ee=gm()):(ba=V,nc="value"in ba?ba.value:ba.textContent,Ul=!0)),Ie=no(B,ze),0<Ie.length&&(ze=new vm(ze,e,null,n,V),te.push({event:ze,listeners:Ie}),Ee?ze.data=Ee:(Ee=_m(n),Ee!==null&&(ze.data=Ee)))),(Ee=L1?U1(e,n):B1(e,n))&&(ze=no(B,"onBeforeInput"),0<ze.length&&(Ie=new vm("onBeforeInput","beforeinput",null,n,V),te.push({event:Ie,listeners:ze}),Ie.data=Ee)),Lv(te,e,B,n,V)}px(te,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function no(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,u=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||u===null||(r=Os(e,n),r!=null&&a.unshift(fi(e,r,u)),r=Os(e,t),r!=null&&a.push(fi(e,r,u))),e.tag===3)return a;e=e.return}return[]}function qv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gx(e,t,n,a,r){for(var u=t._reactName,m=[];n!==null&&n!==a;){var g=n,_=g.alternate,B=g.stateNode;if(g=g.tag,_!==null&&_===a)break;g!==5&&g!==26&&g!==27||B===null||(_=B,r?(B=Os(n,u),B!=null&&m.unshift(fi(n,B,_))):r||(B=Os(n,u),B!=null&&m.push(fi(n,B,_)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Gv=/\r\n?/g,Pv=/\u0000|\uFFFD/g;function bx(e){return(typeof e=="string"?e:""+e).replace(Gv,`
49
+ `).replace(Pv,"")}function yx(e,t){return t=bx(t),bx(e)===t}function nt(e,t,n,a,r,u){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||Dl(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&Dl(e,""+a);else return;break;case"className":Fi(e,"class",a);break;case"tabIndex":Fi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Fi(e,n,a);break;case"style":hm(e,a,u);return;case"data":if(t!=="object"){Fi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Zi(a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&nt(e,t,"name",r.name,r,null),nt(e,t,"formEncType",r.formEncType,r,null),nt(e,t,"formMethod",r.formMethod,r,null),nt(e,t,"formTarget",r.formTarget,r,null)):(nt(e,t,"encType",r.encType,r,null),nt(e,t,"method",r.method,r,null),nt(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Zi(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Ln);return;case"onScroll":a!=null&&Ve("scroll",e);return;case"onScrollEnd":a!=null&&Ve("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Zi(a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Xi(e,"popover",a);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Xi(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=r1.get(n)||n,Xi(e,n,a);else return}Ze=!0}function Fu(e,t,n,a,r,u){switch(n){case"style":hm(e,a,u);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")Dl(e,a);else if(typeof a=="number"||typeof a=="bigint")Dl(e,""+a);else return;break;case"onScroll":a!=null&&Ve("scroll",e);return;case"onScrollEnd":a!=null&&Ve("scrollend",e);return;case"onClick":a!=null&&(e.onclick=Ln);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!lm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),u=n.slice(2,r?n.length-7:void 0),t=e[en]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(u,t,r),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(u,a,r);break e}Ze=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Xi(e,n,a)}return}Ze=!0}function Ht(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var a=!1,r=!1,u;for(u in n)if(n.hasOwnProperty(u)){var m=n[u];if(m!=null)switch(u){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,u,m,n,null)}}r&&nt(e,t,"srcSet",n.srcSet,n,null),a&&nt(e,t,"src",n.src,n,null);return;case"input":Ve("invalid",e);var g=u=m=r=null,_=null,B=null;for(a in n)if(n.hasOwnProperty(a)){var V=n[a];if(V!=null)switch(a){case"name":r=V;break;case"type":m=V;break;case"checked":_=V;break;case"defaultChecked":B=V;break;case"value":u=V;break;case"defaultValue":g=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:nt(e,t,a,V,n,null)}}um(e,u,g,_,B,m,r,!1);return;case"select":Ve("invalid",e),a=m=u=null;for(r in n)if(n.hasOwnProperty(r)&&(g=n[r],g!=null))switch(r){case"value":u=g;break;case"defaultValue":m=g;break;case"multiple":a=g;default:nt(e,t,r,g,n,null)}t=u,n=m,e.multiple=!!a,t!=null?Ol(e,!!a,t,!1):n!=null&&Ol(e,!!a,n,!0);return;case"textarea":Ve("invalid",e),u=r=a=null;for(m in n)if(n.hasOwnProperty(m)&&(g=n[m],g!=null))switch(m){case"value":a=g;break;case"defaultValue":r=g;break;case"children":u=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:nt(e,t,m,g,n,null)}fm(e,a,r,u);return;case"option":for(_ in n)if(n.hasOwnProperty(_)&&(a=n[_],a!=null))switch(_){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:nt(e,t,_,a,n,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(a=0;a<di.length;a++)Ve(di[a],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in n)if(n.hasOwnProperty(B)&&(a=n[B],a!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:nt(e,t,B,a,n,null)}return;default:if(Jo(t)){for(V in n)n.hasOwnProperty(V)&&(a=n[V],a!==void 0&&Fu(e,t,V,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&nt(e,t,g,a,n,null))}var Vv={};function Yv(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,u=null,m=null,g=null,_=null,B=null,V=null;for(G in n){var te=n[G];if(n.hasOwnProperty(G)&&te!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":_=te;default:a.hasOwnProperty(G)||nt(e,t,G,null,a,te)}}for(var R in a){var G=a[R];if(te=n[R],a.hasOwnProperty(R)&&(G!=null||te!=null))switch(R){case"type":G!==te&&(Ze=!0),u=G;break;case"name":G!==te&&(Ze=!0),r=G;break;case"checked":G!==te&&(Ze=!0),B=G;break;case"defaultChecked":G!==te&&(Ze=!0),V=G;break;case"value":G!==te&&(Ze=!0),m=G;break;case"defaultValue":G!==te&&(Ze=!0),g=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:G!==te&&nt(e,t,R,G,a,te)}}Fo(e,m,g,_,B,V,u,r);return;case"select":G=m=g=R=null;for(u in n)if(_=n[u],n.hasOwnProperty(u)&&_!=null)switch(u){case"value":break;case"multiple":G=_;default:a.hasOwnProperty(u)||nt(e,t,u,null,a,_)}for(r in a)if(u=a[r],_=n[r],a.hasOwnProperty(r)&&(u!=null||_!=null))switch(r){case"value":u!==_&&(Ze=!0),R=u;break;case"defaultValue":u!==_&&(Ze=!0),g=u;break;case"multiple":u!==_&&(Ze=!0),m=u;default:u!==_&&nt(e,t,r,u,a,_)}t=g,n=m,a=G,R!=null?Ol(e,!!n,R,!1):!!a!=!!n&&(t!=null?Ol(e,!!n,t,!0):Ol(e,!!n,n?[]:"",!1));return;case"textarea":G=R=null;for(g in n)if(r=n[g],n.hasOwnProperty(g)&&r!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:nt(e,t,g,null,a,r)}for(m in a)if(r=a[m],u=n[m],a.hasOwnProperty(m)&&(r!=null||u!=null))switch(m){case"value":r!==u&&(Ze=!0),R=r;break;case"defaultValue":r!==u&&(Ze=!0),G=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(o(91));break;default:r!==u&&nt(e,t,m,r,a,u)}dm(e,R,G);return;case"option":for(var he in n)if(R=n[he],n.hasOwnProperty(he)&&R!=null&&!a.hasOwnProperty(he))switch(he){case"selected":e.selected=!1;break;default:nt(e,t,he,null,a,R)}for(_ in a)if(R=a[_],G=n[_],a.hasOwnProperty(_)&&R!==G&&(R!=null||G!=null))switch(_){case"selected":R!==G&&(Ze=!0),e.selected=R&&typeof R!="function"&&typeof R!="symbol";break;default:nt(e,t,_,R,a,G)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in n)R=n[we],n.hasOwnProperty(we)&&R!=null&&!a.hasOwnProperty(we)&&nt(e,t,we,null,a,R);for(B in a)if(R=a[B],G=n[B],a.hasOwnProperty(B)&&R!==G&&(R!=null||G!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(137,t));break;default:nt(e,t,B,R,a,G)}return;default:if(Jo(t)){for(var Be in n)R=n[Be],n.hasOwnProperty(Be)&&R!==void 0&&!a.hasOwnProperty(Be)&&Fu(e,t,Be,void 0,a,R);for(V in a)R=a[V],G=n[V],!a.hasOwnProperty(V)||R===G||R===void 0&&G===void 0||Fu(e,t,V,R,a,G);return}}for(var U in n)R=n[U],n.hasOwnProperty(U)&&R!=null&&!a.hasOwnProperty(U)&&nt(e,t,U,null,a,R);for(te in a)R=a[te],G=n[te],!a.hasOwnProperty(te)||R===G||R==null&&G==null||nt(e,t,te,R,a,G)}function vx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],u=r.transferSize,m=r.initiatorType,g=r.duration;if(u&&g&&vx(m)){for(m=0,g=r.responseEnd,a+=1;a<n.length;a++){var _=n[a],B=_.startTime;if(B>g)break;var V=_.transferSize,te=_.initiatorType;V&&vx(te)&&(_=_.responseEnd,m+=V*(_<g?1:(g-B)/(_-B)))}if(--a,t+=8*(u+m)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zu=null,Ju=null;function mi(e){return e.nodeType===9?e:e.ownerDocument}function Nx(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jx(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Sx(e,t,n,a){return n=mi(n).createElement(e),n[Dt]=a,n[en]=t,Ht(n,e,t),At(n),n}function $u(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wu=null;function Kv(){var e=window.event;return e&&e.type==="popstate"?e===Wu?!1:(Wu=e,!0):(Wu=null,!1)}var ed=typeof setTimeout=="function"?setTimeout:void 0,Qv=typeof clearTimeout=="function"?clearTimeout:void 0,wx=typeof Promise=="function"?Promise:void 0,kx=typeof requestAnimationFrame=="function"?requestAnimationFrame:ed,Xv=typeof queueMicrotask=="function"?queueMicrotask:typeof wx<"u"?function(e){return wx.resolve(null).then(e).catch(Fv)}:ed;function Fv(e){setTimeout(function(){throw e})}function Ba(e){return e==="head"}function _x(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),gs(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")od(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,od(n);for(var u=n.firstChild;u;){var m=u.nextSibling,g=u.nodeName;u[zs]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=m}}else n==="body"&&od(e.ownerDocument.body);n=r}while(n);gs(t)}function Cx(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Ex(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var a=1;else for(var r=a=0;r<t.length;r++){var u=t[r];0<u.width&&0<u.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Ax(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Zv(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function td(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Zv(t,n,e)}function Jv(e){return e.documentElement.clientHeight}function $v(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Wv(e,t,n,a,r,u,m,g,_){var B=t.nodeType===9?t:t.ownerDocument;try{var V=B.startViewTransition({update:function(){var R=B.defaultView,G=R.navigation&&R.navigation.transition,he=B.fonts.status;a();var we=[];if(he==="loaded"&&(Jv(B),B.fonts.status==="loading"&&we.push(B.fonts.ready)),he=we.length,e!==null)for(var Be=e.suspenseyImages,U=0,T=0;T<Be.length;T++){var H=Be[T];if(!H.complete){var ee=H.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<R.innerHeight&&ee.left<R.innerWidth){if(U+=Zx(H),U>so){we.length=he;break}H=new Promise($v.bind(H)),we.push(H)}}}if(0<we.length)return R=Promise.race([Promise.all(we),new Promise(function(be){return setTimeout(be,500)})]).then(r,r),(G?Promise.allSettled([G.finished,R]):R).then(u,u);if(r(),G)return G.finished.then(u,u);u()},types:n});B.__reactViewTransition=V;var te=[];return V.ready.then(function(){for(var R=B.documentElement.getAnimations({subtree:!0}),G=0;G<R.length;G++){var he=R[G],we=he.effect,Be=we.pseudoElement;if(Be!=null&&Be.startsWith("::view-transition")){te.push(he),he=we.getKeyframes();for(var U=Be=void 0,T=!0,H=0;H<he.length;H++){var ee=he[H],be=ee.width;if(Be===void 0)Be=be;else if(Be!==be){T=!1;break}if(be=ee.height,U===void 0)U=be;else if(U!==be){T=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}T&&Be!==void 0&&U!==void 0&&(we.setKeyframes(he),T=getComputedStyle(we.target,we.pseudoElement),T.width!==Be||T.height!==U)&&(T=he[0],T.width=Be,T.height=U,T=he[he.length-1],T.width=Be,T.height=U,we.setKeyframes(he))}}m()},function(R){B.__reactViewTransition===V&&(B.__reactViewTransition=null);try{if(typeof R=="object"&&R!==null)switch(R.name){case"InvalidStateError":(R.message==="View transition was skipped because document visibility state is hidden."||R.message==="Skipping view transition because document visibility state has become hidden."||R.message==="Skipping view transition because viewport size changed."||R.message==="Transition was aborted because of invalid state")&&(R=null)}R!==null&&_(R)}finally{a(),r(),m()}}),V.finished.finally(function(){for(var R=0;R<te.length;R++)te[R].cancel();B.__reactViewTransition===V&&(B.__reactViewTransition=null),g()}),V}catch{return a(),r(),m(),null}}function yl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}yl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:M({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},yl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],r=0;r<n.length;r++){var u=n[r].effect;u!==null&&u.target===e&&u.pseudoElement===t&&a.push(n[r])}return a},yl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Tx(e){return{name:e,group:new yl("group",e),imagePair:new yl("image-pair",e),old:new yl("old",e),new:new yl("new",e)}}function gn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}gn.prototype.addEventListener=function(e,t,n){var a=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var u=this._eventListeners;if(Mx(u,e,t,n)===-1){var m=this,g=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(g=function(_){m.removeEventListener(e,t,n),typeof t=="function"?t.call(this,_):t.handleEvent(_)}),a!==null&&(r=m.removeEventListener.bind(m,e,t,n),a.addEventListener("abort",r,{once:!0}),r=a.removeEventListener.bind(a,"abort",r)),a=ds(n),u.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:g,cleanup:r}),b(this._fragmentFiber.child,!1,e2,e,g,a)}this._eventListeners=u}};function e2(e,t,n,a){return O(e).addEventListener(t,n,a),!1}gn.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=Mx(a,e,t,n),t!==-1)){var r=a[t];n=r.attachedListener;var u=r.cleanup;r=ds(r.optionsOrUseCapture),b(this._fragmentFiber.child,!1,t2,e,n,r),a.splice(t,1),u!==null&&u()}};function t2(e,t,n,a){return O(e).removeEventListener(t,n,a),!1}function ds(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zx(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Mx(e,t,n,a){if(e.length===0)return-1;a=zx(a);for(var r=0;r<e.length;r++){var u=e[r];if(u.type===t&&u.listener===n&&zx(u.optionsOrUseCapture)===a)return r}return-1}gn.prototype.dispatchEvent=function(e){var t=j(this._fragmentFiber);if(t===null)return!0;t=O(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var u=n[r];a.addEventListener(u.type,u.attachedListener,ds(u.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(r=0;r<n.length;r++)u=n[r],a.removeEventListener(u.type,u.attachedListener,ds(u.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},gn.prototype.focus=function(e){b(this._fragmentFiber.child,!0,Ox,e,void 0,void 0)};function Ox(e,t){return e.tag===6?!1:(e=O(e),m2(e,t))}gn.prototype.focusLast=function(e){var t=[];b(this._fragmentFiber.child,!0,nd,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Ox(t[n],e);n--);};function nd(e,t){return t.push(e),!1}gn.prototype.blur=function(){var e=j(this._fragmentFiber);e!==null&&(e=O(e),e=mi(e).activeElement,e!==null&&b(this._fragmentFiber.child,!1,n2,e,void 0,void 0))};function n2(e,t){return e.tag===6?!1:(e=O(e),e===t||e.contains(t)?(t.blur(),!0):!1)}gn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),b(this._fragmentFiber.child,!1,a2,e,void 0,void 0)};function a2(e,t){return e.tag===6||(e=O(e),t.observe(e)),!1}gn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),b(this._fragmentFiber.child,!1,l2,e,void 0,void 0);for(var n=t=0;n<Dn.length;n++){var a=Dn[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):Dn[t++]=a}Dn.length=t}};function l2(e,t){return e.tag===6||(e=O(e),t.unobserve(e)),!1}var Dn=[],ad=!1;function s2(e,t,n){Dn.push({fragmentInstance:e,observer:t,instance:n}),ad||(ad=!0,h2(function(){ad=!1;var a=Dn;Dn=[];for(var r=0;r<a.length;r++){var u=a[r];u.observer.unobserve(u.instance)}}))}gn.prototype.getClientRects=function(){var e=[];return b(this._fragmentFiber.child,!1,i2,e,void 0,void 0),e};function i2(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=O(e),t.push.apply(t,e.getClientRects());return!1}gn.prototype.getRootNode=function(e){var t=j(this._fragmentFiber);return t===null?this:O(t).getRootNode(e)},gn.prototype.compareDocumentPosition=function(e){var t=j(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];b(this._fragmentFiber.child,!1,nd,n,void 0,void 0);var a=O(t);if(n.length===0){if(n=a,z(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var r=a=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=C(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=O(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=O(n[0]),r=O(n[n.length-1]);var u=z(this._fragmentFiber)?t.parentElement:a;if(u==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=u.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,u=u.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),g=r.compareDocumentPosition(e),_=m&Node.DOCUMENT_POSITION_CONTAINED_BY||g&Node.DOCUMENT_POSITION_CONTAINED_BY;return g=a&&u&&m&Node.DOCUMENT_POSITION_FOLLOWING&&g&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||u&&r===e||_||g?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!u&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||r2(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function r2(e,t,n,a,r){var u=$a(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!u)e:{for(;u!==null;){if(u.tag===7&&(u===t||u.alternate===t)){n=!0;break e}u=u.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(u===null)return u=r.ownerDocument,r===u||r===u.documentElement||r===u.body;e:{for(u=t,t=j(t);u!==null;){if(!(u.tag!==5&&u.tag!==3&&u.tag!==27||u!==t&&u.alternate!==t)){u=!0;break e}u=u.return}u=!1}return u}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!u)&&!(t=u===n)&&(t=F(n,u,re),t===null?t=!1:(b(t,!0,W,u,n),u=A,A=null,t=u!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!u)&&!(t=u===a)&&(t=F(a,u,re),t===null?t=!1:(b(t,!0,Z,u,a),u=A,q=A=null,t=u!==null)),t):!1}function Dx(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}gn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];b(this._fragmentFiber.child,!1,nd,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=C(this._fragmentFiber);if(a=n?a[1]||a[0]||j(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=O(a),Dx(e,n);return}if(a=O(a),a.nodeType!==9){if(a.nodeType===11){n="host"in a?a.host:null,n!==null&&n.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=n?t.length-1:0;a!==(n?-1:t.length);){var r=t[a];r.tag===6?(r=O(r),Dx(r,n)):O(r).scrollIntoView(e),a+=n?-1:1}};function o2(e,t){return e=O(e),Rx(e,t),!1}function Rx(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Lx(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.addEventListener(r.type,r.attachedListener,ds(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){for(var m=0,g=0;g<Dn.length;g++){var _=Dn[g];(_.fragmentInstance!==t||_.observer!==u||_.instance!==e)&&(Dn[m++]=_)}Dn.length=m,u.observe(e)}),Rx(e,t))}function c2(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a];e.removeEventListener(r.type,r.attachedListener,ds(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(u){typeof u.rootMargin=="string"?s2(t,u,e):u.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function ld(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ld(n),Qi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function u2(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[zs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=_n(e.nextSibling),e===null)break}return null}function d2(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=_n(e.nextSibling),e===null))return null;return e}function Ux(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_n(e.nextSibling),e===null))return null;return e}function sd(e){return e.data==="$?"||e.data==="$~"}function id(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function f2(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function _n(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var rd=null;function Bx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return _n(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Hx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function m2(e,t){function n(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return a}function h2(e){kx(function(){kx(function(t){return e(t)})})}function qx(e,t,n){switch(t=mi(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Gx(e,t,n){for(var a in n){var r=n[a];n.hasOwnProperty(a)&&r!=null&&nt(e,t,a,null,Vv,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Ln&&(e.onclick=null),Qi(e)}function od(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qi(e)}var Cn=new Map,Px=new Set;function hi(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var fa=xe.d;xe.d={f:p2,r:x2,D:g2,C:b2,L:y2,m:v2,X:j2,S:N2,M:S2};function p2(){var e=fa.f(),t=Zr();return e||t}function x2(e){var t=Tl(e);t!==null&&t.tag===5&&t.type==="form"?Yh(t):fa.r(e)}var fs=typeof document>"u"?null:document;function Vx(e,t,n){var a=fs;if(a&&typeof t=="string"&&t){var r=yn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Px.has(r)||(Px.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),Ht(t,"link",e),At(t),a.head.appendChild(t)))}}function g2(e){fa.D(e),Vx("dns-prefetch",e,null)}function b2(e,t){fa.C(e,t),Vx("preconnect",e,t)}function y2(e,t,n){fa.L(e,t,n);var a=fs;if(a&&e&&t){var r='link[rel="preload"][as="'+yn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+yn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+yn(n.imageSizes)+'"]')):r+='[href="'+yn(e)+'"]';var u=r;switch(t){case"style":u=ms(e);break;case"script":u=hs(e)}if(!(Cn.has(u)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Cn.set(u,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(pi(u))||t==="script"&&a.querySelector(xi(u))))){var m=a.createElement("link");Ht(m,"link",e),t==="style"&&(m[Ki]=!0,m.onload=m.onerror=function(){nm(m)}),At(m),a.head.appendChild(m)}}}function v2(e,t){fa.m(e,t);var n=fs;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+yn(a)+'"][href="'+yn(e)+'"]',u=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=hs(e)}if(!Cn.has(u)&&(e=M({rel:"modulepreload",href:e},t),Cn.set(u,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(xi(u)))return}a=n.createElement("link"),Ht(a,"link",e),At(a),n.head.appendChild(a)}}}function N2(e,t,n){fa.S(e,t,n);var a=fs;if(a&&e){var r=zl(a).hoistableStyles,u=ms(e);t=t||"default";var m=r.get(u);if(!m){var g={loading:0,preload:null};if(m=a.querySelector(pi(u)))g.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Cn.get(u))&&cd(e,n);var _=m=a.createElement("link");At(_),Ht(_,"link",e),_._p=new Promise(function(B,V){_.onload=B,_.onerror=V}),_.addEventListener("load",function(){g.loading|=1}),_.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ao(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:g},r.set(u,m)}}}function j2(e,t){fa.X(e,t);var n=fs;if(n&&e){var a=zl(n).hoistableScripts,r=hs(e),u=a.get(r);u||(u=n.querySelector(xi(r)),u||(e=M({src:e,async:!0},t),(t=Cn.get(r))&&ud(e,t),u=n.createElement("script"),At(u),Ht(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function S2(e,t){fa.M(e,t);var n=fs;if(n&&e){var a=zl(n).hoistableScripts,r=hs(e),u=a.get(r);u||(u=n.querySelector(xi(r)),u||(e=M({src:e,async:!0,type:"module"},t),(t=Cn.get(r))&&ud(e,t),u=n.createElement("script"),At(u),Ht(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function Yx(e,t,n,a){var r=(r=pt.current)?hi(r):null;if(!r)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=ms(n.href),t=zl(r).hoistableStyles,a=t.get(n),a||(a={type:"style",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ms(n.href);var u=zl(r).hoistableStyles,m=u.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,m),(u=r.querySelector(pi(e)))?u._p||(m.instance=u,m.state.loading=5):(u=Cn.get(e),u||(u={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cn.set(e,u)),w2(r,e,u,m.state))),t&&a===null)throw Error(o(528,""));return m}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=hs(n),t=zl(r).hoistableScripts,a=t.get(n),a||(a={type:"script",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ms(e){return'href="'+yn(e)+'"'}function pi(e){return'link[rel="stylesheet"]['+e+"]"}function Ix(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function w2(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ki]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Ki]=!0,t.onload=t.onerror=nm.bind(null,t),Ht(t,"link",n),At(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function hs(e){return'[src="'+yn(e)+'"]'}function xi(e){return"script[async]"+e}function Kx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+yn(n.href)+'"]');if(a)return t.instance=a,At(a),a;var r=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),At(a),Ht(a,"style",r),ao(a,n.precedence,e),t.instance=a;case"stylesheet":r=ms(n.href);var u=e.querySelector(pi(r));if(u)return t.state.loading|=4,t.instance=u,At(u),u;a=Ix(n),(r=Cn.get(r))&&cd(a,r),u=(e.ownerDocument||e).createElement("link"),At(u);var m=u;return m._p=new Promise(function(g,_){m.onload=g,m.onerror=_}),Ht(u,"link",a),t.state.loading|=4,ao(u,n.precedence,e),t.instance=u;case"script":return u=hs(n.src),(r=e.querySelector(xi(u)))?(t.instance=r,At(r),r):(a=n,(r=Cn.get(u))&&(a=M({},n),ud(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),At(r),Ht(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ao(a,n.precedence,e));return t.instance}function ao(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,u=r,m=0;m<a.length;m++){var g=a[m];if(g.dataset.precedence===t)u=g;else if(u!==r)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lo=null;function Qx(e,t,n){if(lo===null){var a=new Map,r=lo=new Map;r.set(n,a)}else r=lo,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var u=n[r];if(!(u[zs]||u[Dt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var m=u.getAttribute(t)||"";m=e+m;var g=a.get(m);g?g.push(u):a.set(m,[u])}}return a}function dd(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function k2(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Xx(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Fx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zx(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Jx(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Zx(t),e.suspenseyImages.push(t)),e=E2.bind(e),t.decode().then(e,e))}function _2(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=ms(a.href),u=t.querySelector(pi(r));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=gi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,At(u);return}u=t.ownerDocument||t,a=Ix(a),(r=Cn.get(r))&&cd(a,r),u=u.createElement("link"),At(u);var m=u;m._p=new Promise(function(g,_){m.onload=g,m.onerror=_}),Ht(u,"link",a),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=gi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var so=0;function C2(e,t){return e.stylesheets&&e.count===0&&ro(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&ro(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&so===0&&(so=62500*Iv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ro(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>so?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function $x(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function gi(){this.count--,$x(this)}function E2(){this.imgCount--,$x(this)}var io=null;function ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,io=new Map,t.forEach(A2,e),io=null,gi.call(e))}function A2(e,t){if(!(t.state.loading&4)){var n=io.get(e);if(n)var a=n.get(null);else{n=new Map,io.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<r.length;u++){var m=r[u];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}r=t.instance,m=r.getAttribute("data-precedence"),u=n.get(m)||a,u===a&&n.set(null,r),n.set(m,r),this.count++,a=gi.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),u?u.parentNode.insertBefore(r,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var ps={$$typeof:Y,Provider:null,Consumer:null,_currentValue:it,_currentValue2:it,_threadCount:0};function T2(e,t,n,a,r,u,m,g,_){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Io(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Io(0),this.hiddenUpdates=Io(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=u,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.transitionTypes=null,this.incompleteTransitions=new Map}function Wx(e,t,n,a,r,u,m,g,_,B,V,te){return e=new T2(e,t,n,m,_,B,V,te,g),t=1,u===!0&&(t|=24),u=tn(3,null,null,t),e.current=u,u.stateNode=e,t=_c(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},Tc(u),e}function eg(e){return e?(e=Gl,e):Gl}function tg(e,t,n,a,r,u){r=eg(r),a.context===null?a.context=r:a.pendingContext=r,a=_a(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=Ca(e,a,t),n!==null&&(sn(n,e,t),Xs(n,e,t))}function ng(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fd(e,t){ng(e,t),(e=e.alternate)&&ng(e,t)}function ag(e){if(e.tag===13||e.tag===31){var t=nl(e,67108864);t!==null&&sn(t,e,67108864),fd(e,67108864)}}function lg(e){if(e.tag===13||e.tag===31){var t=xn();t=Ko(t);var n=nl(e,t);n!==null&&sn(n,e,t),fd(e,t)}}var xs=!0;function z2(e,t,n,a){var r=fe.T;fe.T=null;var u=xe.p;try{xe.p=2,md(e,t,n,a)}finally{xe.p=u,fe.T=r}}function M2(e,t,n,a){var r=fe.T;fe.T=null;var u=xe.p;try{xe.p=8,md(e,t,n,a)}finally{xe.p=u,fe.T=r}}function md(e,t,n,a){if(xs){var r=hd(a);if(r===null)Xu(e,t,a,oo,n),ig(e,a);else if(D2(r,e,t,n,a))a.stopPropagation();else if(ig(e,a),t&4&&-1<O2.indexOf(e)){for(;r!==null;){var u=Tl(r);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var m=Ja(u.pendingLanes);if(m!==0){var g=u;for(g.pendingLanes|=2,g.entangledLanes|=2;m;){var _=1<<31-cn(m);g.entanglements[1]|=_,m&=~_}Kn(u),(Je&6)===0&&(Qr=Fe()+500,ui(0))}}break;case 31:case 13:g=nl(u,2),g!==null&&sn(g,u,2),Zr(),fd(u,2)}if(u=hd(a),u===null&&Xu(e,t,a,oo,n),u===r)break;r=u}r!==null&&a.stopPropagation()}else Xu(e,t,a,null,n)}}function hd(e){return e=Wo(e),pd(e)}var oo=null;function pd(e){if(oo=null,e=$a(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=x(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 oo=e,null}function sg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(rn()){case Yf:return 2;case If:return 8;case Gi:case Ky:return 32;case Kf:return 268435456;default:return 32}default:return 32}}var xd=!1,Ha=null,qa=null,Ga=null,bi=new Map,yi=new Map,Pa=[],O2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ig(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":bi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yi.delete(t.pointerId)}}function vi(e,t,n,a,r,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[r]},t!==null&&(t=Tl(t),t!==null&&ag(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function D2(e,t,n,a,r){switch(t){case"focusin":return Ha=vi(Ha,e,t,n,a,r),!0;case"dragenter":return qa=vi(qa,e,t,n,a,r),!0;case"mouseover":return Ga=vi(Ga,e,t,n,a,r),!0;case"pointerover":var u=r.pointerId;return bi.set(u,vi(bi.get(u)||null,e,t,n,a,r)),!0;case"gotpointercapture":return u=r.pointerId,yi.set(u,vi(yi.get(u)||null,e,t,n,a,r)),!0}return!1}function rg(e){var t=$a(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Wf(e.priority,function(){lg(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,Wf(e.priority,function(){lg(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 co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hd(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);$o=a,n.target.dispatchEvent(a),$o=null}else return t=Tl(n),t!==null&&ag(t),e.blockedOn=n,!1;t.shift()}return!0}function og(e,t,n){co(e)&&n.delete(t)}function R2(){xd=!1,Ha!==null&&co(Ha)&&(Ha=null),qa!==null&&co(qa)&&(qa=null),Ga!==null&&co(Ga)&&(Ga=null),bi.forEach(og),yi.forEach(og)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,xd||(xd=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,R2)))}var fo=null;function cg(e){fo!==e&&(fo=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){fo===e&&(fo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(pd(a||n)===null)continue;break}var u=Tl(n);u!==null&&(e.splice(t,3),t-=3,Jc(u,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function gs(e){function t(_){return uo(_,e)}Ha!==null&&uo(Ha,e),qa!==null&&uo(qa,e),Ga!==null&&uo(Ga,e),bi.forEach(t),yi.forEach(t);for(var n=0;n<Pa.length;n++){var a=Pa[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Pa.length&&(n=Pa[0],n.blockedOn===null);)rg(n),n.blockedOn===null&&Pa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],u=n[a+1],m=r[en]||null;if(typeof u=="function")m||cg(n);else if(m){var g=null;if(u&&u.hasAttribute("formAction")){if(r=u,m=u[en]||null)g=m.formAction;else if(pd(r)!==null)continue}else g=m.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),cg(n)}}}function ug(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function gd(e){this._internalRoot=e}mo.prototype.render=gd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,a=xn();tg(n,a,e,t,null,null)},mo.prototype.unmount=gd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tg(e.current,2,null,e,null,null),Zr(),t[Al]=null}};function mo(e){this._internalRoot=e}mo.prototype.unstable_scheduleHydration=function(e){if(e){var t=$f();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pa.length&&t!==0&&t<Pa[n].priority;n++);Pa.splice(n,0,e),n===0&&rg(e)}};var dg=i.version;if(dg!=="19.3.0")throw Error(o(527,dg,"19.3.0"));xe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var L2={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ho.isDisabled&&ho.supportsFiber)try{Es=ho.inject(L2),on=ho}catch{}}return ji.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,a="",r=ep,u=tp,m=np;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Wx(e,1,!1,null,null,n,a,null,r,u,m,ug),e[Al]=t.current,Qu(e),new gd(t)},ji.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var a=!1,r="",u=ep,m=tp,g=np,_=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(_=n.formState)),t=Wx(e,1,!0,t,n??null,a,r,_,u,m,g,ug),t.context=eg(null),n=t.current,a=xn(),a=Ko(a),r=_a(a),r.callback=null,Ca(n,r,a),n=a,t.current.lanes=n,Ts(t,n),Kn(t),e[Al]=t.current,Qu(e),new mo(t)},ji.version="19.3.0",ji}var Ng;function K2(){if(Ng)return vd.exports;Ng=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),vd.exports=I2(),vd.exports}var Q2=K2();const X2=kf(Q2);class It extends Error{constructor(i,c,o){super(c),this.status=i,this.data=o,this.name="ApiError"}get code(){var i;return(i=this.data)==null?void 0:i.code}}async function vl(l,i={}){const c=l.startsWith("/dashboard/api")?l:`/dashboard/api${l.startsWith("/")?l:`/${l}`}`,o={...i.body instanceof Blob?{}:{"Content-Type":"application/json"},...i.headers},d=await fetch(c,{...i,headers:o});if(d.status===401)throw window.location.href="/login",new It(401,"Session expired, redirecting to login...");const f=await d.json().catch(()=>null);if(!d.ok)throw new It(d.status,(f==null?void 0:f.error)||(f==null?void 0:f.message)||`HTTP ${d.status}: Request failed`,f);return f}function F2(l){if(!l)return null;const i=/filename\*=UTF-8''([^;]+)/i.exec(l);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}const c=/filename="([^"]*)"/.exec(l);return(c==null?void 0:c[1])||null}async function jg(l,i={}){const c=await fetch(`/dashboard/api${l}`,i);if(c.status===401)throw window.location.href="/login",new It(401,"Session expired");if(!c.ok){const o=await c.json().catch(()=>null);throw new It(c.status,(o==null?void 0:o.error)||"Sticker operation failed",o)}return{blob:await c.blob(),fileName:F2(c.headers.get("Content-Disposition")),animated:c.headers.get("X-Levix-Animated")==="1"}}const Q={get:l=>vl(l,{method:"GET"}),post:(l,i)=>vl(l,{method:"POST",body:i?JSON.stringify(i):void 0}),patch:(l,i)=>vl(l,{method:"PATCH",body:i?JSON.stringify(i):void 0}),put:(l,i)=>vl(l,{method:"PUT",body:i?JSON.stringify(i):void 0}),delete:l=>vl(l,{method:"DELETE"}),getStats:()=>Q.get("/stats"),getSession:()=>Q.get("/bot/session"),startSession:l=>Q.post("/bot/session/start",l),reconnectSession:()=>Q.post("/bot/session/reconnect"),stopSession:()=>Q.post("/bot/session/stop"),unlinkSession:()=>Q.post("/bot/logout"),restartBot:()=>Q.post("/bot/restart"),getSettings:()=>Q.get("/settings"),updateSetting:(l,i)=>Q.patch("/settings",{key:l,value:i}),updatePrefix:l=>Q.patch("/settings",{key:"prefix",value:l}),exportSettings:()=>Q.get("/settings/export"),importSettings:l=>Q.post("/settings/import",l),getCommands:()=>Q.get("/commands"),updateCommand:(l,i)=>Q.patch(`/commands/${encodeURIComponent(l)}`,i),postMultipart:(l,i,c)=>new Promise((o,d)=>{const f=new FormData;for(const[x,p]of Object.entries(i))p!=null&&p!==""&&f.set(x,p);f.set("file",c);const h=new XMLHttpRequest;h.open("POST",`/dashboard/api${l}`),h.responseType="json",h.onload=()=>{const x=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new It(401,"Session expired"));return}h.status>=200&&h.status<300?o(x):d(new It(h.status,(x==null?void 0:x.error)||(x==null?void 0:x.message)||`HTTP ${h.status}: Request failed`,x))},h.onerror=()=>d(new It(0,"Network error")),h.send(f)}),getSchedules:()=>Q.get("/schedules"),createSchedule:l=>Q.post("/schedules",l),deleteSchedule:l=>Q.delete(`/schedules/${encodeURIComponent(l)}`),retrySchedule:l=>Q.post(`/schedules/${encodeURIComponent(l)}/retry`),getGroups:()=>Q.get("/groups"),updateGroup:(l,i)=>Q.patch(`/groups/${encodeURIComponent(l)}`,i),getPersona:()=>Q.get("/ai/persona"),updatePersona:l=>Q.put("/ai/persona",{body:l}),getMemoryFiles:()=>Q.get("/ai/memory"),getMemoryFile:l=>Q.get(`/ai/memory/${encodeURIComponent(l)}`),updateMemoryFile:(l,i)=>Q.put(`/ai/memory/${encodeURIComponent(l)}`,{content:i}),deleteMemoryFile:l=>Q.delete(`/ai/memory/${encodeURIComponent(l)}`),getAiConversations:()=>Q.get("/ai/conversations"),getAiConversation:l=>Q.get(`/ai/conversations/${encodeURIComponent(l)}`),getRecipients:()=>Q.get("/recipients"),fetchAiModels:l=>Q.post("/ai/models",l||{}),changePassword:(l,i)=>Q.post("/security/password",{current:l,next:i}),getFeedbackMeta:()=>Q.get("/feedback/meta"),sendFeedback:l=>Q.post("/feedback",l),sendFeedbackMultipart:(l,i,c)=>new Promise((o,d)=>{const f=new FormData;f.set("message",l.message),f.set("topic",l.topic),l.rating&&f.set("rating",String(l.rating)),l.contact&&f.set("contact",l.contact),f.set("file",i,i.name);const h=new XMLHttpRequest;h.open("POST","/dashboard/api/feedback"),h.responseType="json",h.upload.onprogress=x=>{x.lengthComputable&&c&&c(x.loaded/x.total)},h.onload=()=>{const x=h.response&&typeof h.response=="object"?h.response:null;if(h.status===401){window.location.href="/login",d(new It(401,"Session expired"));return}h.status>=200&&h.status<300?o(x??{success:!0}):d(new It(h.status,(x==null?void 0:x.error)||(x==null?void 0:x.message)||`HTTP ${h.status}: Request failed`,x))},h.onerror=()=>d(new It(0,"Network error")),h.send(f)}),getLogs:()=>Q.get("/logs"),getStickerCapabilities:()=>Q.get("/stickers/capabilities"),getStickers:l=>{const i=new URLSearchParams;return l.q&&i.set("q",l.q),l.sort&&i.set("sort",l.sort),l.filter&&i.set("filter",l.filter),l.pack&&i.set("pack",l.pack),l.offset!==void 0&&i.set("offset",l.offset.toString()),l.limit!==void 0&&i.set("limit",l.limit.toString()),Q.get(`/stickers?${i.toString()}`)},uploadStickerSource:(l,i)=>{const c={};return i&&(c["X-Filename"]=encodeURIComponent(i)),vl("/stickers/uploads",{method:"POST",body:l,headers:c})},uploadExistingStickerSource:l=>vl(`/stickers/${encodeURIComponent(l)}/uploads`,{method:"POST"}),createStickerJob:l=>Q.post("/stickers/jobs",l),getStickerJob:l=>Q.get(`/stickers/jobs/${encodeURIComponent(l)}`),exportSticker:(l,i)=>jg(`/stickers/${encodeURIComponent(l)}/export?format=${i}`),exportStickers:(l,i)=>jg("/stickers/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:l,format:i})}),updateSticker:(l,i)=>Q.patch(`/stickers/${encodeURIComponent(l)}`,i),deleteSticker:(l,i)=>Q.delete(`/stickers/${encodeURIComponent(l)}${i?"?confirm=1":""}`),bulkStickers:l=>Q.post("/stickers/bulk",l),sendStickers:l=>Q.post("/stickers/send",l),getPacks:()=>Q.get("/sticker-packs"),createPack:l=>Q.post("/sticker-packs",{name:l}),getPack:l=>Q.get(`/sticker-packs/${encodeURIComponent(l)}`),updatePack:(l,i)=>Q.patch(`/sticker-packs/${encodeURIComponent(l)}`,{name:i}),deletePack:(l,i)=>Q.delete(`/sticker-packs/${encodeURIComponent(l)}${i?"?deleteStickers=1":""}`),reorderPack:(l,i)=>Q.put(`/sticker-packs/${encodeURIComponent(l)}/order`,{ids:i}),mergePack:(l,i)=>Q.post(`/sticker-packs/${encodeURIComponent(l)}/merge`,{intoPackId:i})};/**
50
+ * @license lucide-react v1.46.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Z2=l=>l==null?void 0:l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
55
+ * @license lucide-react v1.46.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */function J2(l,i,c=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Z2(l),size:24,node:i,...c.length>0?{aliases:c}:{}}}/**
60
+ * @license lucide-react v1.46.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const $2=l=>{let i="",c=!1;for(const o of l){if(o==="-"||o==="_"||o<=" "){c=i.length>0;continue}i.length===0?i+=o.toLowerCase():i+=c?o.toUpperCase():o,c=!1}return i};/**
65
+ * @license lucide-react v1.46.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const W2=l=>{const i=$2(l);return i.charAt(0).toUpperCase()+i.slice(1)};/**
70
+ * @license lucide-react v1.46.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const df=(...l)=>l.filter((i,c,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===c).join(" ").trim();/**
75
+ * @license lucide-react v1.46.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Nl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
80
+ * @license lucide-react v1.46.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */function wd(l){return l!=null}function eN(l,i={}){var j,z;const c=i.attributeNames??{},o=C=>c[C]??C,d=l.size??l.width??Nl.width,f=l.size??l.height??Nl.height,h=((j=l.aliases)==null?void 0:j.filter(C=>typeof C=="string"&&C.trim()!=="").map(C=>`lucide-${C}`))??[],x=[...l.name?[`lucide-${l.name}`]:[],...h],p=((z=i.className)==null?void 0:z.split(" ").filter(Boolean))??[],v=i.includeDefaultClasses===!1?df(...p):df("lucide",...x,...p),y=i.absoluteStrokeWidth?Number(i.strokeWidth??Nl["stroke-width"])*Number(l.size??l.width??Nl.width)/Number(i.size??i.width??Nl.width):i.strokeWidth??Nl["stroke-width"];return["svg",{...Object.entries(Nl).reduce((C,[w,O])=>(C[o(w)]=O,C),{}),..."color"in i&&i.color&&{[o("stroke")]:i.color},..."size"in i&&wd(i.size)&&{[o("width")]:i.size,[o("height")]:i.size},..."width"in i&&wd(i.width)&&{[o("width")]:i.width},..."height"in i&&wd(i.height)&&{[o("height")]:i.height},[o("stroke-width")]:y,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${d} ${f}`,...i.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},l.node.map(C=>{const[w,O,A]=C,q=i.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...O}:O;return A?[w,q,A]:[w,q]})]}/**
85
+ * @license lucide-react v1.46.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */function tN(l,i={}){return eN(l,{...i,attributeNames:{...i.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
90
+ * @license lucide-react v1.46.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const nN=l=>{for(const i in l)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},aN=S.createContext({}),lN=()=>S.useContext(aN),sN=S.forwardRef(({color:l,size:i,width:c,height:o,strokeWidth:d,absoluteStrokeWidth:f,nonScalingStroke:h,className:x="",children:p,iconNode:v=[],icon:y={node:v,aliases:[],size:24},...b},j)=>{const{size:z=24,strokeWidth:C=2,absoluteStrokeWidth:w=!1,nonScalingStroke:O=!1,color:A="currentColor",className:q=""}=lN()??{},W=!!p||nN(b),[Z,re,F=[]]=tN(y,{color:l??A,width:c??i??z,height:o??i??z,strokeWidth:d??C,absoluteStrokeWidth:f??w,nonScalingStroke:h??O,className:df(q,x),hasA11yProp:W,attributes:b});return S.createElement(Z,{ref:j,...re},[...F.map(([M,k])=>S.createElement(M,k)),...Array.isArray(p)?p:[p]])});/**
95
+ * @license lucide-react v1.46.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */function pe(l,i=[],c=[]){const o=typeof l=="string"?J2(l,i,c):l,d=S.forwardRef(({className:f,...h},x)=>S.createElement(sN,{ref:x,icon:o,className:f,...h}));return o.name&&(d.displayName=W2(o.name)),d}/**
100
+ * @license lucide-react v1.46.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Nb={name:"activity",size:24,node:[["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"}]]};Nb.node;const iN=pe(Nb);/**
105
+ * @license lucide-react v1.46.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const jb={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};jb.node;const rN=pe(jb);/**
110
+ * @license lucide-react v1.46.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Sb={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Sb.node;const oN=pe(Sb);/**
115
+ * @license lucide-react v1.46.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const wb={name:"book-user",size:24,node:[["path",{d:"M15 13a3 3 0 1 0-6 0",key:"10j68g"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}]]};wb.node;const cN=pe(wb);/**
120
+ * @license lucide-react v1.46.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const kb={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};kb.node;const Cf=pe(kb);/**
125
+ * @license lucide-react v1.46.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const _b={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};_b.node;const uN=pe(_b);/**
130
+ * @license lucide-react v1.46.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const Cb={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};Cb.node;const ff=pe(Cb);/**
135
+ * @license lucide-react v1.46.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Eb={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Eb.node;const Di=pe(Eb);/**
140
+ * @license lucide-react v1.46.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Ab={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Ab.node;const dN=pe(Ab);/**
145
+ * @license lucide-react v1.46.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Tb={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};Tb.node;const fN=pe(Tb);/**
150
+ * @license lucide-react v1.46.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const zb={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};zb.node;const mN=pe(zb);/**
155
+ * @license lucide-react v1.46.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Mb={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Mb.node;const hN=pe(Mb);/**
160
+ * @license lucide-react v1.46.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const Ob={name:"circle-alert",size:24,node:[["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"}]],aliases:["alert-circle"]};Ob.node;const Ei=pe(Ob);/**
165
+ * @license lucide-react v1.46.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const Db={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Db.node;const js=pe(Db);/**
170
+ * @license lucide-react v1.46.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const Rb={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};Rb.node;const pN=pe(Rb);/**
175
+ * @license lucide-react v1.46.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Lb={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};Lb.node;const xN=pe(Lb);/**
180
+ * @license lucide-react v1.46.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const Ub={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Ub.node;const gN=pe(Ub);/**
185
+ * @license lucide-react v1.46.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const Bb={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};Bb.node;const bN=pe(Bb);/**
190
+ * @license lucide-react v1.46.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Hb={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};Hb.node;const Ef=pe(Hb);/**
195
+ * @license lucide-react v1.46.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const qb={name:"ellipsis-vertical",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aliases:["more-vertical"]};qb.node;const Af=pe(qb);/**
200
+ * @license lucide-react v1.46.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Gb={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Gb.node;const yN=pe(Gb);/**
205
+ * @license lucide-react v1.46.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const Pb={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};Pb.node;const bs=pe(Pb);/**
210
+ * @license lucide-react v1.46.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const Vb={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Vb.node;const pa=pe(Vb);/**
215
+ * @license lucide-react v1.46.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const Yb={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Yb.node;const So=pe(Yb);/**
220
+ * @license lucide-react v1.46.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const Ib={name:"folder",size:24,node:[["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"}]]};Ib.node;const vN=pe(Ib);/**
225
+ * @license lucide-react v1.46.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Kb={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};Kb.node;const NN=pe(Kb);/**
230
+ * @license lucide-react v1.46.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const Qb={name:"globe",size:24,node:[["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"}]]};Qb.node;const Ri=pe(Qb);/**
235
+ * @license lucide-react v1.46.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const Xb={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};Xb.node;const Sg=pe(Xb);/**
240
+ * @license lucide-react v1.46.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const Fb={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};Fb.node;const wg=pe(Fb);/**
245
+ * @license lucide-react v1.46.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const Zb={name:"heart-handshake",size:24,node:[["path",{d:"M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762",key:"17lmqv"}]]};Zb.node;const jN=pe(Zb);/**
250
+ * @license lucide-react v1.46.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const Jb={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};Jb.node;const SN=pe(Jb);/**
255
+ * @license lucide-react v1.46.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const $b={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};$b.node;const mf=pe($b);/**
260
+ * @license lucide-react v1.46.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const Wb={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Wb.node;const wN=pe(Wb);/**
265
+ * @license lucide-react v1.46.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const e0={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};e0.node;const kN=pe(e0);/**
270
+ * @license lucide-react v1.46.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const t0={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};t0.node;const _N=pe(t0);/**
275
+ * @license lucide-react v1.46.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const n0={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};n0.node;const CN=pe(n0);/**
280
+ * @license lucide-react v1.46.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const a0={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};a0.node;const EN=pe(a0);/**
285
+ * @license lucide-react v1.46.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const l0={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};l0.node;const AN=pe(l0);/**
290
+ * @license lucide-react v1.46.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const s0={name:"message-square-heart",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7.5 9.5c0 .687.265 1.383.697 1.844l3.009 3.264a1.14 1.14 0 0 0 .407.314 1 1 0 0 0 .783-.004 1.14 1.14 0 0 0 .398-.31l3.008-3.264A2.77 2.77 0 0 0 16.5 9.5 2.5 2.5 0 0 0 12 8a2.5 2.5 0 0 0-4.5 1.5",key:"1faxuh"}]]};s0.node;const TN=pe(s0);/**
295
+ * @license lucide-react v1.46.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const i0={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};i0.node;const hf=pe(i0);/**
300
+ * @license lucide-react v1.46.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const r0={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};r0.node;const kd=pe(r0);/**
305
+ * @license lucide-react v1.46.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const o0={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};o0.node;const zN=pe(o0);/**
310
+ * @license lucide-react v1.46.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const c0={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};c0.node;const kg=pe(c0);/**
315
+ * @license lucide-react v1.46.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const u0={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};u0.node;const vs=pe(u0);/**
320
+ * @license lucide-react v1.46.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const d0={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};d0.node;const MN=pe(d0);/**
325
+ * @license lucide-react v1.46.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const f0={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};f0.node;const ON=pe(f0);/**
330
+ * @license lucide-react v1.46.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const m0={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};m0.node;const DN=pe(m0);/**
335
+ * @license lucide-react v1.46.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const h0={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};h0.node;const RN=pe(h0);/**
340
+ * @license lucide-react v1.46.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const p0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};p0.node;const Uo=pe(p0);/**
345
+ * @license lucide-react v1.46.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const x0={name:"qr-code",size:24,node:[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]};x0.node;const _d=pe(x0);/**
350
+ * @license lucide-react v1.46.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const g0={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};g0.node;const Li=pe(g0);/**
355
+ * @license lucide-react v1.46.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const b0={name:"refresh-cw",size:24,node:[["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"}]]};b0.node;const Ui=pe(b0);/**
360
+ * @license lucide-react v1.46.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const y0={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};y0.node;const LN=pe(y0);/**
365
+ * @license lucide-react v1.46.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const v0={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};v0.node;const po=pe(v0);/**
370
+ * @license lucide-react v1.46.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const N0={name:"save",size:24,node:[["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"}]]};N0.node;const Oo=pe(N0);/**
375
+ * @license lucide-react v1.46.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const j0={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};j0.node;const Tf=pe(j0);/**
380
+ * @license lucide-react v1.46.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const S0={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};S0.node;const Bi=pe(S0);/**
385
+ * @license lucide-react v1.46.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const w0={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};w0.node;const UN=pe(w0);/**
390
+ * @license lucide-react v1.46.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const k0={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};k0.node;const Bo=pe(k0);/**
395
+ * @license lucide-react v1.46.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const _0={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};_0.node;const BN=pe(_0);/**
400
+ * @license lucide-react v1.46.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const C0={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};C0.node;const zf=pe(C0);/**
405
+ * @license lucide-react v1.46.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const E0={name:"sliders-vertical",size:24,node:[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],aliases:["sliders"]};E0.node;const A0=pe(E0);/**
410
+ * @license lucide-react v1.46.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */const T0={name:"smartphone",size:24,node:[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]};T0.node;const Ai=pe(T0);/**
415
+ * @license lucide-react v1.46.0 - ISC
416
+ *
417
+ * This source code is licensed under the ISC license.
418
+ * See the LICENSE file in the root directory of this source tree.
419
+ */const z0={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};z0.node;const pf=pe(z0);/**
420
+ * @license lucide-react v1.46.0 - ISC
421
+ *
422
+ * This source code is licensed under the ISC license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */const M0={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};M0.node;const xf=pe(M0);/**
425
+ * @license lucide-react v1.46.0 - ISC
426
+ *
427
+ * This source code is licensed under the ISC license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */const O0={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};O0.node;const Mf=pe(O0);/**
430
+ * @license lucide-react v1.46.0 - ISC
431
+ *
432
+ * This source code is licensed under the ISC license.
433
+ * See the LICENSE file in the root directory of this source tree.
434
+ */const D0={name:"sticker",size:24,node:[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]]};D0.node;const Of=pe(D0);/**
435
+ * @license lucide-react v1.46.0 - ISC
436
+ *
437
+ * This source code is licensed under the ISC license.
438
+ * See the LICENSE file in the root directory of this source tree.
439
+ */const R0={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};R0.node;const HN=pe(R0);/**
440
+ * @license lucide-react v1.46.0 - ISC
441
+ *
442
+ * This source code is licensed under the ISC license.
443
+ * See the LICENSE file in the root directory of this source tree.
444
+ */const L0={name:"tag",size:24,node:[["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"}]]};L0.node;const qN=pe(L0);/**
445
+ * @license lucide-react v1.46.0 - ISC
446
+ *
447
+ * This source code is licensed under the ISC license.
448
+ * See the LICENSE file in the root directory of this source tree.
449
+ */const U0={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};U0.node;const Ss=pe(U0);/**
450
+ * @license lucide-react v1.46.0 - ISC
451
+ *
452
+ * This source code is licensed under the ISC license.
453
+ * See the LICENSE file in the root directory of this source tree.
454
+ */const B0={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};B0.node;const ws=pe(B0);/**
455
+ * @license lucide-react v1.46.0 - ISC
456
+ *
457
+ * This source code is licensed under the ISC license.
458
+ * See the LICENSE file in the root directory of this source tree.
459
+ */const H0={name:"triangle-alert",size:24,node:[["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"}]],aliases:["alert-triangle"]};H0.node;const Ti=pe(H0);/**
460
+ * @license lucide-react v1.46.0 - ISC
461
+ *
462
+ * This source code is licensed under the ISC license.
463
+ * See the LICENSE file in the root directory of this source tree.
464
+ */const q0={name:"unlink",size:24,node:[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]};q0.node;const Cd=pe(q0);/**
465
+ * @license lucide-react v1.46.0 - ISC
466
+ *
467
+ * This source code is licensed under the ISC license.
468
+ * See the LICENSE file in the root directory of this source tree.
469
+ */const G0={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};G0.node;const P0=pe(G0);/**
470
+ * @license lucide-react v1.46.0 - ISC
471
+ *
472
+ * This source code is licensed under the ISC license.
473
+ * See the LICENSE file in the root directory of this source tree.
474
+ */const V0={name:"user",size:24,node:[["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"}]]};V0.node;const Ed=pe(V0);/**
475
+ * @license lucide-react v1.46.0 - ISC
476
+ *
477
+ * This source code is licensed under the ISC license.
478
+ * See the LICENSE file in the root directory of this source tree.
479
+ */const Y0={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Y0.node;const Ns=pe(Y0);/**
480
+ * @license lucide-react v1.46.0 - ISC
481
+ *
482
+ * This source code is licensed under the ISC license.
483
+ * See the LICENSE file in the root directory of this source tree.
484
+ */const I0={name:"volume-2",size:24,node:[["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"}]]};I0.node;const GN=pe(I0);/**
485
+ * @license lucide-react v1.46.0 - ISC
486
+ *
487
+ * This source code is licensed under the ISC license.
488
+ * See the LICENSE file in the root directory of this source tree.
489
+ */const K0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};K0.node;const kl=pe(K0);/**
490
+ * @license lucide-react v1.46.0 - ISC
491
+ *
492
+ * This source code is licensed under the ISC license.
493
+ * See the LICENSE file in the root directory of this source tree.
494
+ */const Q0={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};Q0.node;const PN=pe(Q0),Ad={ar:{overview:"نظرة عامة",stickers:"استوديو الملصقات",connection:"حالة الاتصال",control:"التحكم والإدارة",commands:"كتالوج الأوامر",ai:"الذكاء الاصطناعي",groups:"المجموعات",roles:"الأدوار والمشرفين",schedules:"الرسائل المجدولة",notes:"الملاحظات والقوائم",settings:"الإعدادات العامة",logs:"السجلات المباشرة",connected:"متصل بالواتساب",disconnected:"غير متصل",starting:"جارٍ إنشاء الاتصال...",waiting_for_qr:"بانتظار مسح رمز الـ QR",linking:"جارٍ ربط الجلسة...",reconnecting:"جارٍ إعادة الاتصال...",retry_exhausted:"استُنفذت محاولات الاتصال",logged_out:"تم تسجيل الخروج من الهاتف",idle:"الجلسة خاملة",paused:"متوقف مؤقتاً",resume:"استئناف الجلسة",connectSession:"الاتصال",start:"بدء الاتصال",stop:"إيقاف مؤقت",reconnect:"إعادة الاتصال",unlink:"إلغاء الربط (Unlink)",restart:"إعادة تشغيل البوت",save:"حفظ التغييرات",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",edit:"تعديل",add:"إضافة",refresh:"تحديث",logout:"تسجيل الخروج",backToApp:"العودة للتطبيق",close:"إغلاق",copy:"نسخ",copied:"تم النسخ!",clientIdentity:"هوية العميل",noPhonePaired:"لم يتم ربط أي هاتف بعد",linkedAs:"مرتبط كـ",datastoreHealth:"حالة قاعدة البيانات",datastoreHealthy:"بيانات الاعتماد ومفاتيح الجلسة ومطابقات LID سليمة ومستقرة.",reconnectPolicy:"سياسة إعادة الاتصال",reconnectPolicyDesc:"تراجع خطي تدريجي (5ث، 10ث، 15ث، 20ث، 25ث) مع محاولات محدودة.",maxAttemptsAutoPause:"الحد الأقصى: 5 محاولات · إيقاف تلقائي دون إنترنت",platformWeb:"المنصة: واتساب ويب (v7 Multi-Device)",databaseNodeSqlite:"قاعدة البيانات: node:sqlite (تزامني)",totalGroups:"إجمالي المجموعات",totalUsers:"المستخدمون المسجلون",commandCount:"الأوامر المفعلة",uptime:"مدة التشغيل",uptimeDayUnit:"يوم",uptimeHourUnit:"ساعة",uptimeMinuteUnit:"دقيقة",online:"متصل",offline:"غير متصل",quickCommandsDesc:"{n} أمراً واختصاراً نشطاً",moreActions:"إجراءات إضافية",lightMode:"الوضع الفاتح",darkMode:"الوضع الداكن",dataDir:"مجلد البيانات",quickStatus:"حالة النظام",activeSchedules:"المهام المجدولة النشطة",activeListening:"المساعد نشط ويستقبل الرسائل",pausedOrLinking:"اتصال واتساب متوقف حالياً أو قيد المزامنة",aiTitle:"إعدادات الذكاء الاصطناعي",aiSubtitle:"اختر المزود المناسب بضغطة زر أو خصص النماذج والمفاتيح",aiAgentEnabled:"تفعيل وكيل الذكاء الاصطناعي",aiProvider:"المزود النشط",quickSetup:"معالج الإعداد السريع للمزودين",aiVision:"تحليل وفهم الصور (Vision)",aiVisionDesc:"تحويل الصور وتمريرها لنماذج الرؤية الذكية المتوافقة",aiStt:"محرك تحويل الصوت إلى نص (STT)",sttDesc:"محرك تفريغ الرسائل الصوتية وتحويلها إلى نص",sttAuto:"تلقائي (مطابق للمزود النشط)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"لغة ردود البوت",botLanguageDesc:"تحديد لغة ردود البوت أو تغييرها عبر الأمر !lang",langAuto:"تلقائي (حسب لغة رسالة المستخدم)",langAr:"العربية الفصحى (دائماً)",langEn:"English (دائماً)",modelName:"النموذج",apiKey:"مفتاح API",baseUrl:"Base URL",maxToolSteps:"الحد الأقصى لخطوات الأدوات",googleSearch:"أداة بحث جوجل المدمجة (Google Search)",personaPrompt:"توجيه شخصية البوت (AI Persona)",personaDesc:"تعديل التوجيه الأساسي الذي يحدد أسلوب وشخصية مساعدك الذكي",editPersona:"تعديل توجيه الشخصية",memoryFiles:"الذاكرة طويلة المدى",memoryDesc:"ذاكرة البوت الدائمة: تشترك جميع المحادثات في الذاكرة العامة، ولكل محادثة ملف خاص. يقرأ البوت المعلومات المحفوظة وأي نص حر تكتبه.",manageMemory:"إدارة ملفات الذاكرة",memoryGlobalScope:"الذاكرة العامة",memoryGlobalScopeHint:"تُضاف إلى سياق جميع المحادثات",memoryChatScopeHint:"تُضاف إلى سياق هذه المحادثة فقط",memoryEntriesCount:"{n} معلومة محفوظة",memoryProseHint:"يقرأ البوت محتوى الملف كله: الأسطر التي تبدأ بـ `-` معلومات منفصلة يمكنه إضافتها أو حذفها، ويقرأ أي نص حر كما كُتب.",memoryEditorPlaceholder:"اكتب هنا ما تريد أن يتذكره البوت دائمًا…",aiInspector:"معاينة محادثات الذكاء الاصطناعي",aiInspectorDesc:"نظرة للقراءة فقط على السياق المخزّن لكل محادثة: الردود، الوسائط، واستخدام الأدوات.",openInspector:"فتح المعاينة",noConversations:"لا توجد محادثات محفوظة بعد.",convTurns:"{n} جزء",backToList:"رجوع للقائمة",convTruncated:"يقتصر العرض على آخر 200 جزء.",convMedia:"ملف وسائط",capabilities:"القدرات والميزات المتقدمة",modelsAvailableLive:"نماذج متاحة لحسابك (تم التحقق عبر API)",modelsRecommendedSeed:"نماذج مقترحة / معروفة (دليل النماذج)",connectKeyFirstPrompt:"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك",refreshModels:"تحديث قائمة النماذج",refreshing:"جارٍ التحديث...",fetchModels:"فحص النماذج المتاحة",fetchingModels:"جارٍ فحص النماذج...",capVision:"الرؤية",capStt:"الصوت",capAudio:"إدخال الصوت",capText:"نص",capPdf:"PDF",capVideo:"فيديو",supported:"مدعوم",unsupported:"غير مدعوم",sourceLive:"حسابك",sourceSeed:"مقترح",sourceUnknown:"غير معروف",visionUnsupportedNotice:"النموذج المختار لا يدعم معالجة الصور والرؤية (Vision)، تم تعطيل الميزة تلقائياً.",sttUnsupportedNotice:"النموذج المختار لا يدعم تحويل وفهم الصوت (STT)، تم تعطيل الميزة تلقائياً.",aiSttEnabled:"تفعيل تحويل وفهم الصوت (STT)",aiSttEnabledDesc:"تفريغ الرسائل الصوتية وفهم الملفات الصوتية عبر النموذج المختار",providerGemini:"Google Gemini",providerGeminiDesc:"الافتراضي، يدعم البحث والملفات والصور والصوتيات محلياً",providerGroq:"Groq Cloud",providerGroqDesc:"فائق السرعة لنماذج Llama 3 و Mixtral مع دعم Vision",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"لنماذج GPT-4o أو أي خادم متوافق مع API OpenAI",providerOllama:"Ollama (محلي)",providerOllamaDesc:"تشغيل النماذج محلياً على جهازك مجاناً بدون إنترنت",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"لنماذج Claude 3.5 Sonnet الذكية والمتقدمة",scanQrHint:"افتح تطبيق واتساب على هاتفك > الأجهزة المرتبطة > ربط جهاز، وامسح الرمز أدناه.",pairingCode:"رمز الربط (Pairing Code)",reconnectingSoon:"إعادة الاتصال قريباً...",nextAttemptIn:"المحاولة القادمة خلال",seconds:"ثوانٍ",tabGeneral:"عام والبادئة",tabAI:"الذكاء الاصطناعي",tabSecurity:"الأمان والوصول",tabProxy:"بروكسي واتساب",tabStorage:"التخزين والوسائط",tabLogs:"سجلات النظام",prefixTitle:"بادئة أوامر البوت (Command Prefix)",prefixDesc:"الرمز أو الحرف الذي تبدأ به جميع الأوامر الموجهة للبوت في واتساب (مثل !help أو /ping)",prefixPlaceholder:"مثال: !",prefixPresets:"بادئات شائعة سريعة:",prefixPreview:"معاينة حية لشكل الأوامر:",prefixSaveBtn:"حفظ البادئة الجديدة",prefixUpdated:"تم تحديث بادئة الأوامر بنجاح!",prefixValidation:"يجب أن تكون البادئة من رمز واحد إلى 3 رموز",activePrefix:"البادئة الحالية",changePrefix:"تعديل البادئة",prefix:"بادئة الأوامر (Prefix)",botTimezone:"المنطقة الزمنية (Timezone)",botTimezoneDesc:"المنطقة الزمنية المعتمدة لحساب أوقات الصلاة والمهام المجدولة (مثل Africa/Cairo)",botMinDelay:"الحد الأدنى للتأخير البشري (ms)",botMaxDelay:"الحد الأقصى للتأخير البشري (ms)",delaysDesc:"فترة انتظار قصيرة قبل إرسال الردود ليبدو سلوك البوت طبيعياً وبشرياً",shareSettingsTitle:"مشاركة الإعدادات",shareSettingsDesc:"صدّر إعداداتك في ملف JSON يشاركه أصدقاؤك، أو استورد ملف صديقك. المفاتيح السرية (مفاتيح الـ API وكلمات المرور) لا تُصدَّر أبداً ولا تُستبدل بالاستيراد.",exportSettings:"تصدير الإعدادات",exportSettingsDesc:"ملف JSON يتضمن الإعدادات غير السرية التي غيّرتها",exportSettingsSuccess:"تم تصدير الإعدادات",exportSavedTo:"حُفظ في",exportSettingsError:"تعذر تصدير الإعدادات",importSettings:"استيراد من ملف",importSettingsError:"ملف غير صالح — يجب أن يكون ملفًا صادرًا من إعدادات Levix",importTitle:"استيراد الإعدادات",importSummary:"سيُطبّق على هذا الجهاز:",importSettingsCount:"إعداد",importPermissionsCount:"صلاحية أمر",importAliasesCount:"أسماء بديلة",importDisabledCount:"أمر مُعطَّل",importPrefix:"البادئة",importApply:"تطبيق الاستيراد",importSuccess:"تم استيراد الإعدادات بنجاح",importSkipped:"تم تخطي",importRestartNeeded:"تحتاج إعادة تشغيل البوت لتُطبَّق",changePassword:"تغيير كلمة مرور لوحة التحكم",currentPassword:"كلمة المرور الحالية",newPassword:"كلمة المرور الجديدة",confirmPassword:"تأكيد كلمة المرور الجديدة",passwordMatchError:"كلمتا المرور غير متطابقتين",passwordMinLength:"يجب ألا تقل كلمة المرور عن 8 خانات",passwordChangedSuccess:"تم تغيير كلمة مرور لوحة التحكم بنجاح!",proxyTitle:"بروكسي واتساب الصادر (Outbound Proxy)",proxyDesc:"توجيه اتصالات Baileys إلى واتساب عبر بروكسي خارجي لتجاوز قيود الشبكة أو الحظر",proxyEnabled:"تفعيل البروكسي لاتصالات واتساب",proxyProtocol:"بروتوكول البروكسي (Protocol)",proxyHost:"عنوان المضيف (Host / IP)",proxyPort:"المنفذ (Port)",proxyUsername:"اسم المستخدم (اختياري)",proxyPassword:"كلمة المرور (اختياري)",proxyApplyHint:"⚠️ ملاحظة: عند تعديل إعدادات البروكسي، اضغط على زر إعادة الاتصال في صفحة الاتصال لتطبيق التغييرات.",storageTitle:"إدارة البيانات والاحتفاظ بها",storageDesc:"تحديد مدد صلاحية البيانات المؤقتة وسجلات الرسائل الموجهة والحدود القصوى للجلب",forwardTtl:"صلاحية سجلات الرسائل الموجهة (أيام)",forwardTtlDesc:"حذف إحصائيات الرسائل الموجهة القديمة تلقائياً بعد مرور هذا العدد من الأيام",maxFetchBytes:"الحد الأقصى لجلب محتوى صفحات الويب (Bytes)",maxFetchBytesDesc:"حجم المحتوى الأقصى المسموح لأدوات الذكاء الاصطناعي بجلبه من صفحات الويب (افتراضي: 512KB)",ffmpegPath:"مسار محرك FFmpeg مخصص (اختياري)",weatherApiKey:"مفتاح OpenWeatherMap API (اختياري)",chooseLanguage:"اختر اللغة",langCardTitle:"لغة الواجهة: العربية (RTL)",langCardDesc:"تصميم مخصص بالكامل لاتجاه الكتابة العربي من اليمين لليسار مع خط تجوال",langSwitchBtn:"Switch to English",langName:"العربية",interfaceLanguage:"لغة لوحة التحكم",interfaceLanguageDesc:"التبديل الفوري بين الواجهة العربية (RTL) والإنجليزية (LTR)",botPort:"منفذ خادم لوحة التحكم (Port)",botPortHint:"* يتطلب تغيير المنفذ إعادة تشغيل البوت ليأخذ مفعوله",searchPlaceholder:"ابحث في الأوامر أو الأسماء البديلة...",thCommand:"الأمر",thAliases:"الأسماء البديلة",thDescription:"الوصف",thScope:"النطاق",thRequiredRole:"الرتبة المطلوبة",thStatus:"الحالة",thGroupName:"اسم المجموعة",thGroupJid:"معرف المجموعة (JID)",thMembers:"الأعضاء",thAntiLink:"مانع الروابط",thMedia:"الوسائط",thWelcome:"الترحيب",thTarget:"الوجهة",thMessage:"الرسالة",thSchedule:"الموعد",thType:"النوع",thDelivery:"حالة الإرسال",thActions:"إجراءات",scheduleNewMsg:"جدولة رسالة جديدة",liveServerLogs:"سجلات النظام المباشرة",clearLogs:"مسح السجلات",allLogs:"جميع المستويات",noLogs:"لا توجد سجلات مسجلة حتى الآن.",logSourceBot:"البوت",logSourceHost:"مضيف أندرويد",shareLogs:"مشاركة السجلات",share:"مشاركة",savedSuccessfully:"تم حفظ الإعدادات بنجاح!",saveFailed:"حدث خطأ أثناء حفظ الإعدادات.",connectionStatusUpdated:"تم تحديث حالة الاتصال.",networkError:"تعذر الاتصال بالخادم.",loading:"جارٍ التحميل...",aiAssistantDesc:"وكيل ذكي متعدد الأدوات مع ذاكرة طويلة الأمد",settingsSub:"البادئة، التأخير، الخدمات، والأمان",editAliases:"تعديل الأسماء المستعارة",aliasesFor:"الأسماء المستعارة لـ",addAlias:"إضافة اسم مستعار",newAliasPlaceholder:"اكتب اسماً جديداً...",noAliases:"لا توجد أسماء مستعارة",aliasesHelp:"الأسماء المستعارة تتيح استدعاء هذا الأمر بأسماء بديلة (مثل: p بدلاً من ping).",aliasAlreadyAdded:"هذا الاسم المستعار مضاف بالفعل",aliasScriptArabic:"اسم مستعار بالعربية",aliasScriptLatin:"اسم مستعار بالإنجليزية",commandsSub:"إدارة رتب الأوامر والأسماء المستعارة وتفعيلها أو تعطيلها مباشرة",editPrefixHint:"اضغط لتعديل البادئة",usage:"الاستخدام",usageHint:"الأمر كما يُرسل في واتساب",noMatchingCommands:"لا توجد أوامر مطابقة لبحثك.",commandEnabled:"تم تفعيل الأمر '{name}'",commandDisabled:"تم تعطيل الأمر '{name}'",permissionUpdated:"تم تحديث رتبة '{name}'",scopeAll:"الكل",scopeGroup:"المجموعات",scopePrivate:"خاص",permMembers:"الجميع (الأعضاء)",permAdminsOnly:"مشرفو المجموعة",permAdminsOwner:"مشرفو المجموعة أو المالك",permOwnerOnly:"مالك البوت فقط",selectRecipient:"اختر المحادثة المستهدفة",searchRecipients:"ابحث بالاسم أو رقم الهاتف...",recipients:"المستلمون",chooseChat:"اختر جهة اتصال أو مجموعة...",noRecipientsFound:"لم يتم العثور على محادثات",pickPhoneContact:"من دليل الهاتف",pickPhoneContactHint:"اختر جهة اتصال من هاتف أندرويد",maxSchedulesReached:"تم بلوغ الحد الأقصى (3 رسائل مجدولة)",limitReached:"الحد الأقصى مكتمل",scheduleType:"نوع الجدولة",scheduleRecurring:"دوري متكرر",scheduleOnce:"مرة واحدة (تاريخ ووقت محدد)",repeat:"التكرار",repeatDaily:"كل يوم",repeatWeekly:"كل أسبوع",repeatMonthly:"كل شهر",repeatHourly:"كل عدد من الساعات",weekdays:"أيام الأسبوع",dayOfMonth:"يوم الشهر",monthDayHint:"إذا كان الشهر أقصر من اليوم المختار (مثل 31 في فبراير) تُتخطى تلك المرة.",everyHours:"كل كم ساعة",atMinute:"عند الدقيقة",sendTime:"وقت الإرسال",deliveryDateTime:"موعد وتاريخ الإرسال",timezoneLabel:"المنطقة الزمنية",recurrencePreview:"المعاينة",weekdaySun:"الأحد",weekdayMon:"الاثنين",weekdayTue:"الثلاثاء",weekdayWed:"الأربعاء",weekdayThu:"الخميس",weekdayFri:"الجمعة",weekdaySat:"السبت",contactFallback:"جهة اتصال",groupFallback:"مجموعة",hoursUnit:"ساعة",messageText:"نص الرسالة",messagePlaceholder:"اكتب الرسالة التي سيتم إرسالها تلقائياً...",scheduleAction:"جدولة الرسالة",scheduledCount:"مجدول",headerSubtitle:"إرسال دوري ومحدد بالوقت",noSchedules:"لا توجد رسائل مجدولة حالياً.",typeRecurring:"متكرر",typeOnce:"مرة واحدة",deliveryFailed:"فشل الإرسال",deliveryActive:"نشط",changeChat:"تغيير المحادثة",weekdayRequired:"اختر يوماً واحداً على الأقل",tabIntegrations:"الربط والخدمات",integrationsDesc:"مفاتيح واجهات البرمجة (API) للخدمات الخارجية المرتبطة بالبوت",youtubeApiKey:"مفتاح YouTube Data API (اختياري)",selectModel:"اختر نموذجاً من القائمة...",availableModels:"النماذج المتاحة من المزود",customModel:"أو اكتب اسم نموذج مخصص",sessionStatus:"حالة الجلسة",sessionActive:"الجلسة متصلة وتستقبل الرسائل",sessionOffline:"الجلسة غير متصلة حالياً",connectedNumber:"الرقم المرتبط",tabFeedback:"الملاحظات والدعم",feedbackTitle:"أرسل ملاحظاتك إلى المطوّر",feedbackDesc:"مشكلة، اقتراح، أو سؤال — تُسلَّم رسالتك مباشرةً إلى مطوّر ليفيكس. لا يوجد وسيط ولا نظام تذاكر.",feedbackTopicLabel:"موضوع الرسالة",feedbackTopicBug:"هناك خلل",feedbackTopicIdea:"فكرة أو طلب",feedbackTopicQuestion:"سؤال",feedbackTopicPraise:"يعمل بشكل جيد",feedbackTopicOther:"شيء آخر",feedbackMessageLabel:"رسالتك",feedbackMessagePlaceholder:"ماذا حدث، وماذا كنت تتوقع، وماذا كنت تفعل في ذلك الوقت. التفاصيل تساعد — يقرأها شخص حقيقي.",feedbackCharsNeeded:"حرفاً إضافياً على الأقل",feedbackRatingLabel:"كيف يعمل ليفيكس معك؟ (اختياري)",feedbackContactLabel:"كيف نتواصل معك؟ (اختياري)",feedbackContactPlaceholder:"بريد إلكتروني أو معرّف واتساب/تيليجرام — فقط إن أردت رداً",feedbackSendBtn:"إرسال الملاحظات",feedbackSending:"جارٍ الإرسال...",feedbackSent:"تم الإرسال. شكراً لك!",feedbackSentDesc:"وصلت رسالتك إلى مطوّر ليفيكس. إن تركت وسيلة للتواصل، توقّع رداً.",feedbackSendAnother:"إرسال رسالة أخرى",feedbackWhatIsSent:"ما يُرسَل مع رسالتك",feedbackWhatIsSentDesc:"نص رسالتك، والموضوع، والتقييم ووسيلة التواصل إن أضفتهما، والملف الذي أرفقته إن وُجد، بالإضافة إلى إصدار ليفيكس والمنصة التي يعمل عليها. لا تُرسَل أي رسالة واتساب أو محادثة أو جهة اتصال أو مفتاح، ولا يُرسَل شيء إلا عند الضغط على إرسال.",feedbackRuntimeLabel:"يُرفَق مع الرسالة",feedbackGithubHint:"للأخطاء التي تريد تتبّعها علناً مع السجلات، افتح Issue على GitHub.",feedbackOpenGithub:"فتح Issue على GitHub",feedbackAttach:"إرفاق ملف",feedbackAttachmentHint:"اختياري — لقطة شاشة أو ملف سجل حتى {max} م.ب",feedbackRemoveAttachment:"إزالة المرفق",feedbackFileTooLarge:"الملف كبير جداً — الحد الأقصى {max} م.ب",scheduleAttachMedia:"إرفاق وسائط",scheduleMediaHint:"اختياري — صورة أو فيديو أو صوت أو مستند حتى {max} م.ب",scheduleRemoveMedia:"إزالة الوسائط",scheduleDetails:"تفاصيل الرسالة المجدولة",detailMedia:"الوسائط",detailLastRun:"آخر إرسال",detailError:"الخطأ",detailCreated:"أُنشئت",retryDelivery:"إعادة محاولة الإرسال",mediaKindImage:"صورة",mediaKindVideo:"فيديو",mediaKindAudio:"صوت",mediaKindDocument:"مستند",stickerStudio:"استوديو الملصقات",stickersDesc:"إنشاء وإدارة ملصقات واتساب",library:"المكتبة",packs:"الحزم",favorites:"المفضلة",create:"إنشاء",recent:"مستخدمة حديثاً",allStickers:"الكل",static:"ثابت",animated:"متحرك",noPack:"بدون حزمة",anyPack:"أي حزمة",newPack:"حزمة جديدة…",addToPack:"إضافة لحزمة",moveToPack:"نقل لحزمة",removeFromPack:"إزالة من الحزمة",favorite:"إضافة للمفضلة",unfavorite:"إزالة من المفضلة",download:"تحميل",convertToImage:"تحويل لصورة",shareSticker:"مشاركة",sendViaWhatsapp:"إرسال عبر واتساب",deleteEverywhere:"حذف من كل مكان",deleteKeepStickers:"حذف الحزمة فقط (مع الاحتفاظ بالملصقات)",deletePackAndStickers:"حذف الحزمة والملصقات غير الموجودة في حزم أخرى",openInCreate:"فتح في المُنشئ",packName:"اسم الحزمة",mergeInto:"دمج في حزمة أخرى",merge:"دمج",stickersKept:"سيتم الاحتفاظ بالملصقات",trim:"اقتطاع المقطع",background:"الخلفية",transparent:"شفاف",white:"أبيض",black:"أسود",customColor:"لون مخصص",removePlainBackground:"إزالة الخلفية المسطحة",fit:"الملاءمة",contain:"احتواء",cover:"تغطية",zoom:"تكبير/تصغير",panX:"تحريك أفقي",panY:"تحريك عمودي",rotate:"تدوير",addText:"إضافة نص",addEmoji:"إضافة إيموجي",createAnother:"إنشاء آخر",qualityReduced:"تم ضغط الملصق ليناسب حد واتساب",alreadyInLibrary:"الملصق موجود بالفعل في المكتبة",encoderMissing:"لا يوجد محول WebP، إنشاء الملصقات معطل.",tryAgain:"حاول مرة أخرى",loadMore:"تحميل المزيد",selectAll:"تحديد الكل",clearSelection:"إلغاء التحديد",deleteConfirm:"هل أنت متأكد أنك تريد الحذف؟",nSelected:"{n} محددة",sizeLbl:"الحجم:",formatLbl:"التنسيق:",packsLbl:"الحزم:",gifBadge:"متحرك",startDur:"البداية: {start}ث | المدة: {dur}ث",outlineBox:"إطار/خلفية",toolsLbl:"الأدوات",clearLbl:"مسح",resetPan:"إعادة ضبط",clickOrDrag:"انقر أو اسحب صورة/فيديو للرفع",creatingSticker:"جارٍ إنشاء الملصق…",goToLibrary:"الذهاب للمكتبة",loadingLbl:"جارٍ التحميل…",selectPack:"اختر حزمة…",noPacksCreated:"لم يتم إنشاء أي حزم بعد",packCreated:"تم إنشاء الحزمة",packDeleted:"تم حذف الحزمة",packRenamed:"تم تغيير اسم الحزمة",failedToCreatePack:"فشل إنشاء الحزمة",failedToDeletePack:"فشل حذف الحزمة",failedToRenamePack:"فشل تغيير اسم الحزمة",failedToMerge:"فشل الدمج",someStickersInPacks:"بعض الملصقات موجودة في حزم: {packs}",deleteEverywherePrompt:"حذفها من كل مكان؟",packsMerged:"تم دمج الحزم",emptyLibrary:"المكتبة فارغة",jobStage_probing:"جارٍ الفحص…",jobStage_decoding:"جارٍ فك التشفير…",jobStage_encoding:"جارٍ التشفير…",jobStage_optimizing:"جارٍ التحسين…",jobStage_saving:"جارٍ الحفظ…",jobQueued:"جارٍ الانتظار في الطابور…",sortNewest:"الأحدث",sortOldest:"الأقدم",sortName:"الاسم",sortRecent:"الأحدث استخداماً",unlinkStickersWarning:"سيتم مسح مكتبة الملصقات بالكامل أيضاً.",stickerErr_NO_MEDIA:"أرسل صورة أو فيديو أو ملصقاً.",stickerErr_UNSUPPORTED_TYPE:"نوع الملف غير مدعوم.",stickerErr_TOO_LARGE:"الملف كبير جداً.",stickerErr_DIMENSIONS_TOO_LARGE:"أبعاد الصورة كبيرة جداً.",stickerErr_VIDEO_TOO_LONG:"الفيديو طويل جداً.",stickerErr_CORRUPT:"الملف تالف.",stickerErr_CONVERSION_FAILED:"فشل تحويل الملصق.",stickerErr_OUTPUT_TOO_LARGE:"حجم الملصق النهائي كبير جداً.",stickerErr_ENCODER_MISSING:"الخادم لا يدعم معالجة WebP.",stickerErr_TIMEOUT:"انتهى وقت المعالجة.",stickerErr_BUSY:"النظام مشغول، يرجى المحاولة لاحقاً.",stickerErr_NOT_FOUND:"الملصق غير موجود.",stickerErr_PACK_NOT_FOUND:"الحزمة غير موجودة.",stickerErr_PACK_EXISTS:"اسم الحزمة موجود بالفعل.",stickerErr_INVALID_NAME:"اسم الحزمة غير صالح.",stickerErr_INVALID_OPTIONS:"خيارات التعديل غير صالحة.",stickerErr_LIBRARY_FULL:"المكتبة ممتلئة.",stickerErr_PACK_LIMIT:"تم الوصول للحد الأقصى للحزم.",stickerErr_IN_USE:"الملصق مستخدم في حزم أخرى.",stickerErr_STORAGE_UNAVAILABLE:"مساحة التخزين غير متوفرة.",stickerErr_NOT_CONNECTED:"واتساب غير متصل.",stickerErr_INTERNAL:"خطأ داخلي في الخادم.",stickerErr_CANCELLED:"أُلغي التحويل.",stickerLibraryLimit:"الحد الأقصى للملصقات",stickerLibraryLimitDesc:"عدد الملصقات التي يمكن لكل شخص الاحتفاظ بها في استوديو الملصقات.",stickerUploadInfo:"{kind} · {size} كيلوبايت",stickerRemoveHint:"تُطبّق إزالة الخلفية المسطحة عند الإنشاء.",stickerSelect:"تحديد الملصق",stickerOpen:"فتح تفاصيل الملصق",stickerShareSaved:"حُفظ الملف في {dir}",stickerDrag:"اسحب ملفًا إلى هنا أو اختره",stickerAlignmentStart:"البداية",stickerAlignmentCenter:"الوسط",stickerAlignmentEnd:"النهاية",stickerKindImage:"صورة",stickerKindGif:"صورة متحركة",stickerKindVideo:"فيديو",stickerKindWebp:"ملصق WebP",stickerDeletePackWarning:"سيُحذف الملصق من جميع الحزم.",stickerSendLimit:"يمكن إرسال عدد محدود من الملصقات دفعة واحدة.",stickerExportLimit:"اختر عددًا أقل من الملصقات للتصدير.",tolerance:"نسبة التسامح",stickerName:"اسم الملصق",stickerNamePlaceholder:"اسم اختياري…",trimStart:"البداية",trimDuration:"المدة",trimSeconds:"ثوانٍ",textContent:"النص",textSize:"الحجم",textColor:"اللون",textAlignment:"المحاذاة",textOutline:"إطار",textBackground:"خلفية النص",layerRotation:"الدوران",deleteLayer:"حذف الطبقة",noLayers:"لا توجد طبقات",reorderUp:"تقديم",reorderDown:"تأخير",renamePack:"تغيير اسم الحزمة",deletePack:"حذف الحزمة",packEmpty:"هذه الحزمة فارغة",noPacks:"لا توجد حزم بعد",createFirstPack:"أنشئ حزمتك الأولى",stickerCount:"{n} ملصقات",notConnectedHint:"اتصل بواتساب أولاً",exportFirstFrame:"يصدّر الإطار الأول",downloadWebp:"تحميل WebP",downloadPng:"تحميل PNG",downloadGif:"تحميل GIF",reorderDragHint:"اسحب لإعادة الترتيب",saved:"تم الحفظ",createBtn:"إنشاء ملصق",uploadHint:"يقبل JPEG، PNG، WebP، GIF، MP4، WebM",stickerCreated:"تم إنشاء الملصق!",stickerSent:"تم إرسال الملصق",stickersSent:"تم إرسال الملصقات",stickerPreview:"معاينة الملصق",firstFrameHint:"يُصدَّر الملصق المتحرك كصورة ثابتة من إطاره الأول.",gifOnlyAnimated:"تصدير GIF متاح للملصقات المتحركة فقط.",rename:"إعادة التسمية",inUsePacksLabel:"في هذه الحزم",notInPack:"ليس في أي حزمة",retryLoad:"إعادة المحاولة",showingCount:"يُعرض {shown} من {total}",emojiPaletteLabel:"الرموز التعبيرية",customEmoji:"رمز آخر",emojiInputLabel:"اكتب رمزًا تعبيريًا",textPlaceholder:"نص",layerSelected:"الطبقة المحددة",selectVisible:"تحديد الظاهر",downloadZip:"تنزيل ملف مضغوط",noRecipients:"لا توجد محادثات",recipientGroup:"مجموعة",recipientContact:"جهة اتصال",sending:"جارٍ الإرسال…",deleteStickersTitle:"حذف الملصقات",inUseBody:"هذا الملصق داخل حزمة. حذفه يزيله من تلك الحزم أيضًا.",inUseBulkBody:"بعض الملصقات المحددة موجودة في حزم، ولم تُحذف.",deleteEverywhereHint:"الحذف من كل مكان يزيل الملصقات من جميع الحزم ومن المكتبة.",packNameLength:"يجب أن يكون اسم الحزمة بين حرف واحد و40 حرفًا.",newPackPlaceholder:"اسم الحزمة",createPack:"إنشاء حزمة",skippedOther:"تعذّر تحديث بعض الملصقات.",addedToPack:"أُضيف إلى الحزمة",movedToPack:"نُقل إلى الحزمة",removedFromPack:"أُزيل من الحزمة",renamed:"تم تحديث الاسم",downloaded:"بدأ التنزيل",shareDone:"تمت المشاركة",backToPacks:"كل الحزم",confirmMerge:"دمج الحزم",mergeTitle:"دمج في حزمة أخرى",mergeConfirmBody:"تبقى الملصقات في المكتبة. تُلحَق عناصر هذه الحزمة بالحزمة الأخرى، ويُتخطى المكرر، ثم تُحذف هذه الحزمة.",trimApplied:"يُطبَّق الاقتطاع عند إنشاء الملصق.",gifTrimNote:"يُطبَّق اقتطاع الصورة المتحركة عند الإنشاء، وقد لا يطابق المعاينة إطارًا بإطار.",animatedUnavailable:"هذا الخادم لا يستطيع ترميز الملصقات المتحركة.",targetPack:"إضافة إلى حزمة",previewStage:"معاينة الملصق",rotateQuarter:"تدوير 90 درجة",uploadReady:"الملف جاهز",stickerNameTooLong:"يمكن أن يبلغ اسم الملصق 60 حرفًا كحد أقصى.",noDestinationPack:"اختر حزمة للدمج فيها.",deletePackTitle:"حذف الحزمة",openPack:"فتح الحزمة",searchStickers:"البحث في الملصقات",sortBy:"الترتيب",filterBy:"التصفية",packFilter:"الحزمة",noResults:"لا توجد ملصقات مطابقة للبحث",favoritesEmpty:"لا توجد ملصقات مفضلة بعد",recentEmpty:"لا توجد ملصقات استُخدمت أو أُنشئت خلال آخر 30 يومًا",favoriteBadge:"مفضلة",deleted:"تم الحذف"},en:{overview:"Overview",stickers:"Sticker Studio",connection:"Connection",control:"Control & Management",commands:"Command Catalog",ai:"AI & Memory",groups:"Groups",roles:"Roles & Admins",schedules:"Scheduled Messages",notes:"Notes & Lists",settings:"Settings",logs:"Live Logs",connected:"Connected to WhatsApp",disconnected:"Disconnected",starting:"Starting socket...",waiting_for_qr:"Waiting for QR scan",linking:"Linking session...",reconnecting:"Reconnecting...",retry_exhausted:"Retries exhausted",logged_out:"Logged out from phone",idle:"Session idle",paused:"Paused",resume:"Resume session",connectSession:"Connect",start:"Start Connection",stop:"Pause",reconnect:"Reconnect",unlink:"Unlink Device",restart:"Restart Bot",save:"Save Changes",saving:"Saving...",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",refresh:"Refresh",logout:"Sign Out",backToApp:"Back to app",close:"Close",copy:"Copy",copied:"Copied!",clientIdentity:"Client Identity",noPhonePaired:"No phone paired yet",linkedAs:"Linked as",datastoreHealth:"Datastore Health",datastoreHealthy:"SQLite credentials, auth keys, and LID mappings are healthy.",reconnectPolicy:"Reconnect Policy",reconnectPolicyDesc:"Staged linear backoff (5s, 10s, 15s, 20s, 25s) with bounded retries.",maxAttemptsAutoPause:"Max attempts: 5 • Auto-pause offline",platformWeb:"Platform: WhatsApp Web (v7 Multi-Device)",databaseNodeSqlite:"Database: node:sqlite (Synchronous)",totalGroups:"Total Groups",totalUsers:"Registered Users",commandCount:"Enabled Commands",uptime:"Uptime",uptimeDayUnit:"d",uptimeHourUnit:"h",uptimeMinuteUnit:"m",online:"ONLINE",offline:"OFFLINE",quickCommandsDesc:"{n} active commands & aliases",moreActions:"More actions",lightMode:"Light mode",darkMode:"Dark mode",dataDir:"Data Directory",quickStatus:"System Status",activeSchedules:"Active Schedules",activeListening:"Active and listening to messages",pausedOrLinking:"WhatsApp connection is currently paused or linking",aiTitle:"AI Assistant Configuration",aiSubtitle:"Select a provider with one click or configure custom endpoints and keys",aiAgentEnabled:"Enable AI Agent",aiProvider:"Active Provider",quickSetup:"Quick Provider Setup Wizard",aiVision:"Image Understanding (Vision)",aiVisionDesc:"Encode attached images and pass to supported multimodal vision models",aiStt:"Speech-to-Text Provider (STT)",sttDesc:"Speech-to-text transcription engine for voice notes",sttAuto:"Auto (Matches active provider)",sttGemini:"Google Gemini Audio API",sttOpenAI:"OpenAI / Groq Whisper API",botLanguage:"Bot Response Language",botLanguageDesc:"Set bot response language directly or via command !lang",langAuto:"Auto-detect (matches user's language)",langAr:"Modern Standard Arabic (Always)",langEn:"English (Always)",modelName:"Model",apiKey:"API key",baseUrl:"Base URL",maxToolSteps:"Max Tool Steps",googleSearch:"Built-in Google Search Grounding",personaPrompt:"AI Persona System Prompt",personaDesc:"Edit the live system prompt that shapes your AI assistant's persona, tone, and behavior.",editPersona:"Edit System Prompt",memoryFiles:"Long-term Memory",memoryDesc:"The bot's durable memory. Global memory is shared by every chat; each chat also has its own file. The bot reads saved entries and any free-form text you write.",manageMemory:"Manage Memory Files",memoryGlobalScope:"Global memory",memoryGlobalScopeHint:"Injected into every chat",memoryChatScopeHint:"Injected into this chat only",memoryEntriesCount:"{n} saved entries",memoryProseHint:"Everything in this file reaches the bot: lines starting with '-' are separate entries it can add or forget, and free-form text is included verbatim.",memoryEditorPlaceholder:"Write anything you want the bot to remember for good…",aiInspector:"AI Conversation Inspector",aiInspectorDesc:"Read-only view of each chat's stored conversation context: replies, media references and tool usage.",openInspector:"Open Inspector",noConversations:"No stored conversations yet.",convTurns:"{n} parts",backToList:"Back to list",convTruncated:"Showing only the latest 200 parts.",convMedia:"media file",capabilities:"Capabilities & Toggles",modelsAvailableLive:"Models Available for Your Account (Live API Verified)",modelsRecommendedSeed:"Recommended / Known Models (Catalog)",connectKeyFirstPrompt:"Please connect your API key first to discover models available to your account",refreshModels:"Refresh Models",refreshing:"Refreshing...",fetchModels:"Fetch Available Models",fetchingModels:"Discovering models...",capVision:"Vision",capStt:"Speech",capAudio:"Audio in",capText:"Text",capPdf:"PDF",capVideo:"Video",supported:"Supported",unsupported:"Unsupported",sourceLive:"Your account",sourceSeed:"Catalog",sourceUnknown:"Unknown",visionUnsupportedNotice:"The selected model does not support Vision (image understanding). Feature disabled automatically.",sttUnsupportedNotice:"The selected model does not support Speech-to-Text (STT). Feature disabled automatically.",aiSttEnabled:"Enable Speech-to-Text (STT)",aiSttEnabledDesc:"Audio transcription and voice note understanding using the active model",providerGemini:"Google Gemini",providerGeminiDesc:"Default provider with native Google Search, Files upload, and Multimodal support",providerGroq:"Groq Cloud",providerGroqDesc:"Ultra-fast inference for Llama 3 & Mixtral models with Vision support",providerOpenAI:"OpenAI / Compatible",providerOpenAIDesc:"For GPT-4o models or any OpenAI-compatible API gateway",providerOllama:"Ollama (Local)",providerOllamaDesc:"Run local open-source models completely offline on your own machine",providerAnthropic:"Anthropic Claude",providerAnthropicDesc:"For Claude 3.5 Sonnet advanced reasoning models",scanQrHint:"Open WhatsApp on your phone > Settings > Linked Devices > Link a Device, and scan the QR code below.",pairingCode:"Pairing Code",reconnectingSoon:"Reconnecting soon...",nextAttemptIn:"Next attempt in",seconds:"seconds",tabGeneral:"General & Prefix",tabAI:"AI Assistant",tabSecurity:"Security & Access",tabProxy:"WhatsApp Proxy",tabStorage:"Storage & Media",tabLogs:"System Logs",prefixTitle:"Bot Command Prefix",prefixDesc:"The leading character or symbol that triggers commands in WhatsApp chats (e.g. !help, /ping)",prefixPlaceholder:"e.g. !",prefixPresets:"Common Quick Presets:",prefixPreview:"Live Command Syntax Preview:",prefixSaveBtn:"Save New Prefix",prefixUpdated:"Command prefix updated successfully!",prefixValidation:"Prefix must be 1 to 3 characters long",activePrefix:"Active Prefix",changePrefix:"Change Prefix",prefix:"Command Prefix",botTimezone:"Timezone",botTimezoneDesc:"IANA timezone used for prayer times, AI context, and cron schedules (e.g. Africa/Cairo)",botMinDelay:"Min Human Delay (ms)",botMaxDelay:"Max Human Delay (ms)",delaysDesc:"Simulated human typing pause before replying to avoid robotic triggers",shareSettingsTitle:"Share Settings",shareSettingsDesc:"Export your settings as a JSON file to share with friends, or import a friend's file. Secrets (API keys and passwords) are never exported and never overwritten by an import.",exportSettings:"Export settings",exportSettingsDesc:"A JSON file of the non-secret settings you changed",exportSettingsSuccess:"Settings exported",exportSavedTo:"Saved to",exportSettingsError:"Couldn't export the settings",importSettings:"Import from file",importSettingsError:"Invalid file — expected a Levix settings export",importTitle:"Import settings",importSummary:"This will apply to this install:",importSettingsCount:"settings",importPermissionsCount:"command permissions",importAliasesCount:"alias sets",importDisabledCount:"disabled commands",importPrefix:"Prefix",importApply:"Apply import",importSuccess:"Settings imported",importSkipped:"Skipped",importRestartNeeded:"Needs a bot restart to take effect",changePassword:"Change Dashboard Password",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm New Password",passwordMatchError:"Passwords do not match",passwordMinLength:"Password must be at least 8 characters long",passwordChangedSuccess:"Dashboard password changed successfully!",proxyTitle:"Outbound WhatsApp Proxy",proxyDesc:"Route Baileys WhatsApp traffic through an HTTP or SOCKS5 proxy to bypass restrictions",proxyEnabled:"Enable Outbound Proxy for WhatsApp",proxyProtocol:"Proxy Protocol",proxyHost:"Proxy Host / IP",proxyPort:"Proxy Port",proxyUsername:"Username (Optional)",proxyPassword:"Password (Optional)",proxyApplyHint:"⚠️ Note: To apply proxy changes, go to Connection and reconnect WhatsApp.",storageTitle:"Data Retention & Storage Limits",storageDesc:"Configure data cleanup thresholds, forward score retention, and fetch limits",forwardTtl:"Forward Score Expiry (Days)",forwardTtlDesc:"Automatically purge forwarded message scores after this many days",maxFetchBytes:"Web Fetch Byte Limit",maxFetchBytesDesc:"Maximum response body size AI tools are allowed to fetch from web pages (default: 512KB)",ffmpegPath:"Custom FFmpeg Binary Path (Optional)",weatherApiKey:"OpenWeatherMap API Key (Optional)",chooseLanguage:"Choose Language",langCardTitle:"Interface Language: English (LTR)",langCardDesc:"Full bidirectional layout support with optimized Arabic RTL & English LTR",langSwitchBtn:"التبديل إلى العربية",langName:"English",interfaceLanguage:"Dashboard Interface Language",interfaceLanguageDesc:"Instantly toggle between Arabic (RTL) and English (LTR)",botPort:"Control Panel Port",botPortHint:"* Changing port takes effect on next process restart",searchPlaceholder:"Search commands or aliases...",thCommand:"Command",thAliases:"Aliases",thDescription:"Description",thScope:"Scope",thRequiredRole:"Required Role",thStatus:"Status",thGroupName:"Group Name",thGroupJid:"Group JID",thMembers:"Members",thAntiLink:"Anti-Link",thMedia:"Media",thWelcome:"Welcome",thTarget:"Target",thMessage:"Message",thSchedule:"Schedule",thType:"Type",thDelivery:"Delivery Status",thActions:"Actions",scheduleNewMsg:"Schedule New Message",liveServerLogs:"Live Server Logs",clearLogs:"Clear Logs",allLogs:"All Levels",noLogs:"No log entries to display.",logSourceBot:"Bot",logSourceHost:"Android host",shareLogs:"Share logs",share:"Share",savedSuccessfully:"Settings saved successfully!",saveFailed:"Failed to save settings.",connectionStatusUpdated:"Connection status updated.",networkError:"Network error connecting to server.",loading:"Loading...",aiAssistantDesc:"Autonomous tool-calling AI agent with long-term memory",settingsSub:"Prefix, delays, integrations, & security",editAliases:"Edit Aliases",aliasesFor:"Aliases for",addAlias:"Add Alias",newAliasPlaceholder:"Type new alias...",noAliases:"No custom aliases",aliasesHelp:"Aliases allow invoking this command using alternative names.",aliasAlreadyAdded:"Alias already added",aliasScriptArabic:"Arabic alias",aliasScriptLatin:"Latin alias",commandsSub:"Manage role permissions, edit aliases, or enable/disable bot commands live",editPrefixHint:"Click to change prefix",usage:"Usage",usageHint:"The command as it is sent in WhatsApp",noMatchingCommands:"No commands match your search.",commandEnabled:"Command '{name}' enabled",commandDisabled:"Command '{name}' disabled",permissionUpdated:"Permission for '{name}' updated",scopeAll:"All",scopeGroup:"Group",scopePrivate:"Private",permMembers:"Members (Everyone)",permAdminsOnly:"Group Admins",permAdminsOwner:"Group Admins or Owner",permOwnerOnly:"Bot Owner Only",selectRecipient:"Select Target Chat",searchRecipients:"Search by name or phone...",recipients:"Recipients",chooseChat:"Choose a contact or group...",noRecipientsFound:"No matching chats found",pickPhoneContact:"From phone book",pickPhoneContactHint:"Pick a contact from this Android phone",maxSchedulesReached:"Maximum limit reached (3 scheduled messages)",limitReached:"Limit Reached",scheduleType:"Schedule Type",scheduleRecurring:"Recurring",scheduleOnce:"One-Off (Specific Date & Time)",repeat:"Repeat",repeatDaily:"Every day",repeatWeekly:"Every week",repeatMonthly:"Every month",repeatHourly:"Every N hours",weekdays:"Weekdays",dayOfMonth:"Day of month",monthDayHint:"If the month is shorter than the chosen day (for example 31 in February), that month is skipped.",everyHours:"Every how many hours",atMinute:"At minute",sendTime:"Send time",deliveryDateTime:"Delivery Date & Time",timezoneLabel:"Timezone",recurrencePreview:"Preview",weekdaySun:"Sun",weekdayMon:"Mon",weekdayTue:"Tue",weekdayWed:"Wed",weekdayThu:"Thu",weekdayFri:"Fri",weekdaySat:"Sat",contactFallback:"Contact",groupFallback:"Group",hoursUnit:"hours",messageText:"Message Text",messagePlaceholder:"Message to be sent automatically...",scheduleAction:"Schedule",scheduledCount:"scheduled",headerSubtitle:"Recurring and one-off automated message deliveries",noSchedules:"No active schedules found.",typeRecurring:"Recurring",typeOnce:"Once",deliveryFailed:"Failed",deliveryActive:"Active",changeChat:"Change chat",weekdayRequired:"Select at least one weekday",tabIntegrations:"Integrations",integrationsDesc:"API keys for external services connected to the bot",youtubeApiKey:"YouTube Data API Key (Optional)",selectModel:"Select a model from list...",availableModels:"Models Available from Provider",customModel:"Or type a custom model name",sessionStatus:"Session Status",sessionActive:"Session active and receiving messages",sessionOffline:"Session currently offline",connectedNumber:"Linked Phone",tabFeedback:"Feedback & Support",feedbackTitle:"Send feedback to the developer",feedbackDesc:"A bug, an idea, or a question — it is delivered straight to the person who builds Levix. No middle layer, no ticket queue.",feedbackTopicLabel:"What is this about?",feedbackTopicBug:"Something is broken",feedbackTopicIdea:"An idea or request",feedbackTopicQuestion:"A question",feedbackTopicPraise:"It works well",feedbackTopicOther:"Something else",feedbackMessageLabel:"Your message",feedbackMessagePlaceholder:"What happened, what you expected, and what you were doing at the time. Detail helps — it is read by a person.",feedbackCharsNeeded:"more characters",feedbackRatingLabel:"How is Levix working out? (optional)",feedbackContactLabel:"How to reach you (optional)",feedbackContactPlaceholder:"Email, or a WhatsApp/Telegram handle — only if you want an answer",feedbackSendBtn:"Send feedback",feedbackSending:"Sending...",feedbackSent:"Sent. Thank you!",feedbackSentDesc:"It reached the developer of Levix. If you left a way to reach you, expect a reply.",feedbackSendAnother:"Send something else",feedbackWhatIsSent:"What goes with your message",feedbackWhatIsSentDesc:"Your text, the topic, and the rating and contact if you added them, the file you attached if any, plus the Levix version and the platform it runs on. No WhatsApp message, chat, contact or key is ever attached, and nothing is sent until you press Send.",feedbackRuntimeLabel:"Attached to the message",feedbackGithubHint:"For reproducible bugs you want tracked in public with logs, open a GitHub issue.",feedbackOpenGithub:"Open an Issue on GitHub",feedbackAttach:"Attach a file",feedbackAttachmentHint:"Optional — a screenshot or log up to {max} MB",feedbackRemoveAttachment:"Remove attachment",feedbackFileTooLarge:"The file is too large — the limit is {max} MB",scheduleAttachMedia:"Attach media",scheduleMediaHint:"Optional — an image, video, audio or document up to {max} MB",scheduleRemoveMedia:"Remove media",scheduleDetails:"Schedule details",detailMedia:"Media",detailLastRun:"Last run",detailError:"Error",detailCreated:"Created",retryDelivery:"Retry delivery",mediaKindImage:"Image",mediaKindVideo:"Video",mediaKindAudio:"Audio",mediaKindDocument:"Document",stickerStudio:"Sticker Studio",stickersDesc:"Create and manage WhatsApp stickers",library:"Library",packs:"Packs",favorites:"Favorites",create:"Create",recent:"Recent",allStickers:"All",static:"Static",animated:"Animated",noPack:"No pack",anyPack:"Any pack",newPack:"New pack…",addToPack:"Add to pack",moveToPack:"Move to pack",removeFromPack:"Remove from pack",favorite:"Favorite",unfavorite:"Unfavorite",download:"Download",convertToImage:"Convert to image",shareSticker:"Share",sendViaWhatsapp:"Send via WhatsApp",deleteEverywhere:"Delete everywhere",deleteKeepStickers:"Delete pack only (keep stickers)",deletePackAndStickers:"Delete pack and stickers not in other packs",openInCreate:"Open in Create",packName:"Pack name",mergeInto:"Merge into another pack",merge:"Merge",stickersKept:"Stickers will be kept",trim:"Trim",background:"Background",transparent:"Transparent",white:"White",black:"Black",customColor:"Custom color",removePlainBackground:"Remove plain background",fit:"Fit",contain:"Contain",cover:"Cover",zoom:"Zoom",panX:"Pan X",panY:"Pan Y",rotate:"Rotate",addText:"Add text",addEmoji:"Add emoji",createAnother:"Create another",qualityReduced:"Sticker was compressed to fit WhatsApp's limit",alreadyInLibrary:"This sticker already exists in your library",encoderMissing:"No WebP encoder available. Sticker creation is disabled.",tryAgain:"Try again",loadMore:"Load more",selectAll:"Select all",clearSelection:"Clear selection",deleteConfirm:"Are you sure you want to delete?",nSelected:"{n} selected",sizeLbl:"Size:",formatLbl:"Format:",packsLbl:"Packs:",gifBadge:"Animated",startDur:"Start: {start}s | Duration: {dur}s",outlineBox:"Outline/Background",toolsLbl:"Tools",clearLbl:"Clear",resetPan:"Reset",clickOrDrag:"Click or drag an image/video to upload",creatingSticker:"Creating sticker…",goToLibrary:"Go to Library",loadingLbl:"Loading…",selectPack:"Select a pack…",noPacksCreated:"No packs created yet",packCreated:"Pack created",packDeleted:"Pack deleted",packRenamed:"Pack renamed",failedToCreatePack:"Failed to create pack",failedToDeletePack:"Failed to delete pack",failedToRenamePack:"Failed to rename pack",failedToMerge:"Failed to merge",someStickersInPacks:"Some stickers are in packs: {packs}",deleteEverywherePrompt:"Delete them everywhere?",packsMerged:"Packs merged",emptyLibrary:"Library is empty",jobStage_probing:"Probing…",jobStage_decoding:"Decoding…",jobStage_encoding:"Encoding…",jobStage_optimizing:"Optimizing…",jobStage_saving:"Saving…",jobQueued:"Queued…",sortNewest:"Newest",sortOldest:"Oldest",sortName:"Name",sortRecent:"Recently used",unlinkStickersWarning:"Your sticker library will also be cleared.",stickerErr_NO_MEDIA:"Send an image, video or sticker.",stickerErr_UNSUPPORTED_TYPE:"Unsupported file type.",stickerErr_TOO_LARGE:"File is too large.",stickerErr_DIMENSIONS_TOO_LARGE:"Image dimensions are too large.",stickerErr_VIDEO_TOO_LONG:"Video is too long.",stickerErr_CORRUPT:"File is corrupt.",stickerErr_CONVERSION_FAILED:"Sticker conversion failed.",stickerErr_OUTPUT_TOO_LARGE:"Output sticker is too large.",stickerErr_ENCODER_MISSING:"Server does not support WebP encoding.",stickerErr_TIMEOUT:"Processing timed out.",stickerErr_BUSY:"Server is busy, try again later.",stickerErr_NOT_FOUND:"Sticker not found.",stickerErr_PACK_NOT_FOUND:"Pack not found.",stickerErr_PACK_EXISTS:"Pack name already exists.",stickerErr_INVALID_NAME:"Invalid pack name.",stickerErr_INVALID_OPTIONS:"Invalid edit options.",stickerErr_LIBRARY_FULL:"Library is full.",stickerErr_PACK_LIMIT:"Pack limit reached.",stickerErr_IN_USE:"Sticker is in use by packs.",stickerErr_STORAGE_UNAVAILABLE:"Storage unavailable.",stickerErr_NOT_CONNECTED:"WhatsApp is not connected.",stickerErr_INTERNAL:"Internal server error.",stickerErr_CANCELLED:"Conversion was cancelled.",stickerLibraryLimit:"Sticker library limit",stickerLibraryLimitDesc:"How many stickers one person can keep in Sticker Studio.",stickerUploadInfo:"{kind} · {size} KB",stickerRemoveHint:"Flat background removal is applied when you create the sticker.",stickerSelect:"Select sticker",stickerOpen:"Open sticker details",stickerShareSaved:"Saved to {dir}",stickerDrag:"Drop a file here or choose one",stickerAlignmentStart:"Start",stickerAlignmentCenter:"Center",stickerAlignmentEnd:"End",stickerKindImage:"Image",stickerKindGif:"GIF",stickerKindVideo:"Video",stickerKindWebp:"WebP sticker",stickerDeletePackWarning:"The sticker will be removed from every pack.",stickerSendLimit:"Only a limited number of stickers can be sent at once.",stickerExportLimit:"Select fewer stickers to export.",tolerance:"Tolerance",stickerName:"Sticker name",stickerNamePlaceholder:"Optional name…",trimStart:"Start",trimDuration:"Duration",trimSeconds:"seconds",textContent:"Text",textSize:"Size",textColor:"Color",textAlignment:"Alignment",textOutline:"Outline",textBackground:"Background pill",layerRotation:"Rotation",deleteLayer:"Delete layer",noLayers:"No overlay layers",reorderUp:"Move earlier",reorderDown:"Move later",renamePack:"Rename pack",deletePack:"Delete pack",packEmpty:"This pack is empty",noPacks:"No packs yet",createFirstPack:"Create your first pack",stickerCount:"{n} stickers",notConnectedHint:"Connect WhatsApp first",exportFirstFrame:"Exports the first frame",downloadWebp:"Download WebP",downloadPng:"Download PNG",downloadGif:"Download GIF",reorderDragHint:"Drag to reorder",saved:"Saved",createBtn:"Create sticker",uploadHint:"Accepts JPEG, PNG, WebP, GIF, MP4, WebM",stickerCreated:"Sticker created!",stickerSent:"Sticker sent",stickersSent:"Stickers sent",stickerPreview:"Sticker preview",firstFrameHint:"An animated sticker exports its first frame as a still image.",gifOnlyAnimated:"GIF export is only available for animated stickers.",rename:"Rename",inUsePacksLabel:"In these packs",notInPack:"Not in any pack",retryLoad:"Try again",showingCount:"Showing {shown} of {total}",emojiPaletteLabel:"Emoji",customEmoji:"Other emoji",emojiInputLabel:"Type an emoji",textPlaceholder:"Text",layerSelected:"Selected layer",selectVisible:"Select visible",downloadZip:"Download ZIP",noRecipients:"No chats found",recipientGroup:"Group",recipientContact:"Contact",sending:"Sending…",deleteStickersTitle:"Delete stickers",inUseBody:"This sticker is in a pack. Deleting it removes it from those packs too.",inUseBulkBody:"Some selected stickers are in packs. They were not deleted.",deleteEverywhereHint:"Delete everywhere removes the stickers from every pack and from the library.",packNameLength:"A pack name must be between 1 and 40 characters.",newPackPlaceholder:"Pack name",createPack:"Create pack",skippedOther:"Some stickers could not be updated.",addedToPack:"Added to the pack",movedToPack:"Moved to the pack",removedFromPack:"Removed from the pack",renamed:"Name updated",downloaded:"Download started",shareDone:"Shared",backToPacks:"All packs",confirmMerge:"Merge packs",mergeTitle:"Merge into another pack",mergeConfirmBody:"Stickers stay in the library. Items from this pack are appended to the other pack, duplicates are skipped, and this pack is then deleted.",trimApplied:"The trim is applied when the sticker is created.",gifTrimNote:"GIF trim is applied on create and may not match the preview frame for frame.",animatedUnavailable:"This server cannot encode animated stickers.",targetPack:"Add to pack",previewStage:"Sticker preview",rotateQuarter:"Rotate 90 degrees",uploadReady:"File ready",stickerNameTooLong:"A sticker name can be at most 60 characters.",noDestinationPack:"Choose a pack to merge into.",deletePackTitle:"Delete pack",openPack:"Open pack",searchStickers:"Search stickers",sortBy:"Sort",filterBy:"Filter",packFilter:"Pack",noResults:"No stickers match this search",favoritesEmpty:"No favorite stickers yet",recentEmpty:"No stickers used or created in the last 30 days",favoriteBadge:"Favorite",deleted:"Deleted"}},X0=S.createContext(null),VN=({children:l})=>{const[i,c]=S.useState(()=>{const h=localStorage.getItem("levix_lang");return h==="ar"||h==="en"?h:navigator.language.startsWith("ar")?"ar":"en"}),o=i==="ar"?"rtl":"ltr";S.useEffect(()=>{localStorage.setItem("levix_lang",i),document.documentElement.lang=i,document.documentElement.dir=o},[i,o]);const d=h=>{c(h)},f=S.useMemo(()=>(h,x)=>(Ad[i]||Ad.en)[h]??Ad.en[h]??x??String(h),[i]);return s.jsx(X0.Provider,{value:{language:i,direction:o,setLanguage:d,t:f},children:l})},We=()=>{const l=S.useContext(X0);if(!l)throw new Error("useI18n must be used within an I18nProvider");return l},YN=({onToggleMobileMenu:l,title:i,status:c})=>{var O;const{language:o,setLanguage:d,t:f}=We(),[h,x]=Sl.useState(!1),[p,v]=Sl.useState(!1),y=Sl.useRef(null),b=Sl.useRef(null);Sl.useEffect(()=>{if(!h&&!p)return;const A=W=>{y.current&&!y.current.contains(W.target)&&x(!1),b.current&&!b.current.contains(W.target)&&v(!1)},q=W=>{W.key==="Escape"&&(x(!1),v(!1))};return document.addEventListener("mousedown",A),document.addEventListener("keydown",q),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",q)}},[h,p]);const[j,z]=Sl.useState(()=>{const A=localStorage.getItem("levix_theme");return A?(document.documentElement.setAttribute("data-theme",A),A):document.documentElement.getAttribute("data-theme")||"dark"}),C=()=>{const A=j==="dark"?"light":"dark";z(A),document.documentElement.setAttribute("data-theme",A),localStorage.setItem("levix_theme",A)},w=typeof((O=window.LevixHost)==null?void 0:O.closePanel)=="function";return s.jsxs("header",{className:"h-16 sticky top-0 z-30 flex items-center justify-between px-4 md:px-6 bg-panel/85 backdrop-blur-md border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("button",{type:"button",onClick:l,className:"inline-flex md:hidden items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",id:"mobile-menu-btn","aria-label":"Open navigation menu",children:s.jsx(EN,{size:20})}),s.jsx("h1",{className:"text-lg md:text-xl font-bold tracking-tight text-text-main truncate",title:i,children:i})]}),s.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[s.jsxs("div",{className:"relative",ref:y,children:[s.jsx("button",{type:"button",onClick:()=>x(A=>!A),className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",title:f("chooseLanguage","Choose Language"),"aria-label":f("chooseLanguage","Choose Language"),"aria-expanded":h,"aria-haspopup":"true",id:"btn-header-lang",children:s.jsx(Ri,{size:18,className:"text-brand-cyan"})}),h&&s.jsxs("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"btn-header-lang",className:"absolute end-0 mt-2 w-48 rounded-2xl border border-line bg-panel-solid shadow-2xl p-1.5 z-50 ring-1 ring-black/10 animate-in fade-in zoom-in-95 duration-150",children:[s.jsx("div",{className:"px-2.5 py-1.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider",children:f("chooseLanguage","Choose Language")}),s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{d("ar"),x(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-xs md:text-sm font-medium rounded-lg transition-colors ${o==="ar"?"bg-brand-blue/15 text-brand-cyan font-bold":"text-text-main hover:bg-panel-hover"}`,children:[s.jsx("span",{children:"العربية"}),o==="ar"&&s.jsx(Di,{size:16,className:"text-brand-cyan"})]}),s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{d("en"),x(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-xs md:text-sm font-medium rounded-lg transition-colors ${o==="en"?"bg-brand-blue/15 text-brand-cyan font-bold":"text-text-main hover:bg-panel-hover"}`,children:[s.jsx("span",{children:"English"}),o==="en"&&s.jsx(Di,{size:16,className:"text-brand-cyan"})]})]})]}),s.jsxs("div",{className:"relative",ref:b,children:[s.jsx("button",{type:"button",onClick:()=>v(A=>!A),className:"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",title:f("moreActions","More actions"),"aria-label":f("moreActions","More actions"),"aria-expanded":p,"aria-haspopup":"true",id:"btn-header-more",children:s.jsx(Af,{size:18})}),p&&s.jsxs("div",{role:"menu","aria-orientation":"vertical","aria-labelledby":"btn-header-more",className:"absolute end-0 mt-2 w-52 rounded-2xl border border-line bg-panel-solid shadow-2xl p-1.5 z-50 ring-1 ring-black/10 animate-in fade-in zoom-in-95 duration-150",children:[w&&s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{v(!1),window.LevixHost.closePanel()},className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs md:text-sm font-medium rounded-lg text-text-main hover:bg-panel-hover transition-colors",children:[s.jsx(oN,{size:16,className:"rtl:-scale-x-100 text-brand-cyan"}),s.jsx("span",{children:f("backToApp")})]}),s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{C(),v(!1)},className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs md:text-sm font-medium rounded-lg text-text-main hover:bg-panel-hover transition-colors",children:[j==="dark"?s.jsx(HN,{size:16,className:"text-brand-cyan"}):s.jsx(zN,{size:16,className:"text-brand-cyan"}),s.jsx("span",{children:f(j==="dark"?"lightMode":"darkMode")})]}),s.jsx("div",{className:"my-1 border-t border-line"}),s.jsx("form",{action:"/logout",method:"POST",className:"m-0",children:s.jsxs("button",{type:"submit",role:"menuitem",className:"w-full flex items-center gap-2.5 px-3 py-2 text-xs md:text-sm font-medium rounded-lg text-danger hover:bg-danger/10 transition-colors",children:[s.jsx(CN,{size:16,className:"rtl:-scale-x-100"}),s.jsx("span",{children:f("logout")})]})})]})]})]})]})};function F0(l){var i,c,o="";if(typeof l=="string"||typeof l=="number")o+=l;else if(typeof l=="object")if(Array.isArray(l)){var d=l.length;for(i=0;i<d;i++)l[i]&&(c=F0(l[i]))&&(o&&(o+=" "),o+=c)}else for(c in l)l[c]&&(o&&(o+=" "),o+=c);return o}function IN(){for(var l,i,c=0,o="",d=arguments.length;c<d;c++)(l=arguments[c])&&(i=F0(l))&&(o&&(o+=" "),o+=i);return o}const KN=(l,i)=>{const c=new Array(l.length+i.length);for(let o=0;o<l.length;o++)c[o]=l[o];for(let o=0;o<i.length;o++)c[l.length+o]=i[o];return c},QN=(l,i)=>({classGroupId:l,validator:i}),Z0=(l=new Map,i=null,c)=>({nextPart:l,validators:i,classGroupId:c}),Do="-",_g=[],XN="arbitrary..",FN=l=>{const i=JN(l),{conflictingClassGroups:c,conflictingClassGroupModifiers:o}=l;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return ZN(h);const x=h.split(Do),p=x[0]===""&&x.length>1?1:0;return J0(x,p,i)},getConflictingClassGroupIds:(h,x)=>{if(x){const p=o[h],v=c[h];return p?v?KN(v,p):p:v||_g}return c[h]||_g}}},J0=(l,i,c)=>{if(l.length-i===0)return c.classGroupId;const d=l[i],f=c.nextPart.get(d);if(f){const v=J0(l,i+1,f);if(v)return v}const h=c.validators;if(h===null)return;const x=i===0?l.join(Do):l.slice(i).join(Do),p=h.length;for(let v=0;v<p;v++){const y=h[v];if(y.validator(x))return y.classGroupId}},ZN=l=>l.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=l.slice(1,-1),c=i.indexOf(":"),o=i.slice(0,c);return o?XN+o:void 0})(),JN=l=>{const{theme:i,classGroups:c}=l;return $N(c,i)},$N=(l,i)=>{const c=Z0();for(const o in l){const d=l[o];Df(d,c,o,i)}return c},Df=(l,i,c,o)=>{const d=l.length;for(let f=0;f<d;f++){const h=l[f];WN(h,i,c,o)}},WN=(l,i,c,o)=>{if(typeof l=="string"){ej(l,i,c);return}if(typeof l=="function"){tj(l,i,c,o);return}nj(l,i,c,o)},ej=(l,i,c)=>{const o=l===""?i:$0(i,l);o.classGroupId=c},tj=(l,i,c,o)=>{if(aj(l)){Df(l(o),i,c,o);return}i.validators===null&&(i.validators=[]),i.validators.push(QN(c,l))},nj=(l,i,c,o)=>{const d=Object.entries(l),f=d.length;for(let h=0;h<f;h++){const[x,p]=d[h];Df(p,$0(i,x),c,o)}},$0=(l,i)=>{let c=l;const o=i.split(Do),d=o.length;for(let f=0;f<d;f++){const h=o[f];let x=c.nextPart.get(h);x||(x=Z0(),c.nextPart.set(h,x)),c=x}return c},aj=l=>"isThemeGetter"in l&&l.isThemeGetter===!0,lj=l=>{if(l<1)return{get:()=>{},set:()=>{}};let i=0,c=Object.create(null),o=Object.create(null);const d=(f,h)=>{c[f]=h,i++,i>l&&(i=0,o=c,c=Object.create(null))};return{get(f){let h=c[f];if(h!==void 0)return h;if((h=o[f])!==void 0)return d(f,h),h},set(f,h){f in c?c[f]=h:d(f,h)}}},gf="!",Cg=":",sj=[],Eg=(l,i,c,o,d)=>({modifiers:l,hasImportantModifier:i,baseClassName:c,maybePostfixModifierPosition:o,isExternal:d}),ij=l=>{const{prefix:i,experimentalParseClassName:c}=l;let o=d=>{const f=[];let h=0,x=0,p=0,v;const y=d.length;for(let w=0;w<y;w++){const O=d[w];if(h===0&&x===0){if(O===Cg){f.push(d.slice(p,w)),p=w+1;continue}if(O==="/"){v=w;continue}}O==="["?h++:O==="]"?h--:O==="("?x++:O===")"&&x--}const b=f.length===0?d:d.slice(p);let j=b,z=!1;b.endsWith(gf)?(j=b.slice(0,-1),z=!0):b.startsWith(gf)&&(j=b.slice(1),z=!0);const C=v&&v>p?v-p:void 0;return Eg(f,z,j,C)};if(i){const d=i+Cg,f=o;o=h=>h.startsWith(d)?f(h.slice(d.length)):Eg(sj,!1,h,void 0,!0)}if(c){const d=o;o=f=>c({className:f,parseClassName:d})}return o},rj=l=>{const i=new Map;return l.orderSensitiveModifiers.forEach((c,o)=>{i.set(c,1e6+o)}),c=>{const o=[];let d=[];for(let f=0;f<c.length;f++){const h=c[f],x=h[0]==="[",p=i.has(h);x||p?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(h)):d.push(h)}return d.length>0&&(d.sort(),o.push(...d)),o}},oj=l=>({cache:lj(l.cacheSize),parseClassName:ij(l),sortModifiers:rj(l),postfixLookupClassGroupIds:cj(l),...FN(l)}),cj=l=>{const i=Object.create(null),c=l.postfixLookupClassGroups;if(c)for(let o=0;o<c.length;o++)i[c[o]]=!0;return i},uj=/\s+/,dj=(l,i)=>{const{parseClassName:c,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:h}=i,x=[],p=l.trim().split(uj);let v="";for(let y=p.length-1;y>=0;y-=1){const b=p[y],{isExternal:j,modifiers:z,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:O}=c(b);if(j){v=b+(v.length>0?" "+v:v);continue}let A=!!O,q;if(A){const M=w.substring(0,O);q=o(M);const k=q&&h[q]?o(w):void 0;k&&k!==q&&(q=k,A=!1)}else q=o(w);if(!q){if(!A){v=b+(v.length>0?" "+v:v);continue}if(q=o(w),!q){v=b+(v.length>0?" "+v:v);continue}A=!1}const W=z.length===0?"":z.length===1?z[0]:f(z).join(":"),Z=C?W+gf:W,re=Z+q;if(x.indexOf(re)>-1)continue;x.push(re);const F=d(q,A);for(let M=0;M<F.length;++M){const k=F[M];x.push(Z+k)}v=b+(v.length>0?" "+v:v)}return v},fj=(...l)=>{let i=0,c,o,d="";for(;i<l.length;)(c=l[i++])&&(o=W0(c))&&(d&&(d+=" "),d+=o);return d},W0=l=>{if(typeof l=="string")return l;let i,c="";for(let o=0;o<l.length;o++)l[o]&&(i=W0(l[o]))&&(c&&(c+=" "),c+=i);return c},mj=(l,...i)=>{let c,o,d,f;const h=p=>{const v=i.reduce((y,b)=>b(y),l());return c=oj(v),o=c.cache.get,d=c.cache.set,f=x,x(p)},x=p=>{const v=o(p);if(v)return v;const y=dj(p,c);return d(p,y),y};return f=h,(...p)=>f(fj(...p))},hj=[],_t=l=>{const i=c=>c[l]||hj;return i.isThemeGetter=!0,i.themeKey=l,i},ey=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ty=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,yj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ya=l=>pj.test(l),qe=l=>!!l&&!Number.isNaN(Number(l)),Qn=l=>!!l&&Number.isInteger(Number(l)),Td=l=>l.endsWith("%")&&qe(l.slice(0,-1)),ma=l=>xj.test(l),ny=()=>!0,Nj=l=>gj.test(l)&&!bj.test(l),Rf=()=>!1,jj=l=>yj.test(l),Sj=l=>vj.test(l),wj=l=>!ve(l)&&!je(l),kj=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),_j=l=>Za(l,sy,Rf),ve=l=>ey.test(l),jl=l=>Za(l,iy,Nj),Ag=l=>Za(l,Dj,qe),Cj=l=>Za(l,oy,ny),Ej=l=>Za(l,ry,Rf),Tg=l=>Za(l,ay,Rf),Aj=l=>Za(l,ly,Sj),xo=l=>Za(l,cy,jj),je=l=>ty.test(l),Si=l=>_l(l,iy),Tj=l=>_l(l,ry),zg=l=>_l(l,ay),zj=l=>_l(l,sy),Mj=l=>_l(l,ly),go=l=>_l(l,cy,!0),Oj=l=>_l(l,oy,!0),Za=(l,i,c)=>{const o=ey.exec(l);return o?o[1]?i(o[1]):c(o[2]):!1},_l=(l,i,c=!1)=>{const o=ty.exec(l);return o?o[1]?i(o[1]):c:!1},ay=l=>l==="position"||l==="percentage",ly=l=>l==="image"||l==="url",sy=l=>l==="length"||l==="size"||l==="bg-size",iy=l=>l==="length",Dj=l=>l==="number",ry=l=>l==="family-name",oy=l=>l==="number"||l==="weight",cy=l=>l==="shadow",Rj=()=>{const l=_t("color"),i=_t("font"),c=_t("text"),o=_t("font-weight"),d=_t("tracking"),f=_t("leading"),h=_t("breakpoint"),x=_t("container"),p=_t("spacing"),v=_t("radius"),y=_t("shadow"),b=_t("inset-shadow"),j=_t("text-shadow"),z=_t("drop-shadow"),C=_t("blur"),w=_t("perspective"),O=_t("aspect"),A=_t("ease"),q=_t("animate"),W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],re=()=>[...Z(),je,ve],F=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],k=()=>[je,ve,p],K=()=>[Ya,"full","auto",...k()],X=()=>[Qn,"none","subgrid",je,ve],ie=()=>["auto",{span:["full",Qn,je,ve]},Qn,je,ve],oe=()=>[Qn,"auto",je,ve],ce=()=>["auto","min","max","fr",je,ve],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...k()],J=()=>[Ya,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],ue=()=>[x,Ya,"screen","full","dvw","lvw","svw","min","max","fit",...k()],Ne=()=>[Ya,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],D=()=>[l,je,ve],ae=()=>[...Z(),zg,Tg,{position:[je,ve]}],ke=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ce=()=>["auto","cover","contain",zj,_j,{size:[je,ve]}],N=()=>[Td,Si,jl],E=()=>["","none","full",v,je,ve],le=()=>["",qe,Si,jl],se=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[qe,Td,zg,Tg],de=()=>["","none",C,je,ve],fe=()=>["none",qe,je,ve],xe=()=>["none",qe,je,ve],it=()=>[qe,je,ve],ne=()=>[Ya,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[ny],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[wj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",qe],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ya,ve,je,O]}],container:["container"],"container-type":[{"@container":["","normal","size",je,ve]}],"container-named":[kj],columns:[{columns:[qe,"auto",ve,je,x]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:re()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Qn,"auto",je,ve]}],basis:[{basis:[Ya,"full","auto",x,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Ya,"auto","initial","none",ve]}],grow:[{grow:["",qe,je,ve]}],shrink:[{shrink:["",qe,je,ve]}],order:[{order:[Qn,"first","last","none",je,ve]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...Ne()]}],"min-block-size":[{"min-block":["auto",...Ne()]}],"max-block-size":[{"max-block":["none",...Ne()]}],w:[{w:[x,"screen",...J()]}],"min-w":[{"min-w":[x,"screen","none",...J()]}],"max-w":[{"max-w":[x,"screen","none","prose",{screen:[h]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh","none",...J()]}],"font-size":[{text:["base",c,Si,jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Oj,Cj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Td,ve]}],"font-family":[{font:[Tj,Ej,i]}],"font-features":[{"font-features":[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,je,ve]}],"line-clamp":[{"line-clamp":[qe,"none",je,Ag]}],leading:[{leading:["none",f,...k()]}],"list-image":[{"list-image":["none",je,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",je,jl]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[qe,"auto",je,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[Qn,je,ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:ke()}],"bg-size":[{bg:Ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qn,je,ve],radial:["",je,ve],conic:["",Qn,je,ve]},Mj,Aj]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,je,ve]}],"outline-w":[{outline:["",qe,Si,jl]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","inner","none",y,go,xo]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",b,go,xo]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[qe,jl]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",j,go,xo]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[qe,je,ve]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[je,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:ke()}],"mask-size":[{mask:Ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,ve]}],filter:[{filter:["","none",je,ve]}],blur:[{blur:de()}],brightness:[{brightness:[qe,je,ve]}],contrast:[{contrast:[qe,je,ve]}],"drop-shadow":[{"drop-shadow":["","none",z,go,xo]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",qe,je,ve]}],"hue-rotate":[{"hue-rotate":[qe,je,ve]}],invert:[{invert:["",qe,je,ve]}],saturate:[{saturate:[qe,je,ve]}],sepia:[{sepia:["",qe,je,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",je,ve]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[qe,je,ve]}],"backdrop-contrast":[{"backdrop-contrast":[qe,je,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,je,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,je,ve]}],"backdrop-invert":[{"backdrop-invert":["",qe,je,ve]}],"backdrop-opacity":[{"backdrop-opacity":[qe,je,ve]}],"backdrop-saturate":[{"backdrop-saturate":[qe,je,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,je,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",je,ve]}],ease:[{ease:["linear","initial",A,je,ve]}],delay:[{delay:[qe,je,ve]}],animate:[{animate:["none",q,je,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,ve]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[je,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],zoom:[{zoom:[Qn,je,ve]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je,ve]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[qe,Si,jl,Ag]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Lj=mj(Rj);function Ot(...l){return Lj(IN(l))}const Uj=({currentView:l,onSelectView:i,isOpenMobile:c,onCloseMobile:o})=>{const{t:d}=We(),f=window.__BRAND__||{name:"Levix",tagline:"Private control room",version:"",developer:"Abdelrhman Diab",studio:"Leviro",developerSite:"https://github.com/Abdodiab2005",studioSite:"https://leviro.net"},h=[{id:"overview",label:d("overview"),icon:wN},{id:"connection",label:d("connection"),icon:Li},{labelCategory:d("control")},{id:"commands",label:d("commands"),icon:Ss},{id:"ai",label:d("ai"),icon:Cf},{id:"groups",label:d("groups"),icon:Ns},{id:"schedules",label:d("schedules"),icon:ff},{id:"stickers",label:d("stickers"),icon:Of},{labelCategory:d("settings")},{id:"settings",label:d("settings"),icon:UN},{id:"logs",label:d("logs"),icon:So}];return s.jsxs(s.Fragment,{children:[c&&s.jsx("button",{type:"button",className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-40 md:hidden border-0 p-0 cursor-default",onClick:o,"aria-label":"Close mobile sidebar backdrop"}),s.jsxs("aside",{className:Ot("fixed top-0 bottom-0 start-0 z-50 w-72 md:w-64 md:static md:z-auto bg-panel border-e border-line flex flex-col transition-transform duration-200 ease-out",c?"translate-x-0":"max-md:-translate-x-full rtl:max-md:translate-x-full"),"aria-label":"Main Navigation",children:[s.jsxs("div",{className:"p-4 flex items-center justify-between border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-brand-blue via-brand-blue to-brand-cyan flex items-center justify-center shadow-md shadow-brand-blue/20 shrink-0 text-white",children:s.jsx(PN,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-extrabold text-base text-text-main leading-tight tracking-tight truncate",children:f.name}),s.jsx("div",{className:"text-xs text-muted leading-none truncate mt-0.5",children:f.tagline})]})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex md:hidden items-center justify-center w-10 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors shrink-0","aria-label":"Close menu",children:s.jsx(kl,{size:18})})]}),s.jsx("nav",{className:"flex-1 overflow-y-auto p-3 space-y-1",children:h.map(x=>{if(x.labelCategory)return s.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-faint",children:x.labelCategory},`cat-${x.labelCategory}`);if(!x.icon)return null;const p=x.icon,v=l===x.id;return s.jsxs("button",{type:"button",onClick:()=>{x.id&&(i(x.id),o())},className:Ot("w-full flex items-center gap-3 px-3.5 py-2.5 rounded-xl font-medium text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 text-start min-h-[44px]",v?"bg-brand-blue text-white shadow-md shadow-brand-blue/25 font-bold":"text-muted hover:bg-panel-hover hover:text-text-main"),children:[s.jsx(p,{size:20,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:x.label})]},x.id)})}),s.jsxs("div",{className:"p-4 border-t border-line text-xs text-faint flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted",children:[s.jsx("span",{className:"font-mono",children:f.version?`v${f.version}`:""}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(zf,{size:14,className:"text-brand-cyan"})," Local-first"]})]}),s.jsxs("div",{className:"text-[11px] text-muted truncate",children:["© ",f.copyrightYear||2026," ",s.jsx("a",{href:f.developerSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:f.developer})," ","(",s.jsx("a",{href:f.studioSite||"#",target:"_blank",rel:"noopener noreferrer",className:"text-brand-cyan hover:underline",children:f.studio}),")"]})]})]})]})},uy=S.createContext(null),Bj=({children:l})=>{const[i,c]=S.useState([]),o=S.useCallback(f=>{c(h=>h.filter(x=>x.id!==f))},[]),d=S.useCallback((f,h="info",x=4e3)=>{const p=Math.random().toString(36).slice(2,9);c(v=>[...v,{id:p,message:f,type:h,duration:x}]),setTimeout(()=>o(p),x)},[o]);return s.jsxs(uy.Provider,{value:{toast:d},children:[l,s.jsx("div",{className:"fixed bottom-5 end-5 z-50 flex flex-col gap-2.5 max-w-sm w-full px-4 pointer-events-none","aria-live":"polite",children:i.map(f=>s.jsxs("div",{className:`pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-xl border bg-panel-raised/95 backdrop-blur-md shadow-xl text-xs md:text-sm text-text-main transition-all ${f.type==="success"?"border-ok/35":f.type==="error"?"border-danger/35":f.type==="warning"?"border-warn/35":"border-line"}`,children:[f.type==="success"&&s.jsx(js,{size:18,className:"text-ok shrink-0"}),f.type==="error"&&s.jsx(pN,{size:18,className:"text-danger shrink-0"}),f.type==="warning"&&s.jsx(Ti,{size:18,className:"text-warn shrink-0"}),f.type==="info"&&s.jsx(SN,{size:18,className:"text-info shrink-0"}),s.jsx("span",{className:"flex-1 font-medium",children:f.message}),s.jsx("button",{type:"button",onClick:()=>o(f.id),className:"inline-flex items-center justify-center w-6 h-6 rounded-lg text-muted hover:text-text-main hover:bg-panel-hover transition-colors shrink-0","aria-label":"Dismiss notification",children:s.jsx(kl,{size:14})})]},f.id))})]})},Gt=()=>{const l=S.useContext(uy);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},Jn=Object.create(null);Jn.open="0";Jn.close="1";Jn.ping="2";Jn.pong="3";Jn.message="4";Jn.upgrade="5";Jn.noop="6";const wo=Object.create(null);Object.keys(Jn).forEach(l=>{wo[Jn[l]]=l});const bf={type:"error",data:"parser error"},dy=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",fy=typeof ArrayBuffer=="function",my=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l&&l.buffer instanceof ArrayBuffer,Lf=({type:l,data:i},c,o)=>dy&&i instanceof Blob?c?o(i):Mg(i,o):fy&&(i instanceof ArrayBuffer||my(i))?c?o(i):Mg(new Blob([i]),o):o(Jn[l]+(i||"")),Mg=(l,i)=>{const c=new FileReader;return c.onload=function(){const o=c.result.split(",")[1];i("b"+(o||""))},c.readAsDataURL(l)};function Og(l){return l instanceof Uint8Array?l:l instanceof ArrayBuffer?new Uint8Array(l):new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}let zd;function Hj(l,i){if(dy&&l.data instanceof Blob)return l.data.arrayBuffer().then(Og).then(i);if(fy&&(l.data instanceof ArrayBuffer||my(l.data)))return i(Og(l.data));Lf(l,!1,c=>{zd||(zd=new TextEncoder),i(zd.encode(c))})}const Dg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let l=0;l<Dg.length;l++)Ci[Dg.charCodeAt(l)]=l;const qj=l=>{let i=l.length*.75,c=l.length,o,d=0,f,h,x,p;l[l.length-1]==="="&&(i--,l[l.length-2]==="="&&i--);const v=new ArrayBuffer(i),y=new Uint8Array(v);for(o=0;o<c;o+=4)f=Ci[l.charCodeAt(o)],h=Ci[l.charCodeAt(o+1)],x=Ci[l.charCodeAt(o+2)],p=Ci[l.charCodeAt(o+3)],y[d++]=f<<2|h>>4,y[d++]=(h&15)<<4|x>>2,y[d++]=(x&3)<<6|p&63;return v},Gj=typeof ArrayBuffer=="function",Uf=(l,i)=>{if(typeof l!="string")return{type:"message",data:hy(l,i)};const c=l.charAt(0);return c==="b"?{type:"message",data:Pj(l.substring(1),i)}:wo[c]?l.length>1?{type:wo[c],data:l.substring(1)}:{type:wo[c]}:bf},Pj=(l,i)=>{if(Gj){const c=qj(l);return hy(c,i)}else return{base64:!0,data:l}},hy=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}},py="",Vj=(l,i)=>{const c=l.length,o=new Array(c);let d=0;l.forEach((f,h)=>{Lf(f,!1,x=>{o[h]=x,++d===c&&i(o.join(py))})})},Yj=(l,i)=>{const c=l.split(py),o=[];for(let d=0;d<c.length;d++){const f=Uf(c[d],i);if(o.push(f),f.type==="error")break}return o};function Ij(){return new TransformStream({transform(l,i){Hj(l,c=>{const o=c.length;let d;if(o<126)d=new Uint8Array(1),new DataView(d.buffer).setUint8(0,o);else if(o<65536){d=new Uint8Array(3);const f=new DataView(d.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{d=new Uint8Array(9);const f=new DataView(d.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}l.data&&typeof l.data!="string"&&(d[0]|=128),i.enqueue(d),i.enqueue(c)})}})}let Md;function bo(l){return l.reduce((i,c)=>i+c.length,0)}function yo(l,i){if(l[0].length===i)return l.shift();const c=new Uint8Array(i);let o=0;for(let d=0;d<i;d++)c[d]=l[0][o++],o===l[0].length&&(l.shift(),o=0);return l.length&&o<l[0].length&&(l[0]=l[0].slice(o)),c}function Kj(l,i){Md||(Md=new TextDecoder);const c=[];let o=0,d=-1,f=!1;return new TransformStream({transform(h,x){for(c.push(h);;){if(o===0){if(bo(c)<1)break;const p=yo(c,1);f=(p[0]&128)===128,d=p[0]&127,d<126?o=3:d===126?o=1:o=2}else if(o===1){if(bo(c)<2)break;const p=yo(c,2);d=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),o=3}else if(o===2){if(bo(c)<8)break;const p=yo(c,8),v=new DataView(p.buffer,p.byteOffset,p.length),y=v.getUint32(0);if(y>Math.pow(2,21)-1){x.enqueue(bf);break}d=y*Math.pow(2,32)+v.getUint32(4),o=3}else{if(bo(c)<d)break;const p=yo(c,d);x.enqueue(Uf(f?p:Md.decode(p),i)),o=0}if(d===0||d>l){x.enqueue(bf);break}}}})}const xy=4;function St(l){if(l)return Qj(l)}function Qj(l){for(var i in St.prototype)l[i]=St.prototype[i];return l}St.prototype.on=St.prototype.addEventListener=function(l,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+l]=this._callbacks["$"+l]||[]).push(i),this};St.prototype.once=function(l,i){function c(){this.off(l,c),i.apply(this,arguments)}return c.fn=i,this.on(l,c),this};St.prototype.off=St.prototype.removeListener=St.prototype.removeAllListeners=St.prototype.removeEventListener=function(l,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var c=this._callbacks["$"+l];if(!c)return this;if(arguments.length==1)return delete this._callbacks["$"+l],this;for(var o,d=0;d<c.length;d++)if(o=c[d],o===i||o.fn===i){c.splice(d,1);break}return c.length===0&&delete this._callbacks["$"+l],this};St.prototype.emit=function(l){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),c=this._callbacks["$"+l],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(c){c=c.slice(0);for(var o=0,d=c.length;o<d;++o)c[o].apply(this,i)}return this};St.prototype.emitReserved=St.prototype.emit;St.prototype.listeners=function(l){return this._callbacks=this._callbacks||{},this._callbacks["$"+l]||[]};St.prototype.hasListeners=function(l){return!!this.listeners(l).length};const Ho=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,c)=>c(i,0),En=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Xj="arraybuffer";function gy(l,...i){return i.reduce((c,o)=>(l.hasOwnProperty(o)&&(c[o]=l[o]),c),{})}const Fj=En.setTimeout,Zj=En.clearTimeout;function qo(l,i){i.useNativeTimers?(l.setTimeoutFn=Fj.bind(En),l.clearTimeoutFn=Zj.bind(En)):(l.setTimeoutFn=En.setTimeout.bind(En),l.clearTimeoutFn=En.clearTimeout.bind(En))}const Jj=1.33;function $j(l){return typeof l=="string"?Wj(l):Math.ceil((l.byteLength||l.size)*Jj)}function Wj(l){let i=0,c=0;for(let o=0,d=l.length;o<d;o++)i=l.charCodeAt(o),i<128?c+=1:i<2048?c+=2:i<55296||i>=57344?c+=3:(o++,c+=4);return c}function by(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function eS(l){let i="";for(let c in l)l.hasOwnProperty(c)&&(i.length&&(i+="&"),i+=encodeURIComponent(c)+"="+encodeURIComponent(l[c]));return i}function tS(l){let i={},c=l.split("&");for(let o=0,d=c.length;o<d;o++){let f=c[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class nS extends Error{constructor(i,c,o){super(i),this.description=c,this.context=o,this.type="TransportError"}}class Bf extends St{constructor(i){super(),this.writable=!1,qo(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,c,o){return super.emitReserved("error",new nS(i,c,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const c=Uf(i,this.socket.binaryType);this.onPacket(c)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,c={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(c)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_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(i){const c=eS(i);return c.length?"?"+c:""}}class aS extends Bf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const c=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||c()})),this.writable||(o++,this.once("drain",function(){--o||c()}))}else c()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const c=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};Yj(i,this.socket.binaryType).forEach(c),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,Vj(i,c=>{this.doWrite(c,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",c=this.query||{};return this.opts.timestampRequests!==!1&&(c[this.opts.timestampParam]=by()),!this.supportsBinary&&!c.sid&&(c.b64=1),this.createUri(i,c)}}let yy=!1;try{yy=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const lS=yy;function sS(){}class iS extends aS{constructor(i){if(super(i),typeof location<"u"){const c=location.protocol==="https:";let o=location.port;o||(o=c?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||o!==i.port}}doWrite(i,c){const o=this.request({method:"POST",data:i});o.on("success",c),o.on("error",(d,f)=>{this.onError("xhr post error",d,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(c,o)=>{this.onError("xhr poll error",c,o)}),this.pollXhr=i}}class Zn extends St{constructor(i,c,o){super(),this.createRequest=i,qo(this,o),this._opts=o,this._method=o.method||"GET",this._uri=c,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var i;const c=gy(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");c.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(c);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let d in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(d)&&o.setRequestHeader(d,this._opts.extraHeaders[d])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var d;o.readyState===3&&((d=this._opts.cookieJar)===null||d===void 0||d.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(d){this.setTimeoutFn(()=>{this._onError(d)},0);return}typeof document<"u"&&(this._index=Zn.requestsCount++,Zn.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=sS,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Zn.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Zn.requestsCount=0;Zn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Rg);else if(typeof addEventListener=="function"){const l="onpagehide"in En?"pagehide":"unload";addEventListener(l,Rg,!1)}}function Rg(){for(let l in Zn.requests)Zn.requests.hasOwnProperty(l)&&Zn.requests[l].abort()}const rS=(function(){const l=vy({xdomain:!1});return l&&l.responseType!==null})();class oS extends iS{constructor(i){super(i);const c=i&&i.forceBase64;this.supportsBinary=rS&&!c}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Zn(vy,this.uri(),i)}}function vy(l){const i=l.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||lS))return new XMLHttpRequest}catch{}if(!i)try{return new En[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ny=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class cS extends Bf{get name(){return"websocket"}doOpen(){const i=this.uri(),c=this.opts.protocols,o=Ny?{}:gy(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,c,o)}catch(d){return this.emitReserved("error",d)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let c=0;c<i.length;c++){const o=i[c],d=c===i.length-1;Lf(o,this.supportsBinary,f=>{try{this.doWrite(o,f)}catch{}d&&Ho(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",c=this.query||{};return this.opts.timestampRequests&&(c[this.opts.timestampParam]=by()),this.supportsBinary||(c.b64=1),this.createUri(i,c)}}const Od=En.WebSocket||En.MozWebSocket;class uS extends cS{createSocket(i,c,o){return Ny?new Od(i,c,o):c?new Od(i,c):new Od(i)}doWrite(i,c){this.ws.send(c)}}class dS extends Bf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const c=Kj(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(c).getReader(),d=Ij();d.readable.pipeTo(i.writable),this._writer=d.writable.getWriter();const f=()=>{o.read().then(({done:x,value:p})=>{x||(this.onPacket(p),f())}).catch(x=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let c=0;c<i.length;c++){const o=i[c],d=c===i.length-1;this._writer.write(o).then(()=>{d&&Ho(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const fS={websocket:uS,webtransport:dS,polling:oS},mS=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,hS=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function yf(l){if(l.length>8e3)throw"URI too long";const i=l,c=l.indexOf("["),o=l.indexOf("]");c!=-1&&o!=-1&&(l=l.substring(0,c)+l.substring(c,o).replace(/:/g,";")+l.substring(o,l.length));let d=mS.exec(l||""),f={},h=14;for(;h--;)f[hS[h]]=d[h]||"";return c!=-1&&o!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=pS(f,f.path),f.queryKey=xS(f,f.query),f}function pS(l,i){const c=/\/{2,9}/g,o=i.replace(c,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function xS(l,i){const c={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,d,f){d&&(c[d]=f)}),c}const vf=typeof addEventListener=="function"&&typeof removeEventListener=="function",ko=[];vf&&addEventListener("offline",()=>{ko.forEach(l=>l())},!1);class Qa extends St{constructor(i,c){if(super(),this.binaryType=Xj,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(c=i,i=null),i){const o=yf(i);c.hostname=o.host,c.secure=o.protocol==="https"||o.protocol==="wss",c.port=o.port,o.query&&(c.query=o.query)}else c.host&&(c.hostname=yf(c.host).host);qo(this,c),this.secure=c.secure!=null?c.secure:typeof location<"u"&&location.protocol==="https:",c.hostname&&!c.port&&(c.port=this.secure?"443":"80"),this.hostname=c.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=c.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},c.transports.forEach(o=>{const d=o.prototype.name;this.transports.push(d),this._transportsByName[d]=o}),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},c),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=tS(this.opts.query)),vf&&(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"})},ko.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const c=Object.assign({},this.opts.query);c.EIO=xy,c.transport=i,this.id&&(c.sid=this.id);const o=Object.assign({},this.opts,{query:c,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&Qa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const c=this.createTransport(i);c.open(),this.setTransport(c)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",c=>this._onClose("transport close",c))}onOpen(){this.readyState="open",Qa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const c=new Error("server error");c.code=i.data,this._onError(c);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),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 i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let c=1;for(let o=0;o<this.writeBuffer.length;o++){const d=this.writeBuffer[o].data;if(d&&(c+=$j(d)),o>0&&c>this._maxPayload)return this.writeBuffer.slice(0,o);c+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,Ho(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,c,o){return this._sendPacket("message",i,c,o),this}send(i,c,o){return this._sendPacket("message",i,c,o),this}_sendPacket(i,c,o,d){if(typeof c=="function"&&(d=c,c=void 0),typeof o=="function"&&(d=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const f={type:i,data:c,options:o};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),d&&this.once("flush",d),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},c=()=>{this.off("upgrade",c),this.off("upgradeError",c),i()},o=()=>{this.once("upgrade",c),this.once("upgradeError",c)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}_onError(i){if(Qa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,c){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(),vf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ko.indexOf(this._offlineEventListener);o!==-1&&ko.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,c),this.writeBuffer=[],this._prevBufferLen=0}}}Qa.protocol=xy;class gS extends Qa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let c=this.createTransport(i),o=!1;Qa.priorWebsocketSuccess=!1;const d=()=>{o||(c.send([{type:"ping",data:"probe"}]),c.once("packet",b=>{if(!o)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",c),!c)return;Qa.priorWebsocketSuccess=c.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(y(),this.setTransport(c),c.send([{type:"upgrade"}]),this.emitReserved("upgrade",c),c=null,this.upgrading=!1,this.flush())})}else{const j=new Error("probe error");j.transport=c.name,this.emitReserved("upgradeError",j)}}))};function f(){o||(o=!0,y(),c.close(),c=null)}const h=b=>{const j=new Error("probe error: "+b);j.transport=c.name,f(),this.emitReserved("upgradeError",j)};function x(){h("transport closed")}function p(){h("socket closed")}function v(b){c&&b.name!==c.name&&f()}const y=()=>{c.removeListener("open",d),c.removeListener("error",h),c.removeListener("close",x),this.off("close",p),this.off("upgrading",v)};c.once("open",d),c.once("error",h),c.once("close",x),this.once("close",p),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||c.open()},200):c.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const c=[];for(let o=0;o<i.length;o++)~this.transports.indexOf(i[o])&&c.push(i[o]);return c}}let bS=class extends gS{constructor(i,c={}){const o=typeof i=="object",d=o?{...i}:{...c};(!d.transports||d.transports&&typeof d.transports[0]=="string")&&(d.transports=(d.transports||["polling","websocket","webtransport"]).map(f=>fS[f]).filter(f=>!!f)),super(o?d:i,d)}};function yS(l,i="",c){let o=l;c=c||typeof location<"u"&&location,l==null&&(l=c.protocol+"//"+c.host),typeof l=="string"&&(l.charAt(0)==="/"&&(l.charAt(1)==="/"?l=c.protocol+l:l=c.host+l),/^(https?|wss?):\/\//.test(l)||(typeof c<"u"?l=c.protocol+"//"+l:l="https://"+l),o=yf(l)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const f=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+f+":"+o.port+i,o.href=o.protocol+"://"+f+(c&&c.port===o.port?"":":"+o.port),o}const vS=typeof ArrayBuffer=="function",NS=l=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(l):l.buffer instanceof ArrayBuffer,jy=Object.prototype.toString,jS=typeof Blob=="function"||typeof Blob<"u"&&jy.call(Blob)==="[object BlobConstructor]",SS=typeof File=="function"||typeof File<"u"&&jy.call(File)==="[object FileConstructor]";function Hf(l){return vS&&(l instanceof ArrayBuffer||NS(l))||jS&&l instanceof Blob||SS&&l instanceof File}function _o(l,i){if(!l||typeof l!="object")return!1;if(Array.isArray(l)){for(let c=0,o=l.length;c<o;c++)if(_o(l[c]))return!0;return!1}if(Hf(l))return!0;if(l.toJSON&&typeof l.toJSON=="function"&&arguments.length===1)return _o(l.toJSON(),!0);for(const c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&_o(l[c]))return!0;return!1}function wS(l){const i=[],c=l.data,o=l;return o.data=Co(c,i),o.attachments=i.length,{packet:o,buffers:i}}function Co(l,i,c){if(!l)return l;if(Hf(l)){const o={_placeholder:!0,num:i.length};return i.push(l),o}else if(Array.isArray(l)){const o=new Array(l.length);for(let d=0;d<l.length;d++)o[d]=Co(l[d],i);return o}else if(typeof l=="object"&&!(l instanceof Date)){if(l.toJSON&&typeof l.toJSON=="function"&&!c)return Co(l.toJSON(),i,!0);const o={};for(const d in l)Object.prototype.hasOwnProperty.call(l,d)&&(o[d]=Co(l[d],i));return o}return l}function kS(l,i){return l.data=Nf(l.data,i),delete l.attachments,l}function Nf(l,i){if(!l)return l;if(l&&l._placeholder===!0){if(typeof l.num=="number"&&l.num>=0&&l.num<i.length)return i[l.num];throw new Error("illegal attachments")}else if(Array.isArray(l))for(let c=0;c<l.length;c++)l[c]=Nf(l[c],i);else if(typeof l=="object")for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&(l[c]=Nf(l[c],i));return l}const _S=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ke;(function(l){l[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK"})(Ke||(Ke={}));class CS{constructor(i){this.replacer=i}encode(i){return(i.type===Ke.EVENT||i.type===Ke.ACK)&&_o(i)?this.encodeAsBinary({type:i.type===Ke.EVENT?Ke.BINARY_EVENT:Ke.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let c=""+i.type;return(i.type===Ke.BINARY_EVENT||i.type===Ke.BINARY_ACK)&&(c+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(c+=i.nsp+","),i.id!=null&&(c+=i.id),i.data!=null&&(c+=JSON.stringify(i.data,this.replacer)),c}encodeAsBinary(i){const c=wS(i),o=this.encodeAsString(c.packet),d=c.buffers;return d.unshift(o),d}}class qf extends St{constructor(i){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof i=="function"?{reviver:i}:i)}add(i){let c;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");c=this.decodeString(i);const o=c.type===Ke.BINARY_EVENT;o||c.type===Ke.BINARY_ACK?(c.type=o?Ke.EVENT:Ke.ACK,this.reconstructor=new ES(c)):super.emitReserved("decoded",c)}else if(Hf(i)||i.base64)if(this.reconstructor)c=this.reconstructor.takeBinaryData(i),c&&(this.reconstructor=null,super.emitReserved("decoded",c));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let c=0;const o={type:Number(i.charAt(0))};if(Ke[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ke.BINARY_EVENT||o.type===Ke.BINARY_ACK){const f=c+1;for(;i.charAt(++c)!=="-"&&c!=i.length;);const h=i.substring(f,c);if(h!=Number(h)||i.charAt(c)!=="-")throw new Error("Illegal attachments");const x=Number(h);if(!AS(x)||x<1)throw new Error("Illegal attachments");if(x>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=x}if(i.charAt(c+1)==="/"){const f=c+1;for(;++c&&!(i.charAt(c)===","||c===i.length););o.nsp=i.substring(f,c)}else o.nsp="/";const d=i.charAt(c+1);if(d!==""&&Number(d)==d){const f=c+1;for(;++c;){const h=i.charAt(c);if(h==null||Number(h)!=h){--c;break}if(c===i.length)break}o.id=Number(i.substring(f,c+1))}if(i.charAt(++c)){const f=this.tryParse(i.substr(c));if(qf.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.opts.reviver)}catch{return!1}}static isPayloadValid(i,c){switch(i){case Ke.CONNECT:return Lg(c);case Ke.DISCONNECT:return c===void 0;case Ke.CONNECT_ERROR:return typeof c=="string"||Lg(c);case Ke.EVENT:case Ke.BINARY_EVENT:return Array.isArray(c)&&(typeof c[0]=="number"||typeof c[0]=="string"&&_S.indexOf(c[0])===-1);case Ke.ACK:case Ke.BINARY_ACK:return Array.isArray(c)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ES{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const c=kS(this.reconPack,this.buffers);return this.finishedReconstruction(),c}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const AS=Number.isInteger||function(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l};function Lg(l){return Object.prototype.toString.call(l)==="[object Object]"}const TS=Object.freeze(Object.defineProperty({__proto__:null,Decoder:qf,Encoder:CS,get PacketType(){return Ke}},Symbol.toStringTag,{value:"Module"}));function Rn(l,i,c){return l.on(i,c),function(){l.off(i,c)}}const zS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Sy extends St{constructor(i,c,o){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=i,this.nsp=c,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Rn(i,"open",this.onopen.bind(this)),Rn(i,"packet",this.onpacket.bind(this)),Rn(i,"error",this.onerror.bind(this)),Rn(i,"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(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...c){var o,d,f;if(zS.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(c.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(c),this;const h={type:Ke.EVENT,data:c};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof c[c.length-1]=="function"){const y=this.ids++,b=c.pop();this._registerAckCallback(y,b),h.id=y}const x=(d=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||d===void 0?void 0:d.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!x||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,c){var o;const d=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(d===void 0){this.acks[i]=c;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let x=0;x<this.sendBuffer.length;x++)this.sendBuffer[x].id===i&&this.sendBuffer.splice(x,1);c.call(this,new Error("operation has timed out"))},d),h=(...x)=>{this.io.clearTimeoutFn(f),c.apply(this,x)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...c){return new Promise((o,d)=>{const f=(h,x)=>h?d(h):o(x);f.withError=!0,c.push(f),this.emit(i,...c)})}_addToQueue(i){let c;typeof i[i.length-1]=="function"&&(c=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((d,...f)=>(this._queue[0],d!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),c&&c(d)):(this._queue.shift(),c&&c(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const c=this._queue[0];c.pending&&!i||(c.pending=!0,c.tryCount++,this.flags=c.flags,this.emit.apply(this,c.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Ke.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,c){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,c),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(o=>String(o.id)===i)){const o=this.acks[i];delete this.acks[i],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Ke.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.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 Ke.EVENT:case Ke.BINARY_EVENT:this.onevent(i);break;case Ke.ACK:case Ke.BINARY_ACK:this.onack(i);break;case Ke.DISCONNECT:this.ondisconnect();break;case Ke.CONNECT_ERROR:this.destroy();const o=new Error(i.data.message);o.data=i.data.data,this.emitReserved("connect_error",o);break}}onevent(i){const c=i.data||[];i.id!=null&&c.push(this.ack(i.id)),this.connected?this.emitEvent(c):this.receiveBuffer.push(Object.freeze(c))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const c=this._anyListeners.slice();for(const o of c)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const c=this;let o=!1;return function(...d){o||(o=!0,c.packet({type:Ke.ACK,id:i,data:d}))}}onack(i){const c=this.acks[i.id];typeof c=="function"&&(delete this.acks[i.id],c.withError&&i.data.unshift(null),c.apply(this,i.data))}onconnect(i,c){this.id=i,this.recovered=c&&this._pid===c,this._pid=c,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ke.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const c=this._anyListeners;for(let o=0;o<c.length;o++)if(i===c[o])return c.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const c=this._anyOutgoingListeners;for(let o=0;o<c.length;o++)if(i===c[o])return c.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const c=this._anyOutgoingListeners.slice();for(const o of c)o.apply(this,i.data)}}}function Cs(l){l=l||{},this.ms=l.min||100,this.max=l.max||1e4,this.factor=l.factor||2,this.jitter=l.jitter>0&&l.jitter<=1?l.jitter:0,this.attempts=0}Cs.prototype.duration=function(){var l=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),c=Math.floor(i*this.jitter*l);l=(Math.floor(i*10)&1)==0?l-c:l+c}return Math.min(l,this.max)|0};Cs.prototype.reset=function(){this.attempts=0};Cs.prototype.setMin=function(l){this.ms=l};Cs.prototype.setMax=function(l){this.max=l};Cs.prototype.setJitter=function(l){this.jitter=l};class jf extends St{constructor(i,c){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(c=i,i=void 0),c=c||{},c.path=c.path||"/socket.io",this.opts=c,qo(this,c),this.reconnection(c.reconnection!==!1),this.reconnectionAttempts(c.reconnectionAttempts||1/0),this.reconnectionDelay(c.reconnectionDelay||1e3),this.reconnectionDelayMax(c.reconnectionDelayMax||5e3),this.randomizationFactor((o=c.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new Cs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(c.timeout==null?2e4:c.timeout),this._readyState="closed",this.uri=i;const d=c.parser||TS;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=c.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var c;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(c=this.backoff)===null||c===void 0||c.setMin(i),this)}randomizationFactor(i){var c;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(c=this.backoff)===null||c===void 0||c.setJitter(i),this)}reconnectionDelayMax(i){var c;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(c=this.backoff)===null||c===void 0||c.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new bS(this.uri,this.opts);const c=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const d=Rn(c,"open",function(){o.onopen(),i&&i()}),f=x=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",x),i?i(x):this.maybeReconnectOnOpen()},h=Rn(c,"error",f);if(this._timeout!==!1){const x=this._timeout,p=this.setTimeoutFn(()=>{d(),f(new Error("timeout")),c.close()},x);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(d),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Rn(i,"ping",this.onping.bind(this)),Rn(i,"data",this.ondata.bind(this)),Rn(i,"error",this.onerror.bind(this)),Rn(i,"close",this.onclose.bind(this)),Rn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(c){this.onclose("parse error",c)}}ondecoded(i){Ho(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,c){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new Sy(this,i,c),this.nsps[i]=o),o}_destroy(i){const c=Object.keys(this.nsps);for(const o of c)if(this.nsps[o].active)return;this._close()}_packet(i){const c=this.encoder.encode(i);for(let o=0;o<c.length;o++)this.engine.write(c[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,c){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,c),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const c=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(d=>{d?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",d)):i.onreconnect()}))},c);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const wi={};function Eo(l,i){typeof l=="object"&&(i=l,l=void 0),i=i||{};const c=yS(l,i.path||"/socket.io"),o=c.source,d=c.id,f=c.path,h=wi[d]&&f in wi[d].nsps,x=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let p;return x?p=new jf(o,i):(wi[d]||(wi[d]=new jf(o,i)),p=wi[d]),c.query&&!i.query&&(i.query=c.queryKey),p.socket(c.path,i)}Object.assign(Eo,{Manager:jf,Socket:Sy,io:Eo,connect:Eo});let Dd=null;function Ug(){return Dd||(Dd=Eo(window.location.origin,{path:"/socket.io",transports:["websocket","polling"],reconnectionAttempts:10,reconnectionDelay:2e3})),Dd}function MS(l){const[i,c]=S.useState(!1),[o,d]=S.useState(null);return S.useEffect(()=>{const f=Ug(),h=()=>c(!0),x=()=>c(!1),p=O=>{d(A=>({...A,...O,state:(O==null?void 0:O.state)||(A==null?void 0:A.state)||"idle"})),l==null||l("session",O)},v=O=>{d(A=>({...A,state:(O==null?void 0:O.state)||(A==null?void 0:A.state)||"idle",status:(O==null?void 0:O.status)||(A==null?void 0:A.status)})),l==null||l("status_update",O)},y=O=>{d(A=>({...A,...O})),l==null||l("status",O)},b=O=>{d(A=>({...A,state:"waiting_for_qr",qr:O})),l==null||l("qr",O)},j=O=>{const A=typeof O=="object"&&O&&"code"in O?String(O.code):String(O||"");d(q=>({...q,state:"waiting_for_qr",pairingCode:A})),l==null||l("pairing_code",A)},z=()=>{d(O=>O?{...O,qr:null}:null),l==null||l("qr_cleared",{})},C=()=>{d(O=>O?{...O,pairingCode:null}:null),l==null||l("pairing_code_cleared",{})},w=(O,...A)=>{l==null||l(O,A[0])};return f.on("connect",h),f.on("disconnect",x),f.on("session",p),f.on("status_update",v),f.on("status",y),f.on("qr",b),f.on("pairing_code",j),f.on("pairing-code",j),f.on("qr_cleared",z),f.on("pairing_code_cleared",C),f.onAny(w),c(f.connected),()=>{f.off("connect",h),f.off("disconnect",x),f.off("session",p),f.off("status_update",v),f.off("status",y),f.off("qr",b),f.off("pairing_code",j),f.off("pairing-code",j),f.off("qr_cleared",z),f.off("pairing_code_cleared",C),f.offAny(w)}},[l]),{isConnected:i,sessionStatus:o,socket:Ug()}}const Jt=({isOpen:l,onClose:i,title:c,children:o,footer:d,maxWidth:f})=>(S.useEffect(()=>{const h=x=>{x.key==="Escape"&&i()};return l&&(document.addEventListener("keydown",h),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",h),document.body.style.overflow="auto"}},[l,i]),l?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-y-auto",children:[s.jsx("button",{type:"button",className:"fixed inset-0 bg-black/65 backdrop-blur-sm border-0 p-0 cursor-default",onClick:i,"aria-label":"Close modal backdrop"}),s.jsxs("div",{className:"relative w-full rounded-2xl border border-line bg-panel shadow-2xl overflow-hidden my-auto z-10 animate-in fade-in zoom-in-95 duration-150",role:"dialog","aria-modal":"true","aria-label":c,style:f?{maxWidth:f}:{maxWidth:"520px"},children:[s.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-line",children:[s.jsx("h3",{className:"text-base md:text-lg font-bold text-text-main",children:c}),s.jsx("button",{type:"button",onClick:i,className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-line bg-panel-raised hover:bg-panel-hover text-text-main transition-colors","aria-label":"Close modal",children:s.jsx(kl,{size:18})})]}),s.jsx("div",{className:"p-5 overflow-y-auto max-h-[75vh]",children:o}),d&&s.jsx("div",{className:"flex items-center justify-end gap-3 p-4 border-t border-line bg-panel-raised/50",children:d})]})]}):null),wl=({checked:l,onChange:i,disabled:c=!1,id:o,label:d,description:f})=>{const h=o||`toggle-${Math.random().toString(36).slice(2,8)}`;return s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[(d||f)&&s.jsxs("div",{className:"min-w-0 flex-1",children:[d&&s.jsx("label",{htmlFor:h,className:"font-semibold text-sm cursor-pointer block text-text-main",children:d}),f&&s.jsx("p",{className:"text-xs text-muted mt-0.5",children:f})]}),s.jsx("button",{type:"button",role:"switch","aria-checked":l,id:h,disabled:c,onClick:()=>i(!l),className:Ot("relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 disabled:cursor-not-allowed",l?"bg-brand-blue":"bg-panel-hover border border-line"),children:s.jsx("span",{className:Ot("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow-md ring-0 transition duration-200 ease-in-out",l?"translate-x-5 rtl:-translate-x-5":"translate-x-0")})})]})},OS=()=>{var $t,Et,Wt,I,Ae;const{t:l,language:i}=We(),{toast:c}=Gt(),[o,d]=S.useState({}),[f,h]=S.useState({}),[x,p]=S.useState(!0),[v,y]=S.useState({}),[b,j]=S.useState(!1),[z,C]=S.useState(!1),[w,O]=S.useState(!1),[A,q]=S.useState(""),[W,Z]=S.useState([]),[re,F]=S.useState(null),[M,k]=S.useState(""),[K,X]=S.useState(!1),[ie,oe]=S.useState(!1),[ce,$]=S.useState([]),[Y,P]=S.useState(null),[J,ue]=S.useState(null),[Ne,D]=S.useState(!1),ae=[{id:"gemini",name:"Google Gemini",descKey:"providerGeminiDesc",provider:"gemini",defaultModel:"gemini-3.7-flash",defaultBaseUrl:"",keySetting:"gemini_api_key",modelSetting:"gemini_model",baseUrlSetting:"gemini_base_url"},{id:"groq",name:"Groq Cloud",descKey:"providerGroqDesc",provider:"openai",defaultModel:"llama-3.3-70b-versatile",defaultBaseUrl:"https://api.groq.com/openai/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"openai",name:"OpenAI",descKey:"providerOpenAIDesc",provider:"openai",defaultModel:"gpt-4o-mini",defaultBaseUrl:"https://api.openai.com/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"ollama",name:"Ollama (Local)",descKey:"providerOllamaDesc",provider:"openai",defaultModel:"llama3.2",defaultBaseUrl:"http://localhost:11434/v1",keySetting:"openai_api_key",modelSetting:"openai_model",baseUrlSetting:"openai_base_url"},{id:"anthropic",name:"Anthropic Claude",descKey:"providerAnthropicDesc",provider:"anthropic",defaultModel:"claude-sonnet-4-5",defaultBaseUrl:"https://api.anthropic.com",keySetting:"anthropic_api_key",modelSetting:"anthropic_model",baseUrlSetting:"anthropic_base_url"}],ke=async()=>{try{const L=await Q.getSettings();if(L!=null&&L.settings){const Se={},Ge={};L.settings.forEach(at=>{Se[at.key]=at.value,at.type==="secret"&&(Ge[at.key]=!!at.configured)}),d(Se),h(Ge)}}catch(L){c(L.message,"error")}finally{p(!1)}};S.useEffect(()=>{ke()},[]);const Ce=async(L,Se,Ge=!1)=>{d(at=>({...at,[L]:Se}));try{const at=await Q.updateSetting(L,Se);if(Ge||c(l("savedSuccessfully"),"success"),L.endsWith("_api_key")&&(d(xt=>({...xt,[L]:""})),h(xt=>({...xt,[L]:!!Se}))),at!=null&&at.settings&&Array.isArray(at.settings)){const xt={},Xe={};at.settings.forEach(Fe=>{Fe.type==="secret"?(Xe[Fe.key]=!!Fe.configured,xt[Fe.key]=""):xt[Fe.key]=Fe.value}),d(Fe=>({...Fe,...xt})),h(Fe=>({...Fe,...Xe}))}}catch(at){c(at.message,"error")}},N=o.ai_provider||"gemini",E=ae.find(L=>{var Se,Ge;return L.provider!==N?!1:!!(L.id==="gemini"||L.id==="anthropic"||L.id==="groq"&&((Se=o.openai_base_url)!=null&&Se.includes("groq.com"))||L.id==="ollama"&&((Ge=o.openai_base_url)!=null&&Ge.includes("11434"))||L.id==="openai"&&(!o.openai_base_url||o.openai_base_url.includes("api.openai.com")))})||ae[0],le=async L=>{const Se={...o,ai_provider:L.provider};L.baseUrlSetting&&(Se[L.baseUrlSetting]=L.defaultBaseUrl),L.defaultModel&&(Se[L.modelSetting]=L.defaultModel),d(Se);try{await Q.updateSetting("ai_provider",L.provider),L.baseUrlSetting&&await Q.updateSetting(L.baseUrlSetting,L.defaultBaseUrl),L.defaultModel&&await Q.updateSetting(L.modelSetting,L.defaultModel),c(i==="ar"?`تم التبديل إلى ${L.name}`:`Switched provider to ${L.name}`,"success")}catch(Ge){c(Ge.message,"error")}},se=async(L=!1,Se=!1)=>{j(!0);const Ge=String(o[E.keySetting]||"").trim(),at=!!f[E.keySetting];try{const xt={provider:E.provider,refresh:L,cacheOnly:Se};Ge&&(xt.apiKey=Ge),E.baseUrlSetting&&o[E.baseUrlSetting]&&(xt.baseUrl=o[E.baseUrlSetting]);const Xe=await Q.fetchAiModels(xt);Xe&&(Xe.success||Xe.fallback)?(y(Fe=>{var rn;return{...Fe,[E.id]:{live:!!Xe.live,requiresApiKey:!!Xe.requiresApiKey,fallback:!!Xe.fallback,models:Xe.models||[],cached:!!Xe.cached,error:Xe.success||(rn=Xe.error)==null?void 0:rn.message}}}),!Xe.live&&Xe.requiresApiKey&&L?c(i==="ar"?"يرجى إدخال مفتاح API أولاً لاكتشاف النماذج المتاحة لحسابك":"Enter an API key to discover account models","info"):!Xe.success&&Xe.error&&c(Xe.error.message||"Failed to discover models","error")):Xe&&!Xe.success&&Xe.error&&(y(Fe=>{var rn;return{...Fe,[E.id]:{live:!1,requiresApiKey:!(at||Ge),fallback:!0,models:Xe.models||[],error:(rn=Xe.error)==null?void 0:rn.message}}}),c(Xe.error.message||"Failed to discover models","error"))}catch(xt){Se||c(xt.message||"Failed to fetch models","error")}finally{j(!1)}};S.useEffect(()=>{x||se(!1,!0)},[E.id,x]);const ye=(($t=v[E.id])==null?void 0:$t.models)||[],ge=!!((Et=v[E.id])!=null&&Et.live),de=!!(((Wt=v[E.id])==null?void 0:Wt.requiresApiKey)??!f[E.keySetting]),fe=o[E.modelSetting]||E.defaultModel,xe=ye.find(L=>L.id.toLowerCase()===fe.toLowerCase())||{displayName:fe,provider:E.provider,capabilities:{textInput:!0,textOutput:!0,vision:!1,audioInput:!1,stt:!1,videoInput:!1,pdfInput:!1},capabilitySource:"unknown"},it=!!xe.capabilities.vision,ne=!!xe.capabilities.stt,Oe=xe.capabilitySource==="provider"||xe.capabilitySource==="seed",Le=o.ai_auto_detect_capabilities!==!1,Re=Oe&&Le&&!it,Te=Oe&&Le&&!ne;S.useEffect(()=>{x||(Re&&o.ai_vision_enabled&&Ce("ai_vision_enabled",!1,!0),Te&&o.ai_stt_enabled&&Ce("ai_stt_enabled",!1,!0))},[fe,Re,Te,x]);const bt=async()=>{try{const L=await Q.getPersona(),Se=L==null?void 0:L.persona;q(typeof Se=="string"?Se:(Se==null?void 0:Se.body)||""),O(!0)}catch(L){c(L.message,"error")}},Pt=async()=>{try{await Q.updatePersona(A),c(i==="ar"?"تم تحديث توجيه الشخصية بنجاح!":"Persona updated successfully!","success"),O(!1)}catch(L){c(L.message,"error")}},pt=async()=>{try{const L=await Q.getMemoryFiles(),Se=((L==null?void 0:L.scopes)||[]).map(Ge=>({scope:Ge.scope,label:Ge.label,entries:Ge.entries??0}));Z(Se.some(Ge=>Ge.scope==="global")?Se:[{scope:"global",label:"Global memory",entries:0},...Se])}catch(L){Z([{scope:"global",label:"Global memory",entries:0}]),c(L.message,"error")}},wt=async L=>{F(L),k(""),X(!0);try{const Se=await Q.getMemoryFile(L);k((Se==null?void 0:Se.content)||"")}catch(Se){c(Se.message,"error")}finally{X(!1)}},bn=async()=>{F("global"),X(!0),await pt();try{const L=await Q.getMemoryFile("global");k((L==null?void 0:L.content)||"")}catch(L){c(L.message,"error")}finally{X(!1)}},me=async()=>{if(re)try{await Q.updateMemoryFile(re,M),c(i==="ar"?"تم حفظ ملف الذاكرة بنجاح!":"Memory file updated!","success"),pt(),F(null)}catch(L){c(L.message,"error")}},_e=async()=>{oe(!0),P(null),ue(null),D(!0);try{const L=await Q.getAiConversations();$((L==null?void 0:L.conversations)||[])}catch(L){c(L.message,"error")}finally{D(!1)}},rt=async L=>{P(L),ue(null),D(!0);try{const Se=await Q.getAiConversation(L);ue(Se||null)}catch(Se){c(Se.message,"error")}finally{D(!1)}},Vt=L=>L?new Date(L).toLocaleString(i==="ar"?"ar-EG":"en-GB",{dateStyle:"medium",timeStyle:"short"}):"—";return x?s.jsxs("div",{className:"flex items-center justify-center p-12 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-4 sm:p-6 shadow-sm flex flex-col gap-3.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[s.jsx("div",{className:"w-11 h-11 sm:w-12 sm:h-12 rounded-2xl bg-gradient-to-br from-brand-blue to-brand-cyan text-white flex items-center justify-center shrink-0 shadow-md shadow-brand-blue/20",children:s.jsx(Cf,{size:22,className:"sm:w-6 sm:h-6"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"text-base sm:text-xl font-extrabold text-text-main truncate",children:l("aiTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted truncate",children:l("aiSubtitle")})]})]}),s.jsxs("div",{className:"shrink-0 flex items-center gap-2 bg-panel/60 border border-line/70 rounded-xl px-2.5 py-1.5 shadow-xs",children:[s.jsx("span",{className:"text-xs font-bold text-muted hidden sm:inline",children:o.ai_agent?i==="ar"?"مفعل":"Enabled":i==="ar"?"معطل":"Disabled"}),s.jsx(wl,{checked:!!o.ai_agent,onChange:L=>Ce("ai_agent",L)})]})]}),s.jsx("div",{className:"flex items-center gap-2 pt-1 border-t border-line/40",children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-bold border ${o.ai_agent?"bg-ok/15 text-ok border-ok/30":"bg-danger/10 text-danger border-danger/25"}`,children:[s.jsx("span",{className:"pulse-dot"}),s.jsx("span",{children:o.ai_agent?l("aiAgentEnabled"):i==="ar"?"مساعد الذكاء الاصطناعي معطل":"AI Assistant Disabled"})]})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(pf,{size:18,className:"text-brand-cyan shrink-0"}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("aiProvider")})]}),s.jsxs("div",{className:"flex items-center gap-2 self-start sm:self-auto",children:[s.jsx("span",{className:"text-xs text-muted font-medium",children:i==="ar"?"المزود النشط:":"Active:"}),s.jsxs("span",{className:"text-xs font-bold text-brand-cyan px-2.5 py-1 rounded-lg bg-brand-cyan/10 border border-brand-cyan/25",children:[E.name," • ",s.jsx("span",{className:"font-mono",children:fe})]})]})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 sm:gap-3",children:ae.map(L=>{const Se=E.id===L.id;return s.jsxs("button",{type:"button",onClick:()=>le(L),className:`p-3.5 rounded-xl border text-start transition-all flex flex-col justify-between gap-2.5 focus-visible:ring-2 focus-visible:ring-brand-blue/50 ${Se?"bg-brand-blue/15 border-brand-blue/60 shadow-sm ring-1 ring-brand-blue/40":"bg-panel-raised border-line hover:bg-panel-hover"}`,children:[s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"font-bold text-xs sm:text-sm text-text-main",children:L.name}),Se?s.jsx("span",{className:"w-5 h-5 rounded-full bg-brand-blue text-white flex items-center justify-center shrink-0",children:s.jsx(Di,{size:12,strokeWidth:3})}):s.jsx("span",{className:"w-2 h-2 rounded-full bg-line"})]}),s.jsx("span",{className:"text-[10px] sm:text-[11px] font-mono text-muted truncate block",children:L.defaultModel})]},L.id)})}),de&&s.jsxs("div",{className:"p-3.5 rounded-xl bg-amber-500/10 border border-amber-500/25 flex items-start gap-3",children:[s.jsx(Ti,{size:18,className:"text-amber-500 shrink-0 mt-0.5"}),s.jsxs("div",{className:"text-xs text-text-main",children:[s.jsx("p",{className:"font-bold",children:l("connectKeyFirstPrompt")}),s.jsx("p",{className:"text-muted mt-0.5",children:i==="ar"?"النماذج المعروضة أدناه هي نماذج مقترحة من الدليل المحلي وليست مؤكدة لحسابك حتى يتم ربط المفتاح.":"Models shown below are catalog recommendations and are not verified for your account until a key is configured."})]})]}),((I=v[E.id])==null?void 0:I.error)&&s.jsxs("div",{className:"p-3 rounded-xl bg-danger/10 border border-danger/25 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-danger font-semibold",children:[s.jsx(Ei,{size:16,className:"shrink-0"}),s.jsx("span",{children:(Ae=v[E.id])==null?void 0:Ae.error})]}),s.jsx("button",{type:"button",onClick:()=>se(!0),className:"text-xs font-bold underline hover:opacity-80 shrink-0",children:l("refreshModels")})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 pt-4 border-t border-line",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{htmlFor:"input-api-key",className:"block text-xs font-bold text-muted",children:l("apiKey")}),f[E.keySetting]&&s.jsxs("span",{className:"text-[10px] text-ok font-semibold flex items-center gap-1",children:[s.jsx(js,{size:11}),i==="ar"?"محفوظ":"Saved"]})]}),s.jsx("input",{id:"input-api-key",type:"password",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[E.keySetting]||"",onChange:L=>d({...o,[E.keySetting]:L.target.value}),onBlur:L=>Ce(E.keySetting,L.target.value),placeholder:f[E.keySetting]?"••••••••••••":i==="ar"?"أدخل المفتاح":"Enter API key"})]}),E.baseUrlSetting&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"input-base-url",className:"block text-xs font-bold text-muted",children:l("baseUrl")}),s.jsx("input",{id:"input-base-url",type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[E.baseUrlSetting]||"",onChange:L=>{E.baseUrlSetting&&d({...o,[E.baseUrlSetting]:L.target.value})},onBlur:L=>{E.baseUrlSetting&&Ce(E.baseUrlSetting,L.target.value)},placeholder:E.defaultBaseUrl})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("label",{htmlFor:"input-model-name",className:"block text-xs font-bold text-muted",children:l("modelName")}),ge?s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-ok/15 text-ok border border-ok/30",children:l("sourceLive")}):s.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-brand-cyan/15 text-brand-cyan border border-brand-cyan/30",children:l("sourceSeed")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>C(!z),className:"text-[11px] text-brand-cyan hover:underline font-semibold",children:z?i==="ar"?"القائمة":"List":i==="ar"?"مخصص":"Custom"}),s.jsxs("button",{type:"button",onClick:()=>se(!0),disabled:b,className:"inline-flex items-center gap-1 text-[11px] text-brand-blue hover:text-brand-blue/80 font-bold",title:l("refreshModels"),children:[s.jsx(Ui,{size:11,className:b?"animate-spin":""}),s.jsx("span",{children:l(b?"refreshing":"refreshModels")})]})]})]}),z?s.jsx("input",{id:"input-model-name",type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o[E.modelSetting]||"",onChange:L=>d({...o,[E.modelSetting]:L.target.value}),onBlur:L=>Ce(E.modelSetting,L.target.value),placeholder:E.defaultModel}):s.jsxs("select",{id:"input-model-name",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:fe,onChange:L=>{Ce(E.modelSetting,L.target.value)},children:[s.jsx("optgroup",{label:l(ge?"modelsAvailableLive":"modelsRecommendedSeed"),children:ye.map(L=>s.jsxs("option",{value:L.id,children:[L.displayName&&L.displayName!==L.id?`${L.displayName} (${L.id})`:L.id,L.recommended?" ★":""]},L.id))}),!ye.some(L=>L.id.toLowerCase()===fe.toLowerCase())&&s.jsxs("option",{value:fe,children:[fe," (current)"]})]})]})]}),s.jsxs("div",{className:"p-3.5 rounded-xl border border-line bg-panel-raised/60 flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[s.jsxs("span",{className:"font-bold text-text-main flex items-center gap-1.5",children:[s.jsx(pf,{size:14,className:"text-brand-cyan shrink-0"}),i==="ar"?"القدرات:":"Capabilities:"," ",s.jsx("span",{className:"font-mono text-brand-cyan",children:xe.displayName||fe})]}),s.jsx("span",{className:`text-[10px] font-bold px-2 py-0.5 rounded-full border ${xe.capabilitySource==="provider"?"bg-ok/15 text-ok border-ok/30":xe.capabilitySource==="seed"?"bg-brand-blue/15 text-brand-blue border-brand-blue/30":"bg-muted/15 text-muted border-line"}`,children:xe.capabilitySource==="provider"?l("sourceLive"):xe.capabilitySource==="seed"?l("sourceSeed"):l("sourceUnknown")})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2 text-xs",children:[{icon:pa,label:l("capVision"),on:it},{icon:kd,label:l("capStt"),on:ne},{icon:GN,label:l("capAudio"),on:!!xe.capabilities.audioInput},{icon:So,label:l("capText"),on:!!(xe.capabilities.textInput&&xe.capabilities.textOutput)},{icon:So,label:l("capPdf"),on:!!xe.capabilities.pdfInput},{icon:pa,label:l("capVideo"),on:!!xe.capabilities.videoInput}].map(({icon:L,label:Se,on:Ge})=>s.jsxs("div",{className:`p-2 rounded-lg border flex items-center justify-between ${Oe&&Ge?"bg-ok/10 border-ok/25 text-ok":"bg-panel border-line text-muted"}`,children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[s.jsx(L,{size:14}),s.jsx("span",{children:Se})]}),s.jsx("span",{className:"text-[10px] font-bold",children:Oe?l(Ge?"supported":"unsupported"):"—"})]},Se))})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsx("h3",{className:"text-base font-bold text-text-main",children:l("capabilities")}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"relative rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsx("div",{className:"absolute top-3.5 end-3.5",children:s.jsx(wl,{checked:Re?!1:!!o.ai_vision_enabled,disabled:Re,onChange:L=>{Re||Ce("ai_vision_enabled",L)}})}),s.jsxs("div",{className:"pe-12",children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(pa,{size:17,className:Re?"text-muted shrink-0":"text-brand-cyan shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiVision")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("aiVisionDesc")}),Re&&s.jsxs("p",{className:"text-[11px] text-amber-500 font-semibold mt-2 flex items-center gap-1",children:[s.jsx(Ti,{size:13,className:"shrink-0"}),s.jsx("span",{children:l("visionUnsupportedNotice")})]})]})]}),s.jsxs("div",{className:"relative rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsx("div",{className:"absolute top-3.5 end-3.5",children:s.jsx(wl,{checked:Te?!1:!!(o.ai_stt_enabled??!0),disabled:Te,onChange:L=>{Te||Ce("ai_stt_enabled",L)}})}),s.jsxs("div",{className:"pe-12",children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(kd,{size:17,className:Te?"text-muted shrink-0":"text-purple-400 shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiSttEnabled")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("aiSttEnabledDesc")}),Te&&s.jsxs("p",{className:"text-[11px] text-amber-500 font-semibold mt-2 flex items-center gap-1",children:[s.jsx(Ti,{size:13,className:"shrink-0"}),s.jsx("span",{children:l("sttUnsupportedNotice")})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(kd,{size:17,className:"text-purple-400 shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("aiStt")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("sttDesc")})]}),s.jsxs("select",{className:"w-full h-10 px-3 rounded-lg border border-line bg-panel text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50 disabled:opacity-50",value:o.ai_stt_provider||"auto",disabled:Te,onChange:L=>{Te||Ce("ai_stt_provider",L.target.value)},children:[s.jsx("option",{value:"auto",children:l("sttAuto")}),s.jsx("option",{value:"gemini",children:l("sttGemini")}),s.jsx("option",{value:"openai",children:l("sttOpenAI")})]})]}),s.jsxs("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 text-text-main mb-1",children:[s.jsx(Ri,{size:17,className:"text-ok shrink-0"}),s.jsx("span",{className:"font-bold text-sm",children:l("botLanguage")})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:l("botLanguageDesc")})]}),s.jsxs("select",{className:"w-full h-10 px-3 rounded-lg border border-line bg-panel text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:o.bot_language||"auto",onChange:L=>Ce("bot_language",L.target.value),children:[s.jsx("option",{value:"auto",children:l("langAuto")}),s.jsx("option",{value:"ar",children:l("langAr")}),s.jsx("option",{value:"en",children:l("langEn")})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(So,{size:20,className:"text-brand-blue shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("personaPrompt")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("personaDesc")})]}),s.jsx("button",{type:"button",onClick:bt,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("editPersona")})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(bN,{size:20,className:"text-brand-cyan shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("memoryFiles")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("memoryDesc")})]}),s.jsx("button",{type:"button",onClick:bn,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("manageMemory")})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5 text-text-main mb-2",children:[s.jsx(LN,{size:20,className:"text-brand-blue shrink-0"}),s.jsx("h3",{className:"text-base font-bold",children:l("aiInspector")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("aiInspectorDesc")})]}),s.jsx("button",{type:"button",onClick:_e,className:"w-full h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 flex items-center justify-center gap-2",children:s.jsx("span",{children:l("openInspector")})})]})]}),s.jsx(Jt,{isOpen:w,onClose:()=>O(!1),title:l("personaPrompt"),maxWidth:"750px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>O(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsxs("button",{type:"button",onClick:Pt,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors flex items-center gap-2",children:[s.jsx(Oo,{size:16}),s.jsx("span",{children:l("save")})]})]}),children:s.jsx("textarea",{className:"w-full rounded-xl border border-line bg-panel-raised p-3.5 text-text-main font-mono text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50",rows:12,value:A,onChange:L=>q(L.target.value)})}),s.jsx(Jt,{isOpen:!!re,onClose:()=>F(null),title:l("memoryFiles"),maxWidth:"900px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>F(null),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsxs("button",{type:"button",onClick:me,disabled:K,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors flex items-center gap-2 disabled:opacity-50",children:[s.jsx(Oo,{size:16}),s.jsx("span",{children:l("save")})]})]}),children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[s.jsx("div",{className:"md:w-60 shrink-0 flex flex-col gap-1.5 md:max-h-[420px] overflow-y-auto",children:W.map(L=>{const Se=L.scope==="global",Ge=re===L.scope;return s.jsxs("button",{type:"button",onClick:()=>wt(L.scope),className:`text-start p-2.5 rounded-xl border transition-colors ${Ge?"bg-brand-blue/15 border-brand-blue/60":"bg-panel-raised border-line hover:bg-panel-hover"}`,children:[s.jsxs("span",{className:"flex items-center gap-2 font-bold text-xs text-text-main min-w-0",children:[Se?s.jsx(Ri,{size:14,className:"text-brand-cyan shrink-0"}):s.jsx(hf,{size:14,className:"text-brand-blue shrink-0"}),s.jsx("span",{className:"truncate",children:Se?l("memoryGlobalScope"):L.scope})]}),s.jsxs("span",{className:"block text-[10px] text-muted mt-1",children:[l(Se?"memoryGlobalScopeHint":"memoryChatScopeHint")," · ",l("memoryEntriesCount").replace("{n}",String(L.entries))]})]},L.scope)})}),s.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] text-muted leading-relaxed",children:l("memoryProseHint")}),K?s.jsxs("div",{className:"flex items-center justify-center min-h-[340px] text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):s.jsx("textarea",{className:"w-full min-h-[340px] flex-1 rounded-xl border border-line bg-panel-raised p-3.5 text-text-main font-mono text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50",rows:12,value:M,onChange:L=>k(L.target.value),placeholder:l("memoryEditorPlaceholder")})]})]})}),s.jsx(Jt,{isOpen:ie,onClose:()=>oe(!1),title:l("aiInspector"),maxWidth:"750px",footer:s.jsx("div",{className:"flex items-center justify-end gap-2.5 w-full",children:s.jsx("button",{type:"button",onClick:()=>oe(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")})}),children:Ne?s.jsxs("div",{className:"flex items-center justify-center min-h-[280px] text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("starting")})]}):Y?s.jsxs("div",{className:"flex flex-col gap-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>P(null),className:"text-xs font-bold text-brand-cyan hover:underline",children:["← ",l("backToList")]}),s.jsx("span",{className:"text-[10px] text-muted font-mono truncate",children:Y})]}),(J==null?void 0:J.truncated)&&s.jsx("p",{className:"text-[11px] text-amber-500 font-semibold",children:l("convTruncated")}),s.jsxs("div",{className:"flex flex-col gap-1.5 max-h-[420px] overflow-y-auto",children:[(J==null?void 0:J.messages.length)===0&&s.jsx("p",{className:"text-xs text-muted text-center py-6",children:l("noConversations")}),J==null?void 0:J.messages.map((L,Se)=>s.jsxs("div",{className:`p-2.5 rounded-xl border text-xs ${L.kind==="tool"||L.kind==="toolResult"?"bg-panel border-line text-muted font-mono":L.role==="model"?"bg-brand-blue/10 border-brand-blue/25 text-text-main":"bg-panel-raised border-line text-text-main"}`,children:[L.kind==="text"&&s.jsx("p",{className:"whitespace-pre-wrap break-words leading-relaxed",children:L.text}),L.kind==="media"&&s.jsxs("span",{children:["📎 ",L.mimeType||l("convMedia")]}),L.kind==="tool"&&s.jsxs("span",{children:["⚙️ ",L.name]}),L.kind==="toolResult"&&s.jsxs("span",{children:["↩️ ",L.name]})]},Se))]})]}):s.jsxs("div",{className:"flex flex-col gap-1.5",children:[ce.length===0&&s.jsx("p",{className:"text-xs text-muted text-center py-8",children:l("noConversations")}),ce.map(L=>s.jsxs("button",{type:"button",onClick:()=>rt(L.chatId),className:"text-start p-3 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover transition-colors",children:[s.jsxs("span",{className:"flex items-center gap-2 font-bold text-xs text-text-main",children:[s.jsx(hf,{size:14,className:"text-brand-blue shrink-0"}),s.jsx("span",{className:"truncate font-mono",children:L.chatId})]}),s.jsxs("span",{className:"block text-[10px] text-muted mt-1",children:[l("convTurns").replace("{n}",String(L.turns))," · ",Vt(L.updatedAt)]})]},L.chatId))]})})]})},DS=["MEMBERS","ADMINS_ONLY","ADMINS_OWNER","OWNER_ONLY"],Bg=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,RS=()=>{const{t:l,language:i}=We(),{toast:c}=Gt(),[o,d]=S.useState([]),[f,h]=S.useState(DS),[x,p]=S.useState("!"),[v,y]=S.useState(!1),[b,j]=S.useState("!"),[z,C]=S.useState(""),[w,O]=S.useState(!0),[A,q]=S.useState(null),[W,Z]=S.useState([]),[re,F]=S.useState(""),[M,k]=S.useState(!1),K=async()=>{try{const N=await Q.getCommands();N!=null&&N.commands&&d(N.commands),N!=null&&N.prefix&&(p(N.prefix),j(N.prefix)),Array.isArray(N==null?void 0:N.levels)&&N.levels.length&&h(N.levels)}catch(N){c(N.message,"error")}finally{O(!1)}};S.useEffect(()=>{K()},[]);const X=async()=>{const N=b.trim();if(!N||N.length>3){c(l("prefixValidation"),"error");return}try{await Q.updatePrefix(N),p(N),y(!1),c(`${l("prefixUpdated")} (${N})`,"success")}catch(E){c(E.message,"error")}},ie=async(N,E)=>{d(le=>le.map(se=>se.name===N.name?{...se,enabled:E,overridden:!0}:se));try{await Q.updateCommand(N.name,{enabled:E}),c(l(E?"commandEnabled":"commandDisabled").replace("{name}",N.name),"success")}catch(le){c(le.message,"error"),K()}},oe=async(N,E)=>{d(le=>le.map(se=>se.name===N.name?{...se,permission:E,overridden:!0}:se));try{await Q.updateCommand(N.name,{permission:E}),c(l("permissionUpdated").replace("{name}",N.name),"success")}catch(le){c(le.message,"error"),K()}},ce=N=>{q(N),Z(Array.isArray(N.aliases)?[...N.aliases]:[]),F("")},$=()=>{const N=re.trim().replace(/^[!/#.?$]+/,"").toLowerCase();if(N){if(W.includes(N)){c(l("aliasAlreadyAdded"),"warning");return}Z([...W,N]),F("")}},Y=N=>{Z(W.filter(E=>E!==N))},P=async()=>{if(A){k(!0);try{await Q.updateCommand(A.name,{aliases:W}),d(N=>N.map(E=>E.name===A.name?{...E,aliases:W}:E)),c(l("savedSuccessfully"),"success"),q(null)}catch(N){c(N.message,"error")}finally{k(!1)}}},J=N=>{var E;return((E=N.descriptions)==null?void 0:E[i])||N.description||""},ue=N=>{var E;return((E=N.usages)==null?void 0:E[i])||N.usage||""},Ne=N=>ue(N).split(`
495
+ `).map(E=>E.trim()).filter(Boolean).map(E=>`${x}${E}`),D=N=>({MEMBERS:l("permMembers"),ALL:l("permMembers"),ADMINS_ONLY:l("permAdminsOnly"),ADMINS_OWNER:l("permAdminsOwner"),OWNER_ONLY:l("permOwnerOnly")})[N]||N,ae=N=>({all:l("scopeAll"),group:l("scopeGroup"),private:l("scopePrivate")})[N]||N,ke=z.trim().toLowerCase(),Ce=ke?o.filter(N=>{var E,le;return[N.name,...N.aliases||[],J(N),N.description,ue(N),(E=N.usages)==null?void 0:E.en,(le=N.usages)==null?void 0:le.ar].filter(Boolean).join(" ").toLowerCase().includes(ke)}):o;return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:l("commands")}),s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-xl border border-line bg-panel-raised",children:[s.jsxs("span",{className:"text-xs text-muted font-semibold",children:[l("activePrefix"),":"]}),v?s.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[s.jsx("input",{type:"text",maxLength:3,value:b,onChange:N=>j(N.target.value),className:"w-12 h-7 px-1.5 text-center font-mono font-bold text-xs rounded-lg border border-line bg-panel text-text-main focus:outline-none focus:ring-2 focus:ring-brand-blue/50",onKeyDown:N=>{N.key==="Enter"&&X(),N.key==="Escape"&&y(!1)}}),s.jsx("button",{type:"button",onClick:X,className:"px-2 h-7 rounded-lg bg-brand-blue text-white font-bold text-xs hover:bg-brand-blue/90 transition-colors",children:l("save")}),s.jsx("button",{type:"button",onClick:()=>y(!1),className:"px-2 h-7 rounded-lg border border-line bg-panel-raised text-muted font-bold text-xs hover:bg-panel-hover transition-colors",children:l("cancel")})]}):s.jsx("button",{type:"button",onClick:()=>{j(x),y(!0)},className:"px-2.5 py-0.5 rounded-lg bg-brand-cyan/15 text-brand-cyan border border-brand-cyan/30 font-mono font-bold text-xs hover:bg-brand-cyan/25 transition-colors",title:l("editPrefixHint"),children:x})]})]}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-1",children:l("commandsSub")})]}),s.jsxs("div",{className:"relative w-full md:w-72 shrink-0",children:[s.jsx(Tf,{size:18,className:"absolute start-3.5 top-3 text-muted"}),s.jsx("input",{type:"text",className:"w-full h-11 ps-10 pe-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:l("searchPlaceholder"),value:z,onChange:N=>C(N.target.value)})]})]}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[760px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thCommand")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thAliases")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thDescription")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thScope")}),s.jsx("th",{className:"px-4 py-3.5 text-start",children:l("thRequiredRole")}),s.jsx("th",{className:"px-4 py-3.5 text-center",children:l("thStatus")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:w?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l("loading")})]})})}):Ce.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-12 text-muted text-xs md:text-sm",children:l("noMatchingCommands")})}):Ce.map(N=>{var E;return s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-4 py-3.5 font-mono font-bold text-brand-cyan",children:s.jsxs("bdi",{children:[x,N.name]})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(E=N.aliases)!=null&&E.length?N.aliases.map(le=>{const se=Bg.test(le),ye=se!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] px-2 py-0.5 rounded-md bg-panel-raised border border-line text-muted",title:ye?l(se?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[x,le]}),ye&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:se?"AR":"EN"})]},le)}):s.jsx("span",{className:"text-xs text-muted/60",children:"—"}),s.jsx("button",{type:"button",onClick:()=>ce(N),className:"inline-flex items-center justify-center w-6 h-6 rounded-md bg-panel-raised hover:bg-brand-blue/15 hover:text-brand-cyan text-muted border border-line transition-colors",title:l("editAliases"),children:s.jsx(MN,{size:12})})]})}),s.jsxs("td",{className:"px-4 py-3.5 max-w-xs text-text-main text-xs md:text-sm",children:[J(N),Ne(N).length>0&&s.jsx("ul",{className:"mt-1.5 flex flex-col gap-0.5 list-none","aria-label":l("usage"),title:l("usageHint"),children:Ne(N).map(le=>s.jsx("li",{children:s.jsx("code",{className:"font-mono text-[11px] text-muted bg-panel-raised border border-line rounded px-1.5 py-0.5 w-fit max-w-full overflow-x-auto",children:s.jsx("bdi",{children:le})})},le))})]}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx("span",{className:"inline-flex px-2.5 py-0.5 rounded-lg bg-brand-blue/10 text-brand-cyan text-xs font-semibold",children:ae(N.chat)})}),s.jsx("td",{className:"px-4 py-3.5",children:s.jsx("select",{className:"h-9 px-2.5 rounded-lg border border-line bg-panel-raised text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:N.permission,onChange:le=>oe(N,le.target.value),children:f.map(le=>s.jsx("option",{value:le,children:D(le)},le))})}),s.jsx("td",{className:"px-4 py-3.5 text-center",children:s.jsx(wl,{checked:N.enabled,onChange:le=>ie(N,le)})})]},N.name)})})]})}),s.jsx(Jt,{isOpen:!!A,onClose:()=>q(null),title:`${l("aliasesFor")} ${x}${(A==null?void 0:A.name)||""}`,footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>q(null),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:l("cancel")}),s.jsx("button",{type:"button",onClick:P,disabled:M,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/25 transition-colors disabled:opacity-50",children:l(M?"saving":"save")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted",children:l("aliasesHelp")}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"text-xs font-bold text-muted block",children:l("thAliases")}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap min-h-[42px] p-2 rounded-xl border border-line bg-panel-raised",children:W.length>0?W.map(N=>{const E=Bg.test(N),le=E!==(i==="ar");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-panel border border-line text-xs font-mono font-bold text-text-main",title:le?l(E?"aliasScriptArabic":"aliasScriptLatin"):void 0,children:[s.jsxs("bdi",{children:[x,N]}),le&&s.jsx("span",{className:"font-sans font-bold text-[9px] uppercase tracking-wide text-brand-cyan/80",children:E?"AR":"EN"}),s.jsx("button",{type:"button",onClick:()=>Y(N),className:"text-muted hover:text-danger p-0.5 rounded transition-colors",children:s.jsx(kl,{size:13})})]},N)}):s.jsx("span",{className:"text-xs text-muted/60 px-1",children:l("noAliases")})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-alias-input",className:"text-xs font-bold text-muted block",children:l("addAlias")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(qN,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{id:"new-alias-input",type:"text",value:re,onChange:N=>F(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),$())},placeholder:l("newAliasPlaceholder"),className:"w-full h-11 ps-9 pe-3 rounded-xl border border-line bg-panel text-text-main font-mono text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),s.jsxs("button",{type:"button",onClick:$,className:"inline-flex items-center justify-center gap-1.5 px-4 h-11 rounded-xl bg-panel-raised hover:bg-panel-hover border border-line text-text-main font-bold text-xs sm:text-sm transition-colors shrink-0",children:[s.jsx(Uo,{size:16}),s.jsx("span",{children:l("add")})]})]})]})]})})]})};var ys={},Rd,Hg;function LS(){return Hg||(Hg=1,Rd=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Rd}var Ld={},Ia={},qg;function Cl(){if(qg)return Ia;qg=1;let l;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Ia.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},Ia.getSymbolTotalCodewords=function(o){return i[o]},Ia.getBCHDigit=function(c){let o=0;for(;c!==0;)o++,c>>>=1;return o},Ia.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');l=o},Ia.isKanjiModeEnabled=function(){return typeof l<"u"},Ia.toSJIS=function(o){return l(o)},Ia}var Ud={},Gg;function Gf(){return Gg||(Gg=1,(function(l){l.L={bit:1},l.M={bit:0},l.Q={bit:3},l.H={bit:2};function i(c){if(typeof c!="string")throw new Error("Param is not a string");switch(c.toLowerCase()){case"l":case"low":return l.L;case"m":case"medium":return l.M;case"q":case"quartile":return l.Q;case"h":case"high":return l.H;default:throw new Error("Unknown EC Level: "+c)}}l.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},l.from=function(o,d){if(l.isValid(o))return o;try{return i(o)}catch{return d}}})(Ud)),Ud}var Bd,Pg;function US(){if(Pg)return Bd;Pg=1;function l(){this.buffer=[],this.length=0}return l.prototype={get:function(i){const c=Math.floor(i/8);return(this.buffer[c]>>>7-i%8&1)===1},put:function(i,c){for(let o=0;o<c;o++)this.putBit((i>>>c-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0),i&&(this.buffer[c]|=128>>>this.length%8),this.length++}},Bd=l,Bd}var Hd,Vg;function BS(){if(Vg)return Hd;Vg=1;function l(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}return l.prototype.set=function(i,c,o,d){const f=i*this.size+c;this.data[f]=o,d&&(this.reservedBit[f]=!0)},l.prototype.get=function(i,c){return this.data[i*this.size+c]},l.prototype.xor=function(i,c,o){this.data[i*this.size+c]^=o},l.prototype.isReserved=function(i,c){return this.reservedBit[i*this.size+c]},Hd=l,Hd}var qd={},Yg;function HS(){return Yg||(Yg=1,(function(l){const i=Cl().getSymbolSize;l.getRowColCoords=function(o){if(o===1)return[];const d=Math.floor(o/7)+2,f=i(o),h=f===145?26:Math.ceil((f-13)/(2*d-2))*2,x=[f-7];for(let p=1;p<d-1;p++)x[p]=x[p-1]-h;return x.push(6),x.reverse()},l.getPositions=function(o){const d=[],f=l.getRowColCoords(o),h=f.length;for(let x=0;x<h;x++)for(let p=0;p<h;p++)x===0&&p===0||x===0&&p===h-1||x===h-1&&p===0||d.push([f[x],f[p]]);return d}})(qd)),qd}var Gd={},Ig;function qS(){if(Ig)return Gd;Ig=1;const l=Cl().getSymbolSize,i=7;return Gd.getPositions=function(o){const d=l(o);return[[0,0],[d-i,0],[0,d-i]]},Gd}var Pd={},Kg;function GS(){return Kg||(Kg=1,(function(l){l.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};l.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},l.from=function(d){return l.isValid(d)?parseInt(d,10):void 0},l.getPenaltyN1=function(d){const f=d.size;let h=0,x=0,p=0,v=null,y=null;for(let b=0;b<f;b++){x=p=0,v=y=null;for(let j=0;j<f;j++){let z=d.get(b,j);z===v?x++:(x>=5&&(h+=i.N1+(x-5)),v=z,x=1),z=d.get(j,b),z===y?p++:(p>=5&&(h+=i.N1+(p-5)),y=z,p=1)}x>=5&&(h+=i.N1+(x-5)),p>=5&&(h+=i.N1+(p-5))}return h},l.getPenaltyN2=function(d){const f=d.size;let h=0;for(let x=0;x<f-1;x++)for(let p=0;p<f-1;p++){const v=d.get(x,p)+d.get(x,p+1)+d.get(x+1,p)+d.get(x+1,p+1);(v===4||v===0)&&h++}return h*i.N2},l.getPenaltyN3=function(d){const f=d.size;let h=0,x=0,p=0;for(let v=0;v<f;v++){x=p=0;for(let y=0;y<f;y++)x=x<<1&2047|d.get(v,y),y>=10&&(x===1488||x===93)&&h++,p=p<<1&2047|d.get(y,v),y>=10&&(p===1488||p===93)&&h++}return h*i.N3},l.getPenaltyN4=function(d){let f=0;const h=d.data.length;for(let p=0;p<h;p++)f+=d.data[p];return Math.abs(Math.ceil(f*100/h/5)-10)*i.N4};function c(o,d,f){switch(o){case l.Patterns.PATTERN000:return(d+f)%2===0;case l.Patterns.PATTERN001:return d%2===0;case l.Patterns.PATTERN010:return f%3===0;case l.Patterns.PATTERN011:return(d+f)%3===0;case l.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(f/3))%2===0;case l.Patterns.PATTERN101:return d*f%2+d*f%3===0;case l.Patterns.PATTERN110:return(d*f%2+d*f%3)%2===0;case l.Patterns.PATTERN111:return(d*f%3+(d+f)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}l.applyMask=function(d,f){const h=f.size;for(let x=0;x<h;x++)for(let p=0;p<h;p++)f.isReserved(p,x)||f.xor(p,x,c(d,p,x))},l.getBestMask=function(d,f){const h=Object.keys(l.Patterns).length;let x=0,p=1/0;for(let v=0;v<h;v++){f(v),l.applyMask(v,d);const y=l.getPenaltyN1(d)+l.getPenaltyN2(d)+l.getPenaltyN3(d)+l.getPenaltyN4(d);l.applyMask(v,d),y<p&&(p=y,x=v)}return x}})(Pd)),Pd}var vo={},Qg;function wy(){if(Qg)return vo;Qg=1;const l=Gf(),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],c=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return vo.getBlocksCount=function(d,f){switch(f){case l.L:return i[(d-1)*4+0];case l.M:return i[(d-1)*4+1];case l.Q:return i[(d-1)*4+2];case l.H:return i[(d-1)*4+3];default:return}},vo.getTotalCodewordsCount=function(d,f){switch(f){case l.L:return c[(d-1)*4+0];case l.M:return c[(d-1)*4+1];case l.Q:return c[(d-1)*4+2];case l.H:return c[(d-1)*4+3];default:return}},vo}var Vd={},ki={},Xg;function PS(){if(Xg)return ki;Xg=1;const l=new Uint8Array(512),i=new Uint8Array(256);return(function(){let o=1;for(let d=0;d<255;d++)l[d]=o,i[o]=d,o<<=1,o&256&&(o^=285);for(let d=255;d<512;d++)l[d]=l[d-255]})(),ki.log=function(o){if(o<1)throw new Error("log("+o+")");return i[o]},ki.exp=function(o){return l[o]},ki.mul=function(o,d){return o===0||d===0?0:l[i[o]+i[d]]},ki}var Fg;function VS(){return Fg||(Fg=1,(function(l){const i=PS();l.mul=function(o,d){const f=new Uint8Array(o.length+d.length-1);for(let h=0;h<o.length;h++)for(let x=0;x<d.length;x++)f[h+x]^=i.mul(o[h],d[x]);return f},l.mod=function(o,d){let f=new Uint8Array(o);for(;f.length-d.length>=0;){const h=f[0];for(let p=0;p<d.length;p++)f[p]^=i.mul(d[p],h);let x=0;for(;x<f.length&&f[x]===0;)x++;f=f.slice(x)}return f},l.generateECPolynomial=function(o){let d=new Uint8Array([1]);for(let f=0;f<o;f++)d=l.mul(d,new Uint8Array([1,i.exp(f)]));return d}})(Vd)),Vd}var Yd,Zg;function YS(){if(Zg)return Yd;Zg=1;const l=VS();function i(c){this.genPoly=void 0,this.degree=c,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(o){this.degree=o,this.genPoly=l.generateECPolynomial(this.degree)},i.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(o.length+this.degree);d.set(o);const f=l.mod(d,this.genPoly),h=this.degree-f.length;if(h>0){const x=new Uint8Array(this.degree);return x.set(f,h),x}return f},Yd=i,Yd}var Id={},Kd={},Qd={},Jg;function ky(){return Jg||(Jg=1,Qd.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),Qd}var Xn={},$g;function _y(){if($g)return Xn;$g=1;const l="[0-9]+",i="[A-Z $%*+\\-./:]+";let c="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";c=c.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+c+`)(?:.|[\r
496
+ ]))+`;Xn.KANJI=new RegExp(c,"g"),Xn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Xn.BYTE=new RegExp(o,"g"),Xn.NUMERIC=new RegExp(l,"g"),Xn.ALPHANUMERIC=new RegExp(i,"g");const d=new RegExp("^"+c+"$"),f=new RegExp("^"+l+"$"),h=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Xn.testKanji=function(p){return d.test(p)},Xn.testNumeric=function(p){return f.test(p)},Xn.testAlphanumeric=function(p){return h.test(p)},Xn}var Wg;function El(){return Wg||(Wg=1,(function(l){const i=ky(),c=_y();l.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},l.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},l.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},l.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},l.MIXED={bit:-1},l.getCharCountIndicator=function(f,h){if(!f.ccBits)throw new Error("Invalid mode: "+f);if(!i.isValid(h))throw new Error("Invalid version: "+h);return h>=1&&h<10?f.ccBits[0]:h<27?f.ccBits[1]:f.ccBits[2]},l.getBestModeForData=function(f){return c.testNumeric(f)?l.NUMERIC:c.testAlphanumeric(f)?l.ALPHANUMERIC:c.testKanji(f)?l.KANJI:l.BYTE},l.toString=function(f){if(f&&f.id)return f.id;throw new Error("Invalid mode")},l.isValid=function(f){return f&&f.bit&&f.ccBits};function o(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return l.NUMERIC;case"alphanumeric":return l.ALPHANUMERIC;case"kanji":return l.KANJI;case"byte":return l.BYTE;default:throw new Error("Unknown mode: "+d)}}l.from=function(f,h){if(l.isValid(f))return f;try{return o(f)}catch{return h}}})(Kd)),Kd}var eb;function IS(){return eb||(eb=1,(function(l){const i=Cl(),c=wy(),o=Gf(),d=El(),f=ky(),h=7973,x=i.getBCHDigit(h);function p(j,z,C){for(let w=1;w<=40;w++)if(z<=l.getCapacity(w,C,j))return w}function v(j,z){return d.getCharCountIndicator(j,z)+4}function y(j,z){let C=0;return j.forEach(function(w){const O=v(w.mode,z);C+=O+w.getBitsLength()}),C}function b(j,z){for(let C=1;C<=40;C++)if(y(j,C)<=l.getCapacity(C,z,d.MIXED))return C}l.from=function(z,C){return f.isValid(z)?parseInt(z,10):C},l.getCapacity=function(z,C,w){if(!f.isValid(z))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=d.BYTE);const O=i.getSymbolTotalCodewords(z),A=c.getTotalCodewordsCount(z,C),q=(O-A)*8;if(w===d.MIXED)return q;const W=q-v(w,z);switch(w){case d.NUMERIC:return Math.floor(W/10*3);case d.ALPHANUMERIC:return Math.floor(W/11*2);case d.KANJI:return Math.floor(W/13);case d.BYTE:default:return Math.floor(W/8)}},l.getBestVersionForData=function(z,C){let w;const O=o.from(C,o.M);if(Array.isArray(z)){if(z.length>1)return b(z,O);if(z.length===0)return 1;w=z[0]}else w=z;return p(w.mode,w.getLength(),O)},l.getEncodedBits=function(z){if(!f.isValid(z)||z<7)throw new Error("Invalid QR Code version");let C=z<<12;for(;i.getBCHDigit(C)-x>=0;)C^=h<<i.getBCHDigit(C)-x;return z<<12|C}})(Id)),Id}var Xd={},tb;function KS(){if(tb)return Xd;tb=1;const l=Cl(),i=1335,c=21522,o=l.getBCHDigit(i);return Xd.getEncodedBits=function(f,h){const x=f.bit<<3|h;let p=x<<10;for(;l.getBCHDigit(p)-o>=0;)p^=i<<l.getBCHDigit(p)-o;return(x<<10|p)^c},Xd}var Fd={},Zd,nb;function QS(){if(nb)return Zd;nb=1;const l=El();function i(c){this.mode=l.NUMERIC,this.data=c.toString()}return i.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(o){let d,f,h;for(d=0;d+3<=this.data.length;d+=3)f=this.data.substr(d,3),h=parseInt(f,10),o.put(h,10);const x=this.data.length-d;x>0&&(f=this.data.substr(d),h=parseInt(f,10),o.put(h,x*3+1))},Zd=i,Zd}var Jd,ab;function XS(){if(ab)return Jd;ab=1;const l=El(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function c(o){this.mode=l.ALPHANUMERIC,this.data=o}return c.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(d){let f;for(f=0;f+2<=this.data.length;f+=2){let h=i.indexOf(this.data[f])*45;h+=i.indexOf(this.data[f+1]),d.put(h,11)}this.data.length%2&&d.put(i.indexOf(this.data[f]),6)},Jd=c,Jd}var $d,lb;function FS(){if(lb)return $d;lb=1;const l=El();function i(c){this.mode=l.BYTE,typeof c=="string"?this.data=new TextEncoder().encode(c):this.data=new Uint8Array(c)}return i.getBitsLength=function(o){return o*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(c){for(let o=0,d=this.data.length;o<d;o++)c.put(this.data[o],8)},$d=i,$d}var Wd,sb;function ZS(){if(sb)return Wd;sb=1;const l=El(),i=Cl();function c(o){this.mode=l.KANJI,this.data=o}return c.getBitsLength=function(d){return d*13},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(o){let d;for(d=0;d<this.data.length;d++){let f=i.toSJIS(this.data[d]);if(f>=33088&&f<=40956)f-=33088;else if(f>=57408&&f<=60351)f-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+`
497
+ Make sure your charset is UTF-8`);f=(f>>>8&255)*192+(f&255),o.put(f,13)}},Wd=c,Wd}var ef={exports:{}},ib;function JS(){return ib||(ib=1,(function(l){var i={single_source_shortest_paths:function(c,o,d){var f={},h={};h[o]=0;var x=i.PriorityQueue.make();x.push(o,0);for(var p,v,y,b,j,z,C,w,O;!x.empty();){p=x.pop(),v=p.value,b=p.cost,j=c[v]||{};for(y in j)j.hasOwnProperty(y)&&(z=j[y],C=b+z,w=h[y],O=typeof h[y]>"u",(O||w>C)&&(h[y]=C,x.push(y,C),f[y]=v))}if(typeof d<"u"&&typeof h[d]>"u"){var A=["Could not find a path from ",o," to ",d,"."].join("");throw new Error(A)}return f},extract_shortest_path_from_predecessor_list:function(c,o){for(var d=[],f=o;f;)d.push(f),c[f],f=c[f];return d.reverse(),d},find_path:function(c,o,d){var f=i.single_source_shortest_paths(c,o,d);return i.extract_shortest_path_from_predecessor_list(f,d)},PriorityQueue:{make:function(c){var o=i.PriorityQueue,d={},f;c=c||{};for(f in o)o.hasOwnProperty(f)&&(d[f]=o[f]);return d.queue=[],d.sorter=c.sorter||o.default_sorter,d},default_sorter:function(c,o){return c.cost-o.cost},push:function(c,o){var d={value:c,cost:o};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};l.exports=i})(ef)),ef.exports}var rb;function $S(){return rb||(rb=1,(function(l){const i=El(),c=QS(),o=XS(),d=FS(),f=ZS(),h=_y(),x=Cl(),p=JS();function v(A){return unescape(encodeURIComponent(A)).length}function y(A,q,W){const Z=[];let re;for(;(re=A.exec(W))!==null;)Z.push({data:re[0],index:re.index,mode:q,length:re[0].length});return Z}function b(A){const q=y(h.NUMERIC,i.NUMERIC,A),W=y(h.ALPHANUMERIC,i.ALPHANUMERIC,A);let Z,re;return x.isKanjiModeEnabled()?(Z=y(h.BYTE,i.BYTE,A),re=y(h.KANJI,i.KANJI,A)):(Z=y(h.BYTE_KANJI,i.BYTE,A),re=[]),q.concat(W,Z,re).sort(function(M,k){return M.index-k.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function j(A,q){switch(q){case i.NUMERIC:return c.getBitsLength(A);case i.ALPHANUMERIC:return o.getBitsLength(A);case i.KANJI:return f.getBitsLength(A);case i.BYTE:return d.getBitsLength(A)}}function z(A){return A.reduce(function(q,W){const Z=q.length-1>=0?q[q.length-1]:null;return Z&&Z.mode===W.mode?(q[q.length-1].data+=W.data,q):(q.push(W),q)},[])}function C(A){const q=[];for(let W=0;W<A.length;W++){const Z=A[W];switch(Z.mode){case i.NUMERIC:q.push([Z,{data:Z.data,mode:i.ALPHANUMERIC,length:Z.length},{data:Z.data,mode:i.BYTE,length:Z.length}]);break;case i.ALPHANUMERIC:q.push([Z,{data:Z.data,mode:i.BYTE,length:Z.length}]);break;case i.KANJI:q.push([Z,{data:Z.data,mode:i.BYTE,length:v(Z.data)}]);break;case i.BYTE:q.push([{data:Z.data,mode:i.BYTE,length:v(Z.data)}])}}return q}function w(A,q){const W={},Z={start:{}};let re=["start"];for(let F=0;F<A.length;F++){const M=A[F],k=[];for(let K=0;K<M.length;K++){const X=M[K],ie=""+F+K;k.push(ie),W[ie]={node:X,lastCount:0},Z[ie]={};for(let oe=0;oe<re.length;oe++){const ce=re[oe];W[ce]&&W[ce].node.mode===X.mode?(Z[ce][ie]=j(W[ce].lastCount+X.length,X.mode)-j(W[ce].lastCount,X.mode),W[ce].lastCount+=X.length):(W[ce]&&(W[ce].lastCount=X.length),Z[ce][ie]=j(X.length,X.mode)+4+i.getCharCountIndicator(X.mode,q))}}re=k}for(let F=0;F<re.length;F++)Z[re[F]].end=0;return{map:Z,table:W}}function O(A,q){let W;const Z=i.getBestModeForData(A);if(W=i.from(q,Z),W!==i.BYTE&&W.bit<Z.bit)throw new Error('"'+A+'" cannot be encoded with mode '+i.toString(W)+`.
498
+ Suggested mode is: `+i.toString(Z));switch(W===i.KANJI&&!x.isKanjiModeEnabled()&&(W=i.BYTE),W){case i.NUMERIC:return new c(A);case i.ALPHANUMERIC:return new o(A);case i.KANJI:return new f(A);case i.BYTE:return new d(A)}}l.fromArray=function(q){return q.reduce(function(W,Z){return typeof Z=="string"?W.push(O(Z,null)):Z.data&&W.push(O(Z.data,Z.mode)),W},[])},l.fromString=function(q,W){const Z=b(q,x.isKanjiModeEnabled()),re=C(Z),F=w(re,W),M=p.find_path(F.map,"start","end"),k=[];for(let K=1;K<M.length-1;K++)k.push(F.table[M[K]].node);return l.fromArray(z(k))},l.rawSplit=function(q){return l.fromArray(b(q,x.isKanjiModeEnabled()))}})(Fd)),Fd}var ob;function WS(){if(ob)return Ld;ob=1;const l=Cl(),i=Gf(),c=US(),o=BS(),d=HS(),f=qS(),h=GS(),x=wy(),p=YS(),v=IS(),y=KS(),b=El(),j=$S();function z(F,M){const k=F.size,K=f.getPositions(M);for(let X=0;X<K.length;X++){const ie=K[X][0],oe=K[X][1];for(let ce=-1;ce<=7;ce++)if(!(ie+ce<=-1||k<=ie+ce))for(let $=-1;$<=7;$++)oe+$<=-1||k<=oe+$||(ce>=0&&ce<=6&&($===0||$===6)||$>=0&&$<=6&&(ce===0||ce===6)||ce>=2&&ce<=4&&$>=2&&$<=4?F.set(ie+ce,oe+$,!0,!0):F.set(ie+ce,oe+$,!1,!0))}}function C(F){const M=F.size;for(let k=8;k<M-8;k++){const K=k%2===0;F.set(k,6,K,!0),F.set(6,k,K,!0)}}function w(F,M){const k=d.getPositions(M);for(let K=0;K<k.length;K++){const X=k[K][0],ie=k[K][1];for(let oe=-2;oe<=2;oe++)for(let ce=-2;ce<=2;ce++)oe===-2||oe===2||ce===-2||ce===2||oe===0&&ce===0?F.set(X+oe,ie+ce,!0,!0):F.set(X+oe,ie+ce,!1,!0)}}function O(F,M){const k=F.size,K=v.getEncodedBits(M);let X,ie,oe;for(let ce=0;ce<18;ce++)X=Math.floor(ce/3),ie=ce%3+k-8-3,oe=(K>>ce&1)===1,F.set(X,ie,oe,!0),F.set(ie,X,oe,!0)}function A(F,M,k){const K=F.size,X=y.getEncodedBits(M,k);let ie,oe;for(ie=0;ie<15;ie++)oe=(X>>ie&1)===1,ie<6?F.set(ie,8,oe,!0):ie<8?F.set(ie+1,8,oe,!0):F.set(K-15+ie,8,oe,!0),ie<8?F.set(8,K-ie-1,oe,!0):ie<9?F.set(8,15-ie-1+1,oe,!0):F.set(8,15-ie-1,oe,!0);F.set(K-8,8,1,!0)}function q(F,M){const k=F.size;let K=-1,X=k-1,ie=7,oe=0;for(let ce=k-1;ce>0;ce-=2)for(ce===6&&ce--;;){for(let $=0;$<2;$++)if(!F.isReserved(X,ce-$)){let Y=!1;oe<M.length&&(Y=(M[oe]>>>ie&1)===1),F.set(X,ce-$,Y),ie--,ie===-1&&(oe++,ie=7)}if(X+=K,X<0||k<=X){X-=K,K=-K;break}}}function W(F,M,k){const K=new c;k.forEach(function($){K.put($.mode.bit,4),K.put($.getLength(),b.getCharCountIndicator($.mode,F)),$.write(K)});const X=l.getSymbolTotalCodewords(F),ie=x.getTotalCodewordsCount(F,M),oe=(X-ie)*8;for(K.getLengthInBits()+4<=oe&&K.put(0,4);K.getLengthInBits()%8!==0;)K.putBit(0);const ce=(oe-K.getLengthInBits())/8;for(let $=0;$<ce;$++)K.put($%2?17:236,8);return Z(K,F,M)}function Z(F,M,k){const K=l.getSymbolTotalCodewords(M),X=x.getTotalCodewordsCount(M,k),ie=K-X,oe=x.getBlocksCount(M,k),ce=K%oe,$=oe-ce,Y=Math.floor(K/oe),P=Math.floor(ie/oe),J=P+1,ue=Y-P,Ne=new p(ue);let D=0;const ae=new Array(oe),ke=new Array(oe);let Ce=0;const N=new Uint8Array(F.buffer);for(let ge=0;ge<oe;ge++){const de=ge<$?P:J;ae[ge]=N.slice(D,D+de),ke[ge]=Ne.encode(ae[ge]),D+=de,Ce=Math.max(Ce,de)}const E=new Uint8Array(K);let le=0,se,ye;for(se=0;se<Ce;se++)for(ye=0;ye<oe;ye++)se<ae[ye].length&&(E[le++]=ae[ye][se]);for(se=0;se<ue;se++)for(ye=0;ye<oe;ye++)E[le++]=ke[ye][se];return E}function re(F,M,k,K){let X;if(Array.isArray(F))X=j.fromArray(F);else if(typeof F=="string"){let Y=M;if(!Y){const P=j.rawSplit(F);Y=v.getBestVersionForData(P,k)}X=j.fromString(F,Y||40)}else throw new Error("Invalid data");const ie=v.getBestVersionForData(X,k);if(!ie)throw new Error("The amount of data is too big to be stored in a QR Code");if(!M)M=ie;else if(M<ie)throw new Error(`
499
+ The chosen QR Code version cannot contain this amount of data.
500
+ Minimum version required to store current data is: `+ie+`.
501
+ `);const oe=W(M,k,X),ce=l.getSymbolSize(M),$=new o(ce);return z($,M),C($),w($,M),A($,k,0),M>=7&&O($,M),q($,oe),isNaN(K)&&(K=h.getBestMask($,A.bind(null,$,k))),h.applyMask(K,$),A($,k,K),{modules:$,version:M,errorCorrectionLevel:k,maskPattern:K,segments:X}}return Ld.create=function(M,k){if(typeof M>"u"||M==="")throw new Error("No input text");let K=i.M,X,ie;return typeof k<"u"&&(K=i.from(k.errorCorrectionLevel,i.M),X=v.from(k.version),ie=h.from(k.maskPattern),k.toSJISFunc&&l.setToSJISFunction(k.toSJISFunc)),re(M,X,K,ie)},Ld}var tf={},nf={},cb;function Cy(){return cb||(cb=1,(function(l){function i(c){if(typeof c=="number"&&(c=c.toString()),typeof c!="string")throw new Error("Color should be defined as hex string");let o=c.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+c);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(f){return[f,f]}))),o.length===6&&o.push("F","F");const d=parseInt(o.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+o.slice(0,6).join("")}}l.getOptions=function(o){o||(o={}),o.color||(o.color={});const d=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,f=o.width&&o.width>=21?o.width:void 0,h=o.scale||4;return{width:f,scale:f?4:h,margin:d,color:{dark:i(o.color.dark||"#000000ff"),light:i(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},l.getScale=function(o,d){return d.width&&d.width>=o+d.margin*2?d.width/(o+d.margin*2):d.scale},l.getImageWidth=function(o,d){const f=l.getScale(o,d);return Math.floor((o+d.margin*2)*f)},l.qrToImageData=function(o,d,f){const h=d.modules.size,x=d.modules.data,p=l.getScale(h,f),v=Math.floor((h+f.margin*2)*p),y=f.margin*p,b=[f.color.light,f.color.dark];for(let j=0;j<v;j++)for(let z=0;z<v;z++){let C=(j*v+z)*4,w=f.color.light;if(j>=y&&z>=y&&j<v-y&&z<v-y){const O=Math.floor((j-y)/p),A=Math.floor((z-y)/p);w=b[x[O*h+A]?1:0]}o[C++]=w.r,o[C++]=w.g,o[C++]=w.b,o[C]=w.a}}})(nf)),nf}var ub;function ew(){return ub||(ub=1,(function(l){const i=Cy();function c(d,f,h){d.clearRect(0,0,f.width,f.height),f.style||(f.style={}),f.height=h,f.width=h,f.style.height=h+"px",f.style.width=h+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}l.render=function(f,h,x){let p=x,v=h;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),h||(v=o()),p=i.getOptions(p);const y=i.getImageWidth(f.modules.size,p),b=v.getContext("2d"),j=b.createImageData(y,y);return i.qrToImageData(j.data,f,p),c(b,v,y),b.putImageData(j,0,0),v},l.renderToDataURL=function(f,h,x){let p=x;typeof p>"u"&&(!h||!h.getContext)&&(p=h,h=void 0),p||(p={});const v=l.render(f,h,p),y=p.type||"image/png",b=p.rendererOpts||{};return v.toDataURL(y,b.quality)}})(tf)),tf}var af={},db;function tw(){if(db)return af;db=1;const l=Cy();function i(d,f){const h=d.a/255,x=f+'="'+d.hex+'"';return h<1?x+" "+f+'-opacity="'+h.toFixed(2).slice(1)+'"':x}function c(d,f,h){let x=d+f;return typeof h<"u"&&(x+=" "+h),x}function o(d,f,h){let x="",p=0,v=!1,y=0;for(let b=0;b<d.length;b++){const j=Math.floor(b%f),z=Math.floor(b/f);!j&&!v&&(v=!0),d[b]?(y++,b>0&&j>0&&d[b-1]||(x+=v?c("M",j+h,.5+z+h):c("m",p,0),p=0,v=!1),j+1<f&&d[b+1]||(x+=c("h",y),y=0)):p++}return x}return af.render=function(f,h,x){const p=l.getOptions(h),v=f.modules.size,y=f.modules.data,b=v+p.margin*2,j=p.color.light.a?"<path "+i(p.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",z="<path "+i(p.color.dark,"stroke")+' d="'+o(y,v,p.margin)+'"/>',C='viewBox="0 0 '+b+" "+b+'"',O='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+C+' shape-rendering="crispEdges">'+j+z+`</svg>
502
+ `;return typeof x=="function"&&x(null,O),O},af}var fb;function nw(){if(fb)return ys;fb=1;const l=LS(),i=WS(),c=ew(),o=tw();function d(f,h,x,p,v){const y=[].slice.call(arguments,1),b=y.length,j=typeof y[b-1]=="function";if(!j&&!l())throw new Error("Callback required as last argument");if(j){if(b<2)throw new Error("Too few arguments provided");b===2?(v=x,x=h,h=p=void 0):b===3&&(h.getContext&&typeof v>"u"?(v=p,p=void 0):(v=p,p=x,x=h,h=void 0))}else{if(b<1)throw new Error("Too few arguments provided");return b===1?(x=h,h=p=void 0):b===2&&!h.getContext&&(p=x,x=h,h=void 0),new Promise(function(z,C){try{const w=i.create(x,p);z(f(w,h,p))}catch(w){C(w)}})}try{const z=i.create(x,p);v(null,f(z,h,p))}catch(z){v(z)}}return ys.create=i.create,ys.toCanvas=d.bind(null,c.render),ys.toDataURL=d.bind(null,c.renderToDataURL),ys.toString=d.bind(null,function(f,h,x){return o.render(f,x)}),ys}var Ey=nw();const lf=kf(Ey);function aw(){return typeof window<"u"&&!!window.LevixHost}const lw=({status:l,onRefresh:i,onStatusUpdate:c})=>{var ke;const{t:o,language:d}=We(),{toast:f}=Gt(),[h,x]=S.useState(!1),[p,v]=S.useState(!1),[y,b]=S.useState(null),[j,z]=S.useState("pairing"),[C,w]=S.useState(""),[O,A]=S.useState(!1),q=(l==null?void 0:l.state)||"idle",W=q==="connected",Z=q==="waiting_for_qr",re=q==="starting"||q==="linking",F=q==="reconnecting",M=q==="paused",k=q==="logged_out",K=!!(l!=null&&l.linked)&&!k,X=!K,ie=!!(l!=null&&l.canUnlink),oe=(l==null?void 0:l.isOnline)!==!1,ce=M||q==="disconnected"||q==="retry_exhausted"?d==="ar"?"استئناف الجلسة":"Resume session":d==="ar"?"الاتصال":"Connect";S.useEffect(()=>{if(l!=null&&l.qr){const Ce=Ey.toDataURL||(lf==null?void 0:lf.toDataURL);typeof Ce=="function"&&Ce(l.qr,{width:280,margin:2,color:{dark:"#0b1629",light:"#ffffff"}}).then(N=>b(N)).catch(()=>b(null))}else b(null)},[l==null?void 0:l.qr]),S.useEffect(()=>{if(Z&&!(l!=null&&l.qr)&&!(l!=null&&l.pairingCode)){const Ce=setInterval(()=>{i==null||i()},1500);return()=>clearInterval(Ce)}},[Z,l==null?void 0:l.qr,l==null?void 0:l.pairingCode,i]);const $=async(Ce,N)=>{v(!0);try{const E=await Ce();E&&typeof E=="object"&&"session"in E&&(c==null||c(E.session)),f(N,"success"),await(i==null?void 0:i())}catch(E){f(E instanceof Error?E.message:String(E),"error")}finally{v(!1)}},Y=async Ce=>{Ce&&Ce.preventDefault();const N=C.replace(/\D/g,"");if(!N){f(d==="ar"?"يرجى إدخال رقم الهاتف مع كود الدولة أولاً.":"Please enter your phone number with country code.","error");return}if(N.startsWith("0")){f(d==="ar"?"يرجى حذف الصفر في البداية وكتابة كود الدولة (مثلاً: 2010... وليس 010...)":"Drop the leading 0 and include the country code (e.g. 2010... not 010...).","error");return}await $(()=>Q.startSession({method:"pairing",phone:N}),d==="ar"?"جارٍ طلب رمز الربط من واتساب...":"Requesting pairing code...")},P=async()=>{await $(()=>Q.startSession({method:"qr"}),d==="ar"?"جارٍ بدء الاتصال برمز QR...":"Starting QR code connection...")},J=async()=>{await $(Q.stopSession,d==="ar"?"تم الإلغاء، أدخل رقم هاتفك":"Cancelled, enter your phone number"),z("pairing")},ue=()=>{l!=null&&l.pairingCode&&(navigator.clipboard.writeText(l.pairingCode.replace(/\s+/g,"")),A(!0),f(d==="ar"?"تم نسخ كود الربط!":"Pairing code copied!","success"),setTimeout(()=>A(!1),2500))},Ne=async()=>{x(!1),await $(Q.unlinkSession,d==="ar"?"تم إلغاء ربط الجلسة بنجاح":"Session unlinked successfully.")},D=(ke=l==null?void 0:l.user)!=null&&ke.id?l.user.id.split("@")[0].split(":")[0]:null,ae=aw();return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 border ${W?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":Z?"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20":re||F?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 shadow-sm shadow-brand-blue/20":"bg-info/15 text-info border-info/30 shadow-sm shadow-info/20"}`,children:s.jsx(Li,{size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg sm:text-xl font-extrabold text-text-main",children:o("connection")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:W?o("sessionActive"):M?o("paused"):K?d==="ar"?"جلسة محفوظة — يمكن استئنافها":"Saved session — ready to resume":o("sessionOffline")})]})]}),s.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto",children:s.jsxs("span",{className:`inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-bold border ${W?"bg-ok/15 text-ok border-ok/30":Z?"bg-warn/15 text-warn border-warn/30":re||F?"bg-brand-blue/15 text-brand-blue border-brand-blue/30 animate-pulse":"bg-brand-cyan/15 text-brand-cyan border-brand-cyan/30"}`,children:[s.jsx("span",{className:"pulse-dot"}),s.jsx("span",{children:o(q,q)})]})})]}),l!=null&&l.retryInSeconds?s.jsxs("div",{className:"rounded-xl border border-warn/30 bg-warn/10 p-3.5 flex items-center gap-3 text-warn",children:[s.jsx(Ei,{size:20,className:"shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm",children:[s.jsx("span",{className:"font-bold",children:d==="ar"?"إعادة الاتصال قريباً":"Reconnecting soon"})," ","•"," ",s.jsx("span",{children:d==="ar"?`المحاولة التالية خلال ${l.retryInSeconds} ثانية`:`Next attempt in ${l.retryInSeconds}s`})]})]}):null,W&&D&&s.jsxs("div",{className:"rounded-xl border border-ok/30 bg-ok/10 p-3.5 sm:p-4 flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-ok/20 text-ok flex items-center justify-center shrink-0",children:s.jsx(js,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-xs text-muted font-medium",children:o("connectedNumber")}),s.jsxs("div",{className:"text-sm sm:text-base font-mono font-bold text-text-main",dir:"ltr",children:["+",D]})]})]}),s.jsx("span",{className:"text-xs font-bold text-ok px-2.5 py-1 rounded-lg bg-ok/15 border border-ok/30 shrink-0",children:d==="ar"?"متصل":"Online"})]}),s.jsxs("div",{children:[W&&s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5 sm:gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>$(Q.stopSession,o("stop")),disabled:p,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl border border-danger/40 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",children:[s.jsx(xf,{size:16}),s.jsx("span",{children:o("stop")})]}),s.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto",children:[s.jsxs("button",{type:"button",onClick:()=>$(Q.reconnectSession,o("reconnecting")),disabled:p,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("reconnect"),children:[s.jsx(Ui,{size:15}),s.jsx("span",{children:o("reconnect")})]}),s.jsxs("button",{type:"button",onClick:()=>x(!0),disabled:p,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",title:o("unlink"),children:[s.jsx(Cd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!ae&&s.jsxs("button",{type:"button",onClick:()=>$(Q.restartBot,o("restart")),disabled:p,className:"flex-1 sm:flex-initial inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(po,{size:15}),s.jsx("span",{children:o("restart")})]})]})]}),(re||Z||F)&&s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5 sm:gap-3 w-full sm:w-auto",children:[s.jsxs("button",{type:"button",onClick:()=>$(Q.stopSession,o("stop")),disabled:p,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl border border-danger/40 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",children:[s.jsx(xf,{size:16}),s.jsx("span",{children:d==="ar"?"إلغاء المحاولة":"Cancel Attempt"})]}),!ae&&s.jsxs("button",{type:"button",onClick:()=>$(Q.restartBot,o("restart")),disabled:p,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(po,{size:15}),s.jsx("span",{children:o("restart")})]})]}),!W&&!re&&!Z&&!F&&K&&s.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xl",children:[M&&s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:oe?d==="ar"?"الجلسة محفوظة. اضغط استئناف لإعادة استخدام نفس حساب واتساب.":"This WhatsApp session is saved. Resume to reconnect with the same account.":d==="ar"?"الاتصال متوقف بسبب انقطاع الإنترنت. سيُستأنف تلقائياً عند عودة الشبكة، أو اضغط استئناف.":"Paused while the device is offline. It will resume when the network returns, or tap Resume."}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5",children:[s.jsxs("button",{type:"button",onClick:()=>$(Q.startSession,ce),disabled:p,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 w-full sm:w-fit",children:[s.jsx(Li,{size:16}),s.jsx("span",{children:ce})]}),ie&&s.jsxs("button",{type:"button",onClick:()=>x(!0),disabled:p,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all disabled:opacity-50",title:o("unlink"),children:[s.jsx(Cd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!ae&&s.jsxs("button",{type:"button",onClick:()=>$(Q.restartBot,o("restart")),disabled:p,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all disabled:opacity-50",title:o("restart"),children:[s.jsx(po,{size:15}),s.jsx("span",{children:o("restart")})]})]})]}),!W&&!re&&!Z&&!F&&X&&s.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[s.jsxs("div",{className:"flex items-center gap-1.5 p-1 rounded-xl bg-panel-raised border border-line w-full sm:w-fit",children:[s.jsxs("button",{type:"button",onClick:()=>z("pairing"),className:`flex-1 sm:flex-initial inline-flex items-center justify-center gap-2 px-4 h-10 rounded-lg text-xs sm:text-sm font-bold transition-all ${j==="pairing"?"bg-brand-blue text-white shadow-sm shadow-brand-blue/30":"text-muted hover:text-text-main"}`,children:[s.jsx(Ai,{size:16}),s.jsx("span",{children:d==="ar"?"كود الربط الرقمي (الهاتف)":"Pairing Code (Phone)"})]}),s.jsxs("button",{type:"button",onClick:()=>z("qr"),className:`flex-1 sm:flex-initial inline-flex items-center justify-center gap-2 px-4 h-10 rounded-lg text-xs sm:text-sm font-bold transition-all ${j==="qr"?"bg-brand-blue text-white shadow-sm shadow-brand-blue/30":"text-muted hover:text-text-main"}`,children:[s.jsx(_d,{size:16}),s.jsx("span",{children:d==="ar"?"مسح رمز QR":"QR Code Scan"})]})]}),j==="pairing"&&s.jsxs("form",{onSubmit:Y,className:"flex flex-col gap-3 max-w-xl w-full",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2.5",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(DN,{size:17,className:"absolute top-1/2 -translate-y-1/2 start-3.5 text-muted pointer-events-none"}),s.jsx("input",{type:"tel",value:C,onChange:Ce=>w(Ce.target.value),placeholder:d==="ar"?"201012345678 (مع كود الدولة)":"e.g. 201012345678",dir:"ltr",className:"w-full h-12 sm:h-11 ps-10 pe-4 rounded-xl border border-line bg-panel-raised text-text-main font-mono text-sm placeholder:text-muted/60 focus:border-brand-blue focus:ring-2 focus:ring-brand-blue/20 outline-none transition-all"})]}),s.jsxs("button",{type:"submit",disabled:p,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 shrink-0",children:[s.jsx(mf,{size:16}),s.jsx("span",{children:d==="ar"?"الحصول على كود الربط":"Get Pairing Code"})]})]}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:d==="ar"?"💡 أدخل رقم هاتفك مسبوقاً بكود الدولة وبدون 0 في البداية (مثال: 2010... وليس 010...). سيظهر لك كود لإدخاله في واتساب فوراً.":"💡 Enter your number with country code, no leading zeros (e.g. 2010... not 010...). A code will appear to enter into WhatsApp."})]}),j==="qr"&&s.jsxs("div",{className:"flex flex-col gap-2 max-w-xl",children:[s.jsxs("button",{type:"button",onClick:P,disabled:p,className:"inline-flex items-center justify-center gap-2 px-6 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-sm shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 w-full sm:w-fit",children:[s.jsx(_d,{size:18}),s.jsx("span",{children:d==="ar"?"بدء الربط عبر رمز QR":"Start QR Linking"})]}),s.jsx("p",{className:"text-xs text-muted",children:d==="ar"?"سيتم إنشاء رمز QR لمسحه من هاتف آخر أو من شاشة الحاسوب عبر كاميرا واتساب.":"Generates a QR code to be scanned using WhatsApp camera on another device or screen."})]}),s.jsxs("div",{className:"flex items-center gap-2.5 pt-1",children:[ie&&s.jsxs("button",{type:"button",onClick:()=>x(!0),disabled:p,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-danger/30 bg-danger/10 hover:bg-danger/20 text-danger font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-danger/50 disabled:opacity-50",title:o("unlink"),children:[s.jsx(Cd,{size:15}),s.jsx("span",{children:o("unlink")})]}),!ae&&s.jsxs("button",{type:"button",onClick:()=>$(Q.restartBot,o("restart")),disabled:p,className:"inline-flex items-center justify-center gap-1.5 sm:gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",title:o("restart"),children:[s.jsx(po,{size:15}),s.jsx("span",{children:o("restart")})]})]})]})]})]}),re&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-6 sm:p-8 shadow-sm flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/15 text-brand-blue flex items-center justify-center mb-4 border border-brand-blue/30",children:s.jsx(Ui,{size:24,className:"animate-spin"})}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main mb-1.5",children:q==="linking"?d==="ar"?"جارٍ إتمام الربط مع الهاتف...":"Finishing link handshake...":d==="ar"?"جارٍ بدء تشغيل الجلسة...":"Initializing WhatsApp session..."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md",children:d==="ar"?"يتم الآن إنشاء مقبس الاتصال، ستظهر بيانات الربط خلال ثوانٍ معدودة.":"Creating connection socket. Pairing details will appear in just a few seconds."})]}),Z&&s.jsx("div",{className:"rounded-2xl border border-line bg-panel p-6 sm:p-8 shadow-sm flex flex-col items-center text-center max-w-2xl mx-auto w-full",children:l!=null&&l.pairingCode?s.jsxs("div",{className:"flex flex-col items-center w-full animate-in fade-in zoom-in-95 duration-300",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(Ai,{size:26})}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-text-main mb-1.5",children:d==="ar"?"كود الربط الرقمي مع واتساب":"WhatsApp Pairing Code"}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"أدخل هذا الكود في تطبيق واتساب على هاتفك لتأكيد الربط مباشرة.":"Enter this code into WhatsApp on your phone to complete pairing."}),s.jsxs("div",{className:"rounded-2xl border-2 border-brand-cyan/40 bg-brand-cyan/10 p-5 sm:p-6 w-full max-w-md flex flex-col items-center gap-4 shadow-lg shadow-brand-cyan/10",children:[s.jsx("div",{className:"text-xs font-bold text-brand-cyan uppercase tracking-wider",children:d==="ar"?"كود الربط المكون من 8 خانات":"8-Digit Pairing Code"}),s.jsx("div",{className:"text-3xl sm:text-4xl font-mono font-extrabold tracking-widest text-brand-cyan select-all",dir:"ltr",children:l.pairingCode.length===8?`${l.pairingCode.slice(0,4)} - ${l.pairingCode.slice(4)}`:l.pairingCode}),s.jsxs("button",{type:"button",onClick:ue,className:"inline-flex items-center justify-center gap-2 px-6 h-11 rounded-xl bg-brand-cyan hover:bg-brand-cyan/90 text-bg font-extrabold text-sm shadow-md shadow-brand-cyan/25 transition-all active:scale-95",children:[O?s.jsx(Di,{size:18}):s.jsx(gN,{size:18}),s.jsx("span",{children:O?d==="ar"?"تم النسخ بنجاح!":"Copied!":d==="ar"?"نسخ كود الربط":"Copy Code"})]})]}),s.jsxs("div",{className:"mt-6 p-4 rounded-xl border border-line bg-panel-raised text-start w-full max-w-md",children:[s.jsx("div",{className:"text-xs font-bold text-text-main mb-3",children:d==="ar"?"خطوات الإدخال في واتساب:":"Steps to enter in WhatsApp:"}),s.jsxs("ol",{className:"text-xs text-muted space-y-2 list-decimal list-inside leading-relaxed",children:[s.jsx("li",{children:d==="ar"?"افتح تطبيق واتساب على هاتفك.":"Open WhatsApp on your phone."}),s.jsx("li",{children:d==="ar"?"اذهب إلى الإعدادات > الأجهزة المرتبطة > ربط جهاز.":"Go to Settings > Linked Devices > Link a Device."}),s.jsx("li",{children:s.jsx("strong",{className:"text-text-main",children:d==="ar"?"اضغط على «الربط باستخدام رقم الهاتف بدلاً من ذلك» أسفل الشاشة.":"Tap 'Link with phone number instead' at bottom of screen."})}),s.jsx("li",{children:d==="ar"?"اكتب هذا الكود وسيتم ربط البوت مباشرة!":"Enter the code above to connect immediately!"})]})]})]}):y?s.jsxs("div",{className:"flex flex-col items-center w-full",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/15 text-brand-cyan flex items-center justify-center mb-4 border border-brand-cyan/30",children:s.jsx(_d,{size:26})}),s.jsx("h3",{className:"text-lg font-bold text-text-main mb-1.5",children:o("waiting_for_qr")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted max-w-md mb-6",children:d==="ar"?"افتح واتساب على هاتفك، اذهب إلى الأجهزة المرتبطة، ثم امسح هذا الرمز للربط.":"Open WhatsApp on your phone, go to Linked Devices, and scan this code to link."}),s.jsx("div",{className:"p-3 sm:p-4 bg-white rounded-2xl shadow-xl border border-line animate-in fade-in zoom-in-95 duration-300",children:s.jsx("img",{src:y,alt:"WhatsApp QR Code",className:"w-56 h-56 sm:w-64 sm:h-64 block rounded-lg"})}),s.jsxs("div",{className:"mt-6 pt-5 border-t border-line w-full max-w-md flex flex-col items-center gap-2.5",children:[s.jsx("p",{className:"text-xs text-muted text-center",children:d==="ar"?"هل تستخدم التطبيق من نفس الهاتف ولا تستطيع مسح الرمز؟":"Using the app on the same phone and can't scan?"}),s.jsxs("button",{type:"button",onClick:J,disabled:p,className:"w-full inline-flex items-center justify-center gap-2 px-4 h-12 sm:h-11 rounded-xl border border-brand-cyan/40 bg-brand-cyan/10 hover:bg-brand-cyan/20 text-brand-cyan font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-cyan/50",children:[s.jsx(Ai,{size:17}),s.jsx("span",{children:d==="ar"?"الربط برقم الهاتف (كود الربط الرقمي) بدلاً من QR":"Link with Phone Pairing Code Instead"})]})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-muted",children:[s.jsx("div",{className:"w-9 h-9 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs sm:text-sm font-semibold animate-pulse",children:d==="ar"?"جارٍ تجهيز بيانات الربط من واتساب...":"Preparing pairing details from WhatsApp..."})]})}),s.jsxs(Jt,{isOpen:h,onClose:()=>x(!1),title:o("unlink"),footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>x(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:o("cancel")}),s.jsx("button",{type:"button",onClick:Ne,className:"px-4 h-10 rounded-xl bg-danger hover:bg-danger/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-danger/25 transition-colors",children:o("unlink")})]}),children:[s.jsx("p",{className:"text-xs sm:text-sm text-text-main leading-relaxed",children:d==="ar"?"هل أنت متأكد من رغبتك في إلغاء ربط جلسة واتساب الحالية؟ ستحتاج إلى مسح رمز QR جديد أو إدخال كود ربط لإعادة ربط الحساب.":"Are you sure you want to unlink this WhatsApp session? You will need to scan a new QR code or enter a pairing code to reconnect."}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed mt-2",children:o("unlinkStickersWarning")})]})]})},sw=()=>{const{t:l,language:i}=We(),{toast:c}=Gt(),[o,d]=S.useState([]),[f,h]=S.useState(!0),x=y=>{var z,C;const b=y.jid||y.id||"",j=typeof y.antilink=="boolean"?y.antilink:!!(y.antilinkEnabled??((z=y.antilink)==null?void 0:z.enabled));return{...y,jid:b,subject:y.subject||"",memberCount:y.memberCount??y.participants??0,antilink:j,antilinkEnabled:j,welcomeEnabled:!!(y.welcomeEnabled??((C=y.welcome_system)==null?void 0:C.enabled)),mediaRestriction:y.mediaRestriction||"none"}},p=async()=>{try{const y=await Q.getGroups();y!=null&&y.groups&&d(y.groups.map(x))}catch(y){c(y.message,"error")}finally{h(!1)}};S.useEffect(()=>{p()},[]);const v=async(y,b)=>{d(j=>j.map(z=>z.jid===y?{...z,...b}:z));try{await Q.updateGroup(y,b),c(l("savedSuccessfully"),"success")}catch(j){c(j.message,"error"),p()}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{className:"rounded-2xl border border-line bg-panel p-5 md:p-6 shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4",children:s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-blue/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(Ns,{size:24})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:l("groups")}),s.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-brand-blue/10 text-brand-cyan border border-brand-cyan/20",children:[o.length," ",i==="ar"?"مجموعة":"groups"]})]}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-1",children:i==="ar"?"إدارة مجموعات واتساب، الحماية من الروابط، تقييد الوسائط، ورسائل الترحيب التلقائية":"WhatsApp group moderation, anti-link defense, media filtering, and automated greetings"})]})]})}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[640px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:l("thGroupName")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thGroupJid")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thMembers")}),s.jsx("th",{className:"px-5 py-4 text-center",children:l("thAntiLink")}),s.jsx("th",{className:"px-5 py-4 text-start",children:l("thMedia")}),s.jsx("th",{className:"px-5 py-4 text-center",children:l("thWelcome")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:f?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-blue border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l("loading")})]})})}):o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 px-4",children:s.jsxs("div",{className:"max-w-md mx-auto flex flex-col items-center gap-3",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-panel-raised flex items-center justify-center text-muted",children:s.jsx(BN,{size:28})}),s.jsx("h4",{className:"text-base font-bold text-text-main",children:i==="ar"?"لا توجد مجموعات حتى الآن":"No active groups found"}),s.jsx("p",{className:"text-xs text-muted leading-relaxed",children:i==="ar"?"بمجرد إضافة البوت إلى مجموعات واتساب، ستظهر تلقائياً هنا مع خيارات الإشراف والحماية.":"Once the bot is added to WhatsApp groups, they will automatically appear here with full moderation and anti-link controls."})]})})}):o.map(y=>{var b;return s.jsxs("tr",{className:"hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-5 py-4 font-bold text-text-main",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-9 h-9 rounded-xl bg-brand-blue/10 text-brand-cyan flex items-center justify-center font-bold text-sm shrink-0",children:(y.subject||"G").charAt(0).toUpperCase()}),s.jsx("span",{className:"line-clamp-1",children:y.subject||(i==="ar"?"مجموعة بدون اسم":"Unnamed group")})]})}),s.jsx("td",{className:"px-5 py-4 font-mono text-xs text-muted",children:s.jsx("bdi",{className:"px-2 py-1 rounded bg-bg-soft border border-line select-all",children:((b=y.jid)==null?void 0:b.split("@")[0])||y.jid})}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-panel-raised border border-line text-xs font-semibold text-text-main",children:y.memberCount||"—"})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(wl,{checked:!!y.antilink,onChange:j=>v(y.jid,{antilink:j})})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("select",{className:"h-9 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:y.mediaRestriction||"none",onChange:j=>v(y.jid,{mediaRestriction:j.target.value}),children:[s.jsx("option",{value:"none",children:i==="ar"?"بلا قيود (الكل)":"No Restrictions"}),s.jsx("option",{value:"block_all",children:i==="ar"?"حظر كافة الوسائط":"Block All Media"})]})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsx(wl,{checked:!!y.welcomeEnabled,onChange:j=>v(y.jid,{welcomeEnabled:j})})})]},y.jid)})})]})})]})};var vb;const sf=typeof((vb=window.LevixHost)==null?void 0:vb.hostLog)=="function",iw=({socket:l})=>{const{t:i,language:c}=We(),[o,d]=S.useState([]),[f,h]=S.useState("all"),[x,p]=S.useState(!0),v=S.useRef(null),[y,b]=S.useState("bot"),[j,z]=S.useState([]);S.useEffect(()=>{y==="bot"&&Q.getLogs().then(A=>{A!=null&&A.logs&&d(A.logs)}).catch(()=>{})},[y]),S.useEffect(()=>{if(y!=="bot"||!l)return;const A=q=>{d(W=>[...W.slice(-400),q])};return l.on("log",A),()=>{l.off("log",A)}},[l,y]);const C=S.useCallback(()=>{var A;try{const q=((A=window.LevixHost)==null?void 0:A.hostLog(500))??"";z(q?q.split(`
503
+ `).filter(Boolean):[])}catch{z([])}},[]);S.useEffect(()=>{if(y!=="host"||!sf)return;C();const A=setInterval(C,3e3);return()=>clearInterval(A)},[y,C]),S.useEffect(()=>{x&&v.current&&v.current.scrollIntoView({behavior:"smooth"})},[o,j,x]);const w=o.filter(A=>f==="all"?!0:A.level===f),O=y==="bot"?w.length:j.length;return s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 md:p-5 shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(Ss,{size:20})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("h2",{className:"text-base md:text-lg font-bold text-text-main",children:i("liveServerLogs")}),s.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-mono font-bold bg-panel-raised border border-line text-muted",children:O})]}),s.jsx("p",{className:"text-xs text-muted mt-0.5",children:c==="ar"?"سجل أحداث النظام واتصالات واتساب واستدعاءات الذكاء الاصطناعي في الوقت الفعلي":"Real-time streaming console for WhatsApp socket, AI calls, and bot commands"})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap sm:flex-nowrap",children:[sf&&s.jsxs("div",{className:"flex rounded-xl border border-line overflow-hidden",children:[s.jsx("button",{type:"button",onClick:()=>b("bot"),className:`px-3 h-10 text-xs font-semibold transition-colors ${y==="bot"?"bg-brand-cyan/15 text-brand-cyan":"bg-panel-raised text-muted hover:text-text-main"}`,children:i("logSourceBot")}),s.jsxs("button",{type:"button",onClick:()=>b("host"),className:`px-3 h-10 text-xs font-semibold transition-colors border-s border-line flex items-center gap-1.5 ${y==="host"?"bg-brand-cyan/15 text-brand-cyan":"bg-panel-raised text-muted hover:text-text-main"}`,children:[s.jsx(Ai,{size:13}),i("logSourceHost")]})]}),y==="bot"&&s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(NN,{size:15,className:"absolute start-3 text-muted pointer-events-none"}),s.jsxs("select",{className:"h-10 ps-9 pe-8 rounded-xl border border-line bg-panel-raised text-text-main text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:f,onChange:A=>h(A.target.value),children:[s.jsx("option",{value:"all",children:i("allLogs")}),s.jsx("option",{value:"info",children:"INFO"}),s.jsx("option",{value:"warn",children:"WARN"}),s.jsx("option",{value:"error",children:"ERROR"})]})]}),y==="host"&&sf&&s.jsxs("button",{type:"button",onClick:()=>{var A;try{(A=window.LevixHost)==null||A.shareHostLogs()}catch{}},className:"inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-muted hover:text-brand-cyan text-xs font-semibold transition-colors",title:i("shareLogs"),children:[s.jsx(Bo,{size:14}),s.jsx("span",{children:i("share")})]}),s.jsxs("button",{type:"button",onClick:()=>p(!x),className:`inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border text-xs font-semibold transition-colors ${x?"bg-brand-cyan/15 text-brand-cyan border-brand-cyan/30":"bg-panel-raised text-muted border-line hover:text-text-main"}`,title:"Auto-scroll to latest log entry",children:[s.jsx(rN,{size:14,className:x?"animate-bounce":""}),s.jsx("span",{children:x?"Auto-scroll ON":"Auto-scroll OFF"})]}),s.jsxs("button",{type:"button",onClick:()=>{y==="bot"?d([]):z([])},className:"inline-flex items-center gap-1.5 px-3 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-muted hover:text-danger text-xs font-semibold transition-colors",title:"Clear logs view",children:[s.jsx(ws,{size:14}),s.jsx("span",{children:i("clearLogs")})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-[#030712] p-4 md:p-5 shadow-2xl h-[65vh] overflow-y-auto font-mono text-xs leading-relaxed flex flex-col gap-1.5 text-slate-300",dir:"ltr",children:[y==="bot"?w.length===0?s.jsxs("div",{className:"m-auto text-center py-16 text-muted text-xs flex flex-col items-center gap-2",children:[s.jsx(Ss,{size:24,className:"opacity-40"}),s.jsx("span",{children:i("noLogs")})]}):w.map((A,q)=>{const W=A.level==="error"?"text-red-400 bg-red-500/10 border-red-500/20":A.level==="warn"?"text-amber-300 bg-amber-500/10 border-amber-500/20":"text-cyan-400 bg-cyan-500/10 border-cyan-500/20";return s.jsxs("div",{className:"flex items-baseline gap-2.5 py-0.5 hover:bg-white/[0.03] px-1 rounded transition-colors",children:[s.jsx("span",{className:"text-slate-500 shrink-0 select-none text-[11px]",children:A.time||new Date().toLocaleTimeString()}),s.jsx("span",{className:`inline-flex items-center px-1.5 py-0.2 rounded border font-mono font-bold text-[10px] shrink-0 ${W}`,children:(A.level||"info").toUpperCase()}),s.jsx("span",{className:"text-slate-200 break-all font-mono",children:A.msg})]},q)}):j.length===0?s.jsxs("div",{className:"m-auto text-center py-16 text-muted text-xs flex flex-col items-center gap-2",children:[s.jsx(Ai,{size:24,className:"opacity-40"}),s.jsx("span",{children:i("noLogs")})]}):j.map((A,q)=>s.jsx("div",{className:"flex items-baseline gap-2.5 py-0.5 hover:bg-white/[0.03] px-1 rounded transition-colors",children:s.jsx("span",{className:"text-slate-200 break-all font-mono",children:A})},q)),s.jsx("div",{ref:v})]})]})},rw=({status:l,onNavigate:i})=>{var z;const{t:c}=We(),{toast:o}=Gt(),[d,f]=S.useState(null),[h,x]=S.useState(!0);S.useEffect(()=>{let C=!0;return Q.getStats().then(w=>{C&&(w!=null&&w.stats)&&f(w.stats)}).catch(w=>{o(w.message,"error")}).finally(()=>{C&&x(!1)}),()=>{C=!1}},[o]);const p=C=>{const w=Math.floor(C/86400),O=Math.floor(C%86400/3600),A=Math.floor(C%3600/60);return w?`${w} ${c("uptimeDayUnit")} ${O} ${c("uptimeHourUnit")}`:O?`${O} ${c("uptimeHourUnit")} ${A} ${c("uptimeMinuteUnit")}`:`${A} ${c("uptimeMinuteUnit")}`},v=(l==null?void 0:l.state)==="connected",y=async()=>{try{await Q.startSession(),o(c("starting"),"info")}catch(C){o(C.message,"error")}},b=async()=>{try{await Q.stopSession(),o(c("stop"),"info")}catch(C){o(C.message,"error")}},j=[{id:"connection",title:c("connection"),desc:v?c("connected"):c(l==null?void 0:l.state,"disconnected"),icon:Li,color:"text-brand-cyan bg-brand-cyan/10 border-brand-cyan/20"},{id:"ai",title:c("ai"),desc:c("aiAssistantDesc")||"Autonomous tool-calling AI agent",icon:Cf,color:"text-purple-400 bg-purple-500/10 border-purple-500/20"},{id:"commands",title:c("commands"),desc:c("quickCommandsDesc").replace("{n}",String((d==null?void 0:d.commandCount)??0)),icon:Ss,color:"text-brand-blue bg-blue-500/10 border-blue-500/20"},{id:"settings",title:c("settings"),desc:c("settingsSub")||"Prefix, ports, delays, security & storage",icon:A0,color:"text-ok bg-ok/10 border-ok/20"}];return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised via-panel to-panel p-5 sm:p-6 shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-5",children:[s.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 border ${v?"bg-ok/15 text-ok border-ok/30 shadow-sm shadow-ok/20":"bg-warn/15 text-warn border-warn/30 shadow-sm shadow-warn/20"}`,children:s.jsx(iN,{size:24})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-extrabold text-text-main tracking-tight truncate",children:v?c("connected"):c(l==null?void 0:l.state,"disconnected")}),s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold border ${v?"bg-ok/10 text-ok border-ok/30":"bg-warn/10 text-warn border-warn/30"}`,children:[s.jsx("span",{className:"pulse-dot"}),c(v?"online":"offline")]})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted truncate mt-1",children:v?(z=l==null?void 0:l.user)!=null&&z.id?s.jsx("bdi",{dir:"ltr",children:`+${l.user.id.split("@")[0]}`}):c("activeListening"):c("pausedOrLinking")})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap shrink-0",children:[v?s.jsxs("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-danger/15 hover:border-danger/40 hover:text-danger text-text-main text-xs sm:text-sm font-bold transition-all focus-visible:ring-2 focus-visible:ring-danger/50",children:[s.jsx(xf,{size:16}),s.jsx("span",{children:c("stop")})]}):s.jsxs("button",{type:"button",onClick:y,className:"inline-flex items-center justify-center gap-2 px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white text-xs sm:text-sm font-bold shadow-md shadow-brand-blue/25 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(RN,{size:16}),s.jsx("span",{children:c("start")})]}),s.jsxs("button",{type:"button",onClick:()=>i("connection"),className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main text-xs sm:text-sm font-bold transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(Li,{size:16,className:"text-brand-cyan"}),s.jsx("span",{children:c("connection")})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-brand-blue/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("totalGroups")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-blue-500/10 text-brand-blue flex items-center justify-center shrink-0 border border-blue-500/20",children:s.jsx(Ns,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:h?"—":(d==null?void 0:d.totalGroups)??0})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-brand-cyan/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("commandCount")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0 border border-brand-cyan/20",children:s.jsx(Ss,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:h?"—":(d==null?void 0:d.commandCount)??0})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-ok/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("uptime")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-ok/10 text-ok flex items-center justify-center shrink-0 border border-ok/20",children:s.jsx(xN,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:h?"—":p((d==null?void 0:d.uptime)||0)})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-5 shadow-sm space-y-2 sm:space-y-3 hover:border-purple-500/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-[11px] sm:text-xs font-bold text-muted uppercase tracking-wider truncate",children:c("activeSchedules")}),s.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-purple-500/10 text-purple-400 flex items-center justify-center shrink-0 border border-purple-500/20",children:s.jsx(hf,{size:18})})]}),s.jsx("div",{className:"text-2xl sm:text-3xl font-extrabold text-text-main font-mono tracking-tight",children:h?"—":(d==null?void 0:d.activeSchedules)??0})]})]}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4",children:j.map(C=>{const w=C.icon;return s.jsxs("button",{type:"button",onClick:()=>i(C.id),className:"group rounded-2xl border border-line bg-panel hover:bg-panel-hover p-4 sm:p-5 shadow-sm text-start flex flex-col justify-between gap-3 sm:gap-4 transition-all hover:-translate-y-0.5 hover:border-brand-blue/30 focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("div",{className:`w-9 h-9 sm:w-10 sm:h-10 rounded-xl flex items-center justify-center shrink-0 border ${C.color}`,children:s.jsx(w,{size:18})}),s.jsx("div",{className:"w-7 h-7 rounded-full bg-white/[0.04] border border-white/[0.08] flex items-center justify-center text-muted group-hover:text-brand-cyan group-hover:border-brand-cyan/40 group-hover:bg-brand-cyan/10 transition-all",children:s.jsx(mN,{size:14,className:"rtl:rotate-180 transition-transform group-hover:translate-x-0.5 rtl:group-hover:-translate-x-0.5"})})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs sm:text-sm font-bold text-text-main group-hover:text-brand-cyan transition-colors",children:C.title}),s.jsx("p",{className:"text-[11px] sm:text-xs text-muted mt-0.5 line-clamp-2 leading-relaxed",children:C.desc})]})]},C.id)})}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 shadow-sm flex items-center gap-3.5",children:[s.jsx(vN,{size:20,className:"text-faint shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-xs font-semibold text-muted",children:c("dataDir")}),s.jsx("div",{className:"text-xs font-mono text-text-main truncate text-start",dir:"ltr",children:(d==null?void 0:d.dataDir)||"..."})]})]})]})},ks=()=>window.LevixHost,zi=new Map;let mb=!1;function ow(){mb||(mb=!0,window.__levixHostDone=(l,i)=>{const c=zi.get(l);zi.delete(l),c==null||c(i)})}function Hi(l,i,c){const o=ks(),d=o==null?void 0:o[l];if(!o||typeof d!="function")return Promise.resolve({ok:!1,code:"UNAVAILABLE"});ow();const f=crypto.randomUUID();return new Promise(h=>{var p,v,y,b,j;const x=z=>{h(z)};zi.set(f,x);try{const z=l==="pickStickerSource"?(p=o.pickStickerSource)==null?void 0:p.call(o,f):l==="pickFile"?(v=o.pickFile)==null?void 0:v.call(o,f):l==="uploadSource"?(y=o.uploadSource)==null?void 0:y.call(o,f,i[0],i[1],i[2]):l==="uploadForm"?(b=o.uploadForm)==null?void 0:b.call(o,f,i[0],i[1],i[2],i[3]):(j=o.exportFile)==null?void 0:j.call(o,f,i[0],i[1],i[2],i[3],i[4],i[5]),C=JSON.parse(z||"");C.ok||(zi.delete(f),x(C))}catch{zi.delete(f),x({ok:!1,code:"UNAVAILABLE"})}})}function Ao(){var l;return typeof((l=ks())==null?void 0:l.pickStickerSource)=="function"}function Go(){var l;return typeof((l=ks())==null?void 0:l.exportFile)=="function"}async function cw(){const l=await Hi("pickStickerSource",[]);if(!l.ok&&!l.cancelled)throw qi(l);return l.ok&&l.token&&l.url?l:null}function uw(){try{const l=ks(),i=l!=null&&l.takePendingSticker?JSON.parse(l.takePendingSticker()):null;return i!=null&&i.ok&&i.token&&i.url&&["create","save"].includes(i.intent)?i:null}catch{return null}}function qi(l){l.status===401&&(window.location.href="/login");const i=l.body,c=i?(()=>{try{return JSON.parse(i)}catch{return null}})():null,o=l.cancelled?"CANCELLED":l.code==="UNAVAILABLE"?"STORAGE_UNAVAILABLE":l.code;return new It(l.status||0,(c==null?void 0:c.error)||l.error||o||"Sticker operation failed",c||{code:o})}async function Ay(l,i,c,o){const d=await Hi("uploadSource",[l,i,c]);if(!d.ok||!d.status||d.status<200||d.status>=300)throw qi(d);try{return JSON.parse(d.body||"")}catch{throw new It(d.status,"Invalid upload response",{code:"INTERNAL"})}}function Ro(){var l,i;return typeof((l=ks())==null?void 0:l.uploadForm)=="function"&&typeof((i=ks())==null?void 0:i.pickFile)=="function"}async function Ty(){const l=await Hi("pickFile",[]);if(!l.ok&&!l.cancelled)throw qi(l);return l.ok&&l.token&&l.url?l:null}async function zy(l,i,c,o,d){const f=await Hi("uploadForm",[l,JSON.stringify(i),c,o]);if(!f.ok||!f.status||f.status<200||f.status>=300)throw qi(f);try{return f.body?JSON.parse(f.body):{}}catch{throw new It(f.status||0,"Invalid upload response",{code:"INTERNAL"})}}async function dw(l,i,c,o,d,f){const h=await Hi("exportFile",[l,i,c,o,d,f]);if(!h.ok)throw qi(h);return h}const fw=["weekdaySun","weekdayMon","weekdayTue","weekdayWed","weekdayThu","weekdayFri","weekdaySat"],mw=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],hw=["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],My=[1,2,3,4,6,8,12];function pw(){const l=window.LevixHost;return!!(l&&typeof l.pickContact=="function")}function xw(l){let i=String(l||"").replace(/\D/g,"");return i.startsWith("00")&&(i=i.slice(2)),i.length<8||i.length>15?null:`${i}@s.whatsapp.net`}function xa(l){const i=String(l||"").trim();return!i||i.includes("@")||/^\d{8,}$/.test(i)?null:i}function gw(l,i){return xa(l.savedName)||xa(l.pushName)||xa(l.name)||xa(l.targetLabel)||l.phone||i}function Sf(l){return String(l).padStart(2,"0")}function bw(l,i){const c=l.map(o=>i?hw[o]:mw[o]);return i?c.join(" و"):c.length===1?c[0]:c.length===2?`${c[0]} and ${c[1]}`:`${c.slice(0,-1).join(", ")} and ${c[c.length-1]}`}function yw(l){return l===1?"كل ساعة":l===2?"كل ساعتين":l>=3&&l<=10?`كل ${l} ساعات`:`كل ${l} ساعة`}function vw(l,i){return i==="image"?l("mediaKindImage"):i==="video"?l("mediaKindVideo"):i==="audio"?l("mediaKindAudio"):i==="document"?l("mediaKindDocument"):i}const ha=({label:l,children:i})=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[s.jsx("span",{className:"sm:w-32 shrink-0 font-bold text-muted",children:l}),s.jsx("span",{className:"min-w-0",children:i})]});function Nw(l,i,c,o,d,f,h,x){const p=/^\d{1,2}:\d{2}$/.test(i),v=h||"UTC";if(l==="hourly")return!Number.isInteger(d)||!My.includes(d)||!Number.isInteger(f)||f<0||f>59?null:x?`${`${yw(d)} عند الدقيقة ${f}`} (${v})`:`${d===1?`Every hour at minute ${f}`:`Every ${d} hours at minute ${f}`} (${v})`;if(!p)return null;const[y,b]=i.split(":").map(Number);if(y>23||b>59)return null;const j=`${Sf(y)}:${Sf(b)}`;if(l==="daily")return x?`يومياً الساعة ${j} (${v})`:`Daily at ${j} (${v})`;if(l==="weekly"){const z=[...new Set(c.filter(w=>w>=0&&w<=6))].sort((w,O)=>w-O);if(!z.length)return null;const C=bw(z,x);return x?`كل يوم ${C} الساعة ${j} (${v})`:`Every ${C} at ${j} (${v})`}return l==="monthly"?!Number.isInteger(o)||o<1||o>31?null:x?`كل شهر في اليوم ${o} الساعة ${j} (${v})`:`Every month on day ${o} at ${j} (${v})`:null}const jw=({isConnected:l=!1,onNavigate:i})=>{const{t:c,language:o}=We(),{toast:d}=Gt(),[f,h]=S.useState([]),[x,p]=S.useState("UTC"),[v,y]=S.useState(!0),[b,j]=S.useState([]),[z,C]=S.useState(!1),[w,O]=S.useState(null),[A,q]=S.useState(""),[W,Z]=S.useState(!1),[re,F]=S.useState(""),[M,k]=S.useState("recurring"),[K,X]=S.useState("daily"),[ie,oe]=S.useState("09:00"),[ce,$]=S.useState([1]),[Y,P]=S.useState(1),[J,ue]=S.useState(1),[Ne,D]=S.useState(0),[ae,ke]=S.useState(""),[Ce,N]=S.useState(!1),[E,le]=S.useState(null),[se,ye]=S.useState(null),ge=S.useRef(null),[de,fe]=S.useState(null),xe=3,it=20*1024*1024,ne=20,Oe=f.length>=xe,Le=o==="ar",Re=S.useMemo(()=>Nw(K,ie,ce,Y,J,Ne,x,Le),[K,ie,ce,Y,J,Ne,x,Le]),Te=async()=>{try{const I=await Q.getSchedules();I!=null&&I.schedules&&(h(I.schedules),I.timezone&&p(I.timezone))}catch(I){d(I.message,"error")}finally{y(!1)}},bt=async()=>{C(!0);try{const I=await Q.getRecipients();I!=null&&I.recipients&&j(I.recipients)}catch{}finally{C(!1)}};S.useEffect(()=>{Te(),l&&bt()},[l]);const Pt=async I=>{try{await Q.deleteSchedule(I),d(c("savedSuccessfully"),"success"),h(Ae=>Ae.filter(L=>L.id!==I))}catch(Ae){d(Ae.message,"error")}},pt=async I=>{if(!l){d(o==="ar"?"واتساب غير متصل، يرجى بدء الاتصال أولاً":"WhatsApp is disconnected, please connect first","warning");return}try{await Q.retrySchedule(I),d(o==="ar"?"تمت إعادة محاولة الإرسال":"Delivery retry triggered","info"),Te()}catch(Ae){d(Ae.message,"error")}},wt=async()=>{const I=window.LevixHost;if(!(I!=null&&I.pickContact)){d(o==="ar"?"دليل الهاتف متاح من تطبيق أندرويد فقط":"Phone book is available in the Android app","info");return}const Ae=await new Promise(at=>{var Xe;const xt=Fe=>{window.removeEventListener("levix-contact",xt);const rn=Fe.detail;if(!(rn!=null&&rn.phone)){at(null);return}at({name:String(rn.name||""),phone:String(rn.phone)})};window.addEventListener("levix-contact",xt);try{(Xe=I.pickContact)==null||Xe.call(I)}catch{window.removeEventListener("levix-contact",xt),at(null)}});if(!Ae)return;const L=xw(Ae.phone);if(!L){d(o==="ar"?"الرقم غير صالح. استخدم رقمًا مع كود الدولة.":"That number is not valid. Use a number with country code.","error");return}const Se=`+${L.split("@")[0]}`,Ge=xa(Ae.name);O({id:L,name:Ge||Se,savedName:Ge,pushName:null,phone:Se,type:"contact"})},bn=()=>{O(null),q(""),F(""),k("recurring"),X("daily"),oe("09:00"),$([1]),P(1),ue(1),D(0),ke(""),le(null),ye(null)},me=()=>{le(null),ye(null)},_e=async()=>{try{const I=await Ty();if(!I)return;if(I.size>it){d(c("feedbackFileTooLarge").replace("{max}",String(ne)),"error");return}ye(I)}catch(I){d((I==null?void 0:I.message)||"Could not attach the file","error")}},rt=()=>{if(!l){d(o==="ar"?"يلزم اتصال واتساب لجدولة الرسائل":"Active WhatsApp connection is required to schedule messages","warning");return}if(Oe){d(c("maxSchedulesReached"),"warning");return}bn(),Z(!0),b.length||bt()},Vt=I=>{$(Ae=>Ae.includes(I)?Ae.filter(L=>L!==I):[...Ae,I].sort((L,Se)=>L-Se))},$t=async()=>{if(!w){d(o==="ar"?"يرجى اختيار المحادثة المستهدفة":"Please select a recipient chat","warning");return}if(!re.trim()&&!E&&!se){d(o==="ar"?"يرجى كتابة نص الرسالة أو إرفاق ملف":"Please write the message text or attach a file","warning");return}if(M==="once"&&(!ae||new Date(ae).getTime()<=Date.now())){d(o==="ar"?"يرجى تحديد وقت وتاريخ مستقبلي صالح":"Please select a valid future date and time","warning");return}if(M==="recurring"&&K==="weekly"&&ce.length===0){d(c("weekdayRequired"),"warning");return}N(!0);const I={targetJid:w.id,message:re.trim(),type:M};if(w.type==="contact"){const Ae=xa(w.savedName)||xa(w.name);Ae&&Ae!==w.phone&&(I.targetName=Ae)}if(M==="recurring"){const Ae={kind:K};K==="hourly"?(Ae.everyHours=J,Ae.time=`00:${Sf(Ne)}`):(Ae.time=ie,K==="weekly"&&(Ae.weekdays=ce),K==="monthly"&&(Ae.dayOfMonth=Y)),I.recurrence=Ae}else I.scheduledTime=new Date(ae).getTime();try{const Ae={};for(const[L,Se]of Object.entries(I))Ae[L]=L==="recurrence"?JSON.stringify(Se):String(Se);se?await zy("/dashboard/api/schedules",Ae,se.token,it+1024*1024):E?await Q.postMultipart("/schedules",Ae,E):await Q.createSchedule(I),d(c("savedSuccessfully"),"success"),Z(!1),bn(),Te()}catch(Ae){d(Ae.message,"error")}finally{N(!1)}},Et=b.filter(I=>{var L,Se,Ge;const Ae=A.toLowerCase().trim();return Ae?I.name.toLowerCase().includes(Ae)||!!((L=I.savedName)!=null&&L.toLowerCase().includes(Ae))||!!((Se=I.pushName)!=null&&Se.toLowerCase().includes(Ae))||!!((Ge=I.phone)!=null&&Ge.toLowerCase().includes(Ae)):!0}),Wt=(I,Ae,L=!0)=>{var Xe;if(I.type==="group"||I.targetKind==="group"||!!((Xe=I.targetJid)!=null&&Xe.includes("@g.us"))){const Fe=xa(I.name)||(xa(I.targetLabel)&&I.targetLabel!=="Group"?I.targetLabel:null)||c("groupFallback");return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-brand-cyan min-w-0",children:[L&&s.jsx(Ns,{size:14,className:"shrink-0"}),s.jsx("span",{className:`${Ae} truncate`,children:Fe})]})}const Ge=I.phone||I.targetPhone||null,at=gw(I,c("contactFallback")),xt=!!(Ge&&at!==Ge);return s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-ok min-w-0",children:[L&&s.jsx(Ed,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:`${Ae} truncate block`,children:at}),xt&&s.jsx("span",{className:"block text-[11px] text-muted font-mono",dir:"ltr",children:Ge})]})]})};return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[!l&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-warn/20 text-warn flex items-center justify-center shrink-0",children:s.jsx(Ei,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm sm:text-base font-bold text-warn",children:o==="ar"?"واتساب غير متصل حالياً":"WhatsApp is Disconnected"}),s.jsx("p",{className:"text-xs sm:text-sm text-text-main/80 mt-0.5",children:o==="ar"?"يلزم وجود اتصال نشط بواتساب لجدولة الرسائل وإرسالها واختيار جهات الاتصال.":"An active WhatsApp connection is required to schedule messages, fetch chats, and deliver automated jobs."})]})]}),s.jsx("button",{type:"button",onClick:()=>i==null?void 0:i("connection"),className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl bg-warn hover:bg-warn/90 text-bg font-bold text-xs sm:text-sm shadow-sm transition-all shrink-0",children:s.jsx("span",{children:o==="ar"?"الذهاب للاتصال":"Go to Connection"})})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(ff,{size:24})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:c("schedules")}),s.jsxs("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-bold border ${Oe?"bg-warn/15 text-warn border-warn/30":"bg-brand-cyan/10 text-brand-cyan border-brand-cyan/20"}`,children:[f.length," / ",xe," ",c("scheduledCount")]})]}),s.jsxs("p",{className:"text-xs md:text-sm text-muted mt-1",children:[c("timezoneLabel"),":"," ",s.jsx("code",{className:"text-brand-cyan font-mono font-semibold px-1.5 py-0.5 rounded bg-bg-soft border border-line",children:x})," ","· ",c("headerSubtitle")]})]})]}),s.jsxs("button",{type:"button",onClick:rt,disabled:Oe||!l,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-5 h-12 sm:h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 shrink-0 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Uo,{size:18}),s.jsx("span",{children:l?c(Oe?"limitReached":"scheduleNewMsg"):o==="ar"?"يلزم اتصال واتساب":"Connection Required"})]})]}),s.jsx("div",{className:"rounded-2xl border border-line bg-panel overflow-hidden shadow-sm overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[680px] text-start border-collapse text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-panel-raised border-b border-line text-xs font-bold text-muted uppercase tracking-wider",children:[s.jsx("th",{className:"px-5 py-4 text-start",children:c("thTarget")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thMessage")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thSchedule")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thType")}),s.jsx("th",{className:"px-5 py-4 text-start",children:c("thDelivery")}),s.jsx("th",{className:"px-5 py-4 text-center",children:c("thActions")})]})}),s.jsx("tbody",{className:"divide-y divide-line/40",children:v?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:c("loading")})]})})}):f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"text-center py-16 text-muted text-xs sm:text-sm",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx(ff,{size:28,className:"text-muted/40"}),s.jsx("span",{children:c("noSchedules")})]})})}):f.map(I=>{var Ae;return s.jsxs("tr",{onClick:()=>fe(I),className:"cursor-pointer hover:bg-panel-hover/50 transition-colors",children:[s.jsx("td",{className:"px-5 py-4 text-xs text-text-main",children:s.jsx("bdi",{children:Wt({targetJid:I.targetJid,targetKind:I.targetKind,targetLabel:I.targetLabel,targetPhone:I.targetPhone,savedName:I.savedName,pushName:I.pushName,phone:I.phone},"font-semibold max-w-[12rem]")})}),s.jsxs("td",{className:"px-5 py-4 max-w-xs text-text-main truncate text-xs sm:text-sm",children:[I.media&&s.jsx(vs,{size:12,className:"inline me-1 text-brand-cyan"}),I.message||((Ae=I.media)!=null&&Ae.fileName?I.media.fileName:"—")]}),s.jsx("td",{className:"px-5 py-4 text-xs text-muted",children:Le?I.whenAr||I.when:I.when||I.cronString||"—"}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("span",{className:`inline-flex px-2.5 py-0.5 rounded-lg text-xs font-semibold ${I.type==="recurring"?"bg-brand-blue/10 text-brand-cyan":"bg-purple-500/10 text-purple-400"}`,children:I.type==="recurring"?c("typeRecurring"):c("typeOnce")})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold ${I.lastDeliveryStatus==="failed"?"bg-danger/10 text-danger border border-danger/25":I.status==="active"?"bg-ok/10 text-ok border border-ok/25":"bg-muted/10 text-muted"}`,children:[I.lastDeliveryStatus==="failed"?s.jsx(Ei,{size:13}):s.jsx(js,{size:13}),s.jsx("span",{children:I.lastDeliveryStatus==="failed"?c("deliveryFailed"):I.status==="active"?c("deliveryActive"):I.status})]})}),s.jsx("td",{className:"px-5 py-4 text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[I.lastDeliveryStatus==="failed"&&s.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),pt(I.id)},className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-line bg-panel-raised hover:bg-panel-hover text-brand-cyan transition-colors",title:c("retryDelivery"),children:s.jsx(Ui,{size:14})}),s.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),Pt(I.id)},className:"inline-flex items-center justify-center w-8 h-8 rounded-lg border border-danger/25 bg-danger/10 hover:bg-danger/20 text-danger transition-colors",title:c("delete"),children:s.jsx(ws,{size:14})})]})})]},I.id)})})]})}),s.jsx(Jt,{isOpen:W,onClose:()=>Z(!1),title:c("scheduleNewMsg"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex items-center justify-end gap-2.5 w-full",children:[s.jsx("button",{type:"button",onClick:()=>Z(!1),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:c("cancel")}),s.jsx("button",{type:"button",onClick:$t,disabled:Ce||!w||!re.trim()&&!E&&!se,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all disabled:opacity-50",children:c(Ce?"saving":"scheduleAction")})]}),children:s.jsxs("div",{className:"flex flex-col gap-4 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"block text-xs font-bold text-text-main",children:[c("selectRecipient")," ",s.jsx("span",{className:"text-danger",children:"*"})]}),w?s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl border border-brand-blue/40 bg-brand-blue/10",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-blue/20 text-brand-cyan flex items-center justify-center shrink-0",children:w.type==="group"?s.jsx(Ns,{size:16}):s.jsx(Ed,{size:16})}),s.jsx("div",{className:"min-w-0",children:Wt(w,"text-xs sm:text-sm font-bold text-text-main",!1)})]}),s.jsx("button",{type:"button",onClick:()=>O(null),className:"p-1 rounded-lg hover:bg-panel text-muted hover:text-danger transition-colors",title:c("changeChat"),children:s.jsx(kl,{size:16})})]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Tf,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{type:"search",value:A,onChange:I=>q(I.target.value),placeholder:c("searchRecipients"),"aria-label":c("searchRecipients"),className:"w-full h-10 ps-9 pe-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),pw()&&s.jsxs("button",{type:"button",onClick:wt,className:"inline-flex items-center justify-center gap-1.5 h-10 px-3 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main text-xs font-bold shrink-0",title:c("pickPhoneContactHint"),children:[s.jsx(cN,{size:15}),s.jsx("span",{className:"hidden sm:inline",children:c("pickPhoneContact")})]})]}),s.jsx("div",{className:"max-h-48 overflow-y-auto rounded-xl border border-line bg-panel-raised divide-y divide-line/40",children:z?s.jsx("div",{className:"p-4 text-center text-xs text-muted",children:c("loading")}):Et.length===0?s.jsx("div",{className:"p-4 text-center text-xs text-muted",children:c("noRecipientsFound")}):Et.map(I=>s.jsxs("button",{type:"button",onClick:()=>O(I),className:"w-full p-2.5 flex items-center justify-between gap-2 hover:bg-panel text-start transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-panel border border-line flex items-center justify-center shrink-0 text-muted",children:I.type==="group"?s.jsx(Ns,{size:14}):s.jsx(Ed,{size:14})}),s.jsx("div",{className:"min-w-0",children:Wt(I,"text-xs font-bold text-text-main",!1)})]}),s.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded bg-panel text-muted shrink-0",children:I.type==="group"?c("groupFallback"):c("contactFallback")})]},I.id))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"schedule-type",className:"block text-xs font-bold text-text-main",children:c("scheduleType")}),s.jsxs("select",{id:"schedule-type",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:M,onChange:I=>k(I.target.value),children:[s.jsx("option",{value:"recurring",children:c("scheduleRecurring")}),s.jsx("option",{value:"once",children:c("scheduleOnce")})]})]}),M==="recurring"?s.jsxs("div",{className:"space-y-3 rounded-xl border border-line bg-panel-raised/40 p-3.5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"repeat-kind",className:"block text-xs font-bold text-text-main",children:c("repeat")}),s.jsxs("select",{id:"repeat-kind",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:K,onChange:I=>X(I.target.value),children:[s.jsx("option",{value:"daily",children:c("repeatDaily")}),s.jsx("option",{value:"weekly",children:c("repeatWeekly")}),s.jsx("option",{value:"monthly",children:c("repeatMonthly")}),s.jsx("option",{value:"hourly",children:c("repeatHourly")})]})]}),K==="weekly"&&s.jsxs("fieldset",{className:"space-y-1.5",children:[s.jsx("legend",{className:"block text-xs font-bold text-text-main",children:c("weekdays")}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:fw.map((I,Ae)=>{const L=ce.includes(Ae);return s.jsx("button",{type:"button","aria-pressed":L,onClick:()=>Vt(Ae),className:`h-9 px-2.5 rounded-lg text-xs font-bold border transition-colors ${L?"bg-brand-blue text-white border-brand-blue":"bg-panel-raised text-text-main border-line hover:bg-panel-hover"}`,children:c(I)},I)})})]}),K==="monthly"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"day-of-month",className:"block text-xs font-bold text-text-main",children:c("dayOfMonth")}),s.jsx("input",{id:"day-of-month",type:"number",min:1,max:31,inputMode:"numeric",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:Y,onChange:I=>P(Number(I.target.value))}),s.jsx("p",{className:"text-xs text-muted",children:c("monthDayHint")})]}),K==="hourly"?s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"every-hours",className:"block text-xs font-bold text-text-main",children:c("everyHours")}),s.jsx("select",{id:"every-hours",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:J,onChange:I=>ue(Number(I.target.value)),children:My.map(I=>s.jsx("option",{value:I,children:I},I))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"hourly-minute",className:"block text-xs font-bold text-text-main",children:c("atMinute")}),s.jsx("input",{id:"hourly-minute",type:"number",min:0,max:59,inputMode:"numeric",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:Ne,onChange:I=>D(Number(I.target.value)),dir:"ltr"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{htmlFor:"send-time",className:"block text-xs font-bold text-text-main",children:[c("sendTime"),s.jsxs("span",{className:"ms-1.5 font-semibold text-muted",children:["(",x,")"]})]}),s.jsx("input",{id:"send-time",type:"time",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:ie,onChange:I=>oe(I.target.value),dir:"ltr"})]}),s.jsxs("p",{className:"text-xs text-text-main/90 bg-bg-soft border border-line rounded-lg px-3 py-2",children:[s.jsxs("span",{className:"font-bold text-muted",children:[c("recurrencePreview"),": "]}),s.jsx("span",{dir:"auto",children:Re||"—"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"one-off-time",className:"block text-xs font-bold text-text-main",children:c("deliveryDateTime")}),s.jsx("input",{id:"one-off-time",type:"datetime-local",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:ae,onChange:I=>ke(I.target.value),dir:"ltr"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{htmlFor:"schedule-message",className:"block text-xs font-bold text-text-main",children:[c("messageText")," ",!E&&!se&&s.jsx("span",{className:"text-danger",children:"*"})]}),s.jsx("textarea",{id:"schedule-message",className:"w-full p-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50 resize-y min-h-[90px]",rows:3,placeholder:c("messagePlaceholder"),value:re,onChange:I=>F(I.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("span",{className:"block text-xs font-bold text-text-main",children:c("scheduleAttachMedia")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[se||E?s.jsxs("span",{className:"inline-flex items-center gap-2 ps-3 pe-2 h-10 rounded-xl border border-brand-blue/40 bg-brand-blue/10 text-xs sm:text-sm text-text-main max-w-full",children:[s.jsx(vs,{size:14,className:"text-brand-cyan shrink-0"}),s.jsx("span",{className:"truncate max-w-[220px]",children:(se==null?void 0:se.name)??(E==null?void 0:E.name)}),s.jsx("button",{type:"button",onClick:me,"aria-label":c("scheduleRemoveMedia"),className:"w-7 h-7 rounded-lg text-muted hover:text-danger hover:bg-danger/10 flex items-center justify-center transition-colors",children:s.jsx(kl,{size:14})})]}):s.jsxs("button",{type:"button",onClick:()=>{var I;return Ro()?void _e():(I=ge.current)==null?void 0:I.click()},className:"inline-flex items-center gap-2 px-3 h-10 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-bold hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(vs,{size:14,className:"text-brand-cyan shrink-0"}),s.jsx("span",{children:c("scheduleAttachMedia")})]}),s.jsx("span",{className:"text-[11px] text-muted",children:c("scheduleMediaHint").replace("{max}",String(ne))})]}),!Ro()&&s.jsx("input",{ref:ge,type:"file",className:"sr-only",onChange:I=>{var L;const Ae=((L=I.target.files)==null?void 0:L[0])??null;if(I.target.value="",!!Ae){if(Ae.size>it){d(c("feedbackFileTooLarge").replace("{max}",String(ne)),"error");return}le(Ae)}}})]})]})}),s.jsx(Jt,{isOpen:!!de,onClose:()=>fe(null),title:c("scheduleDetails"),maxWidth:"560px",footer:s.jsxs("div",{className:"flex items-center justify-between w-full gap-2",children:[(de==null?void 0:de.lastDeliveryStatus)==="failed"?s.jsxs("button",{type:"button",onClick:()=>{const I=de.id;fe(null),pt(I)},className:"inline-flex items-center gap-1.5 px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-brand-cyan font-bold text-xs sm:text-sm transition-colors",children:[s.jsx(Ui,{size:14}),s.jsx("span",{children:c("retryDelivery")})]}):s.jsx("span",{}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>fe(null),className:"px-4 h-10 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-colors",children:c("close")}),s.jsxs("button",{type:"button",onClick:()=>{const I=de==null?void 0:de.id;fe(null),I&&Pt(I)},className:"inline-flex items-center gap-1.5 px-4 h-10 rounded-xl bg-danger hover:bg-danger/90 text-white font-bold text-xs sm:text-sm transition-colors",children:[s.jsx(ws,{size:14}),s.jsx("span",{children:c("delete")})]})]})]}),children:de&&s.jsxs("div",{className:"flex flex-col gap-3.5 py-1 text-xs sm:text-sm",children:[s.jsx(ha,{label:c("thTarget"),children:s.jsx("bdi",{children:Wt({targetJid:de.targetJid,targetKind:de.targetKind,targetLabel:de.targetLabel,targetPhone:de.targetPhone,savedName:de.savedName,pushName:de.pushName,phone:de.phone},"font-semibold",!1)})}),s.jsx(ha,{label:c("thMessage"),children:de.message?s.jsx("span",{className:"whitespace-pre-wrap break-words",children:de.message}):s.jsx("span",{className:"text-muted",children:"—"})}),de.media&&s.jsx(ha,{label:c("detailMedia"),children:s.jsxs("span",{className:"inline-flex items-center gap-1.5 min-w-0",children:[s.jsx(vs,{size:13,className:"text-brand-cyan shrink-0"}),s.jsxs("span",{className:"truncate",children:[vw(c,de.media.kind),de.media.fileName?` · ${de.media.fileName}`:""]})]})}),s.jsx(ha,{label:c("thSchedule"),children:s.jsx("span",{dir:"auto",children:Le&&de.whenAr||de.when})}),s.jsx(ha,{label:c("thType"),children:de.type==="recurring"?c("typeRecurring"):c("typeOnce")}),s.jsx(ha,{label:c("thDelivery"),children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold ${de.lastDeliveryStatus==="failed"?"bg-danger/10 text-danger border border-danger/25":de.status==="active"?"bg-ok/10 text-ok border border-ok/25":"bg-muted/10 text-muted"}`,children:[de.lastDeliveryStatus==="failed"?s.jsx(Ei,{size:13}):s.jsx(js,{size:13}),s.jsx("span",{children:de.lastDeliveryStatus==="failed"?c("deliveryFailed"):de.status==="active"?c("deliveryActive"):de.status})]})}),de.lastRunAt&&s.jsx(ha,{label:c("detailLastRun"),children:new Date(de.lastRunAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")}),de.lastError&&s.jsx(ha,{label:c("detailError"),children:s.jsx("span",{className:"text-danger break-words",dir:"auto",children:de.lastError})}),de.createdAt&&s.jsx(ha,{label:c("detailCreated"),children:new Date(de.createdAt).toLocaleString(o==="ar"?"ar-EG":"en-GB")})]})})]})},rf={messageMin:10,messageMax:2e3,attachmentMax:20*1024*1024},of={bug:{icon:uN,labelKey:"feedbackTopicBug"},idea:{icon:kN,labelKey:"feedbackTopicIdea"},question:{icon:pf,labelKey:"feedbackTopicQuestion"},praise:{icon:jN,labelKey:"feedbackTopicPraise"},other:{icon:Bi,labelKey:"feedbackTopicOther"}},Sw=["bug","idea","question","praise","other"],ww=()=>{var Ne;const{t:l}=We(),{toast:i}=Gt(),[c,o]=S.useState(null),[d,f]=S.useState("bug"),[h,x]=S.useState(""),[p,v]=S.useState(0),[y,b]=S.useState(""),[j,z]=S.useState(null),[C,w]=S.useState(null),[O,A]=S.useState(null),[q,W]=S.useState(!1),[Z,re]=S.useState(!1),F=S.useRef(null);S.useEffect(()=>{Q.getFeedbackMeta().then(o).catch(()=>{})},[]);const M=(c==null?void 0:c.messageMin)??rf.messageMin,k=(c==null?void 0:c.messageMax)??rf.messageMax,K=(c==null?void 0:c.attachmentMax)??rf.attachmentMax,X=Math.round(K/(1024*1024)),ie=h.trim(),oe=Math.max(0,M-ie.length),ce=((Ne=c==null?void 0:c.topics)!=null&&Ne.length?c.topics:Sw).filter(D=>D in of),$=()=>i(l("feedbackFileTooLarge").replace("{max}",String(X)),"error"),Y=async()=>{try{const D=await Ty();if(!D)return;if(D.size>K){$();return}w(D)}catch(D){i((D==null?void 0:D.message)||"Could not attach the file","error")}},P=async D=>{if(D.preventDefault(),oe>0||q)return;W(!0),A(C?0:null);const ae={message:ie,topic:d,rating:p||null,contact:y.trim()||null};try{C?await zy("/dashboard/api/feedback",{message:ae.message,topic:ae.topic,...ae.rating?{rating:String(ae.rating)}:{},...ae.contact?{contact:ae.contact}:{}},C.token,K+1024*1024):j?await Q.sendFeedbackMultipart(ae,j,ke=>A(ke)):await Q.sendFeedback(ae),re(!0),i(l("feedbackSent"),"success")}catch(ke){i(ke==null?void 0:ke.message,"error")}finally{W(!1),A(null)}},J=()=>{x(""),b(""),v(0),f("bug"),z(null),w(null),re(!1)},ue=()=>{z(null),w(null)};return Z?s.jsxs("div",{className:"rounded-2xl border border-ok/30 bg-panel p-6 sm:p-8 text-center shadow-sm",children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-ok/10 text-ok flex items-center justify-center",children:s.jsx(js,{size:26})}),s.jsx("h3",{className:"mt-4 text-lg font-bold text-text-main",children:l("feedbackSent")}),s.jsx("p",{className:"mt-2 mx-auto max-w-md text-xs sm:text-sm text-muted leading-relaxed",children:l("feedbackSentDesc")}),s.jsx("button",{type:"button",onClick:J,className:"mt-6 inline-flex items-center justify-center px-4 h-11 rounded-xl border border-line bg-panel-raised text-text-main font-bold text-xs sm:text-sm hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:l("feedbackSendAnother")})]}):s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("form",{onSubmit:P,className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 sm:w-11 sm:h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(Bi,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("feedbackTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("feedbackDesc")})]})]}),s.jsxs("fieldset",{className:"flex flex-col gap-2",children:[s.jsx("legend",{className:"text-xs sm:text-sm font-bold text-text-main mb-2",children:l("feedbackTopicLabel")}),s.jsx("div",{className:"flex flex-wrap gap-2",children:ce.map(D=>{const ae=of[D].icon,ke=d===D;return s.jsxs("button",{type:"button","aria-pressed":ke,onClick:()=>f(D),className:Ot("inline-flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl border font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",ke?"bg-brand-blue text-white border-brand-blue shadow-md shadow-brand-blue/20":"bg-panel-raised border-line text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(ae,{size:16,className:"shrink-0"}),s.jsx("span",{children:l(of[D].labelKey)})]},D)})})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{htmlFor:"feedback-message",className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackMessageLabel")}),s.jsx("textarea",{id:"feedback-message",rows:6,required:!0,maxLength:k,value:h,onChange:D=>x(D.target.value),placeholder:l("feedbackMessagePlaceholder"),className:"w-full resize-y px-3.5 py-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-brand-blue/50"}),s.jsx("span",{className:"self-end text-[11px] text-muted tabular-nums",children:oe>0?`${oe} ${l("feedbackCharsNeeded")}`:`${h.length} / ${k}`})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackAttach")}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C||j?s.jsxs("span",{className:"inline-flex items-center gap-2 ps-3 pe-2 h-10 rounded-xl border border-line bg-panel-raised text-xs sm:text-sm text-text-main max-w-full",children:[s.jsx(vs,{size:14,className:"text-brand-cyan shrink-0"}),s.jsx("span",{className:"truncate max-w-[200px]",children:(C==null?void 0:C.name)??(j==null?void 0:j.name)}),s.jsx("button",{type:"button",onClick:ue,"aria-label":l("feedbackRemoveAttachment"),className:"w-7 h-7 rounded-lg text-muted hover:text-danger hover:bg-danger/10 flex items-center justify-center transition-colors",children:s.jsx(kl,{size:14})})]}):s.jsxs("button",{type:"button",onClick:()=>{var D;return Ro()?void Y():(D=F.current)==null?void 0:D.click()},className:"inline-flex items-center gap-2 px-3 h-10 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-bold hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(vs,{size:14,className:"text-brand-cyan shrink-0"}),s.jsx("span",{children:l("feedbackAttach")})]}),s.jsx("span",{className:"text-[11px] text-muted",children:l("feedbackAttachmentHint").replace("{max}",String(X))})]}),!Ro()&&s.jsx("input",{ref:F,type:"file",className:"sr-only",onChange:D=>{var ke;const ae=((ke=D.target.files)==null?void 0:ke[0])??null;if(D.target.value="",!!ae){if(ae.size>K){$();return}z(ae)}}})]}),s.jsxs("fieldset",{className:"flex flex-col gap-2",children:[s.jsx("legend",{className:"text-xs sm:text-sm font-bold text-text-main mb-1",children:l("feedbackRatingLabel")}),s.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(D=>s.jsx("button",{type:"button","aria-label":`${D} / 5`,"aria-pressed":p===D,onClick:()=>v(p===D?0:D),className:"p-2 rounded-lg hover:bg-panel-hover transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:s.jsx(Mf,{size:22,className:Ot("transition-colors",D<=p?"fill-brand-cyan text-brand-cyan":"text-muted")})},D))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("label",{htmlFor:"feedback-contact",className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackContactLabel")}),s.jsx("input",{id:"feedback-contact",type:"text",maxLength:200,value:y,onChange:D=>b(D.target.value),placeholder:l("feedbackContactPlaceholder"),className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50"})]}),q&&(C||j)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:C?s.jsx("div",{className:"h-full w-1/3 rounded-full bg-brand-blue animate-pulse"}):s.jsx("div",{className:"h-full rounded-full bg-brand-blue transition-[width]",style:{width:`${Math.max(4,Math.round((O??0)*100))}%`}})}),s.jsxs("span",{className:"text-[11px] text-muted tabular-nums",children:[l("feedbackSending"),!C&&O!==null&&O>0?` ${Math.round(O*100)}%`:"…"]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 pt-1",children:[c!=null&&c.runtime?s.jsxs("span",{className:"text-[11px] text-muted",children:[l("feedbackRuntimeLabel"),": v",c.runtime.version," · ",c.runtime.platform]}):s.jsx("span",{}),s.jsxs("button",{type:"submit",disabled:oe>0||q,className:"inline-flex items-center justify-center gap-2 px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm transition-all shadow-md shadow-brand-blue/20 focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(Bi,{size:16}),s.jsx("span",{children:l(q?"feedbackSending":"feedbackSendBtn")})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(zf,{size:16,className:"text-brand-cyan shrink-0"}),s.jsx("h4",{className:"text-xs sm:text-sm font-bold text-text-main",children:l("feedbackWhatIsSent")})]}),s.jsx("p",{className:"text-xs sm:text-sm text-muted leading-relaxed",children:l("feedbackWhatIsSentDesc")}),s.jsxs("div",{className:"pt-2 border-t border-line flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[s.jsx("span",{className:"text-xs text-muted leading-relaxed",children:l("feedbackGithubHint")}),s.jsxs("a",{href:"https://github.com/Abdodiab2005/levix/issues",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-xs font-bold text-brand-cyan hover:underline whitespace-nowrap",children:[l("feedbackOpenGithub"),s.jsx(yN,{size:13})]})]})]})]})},kw=["!","/",".","#","$","?"],_w="levix-settings";function Cw(l){const i=new TextEncoder().encode(l);let c="";for(const o of i)c+=String.fromCharCode(o);return btoa(c)}const Ew=()=>{var de,fe,xe,it;const{t:l,language:i,setLanguage:c}=We(),{toast:o}=Gt(),[d,f]=S.useState("general"),[h,x]=S.useState({}),[p,v]=S.useState(!0),[y,b]=S.useState("!"),[j,z]=S.useState("!"),[C,w]=S.useState(!1),[O,A]=S.useState(""),[q,W]=S.useState(""),[Z,re]=S.useState(""),[F,M]=S.useState(!1),[k,K]=S.useState(!1),[X,ie]=S.useState(!1),[oe,ce]=S.useState(!1),[$,Y]=S.useState(!1),[P,J]=S.useState(!1),[ue,Ne]=S.useState(!1),[D,ae]=S.useState(null),ke=S.useRef(null),Ce=async()=>{var ne;J(!0);try{const Oe=await Q.exportSettings(),Le=JSON.stringify(Oe,null,2),Re=`levix-settings-${((ne=Oe.exportedAt)==null?void 0:ne.slice(0,10))||"export"}.json`,Te=window.LevixHost;if(Te&&typeof Te.saveExportFile=="function"){const wt=JSON.parse(Te.saveExportFile(Re,Cw(Le)));if(!(wt!=null&&wt.ok))throw new Error((wt==null?void 0:wt.error)||l("exportSettingsError"));o(`${l("exportSettingsSuccess")} — ${l("exportSavedTo")} ${wt.dir}`,"success");return}const bt=new Blob([Le],{type:"application/json"}),Pt=URL.createObjectURL(bt),pt=document.createElement("a");pt.href=Pt,pt.download=Re,pt.click(),URL.revokeObjectURL(Pt),o(l("exportSettingsSuccess"),"success")}catch(Oe){o(Oe.message||l("exportSettingsError"),"error")}finally{J(!1)}},N=async ne=>{var Re;const Oe=(Re=ne.target.files)==null?void 0:Re[0];if(ne.target.value="",!Oe)return;let Le;try{Le=JSON.parse(await Oe.text())}catch{o(l("importSettingsError"),"error");return}if((Le==null?void 0:Le.format)!==_w){o(l("importSettingsError"),"error");return}ae(Le)},E=async()=>{var ne,Oe,Le;if(D){Ne(!0);try{const Re=await Q.importSettings(D),Te=[`${((ne=Re.applied)==null?void 0:ne.length)||0} ${l("importSettingsCount")}`];(Oe=Re.skipped)!=null&&Oe.length&&Te.push(`${l("importSkipped")}: ${Re.skipped.length}`),(Le=Re.restartNeeded)!=null&&Le.length&&Te.push(`${l("importRestartNeeded")}: ${Re.restartNeeded.join(", ")}`),o(`${l("importSuccess")} — ${Te.join(" · ")}`,"success"),ae(null),await le()}catch(Re){o(Re.message,"error")}finally{Ne(!1)}}},le=async()=>{try{const ne=await Q.getSettings();if(ne!=null&&ne.settings){const Oe={};ne.settings.forEach(Le=>{Oe[Le.key]=Le.value}),x(Oe)}ne!=null&&ne.prefix&&(b(ne.prefix),z(ne.prefix))}catch(ne){o(ne.message,"error")}finally{v(!1)}};S.useEffect(()=>{le()},[]);const se=async(ne,Oe)=>{x(Le=>({...Le,[ne]:Oe}));try{await Q.updateSetting(ne,Oe),o(l("savedSuccessfully"),"success")}catch(Le){o(Le.message,"error")}},ye=async ne=>{const Oe=(ne!==void 0?ne:j).trim();if(!Oe||Oe.length>3){o(l("prefixValidation"),"error");return}w(!0);try{await Q.updatePrefix(Oe),b(Oe),z(Oe),o(`${l("prefixUpdated")} (${Oe})`,"success")}catch(Le){o(Le.message,"error")}finally{w(!1)}},ge=async ne=>{if(ne.preventDefault(),q!==Z){o(l("passwordMatchError"),"error");return}if(q.length<8){o(l("passwordMinLength"),"error");return}M(!0);try{await Q.changePassword(O,q),o(l("passwordChangedSuccess"),"success"),A(""),W(""),re("")}catch(Oe){o(Oe.message,"error")}finally{M(!1)}};return p?s.jsxs("div",{className:"flex items-center justify-center p-12 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin mr-2"}),s.jsx("span",{className:"text-sm font-semibold",children:l("loading")})]}):s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{role:"tablist","aria-label":"Settings Categories",className:"flex items-center gap-1.5 p-1.5 rounded-2xl bg-panel border border-line overflow-x-auto no-scrollbar shadow-sm",children:[s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="general",onClick:()=>f("general"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="general"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(A0,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabGeneral")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="integrations",onClick:()=>f("integrations"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="integrations"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(mf,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabIntegrations")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="proxy",onClick:()=>f("proxy"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="proxy"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(Ri,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabProxy")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="security",onClick:()=>f("security"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="security"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(zf,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabSecurity")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="storage",onClick:()=>f("storage"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="storage"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(wg,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabStorage")})]}),s.jsxs("button",{type:"button",role:"tab","aria-selected":d==="feedback",onClick:()=>f("feedback"),className:Ot("flex items-center gap-2 px-3.5 py-2.5 min-h-[44px] rounded-xl font-bold text-xs sm:text-sm whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",d==="feedback"?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:text-text-main hover:bg-panel-hover"),children:[s.jsx(TN,{size:17,className:"shrink-0"}),s.jsx("span",{children:l("tabFeedback")})]})]}),d==="general"&&s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-gradient-to-br from-panel-raised to-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4 sm:gap-5",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 sm:w-11 sm:h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(Ss,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("prefixTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("prefixDesc")})]})]}),s.jsxs("div",{className:"flex items-center gap-2 self-start sm:self-auto",children:[s.jsxs("span",{className:"text-xs text-muted font-semibold",children:[l("activePrefix"),":"]}),s.jsx("span",{className:"inline-flex items-center justify-center px-3 py-1 rounded-lg bg-brand-cyan/15 text-brand-cyan font-mono font-bold text-base border border-brand-cyan/30 shadow-sm",children:y})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4 pt-1",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs text-muted font-semibold",children:l("prefixPresets")}),s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:kw.map(ne=>{const Oe=y===ne;return s.jsx("button",{type:"button",className:Ot("w-10 h-10 sm:w-11 sm:h-11 rounded-xl border font-mono font-bold text-sm transition-all flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",Oe?"bg-brand-cyan text-slate-900 border-brand-cyan shadow-sm":"bg-panel-raised border-line text-text-main hover:bg-panel-hover"),onClick:()=>{z(ne),ye(ne)},children:ne},ne)})})]}),s.jsxs("div",{className:"flex flex-col gap-1.5 flex-1 min-w-[200px]",children:[s.jsx("span",{className:"text-xs text-muted font-semibold",children:l("changePrefix")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",className:"w-20 sm:w-24 h-11 px-3 text-center font-mono font-bold text-base rounded-xl border border-line bg-panel text-text-main focus:outline-none focus:ring-2 focus:ring-brand-blue/50 shrink-0",maxLength:3,placeholder:l("prefixPlaceholder"),value:j,onChange:ne=>z(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&ye()}}),s.jsxs("button",{type:"button",onClick:()=>ye(),disabled:C||j.trim()===y,className:"inline-flex items-center justify-center gap-2 px-4 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm whitespace-nowrap transition-all shadow-md shadow-brand-blue/20 focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",children:[s.jsx(Oo,{size:16}),s.jsx("span",{children:l(C?"saving":"prefixSaveBtn")})]})]})]})]}),s.jsxs("div",{className:"rounded-xl bg-bg-soft/70 border border-line p-3 flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:[s.jsx("span",{className:"font-semibold text-muted",children:l("prefixPreview")}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[j||y,"help"]})}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[j||y,"lang ar"]})}),s.jsx("div",{className:"px-2 py-0.5 rounded-lg bg-panel border border-line font-mono font-medium text-brand-cyan text-xs",children:s.jsxs("code",{children:[j||y,"sticker"]})})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:i==="ar"?"سلوك النظام والردود":"System Behavior & Delays"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("interfaceLanguage")}),s.jsxs("select",{className:"w-full h-11 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:i,onChange:ne=>c(ne.target.value),children:[s.jsx("option",{value:"ar",children:"العربية (RTL - اليمين لليسار)"}),s.jsx("option",{value:"en",children:"English (LTR - Left to Right)"})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("interfaceLanguageDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botLanguage")}),s.jsxs("select",{className:"w-full h-11 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_language||"auto",onChange:ne=>se("bot_language",ne.target.value),children:[s.jsx("option",{value:"auto",children:l("langAuto")}),s.jsx("option",{value:"ar",children:l("langAr")}),s.jsx("option",{value:"en",children:l("langEn")})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("botLanguageDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botTimezone")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"Africa/Cairo",value:h.bot_timezone||"Africa/Cairo",onChange:ne=>x({...h,bot_timezone:ne.target.value}),onBlur:ne=>se("bot_timezone",ne.target.value)}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("botTimezoneDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botMinDelay")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_min_delay_ms||400,onChange:ne=>x({...h,bot_min_delay_ms:Number(ne.target.value)}),onBlur:ne=>se("bot_min_delay_ms",Number(ne.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("delaysDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("botMaxDelay")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.bot_max_delay_ms||900,onChange:ne=>x({...h,bot_max_delay_ms:Number(ne.target.value)}),onBlur:ne=>se("bot_max_delay_ms",Number(ne.target.value))})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-line",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-brand-blue/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(Bo,{size:20})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("shareSettingsTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("shareSettingsDesc")})]})]}),s.jsxs("div",{className:"flex flex-row gap-3",children:[s.jsxs("button",{type:"button",onClick:Ce,disabled:P,className:"flex-1 min-w-0 inline-flex items-center justify-center gap-1.5 sm:gap-2 px-2.5 sm:px-5 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",children:[s.jsx(Ef,{size:16,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:l("exportSettings")})]}),s.jsxs("button",{type:"button",onClick:()=>{var ne;return(ne=ke.current)==null?void 0:ne.click()},className:"flex-1 min-w-0 inline-flex items-center justify-center gap-1.5 sm:gap-2 px-2.5 sm:px-5 h-11 rounded-xl border border-line bg-panel-raised hover:bg-panel-hover text-text-main font-bold text-xs sm:text-sm transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:[s.jsx(P0,{size:16,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:l("importSettings")})]}),s.jsx("input",{ref:ke,type:"file",accept:"application/json,.json",className:"hidden",onChange:N})]})]})]}),d==="integrations"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3.5 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(mf,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("tabIntegrations")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("integrationsDesc")})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[s.jsx("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main mb-1",children:l("weatherApiKey")}),s.jsx("p",{className:"text-xs text-muted mb-3",children:i==="ar"?"مطلوب لتشغيل أمر الطقس والأحوال الجوية !weather":"Required for the !weather forecast command"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:oe?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"OpenWeatherMap API Key",value:h.openweathermap_api_key||"",onChange:ne=>x({...h,openweathermap_api_key:ne.target.value}),onBlur:ne=>se("openweathermap_api_key",ne.target.value)}),s.jsx("button",{type:"button",onClick:()=>ce(!oe),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:oe?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]})]})}),s.jsx("div",{className:"rounded-xl border border-line bg-panel-raised p-4 flex flex-col justify-between gap-3",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main mb-1",children:l("youtubeApiKey")}),s.jsx("p",{className:"text-xs text-muted mb-3",children:i==="ar"?"مطلوب لأدوات البحث ومعلومات الفيديوهات من يوتيوب":"Required for YouTube search and video tools"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:$?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel text-text-main font-mono text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"YouTube Data API Key",value:h.youtube_api_key||"",onChange:ne=>x({...h,youtube_api_key:ne.target.value}),onBlur:ne=>se("youtube_api_key",ne.target.value)}),s.jsx("button",{type:"button",onClick:()=>Y(!$),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:$?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]})]})})]})]}),d==="proxy"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 pb-4 border-b border-line",children:[s.jsxs("div",{className:"flex items-center gap-3.5 min-w-0 flex-1",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-blue-500/10 text-brand-blue flex items-center justify-center shrink-0",children:s.jsx(Ri,{size:22})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main truncate",children:l("proxyTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5 truncate",children:l("proxyDesc")})]})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(wl,{checked:!!h.whatsapp_proxy_enabled,onChange:ne=>se("whatsapp_proxy_enabled",ne)})})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyProtocol")}),s.jsxs("select",{className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_protocol||"http",onChange:ne=>se("whatsapp_proxy_protocol",ne.target.value),children:[s.jsx("option",{value:"http",children:"HTTP"}),s.jsx("option",{value:"https",children:"HTTPS"}),s.jsx("option",{value:"socks5",children:"SOCKS5"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyHost")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"proxy.example.com",value:h.whatsapp_proxy_host||"",onChange:ne=>x({...h,whatsapp_proxy_host:ne.target.value}),onBlur:ne=>se("whatsapp_proxy_host",ne.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyPort")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",placeholder:"1080",value:h.whatsapp_proxy_port||"",onChange:ne=>x({...h,whatsapp_proxy_port:Number(ne.target.value)}),onBlur:ne=>se("whatsapp_proxy_port",Number(ne.target.value))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyUsername")}),s.jsx("input",{type:"text",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised font-mono text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_username||"",onChange:ne=>x({...h,whatsapp_proxy_username:ne.target.value}),onBlur:ne=>se("whatsapp_proxy_username",ne.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("proxyPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:k?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.whatsapp_proxy_password||"",onChange:ne=>x({...h,whatsapp_proxy_password:ne.target.value}),onBlur:ne=>se("whatsapp_proxy_password",ne.target.value)}),s.jsx("button",{type:"button",onClick:()=>K(!k),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:k?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]})]})]})]}),d==="security"&&s.jsx("div",{className:"flex flex-col gap-5",children:s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-4 max-w-xl",children:[s.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-line",children:[s.jsx(_N,{size:20,className:"text-ok"}),s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("changePassword")})]}),s.jsxs("form",{onSubmit:ge,className:"flex flex-col gap-3.5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("currentPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:X?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,value:O,onChange:ne=>A(ne.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>ie(!X),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:X?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("newPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:X?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,minLength:8,value:q,onChange:ne=>W(ne.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>ie(!X),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:X?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("passwordMinLength")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("confirmPassword")}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:X?"text":"password",className:"w-full h-11 px-3.5 pe-11 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",required:!0,minLength:8,value:Z,onChange:ne=>re(ne.target.value)}),s.jsx("button",{type:"button","aria-label":i==="ar"?"إظهار كلمة السر":"Show password",onClick:()=>ie(!X),className:"absolute top-1.5 end-1.5 w-8 h-8 rounded-lg flex items-center justify-center text-muted hover:text-text-main transition-colors",children:X?s.jsx(bs,{size:16}):s.jsx(pa,{size:16})})]})]}),s.jsxs("button",{type:"submit",disabled:F,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 h-11 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50 self-start mt-2",children:[s.jsx(Oo,{size:16}),s.jsx("span",{children:l(F?"saving":"save")})]})]})]})}),d==="storage"&&s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex flex-col gap-5",children:[s.jsxs("div",{className:"flex items-center gap-3.5 pb-4 border-b border-line",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-purple-500/10 text-purple-400 flex items-center justify-center shrink-0",children:s.jsx(wg,{size:22})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-base sm:text-lg font-bold text-text-main",children:l("storageTitle")}),s.jsx("p",{className:"text-xs sm:text-sm text-muted mt-0.5",children:l("storageDesc")})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("forwardTtl")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.forward_score_ttl_days||30,onChange:ne=>x({...h,forward_score_ttl_days:Number(ne.target.value)}),onBlur:ne=>se("forward_score_ttl_days",Number(ne.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("forwardTtlDesc")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"block text-xs sm:text-sm font-bold text-text-main",children:l("maxFetchBytes")}),s.jsx("input",{type:"number",className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.max_fetch_bytes||524288,onChange:ne=>x({...h,max_fetch_bytes:Number(ne.target.value)}),onBlur:ne=>se("max_fetch_bytes",Number(ne.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("maxFetchBytesDesc")})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"sticker-library-limit",className:"block text-xs sm:text-sm font-bold text-text-main",children:l("stickerLibraryLimit")}),s.jsx("input",{id:"sticker-library-limit",type:"number",min:1,max:1e5,className:"w-full h-11 px-3.5 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50",value:h.sticker_library_limit||1e3,onChange:ne=>x({...h,sticker_library_limit:Number(ne.target.value)}),onBlur:ne=>se("sticker_library_limit",Number(ne.target.value))}),s.jsx("span",{className:"block text-[11px] text-muted",children:l("stickerLibraryLimitDesc")})]})})]}),d==="feedback"&&s.jsx(ww,{}),s.jsx(Jt,{isOpen:!!D,onClose:()=>ae(null),title:l("importTitle"),footer:s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx("button",{type:"button",onClick:()=>ae(null),className:"px-5 h-10 rounded-xl border border-line text-muted hover:text-text-main font-bold text-xs sm:text-sm transition-colors",children:i==="ar"?"إلغاء":"Cancel"}),s.jsx("button",{type:"button",onClick:E,disabled:ue,className:"px-5 h-10 rounded-xl bg-brand-blue hover:bg-brand-blue/90 text-white font-bold text-xs sm:text-sm shadow-md shadow-brand-blue/20 transition-all disabled:opacity-50",children:l("importApply")})]}),children:D&&s.jsxs("div",{className:"flex flex-col gap-3 text-xs sm:text-sm text-text-main",children:[s.jsx("p",{className:"text-muted",children:l("importSummary")}),s.jsxs("ul",{className:"flex flex-col gap-1.5 bg-panel-raised rounded-xl border border-line p-4",children:[s.jsxs("li",{children:[l("importPrefix"),":"," ",s.jsx("span",{className:"font-mono font-bold",children:(de=D.commands)==null?void 0:de.prefix})]}),s.jsxs("li",{children:[Object.keys(D.settings||{}).length," ",l("importSettingsCount")]}),s.jsxs("li",{children:[Object.keys(((fe=D.commands)==null?void 0:fe.permissions)||{}).length," ",l("importPermissionsCount")]}),s.jsxs("li",{children:[Object.keys(((xe=D.commands)==null?void 0:xe.aliases)||{}).length," ",l("importAliasesCount")]}),s.jsxs("li",{children:[(((it=D.commands)==null?void 0:it.disabled)||[]).length," ",l("importDisabledCount")]})]})]})})]})},Aw={NO_MEDIA:"stickerErr_NO_MEDIA",UNSUPPORTED_TYPE:"stickerErr_UNSUPPORTED_TYPE",TOO_LARGE:"stickerErr_TOO_LARGE",DIMENSIONS_TOO_LARGE:"stickerErr_DIMENSIONS_TOO_LARGE",VIDEO_TOO_LONG:"stickerErr_VIDEO_TOO_LONG",CORRUPT:"stickerErr_CORRUPT",CONVERSION_FAILED:"stickerErr_CONVERSION_FAILED",OUTPUT_TOO_LARGE:"stickerErr_OUTPUT_TOO_LARGE",ENCODER_MISSING:"stickerErr_ENCODER_MISSING",TIMEOUT:"stickerErr_TIMEOUT",BUSY:"stickerErr_BUSY",NOT_FOUND:"stickerErr_NOT_FOUND",PACK_NOT_FOUND:"stickerErr_PACK_NOT_FOUND",PACK_EXISTS:"stickerErr_PACK_EXISTS",INVALID_NAME:"stickerErr_INVALID_NAME",INVALID_OPTIONS:"stickerErr_INVALID_OPTIONS",LIBRARY_FULL:"stickerErr_LIBRARY_FULL",PACK_LIMIT:"stickerErr_PACK_LIMIT",IN_USE:"stickerErr_IN_USE",STORAGE_UNAVAILABLE:"stickerErr_STORAGE_UNAVAILABLE",NOT_CONNECTED:"stickerErr_NOT_CONNECTED",CANCELLED:"stickerErr_CANCELLED",INTERNAL:"stickerErr_INTERNAL"};function Tw(l){return l?Aw[l]??null:null}function Pf(l,i){const c=Tw(i);return l(c||"stickerErr_INTERNAL")}function ut(l,i){return i instanceof It?Pf(l,i.code):l("stickerErr_INTERNAL")}function zw(l,i){const o=i?{probing:"jobStage_probing",decoding:"jobStage_decoding",encoding:"jobStage_encoding",optimizing:"jobStage_optimizing",queued:"jobQueued"}[i]:null;return l(o||"jobQueued")}function Xa(l,i){return l.replace(/\{([A-Za-z0-9_]+)\}/g,(c,o)=>Object.hasOwn(i,o)?String(i[o]):c)}function Lo(l,i){return`${[...(l||"sticker").replace(/[\\/:*?"<>|]+/g," ").trim()||"sticker"].slice(0,80).join("")}.${i}`}function Oy(l,i){const c=URL.createObjectURL(l),o=document.createElement("a");o.href=c,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(c),1500)}async function Dy(l,i){return Oy(l,i),{ok:!0,via:"browser"}}async function Ry(l,i,c){const o=new File([l],i,{type:c});if(typeof navigator.share=="function"&&typeof navigator.canShare=="function"&&navigator.canShare({files:[o]}))try{return await navigator.share({files:[o]}),{ok:!0,via:"share"}}catch(f){if(f instanceof DOMException&&f.name==="AbortError")return{ok:!1,cancelled:!0}}return Oy(l,i),{ok:!0,via:"browser"}}async function Po(l,i,c,o,d,f){const h=await dw(l,i,c,o,d,f);return l==="share"?{ok:!0,via:"share"}:{ok:!0,via:"host",name:h.name||d,dir:h.dir||"Downloads/Levix"}}const Fa={webp:"image/webp",png:"image/png",gif:"image/gif",zip:"application/zip"};function Vo(l,i,c,o){return{name:l||i,mime:c.type||o,blob:c}}async function Mi(l,i){if(Go())return Po("save",`/dashboard/api/stickers/${encodeURIComponent(l.id)}/export?format=${i}`,"GET","",Lo(l.name,i),Fa[i]);const c=await Q.exportSticker(l.id,i),o=Vo(c.fileName,Lo(l.name,i),c.blob,Fa[i]);return Dy(o.blob,o.name)}async function Ly(l,i){if(Go())return Po("share",`/dashboard/api/stickers/${encodeURIComponent(l.id)}/export?format=${i}`,"GET","",Lo(l.name,i),Fa[i]);const c=await Q.exportSticker(l.id,i),o=Vo(c.fileName,Lo(l.name,i),c.blob,Fa[i]);return Ry(o.blob,o.name,o.mime)}async function Mw(l,i){if(Go())return Po("save","/dashboard/api/stickers/export","POST",JSON.stringify({ids:l,format:i}),`stickers-${i}.zip`,Fa.zip);const c=await Q.exportStickers(l,i),o=Vo(c.fileName,`stickers-${i}.zip`,c.blob,Fa.zip);return Dy(o.blob,o.name)}async function Ow(l,i){if(Go())return Po("share","/dashboard/api/stickers/export","POST",JSON.stringify({ids:l,format:i}),`stickers-${i}.zip`,Fa.zip);const c=await Q.exportStickers(l,i),o=Vo(c.fileName,`stickers-${i}.zip`,c.blob,Fa.zip);return Ry(o.blob,o.name,o.mime)}async function wf(l){if(l.length)try{await Q.bulkStickers({action:"touch",ids:l})}catch{}}const Dw=16*1024*1024,hb=200,Rw=10,Uy=40,Yo=60,Lw=60;function Oi(l){const i=[...l.trim()].length;return i<1?"empty":i>Uy?"long":null}function Uw(l){return l.type.startsWith("video/")||/\.(mp4|webm|mov|mkv)$/i.test(l.name)}function Bw(l){return new Promise(i=>{const c=URL.createObjectURL(l),o=new Image;o.onload=()=>{URL.revokeObjectURL(c),i({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(c),i(null)},o.src=c})}function Hw(l){return new Promise(i=>{const c=URL.createObjectURL(l),o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{const d={width:o.videoWidth,height:o.videoHeight,duration:o.duration};URL.revokeObjectURL(c),o.src="",i(d)},o.onerror=()=>{URL.revokeObjectURL(c),i(null)},o.src=c})}async function qw(l,i){if(l.size<=0)return"stickerErr_NO_MEDIA";if(l.size>i.uploadBytes)return"stickerErr_TOO_LARGE";if(Uw(l)){const o=await Hw(l);return o?o.width>i.maxSide||o.height>i.maxSide?"stickerErr_DIMENSIONS_TOO_LARGE":Number.isFinite(o.duration)&&o.duration>i.videoSeconds+.05?"stickerErr_VIDEO_TOO_LONG":null:null}const c=await Bw(l);return c&&(c.width>i.maxSide||c.height>i.maxSide)?"stickerErr_DIMENSIONS_TOO_LARGE":null}const Gw={primary:"bg-brand-blue hover:bg-brand-blue/90 text-white shadow-md shadow-brand-blue/20",ghost:"border border-line bg-panel-raised hover:bg-panel-hover text-text-main",danger:"bg-danger hover:bg-danger/90 text-white shadow-md shadow-danger/25",quiet:"text-muted hover:bg-panel-hover hover:text-text-main"};function Me({variant:l="ghost",className:i,children:c,...o}){return s.jsx("button",{...o,type:"button",className:Ot("inline-flex items-center justify-center gap-1.5 px-3 h-10 rounded-xl font-bold text-xs sm:text-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",Gw[l],i),children:c})}function pb({label:l,danger:i,className:c,children:o,...d}){return s.jsxs("button",{...d,type:"button",title:l,"aria-label":l,className:Ot("inline-flex items-center gap-1.5 px-2.5 min-h-9 rounded-lg border text-xs font-bold transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-50",i?"border-danger/40 text-danger hover:bg-danger/10":"border-line bg-panel-raised text-text-main hover:bg-panel-hover",c),children:[o,s.jsx("span",{className:"hidden md:inline",children:l})]})}const Kt="w-full h-10 px-3 rounded-xl border border-line bg-panel-raised text-text-main text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-brand-blue/50";function To({children:l,htmlFor:i}){return s.jsx("label",{htmlFor:i,className:"block text-xs font-bold text-text-main mb-1",children:l})}function Vf({icon:l,text:i}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-2 text-muted",children:[l,s.jsx("span",{className:"text-xs sm:text-sm text-center",children:i})]})}function _s({text:l}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-2 text-muted",children:[s.jsx("div",{className:"w-6 h-6 border-2 border-brand-cyan border-t-transparent rounded-full animate-spin"}),s.jsx("span",{className:"text-xs",children:l})]})}function Pw(l){return!l||l==="transparent"?"transparent":l==="#ffffff"?"white":l==="#000000"?"black":"custom"}const Vw=({options:l,onChange:i,canRemoveBackground:c,name:o,onName:d,packId:f,onPack:h,packs:x})=>{var j,z,C;const{t:p}=We(),v=Pw(l.background),y=((j=l.removeBackground)==null?void 0:j.tolerance)??.15,b=l.rotate??0;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{children:[s.jsx(To,{htmlFor:"sticker-fit",children:p("fit")}),s.jsxs("select",{id:"sticker-fit",className:Kt,value:l.fit||"contain",onChange:w=>i({fit:w.target.value==="cover"?"cover":"contain"}),children:[s.jsx("option",{value:"contain",children:p("contain")}),s.jsx("option",{value:"cover",children:p("cover")})]})]}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-zoom",children:[p("zoom")," (",(l.zoom??1).toFixed(2),")"]}),s.jsx("input",{id:"sticker-zoom",type:"range",min:1,max:4,step:.01,value:l.zoom??1,onChange:w=>i({zoom:Number(w.target.value)})}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-x",children:[p("panX")," (",(l.panX??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-x",type:"range",min:-1,max:1,step:.01,value:l.panX??0,onChange:w=>i({panX:Number(w.target.value)})}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-pan-y",children:[p("panY")," (",(l.panY??0).toFixed(2),")"]}),s.jsx("input",{id:"sticker-pan-y",type:"range",min:-1,max:1,step:.01,value:l.panY??0,onChange:w=>i({panY:Number(w.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Me,{onClick:()=>i({panX:0,panY:0,zoom:1}),children:p("resetPan")}),s.jsxs(Me,{onClick:()=>{const w=(b+90)%360;i({rotate:w})},children:[p("rotateQuarter")," (",b,"°)"]})]}),s.jsx("p",{className:"text-xs font-bold",children:p("background")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:[["transparent",p("transparent")],["white",p("white")],["black",p("black")],["custom",p("customColor")]].map(([w,O])=>s.jsx(Me,{variant:v===w?"primary":"ghost",onClick:()=>{i(w==="transparent"?{background:"transparent"}:w==="white"?{background:"#ffffff"}:w==="black"?{background:"#000000"}:{background:"#3366ff"})},children:O},w))}),v==="custom"&&s.jsx("input",{type:"color","aria-label":p("customColor"),value:/^#[0-9a-f]{6}$/i.test(l.background||"")?l.background:"#3366ff",onChange:w=>i({background:w.target.value.toLowerCase()}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),c&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:((z=l.removeBackground)==null?void 0:z.mode)==="plain",onChange:w=>i({removeBackground:w.target.checked?{mode:"plain",tolerance:.15}:null})}),p("removePlainBackground")]}),s.jsx("p",{className:"text-xs text-muted",children:p("stickerRemoveHint")}),((C=l.removeBackground)==null?void 0:C.mode)==="plain"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"sticker-tolerance",children:[p("tolerance")," (",y.toFixed(2),")"]}),s.jsx("input",{id:"sticker-tolerance",type:"range",min:.02,max:.6,step:.01,value:y,onChange:w=>i({removeBackground:{mode:"plain",tolerance:Number(w.target.value)}})})]})]}),s.jsxs("div",{children:[s.jsx(To,{htmlFor:"sticker-name",children:p("stickerName")}),s.jsx("input",{id:"sticker-name",value:o,maxLength:Yo,onChange:w=>d(w.target.value),placeholder:p("stickerNamePlaceholder"),className:Kt})]}),s.jsxs("div",{children:[s.jsx(To,{htmlFor:"sticker-pack",children:p("targetPack")}),s.jsxs("select",{id:"sticker-pack",value:f,onChange:w=>h(w.target.value),className:Kt,children:[s.jsx("option",{value:"",children:p("noPack")}),x.map(w=>s.jsx("option",{value:w.id,children:w.name},w.id))]})]})]})},Yw=({options:l,onChange:i,kind:c,durationMs:o,limits:d,animatedOk:f})=>{const{t:h}=We();if(!(c==="video"||c==="gif"))return null;const p=o>0?o/1e3:d.videoSeconds,v=Math.min(d.videoSeconds,Math.max(0,p)),y=(b,j)=>{const z=Math.min(v,Math.max(0,b)),C=Math.min(d.stickerSeconds,Math.max(.5,j));i({trim:{start:z,duration:C}})};return s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-3 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[s.jsx("input",{type:"checkbox",checked:!!l.trim,onChange:b=>{b.target.checked?y(0,Math.min(d.stickerSeconds,Math.max(.5,p))):i({trim:null})}}),h("trim")]}),l.trim&&s.jsxs("span",{className:"text-xs font-mono text-muted",dir:"ltr",children:[l.trim.start.toFixed(1),"s →"," ",(l.trim.start+l.trim.duration).toFixed(1),"s"]})]}),!f&&s.jsx("p",{className:"text-xs text-warn",children:h("animatedUnavailable")}),s.jsx("p",{className:"text-xs text-muted",children:h(c==="gif"?"gifTrimNote":"trimApplied")}),l.trim&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-start",children:[h("trimStart")," (",l.trim.start.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-start",type:"range",min:0,max:v,step:.1,value:l.trim.start,onChange:b=>{var j;return y(Number(b.target.value),((j=l.trim)==null?void 0:j.duration)??.5)}}),s.jsxs("label",{className:"text-xs font-bold",htmlFor:"trim-duration",children:[h("trimDuration")," (",l.trim.duration.toFixed(1)," ",h("trimSeconds"),")"]}),s.jsx("input",{id:"trim-duration",type:"range",min:.5,max:d.stickerSeconds,step:.1,value:l.trim.duration,onChange:b=>{var j;return y(((j=l.trim)==null?void 0:j.start)??0,Number(b.target.value))}})]})]})},Ct=512;function Iw(l,i,c){const o=c.fit||"contain",d=c.zoom??1,f=c.panX??0,h=c.panY??0,x=c.rotate??0,p=x===90||x===270,v=p?i:l,y=p?l:i,j=(o==="cover"?Ct/Math.min(v,y):Ct/Math.max(v,y))*d,z=Math.max(1,Math.round(v*j)),C=Math.max(1,Math.round(y*j)),w=Math.round((Ct-z)/2+f*Math.abs(Ct-z)/2),O=Math.round((Ct-C)/2+h*Math.abs(Ct-C)/2);return{width:z,height:C,x:w,y:O}}const Kw='"Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif';function Qw(l){return/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(l)}function Xw(l){const i=/^#([0-9a-f]{6})$/i.exec(l.trim());if(!i)return"#000000";const c=Number.parseInt(i[1],16),o=c>>16&255,d=c>>8&255,f=c&255;return(.2126*o+.7152*d+.0722*f)/255>.6?"#000000":"#ffffff"}function Fw(l,i,c,o,d,f){const h=Math.max(0,Math.min(f,o/2,d/2));l.beginPath(),l.moveTo(i+h,c),l.arcTo(i+o,c,i+o,c+d,h),l.arcTo(i+o,c+d,i,c+d,h),l.arcTo(i,c+d,i,c,h),l.arcTo(i,c,i+o,c,h),l.closePath(),l.fill()}function Zw(l,i,c,o){const d=l==="center"?"center":l==="start"?i==="rtl"?"right":"left":i==="rtl"?"left":"right";return d==="center"?-c/2-o:d==="right"?-c-o:-o}function By(l,i,c){const o=[];for(const d of i){if(!d.text)continue;const f=Qw(d.text)?"rtl":"ltr";l.save(),l.translate(d.x,d.y),l.rotate(d.rotate*Math.PI/180),l.direction=f,l.font=`${d.fontSize}px ${Kw}`,l.textAlign=d.align,l.textBaseline="middle";const h=l.measureText(d.text).width,x=d.background?d.fontSize*.4:8,p=d.background?d.fontSize*.22:6,v=h+x*2,y=d.fontSize*1.25+p*2,b=Zw(d.align,f,h,x),j=-y/2;d.background&&(l.fillStyle="rgba(0, 0, 0, 0.55)",Fw(l,b,j,v,y,y/2)),c===d.id&&(l.strokeStyle="#38bdf8",l.lineWidth=2,l.strokeRect(b-3,j-3,v+6,y+6)),d.outline&&(l.lineJoin="round",l.miterLimit=2,l.lineWidth=Math.max(2,d.fontSize/10),l.strokeStyle=Xw(d.color),l.strokeText(d.text,0,0)),l.fillStyle=d.color,l.fillText(d.text,0,0),l.restore(),o.push({id:d.id,cx:d.x,cy:d.y,rotate:d.rotate,left:b,top:j,right:b+v,bottom:j+y})}return o}function Jw(l,i,c){for(let o=l.length-1;o>=0;o--){const d=l[o],f=i-d.cx,h=c-d.cy,x=-d.rotate*Math.PI/180,p=f*Math.cos(x)-h*Math.sin(x),v=f*Math.sin(x)+h*Math.cos(x);if(p>=d.left&&p<=d.right&&v>=d.top&&v<=d.bottom)return d.id}return null}function $w(l){const i=l.filter(d=>d.text.trim().length>0);if(!i.length)return;const c=document.createElement("canvas");c.width=512,c.height=512;const o=c.getContext("2d");if(o)return By(o,i,null),c.toDataURL("image/png")}const Ww=["😀","😂","❤️","🔥","👍","🎉","✨","💯","🙏","😎","🥳","💀","👀","💪","🌹","⭐","✅","😢","🤔","👋"];function No(l,i,c){return Math.min(c,Math.max(i,l))}const ek=({mediaUrl:l,kind:i,width:c,height:o,options:d,layers:f,selectedId:h,onPan:x,onSelect:p,onMoveLayer:v,label:y})=>{const b=S.useRef(null),j=S.useRef(null),z=S.useRef([]),C=S.useRef(null),w=S.useRef(null),O=S.useRef(1),A=d.rotate??0,q=c>0&&o>0?Iw(c,o,{fit:d.fit,zoom:d.zoom,panX:d.panX,panY:d.panY,rotate:A}):null,W=A===90||A===270,Z=q?W?q.height:q.width:0,re=q?W?q.width:q.height:0,F=q?q.x+(q.width-Z)/2:0,M=q?q.y+(q.height-re)/2:0,k=d.background&&d.background!=="transparent"?d.background:null;S.useEffect(()=>{const $=b.current;if(!$)return;const Y=()=>{const J=Math.min($.clientWidth,512);O.current=J>0?J/Ct:1,$.style.setProperty("--stage-scale",String(O.current))};Y();const P=new ResizeObserver(Y);return P.observe($),()=>P.disconnect()},[]),S.useEffect(()=>{const $=j.current;if(!$)return;const Y=window.devicePixelRatio||1;$.width=Ct*Y,$.height=Ct*Y;const P=$.getContext("2d");P&&(P.setTransform(Y,0,0,Y,0,0),P.clearRect(0,0,Ct,Ct),z.current=By(P,f,h))},[f,h]),S.useEffect(()=>{const $=w.current,Y=d.trim;if(!$||!Y||i!=="video"||!l)return;const P=Y.start,J=Y.start+Y.duration,ue=()=>{($.currentTime<P-.05||$.currentTime>=J-.02)&&($.currentTime=P)};return $.addEventListener("timeupdate",ue),$.addEventListener("ended",ue),$.currentTime=P,()=>{$.removeEventListener("timeupdate",ue),$.removeEventListener("ended",ue)}},[d.trim,i,l]);const K=$=>{const Y=$.currentTarget.getBoundingClientRect();return{x:($.clientX-Y.left)/Y.width*Ct,y:($.clientY-Y.top)/Y.height*Ct}},X=$=>{if($.button!==0)return;$.currentTarget.setPointerCapture($.pointerId);const Y=K($),P=Jw(z.current,Y.x,Y.y);if(P){const J=f.find(ue=>ue.id===P);if(!J)return;p(P),C.current={kind:"layer",id:P,x:Y.x,y:Y.y,originX:J.x,originY:J.y};return}p(null),q&&(C.current={kind:"pan",x:Y.x,y:Y.y,panX:d.panX??0,panY:d.panY??0,placeW:q.width,placeH:q.height})},ie=$=>{const Y=C.current;if(!Y)return;const P=K($);if(Y.kind==="layer"){v(Y.id,No(Y.originX+(P.x-Y.x),0,Ct),No(Y.originY+(P.y-Y.y),0,Ct));return}const J=Math.abs(Ct-Y.placeW),ue=Math.abs(Ct-Y.placeH),Ne=J<1?Y.panX:No(Y.panX+(P.x-Y.x)*2/J,-1,1),D=ue<1?Y.panY:No(Y.panY+(P.y-Y.y)*2/ue,-1,1);x(Ne,D)},oe=()=>{C.current=null},ce={position:"absolute",left:F,top:M,width:Z,height:re,transform:`rotate(${A}deg)`,transformOrigin:"center center",maxWidth:"none",pointerEvents:"none"};return s.jsx("div",{ref:b,className:"w-full",children:s.jsx("div",{className:"relative mx-auto overflow-hidden rounded-2xl border border-line",style:{width:"calc(512px * var(--stage-scale, 1))",height:"calc(512px * var(--stage-scale, 1))"},children:s.jsxs("div",{role:"img","aria-label":y,className:"absolute top-0 start-0 origin-top-left",style:{width:Ct,height:Ct,transform:"scale(var(--stage-scale, 1))",backgroundColor:"#1a1a1e",backgroundImage:"linear-gradient(45deg, #2c2c31 25%, transparent 25%), linear-gradient(-45deg, #2c2c31 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #2c2c31 75%), linear-gradient(-45deg, transparent 75%, #2c2c31 75%)",backgroundSize:"32px 32px",backgroundPosition:"0 0, 0 16px, 16px -16px, -16px 0"},children:[k&&s.jsx("div",{className:"absolute inset-0",style:{background:k}}),q&&i==="video"?s.jsx("video",{ref:w,src:l,muted:!0,autoPlay:!0,playsInline:!0,loop:!d.trim,style:ce}):q&&s.jsx("img",{src:l,alt:"",draggable:!1,style:ce}),s.jsx("canvas",{ref:j,className:"absolute inset-0 w-full h-full touch-none",onPointerDown:X,onPointerMove:ie,onPointerUp:oe,onPointerCancel:oe})]})})})},tk=({layers:l,selectedId:i,onSelect:c,onChange:o,onDelete:d,onAddText:f,onAddEmoji:h})=>{const{t:x}=We(),p=l.find(v=>v.id===i)||null;return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Me,{onClick:f,children:x("addText")}),s.jsx(Me,{onClick:()=>h("😀"),children:x("addEmoji")})]}),s.jsxs("div",{children:[s.jsx(To,{children:x("emojiPaletteLabel")}),s.jsx("div",{className:"flex flex-wrap gap-1",children:Ww.map(v=>s.jsx("button",{type:"button",className:"w-9 h-9 rounded-lg border border-line hover:bg-panel-hover text-lg",onClick:()=>h(v),"aria-label":v,children:v},v))}),s.jsx("label",{className:"block mt-2 text-xs font-bold text-text-main",htmlFor:"emoji-free",children:x("customEmoji")}),s.jsx("input",{id:"emoji-free",className:`${Kt} mt-1`,placeholder:x("emojiInputLabel"),onKeyDown:v=>{if(v.key==="Enter"){const y=v.currentTarget.value.trim();y&&(h(y),v.currentTarget.value="")}}})]}),l.length===0&&s.jsx("p",{className:"text-xs text-muted",children:x("noLayers")}),l.length>0&&s.jsx("div",{className:"flex flex-col gap-1",children:l.map(v=>s.jsx("button",{type:"button","aria-pressed":v.id===i,onClick:()=>c(v.id),className:`text-start px-3 py-2 rounded-lg border text-sm truncate ${v.id===i?"border-brand-blue bg-brand-blue/10":"border-line"}`,children:v.text||x("textPlaceholder")},v.id))}),p&&s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-line p-3",children:[s.jsx("p",{className:"text-xs font-bold",children:x("layerSelected")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-text",children:x("textContent")}),s.jsx("input",{id:"layer-text",value:p.text,onChange:v=>o(p.id,{text:v.target.value}),className:Kt}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-size",children:x("textSize")}),s.jsx("input",{id:"layer-size",type:"range",min:16,max:200,value:p.fontSize,onChange:v=>o(p.id,{fontSize:Number(v.target.value)})}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-color",children:x("textColor")}),s.jsx("input",{id:"layer-color",type:"color",value:/^#[0-9a-f]{6}$/i.test(p.color)?p.color:"#ffffff",onChange:v=>o(p.id,{color:v.target.value}),className:"h-10 w-full rounded-xl border border-line bg-panel-raised"}),s.jsx("p",{className:"text-xs font-bold",children:x("textAlignment")}),s.jsx("div",{className:"flex gap-1",children:["start","center","end"].map(v=>s.jsx(Me,{className:"flex-1",variant:p.align===v?"primary":"ghost",onClick:()=>o(p.id,{align:v}),children:x(v==="start"?"stickerAlignmentStart":v==="center"?"stickerAlignmentCenter":"stickerAlignmentEnd")},v))}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"layer-rotate",children:x("layerRotation")}),s.jsx("input",{id:"layer-rotate",type:"range",min:-180,max:180,value:p.rotate,onChange:v=>o(p.id,{rotate:Number(v.target.value)})}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:p.outline,onChange:v=>o(p.id,{outline:v.target.checked})}),x("textOutline")]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:p.background,onChange:v=>o(p.id,{background:v.target.checked})}),x("textBackground")]}),s.jsxs(Me,{variant:"danger",onClick:()=>d(p.id),children:[s.jsx(ws,{size:14}),x("deleteLayer")]})]})]})},Hy=({open:l,title:i,packs:c,onClose:o,onPick:d,onCreated:f})=>{const{t:h}=We(),{toast:x}=Gt(),[p,v]=S.useState(""),[y,b]=S.useState(null),[j,z]=S.useState(!1);S.useEffect(()=>{l||(v(""),b(null))},[l]);const C=async()=>{if(Oi(p)){b(h("packNameLength"));return}z(!0),b(null);try{const O=await Q.createPack(p.trim());v(""),f(O),d(O.id),x(h("packCreated"),"success")}catch(O){x(ut(h,O),"error")}finally{z(!1)}};return s.jsx(Jt,{isOpen:l,onClose:o,title:i,footer:s.jsx(Me,{onClick:o,children:h("close")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[c.length===0?s.jsx("p",{className:"text-sm text-muted",children:h("noPacks")}):s.jsx("div",{className:"flex flex-col gap-1.5 max-h-64 overflow-y-auto",children:c.map(w=>s.jsxs("button",{type:"button",onClick:()=>d(w.id),className:"w-full text-start px-3 py-2.5 rounded-xl border border-line hover:bg-panel-hover text-sm font-semibold",children:[w.name,s.jsx("span",{className:"text-muted font-medium ms-2",children:w.count})]},w.id))}),s.jsxs("div",{className:"flex flex-col gap-1.5 border-t border-line pt-3",children:[s.jsx("label",{className:"text-xs font-bold text-text-main",htmlFor:"new-pack-name",children:h("newPack")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{id:"new-pack-name",value:p,onChange:w=>{const O=w.target.value;v(O),y&&b(Oi(O)?h("packNameLength"):null)},placeholder:h("newPackPlaceholder"),className:Kt,maxLength:80}),s.jsx(Me,{variant:"primary",onClick:C,disabled:j,children:h("createPack")})]}),y&&s.jsx("p",{className:"text-xs text-danger",children:y})]})]})})},qy=({open:l,busy:i,onClose:c,onPick:o})=>{const{t:d}=We(),[f,h]=S.useState([]),[x,p]=S.useState(""),[v,y]=S.useState(!1),[b,j]=S.useState(null);S.useEffect(()=>{if(!l)return;let C=!1;return y(!0),j(null),Q.getRecipients().then(w=>{C||h(w.recipients)}).catch(w=>{C||j(ut(d,w))}).finally(()=>{C||y(!1)}),()=>{C=!0}},[l,d]);const z=S.useMemo(()=>{const C=x.trim().toLowerCase();return C?f.filter(w=>w.name.toLowerCase().includes(C)||(w.phone||"").toLowerCase().includes(C)):f},[f,x]);return s.jsx(Jt,{isOpen:l,onClose:c,title:d("sendViaWhatsapp"),footer:s.jsx(Me,{onClick:c,children:d("cancel")}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Tf,{size:16,className:"absolute start-3 top-3 text-muted"}),s.jsx("input",{type:"search",value:x,onChange:C=>p(C.target.value),placeholder:d("searchRecipients"),"aria-label":d("searchRecipients"),className:`${Kt} ps-9`})]}),v&&s.jsx(_s,{text:d("loading")}),b&&s.jsx("p",{className:"text-sm text-danger",children:b}),!v&&!b&&z.length===0&&s.jsx("p",{className:"text-sm text-muted",children:d("noRecipients")}),s.jsx("div",{className:"flex flex-col gap-1.5 max-h-72 overflow-y-auto",children:z.map(C=>s.jsxs("button",{type:"button",disabled:i,onClick:()=>o(C.id),className:"w-full text-start px-3 py-2.5 rounded-xl border border-line hover:bg-panel-hover disabled:opacity-50",children:[s.jsx("span",{className:"block text-sm font-semibold truncate",children:C.name}),s.jsxs("span",{className:"block text-[11px] text-muted",children:[C.type==="group"?d("recipientGroup"):d("recipientContact"),C.phone?s.jsx("span",{dir:"ltr",className:"ms-2",children:C.phone}):null]})]},C.id))}),i&&s.jsx("p",{className:"text-xs text-muted",children:d("sending")})]})})},nk=600;function ak(){const[l,i]=S.useState(null),[c,o]=S.useState(!1),[d,f]=S.useState(null),h=S.useRef(0);return S.useEffect(()=>()=>{h.current+=1},[]),{job:l,running:c,submitError:d,start:async v=>{const y=++h.current;f(null),i(null),o(!0);try{const{jobId:b}=await Q.createStickerJob(v);for(;h.current===y;){const j=await Q.getStickerJob(b);if(h.current!==y)return;if(i(j),j.state==="done"||j.state==="failed")break;await new Promise(z=>setTimeout(z,nk))}}catch(b){h.current===y&&f(b)}finally{h.current===y&&o(!1)}},reset:()=>{h.current+=1,i(null),f(null),o(!1)}}}const cf={fit:"contain",zoom:1,panX:0,panY:0,rotate:0,background:"transparent",removeBackground:null,trim:null};function lk(l,i){return l(i==="gif"?"stickerKindGif":i==="video"?"stickerKindVideo":i==="webp"?"stickerKindWebp":"stickerKindImage")}const sk=({capabilities:l,capsError:i,onRetryCaps:c,incoming:o,onConsumedIncoming:d,isConnected:f,onGoLibrary:h,onCreated:x})=>{var xe,it,ne,Oe,Le,Re,Te,bt,Pt,pt,wt,bn;const{t:p}=We(),{toast:v}=Gt(),y=ak(),[b,j]=S.useState(null),[z,C]=S.useState(null),[w,O]=S.useState("PANEL_UPLOAD"),[A,q]=S.useState(!1),[W,Z]=S.useState(!1),[re,F]=S.useState(cf),[M,k]=S.useState([]),[K,X]=S.useState(null),[ie,oe]=S.useState(""),[ce,$]=S.useState(""),[Y,P]=S.useState([]),[J,ue]=S.useState(!1),[Ne,D]=S.useState(!1),ae=S.useRef(null),ke=S.useRef(null),Ce=S.useRef(async()=>{});S.useEffect(()=>(Q.getPacks().then(me=>P(me.packs)).catch(()=>{}),()=>{ae.current&&URL.revokeObjectURL(ae.current)}),[]);const N=me=>{ae.current&&URL.revokeObjectURL(ae.current);const _e=URL.createObjectURL(me);ae.current=_e,C(_e)},E=async(me,_e,rt,Vt,$t)=>{if(!(l!=null&&l.webp))return;const Et=me instanceof File?me:new File([me],_e,{type:me.type}),Wt=await qw(Et,l.limits);if(Wt){v(p(Wt),"error");return}q(!0),O(rt);try{const I=Vt?await Ay(Vt,_e,l.limits.uploadBytes):$t?await Q.uploadExistingStickerSource($t):await Q.uploadStickerSource(Et,_e);N(Et),j(I),F(cf),v(p("uploadReady"),"success")}catch(I){v(ut(p,I),"error")}finally{q(!1)}};Ce.current=E,S.useEffect(()=>{!o||!l||o===ke.current||(ke.current=o,d(),Promise.resolve(o.blob).then(me=>Ce.current(me,o.name,o.source,o.token,o.existingId)).catch(me=>v(ut(p,me),"error")))},[o,l,d]);const le=()=>{y.reset(),j(null),oe(""),$(""),k([]),X(null),F(cf),O("PANEL_UPLOAD"),ae.current&&URL.revokeObjectURL(ae.current),ae.current=null,C(null),ke.current=null},se=()=>{if(!b)return null;const me=ie.trim();if([...me].length>Yo)return v(p("stickerNameTooLong"),"warning"),null;const _e=$w(M);return{uploadId:b.uploadId,options:re,..._e?{overlay:_e}:{},...me?{name:me}:{},...ce?{packId:ce}:{},source:w}},ye=()=>{const me=se();me&&y.start(me)},ge=async(me,_e)=>{me.ok&&(me.via==="host"?v(Xa(p("stickerShareSaved"),{dir:me.dir}),"success"):me.via==="share"?v(p("shareDone"),"success"):v(p("downloaded"),"success"),await wf([_e.id]),x())};if(i)return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:i}),s.jsx(Me,{onClick:c,children:p("retryLoad")})]});if(!l)return s.jsx(_s,{text:p("loading")});if(!l.webp)return s.jsx("p",{className:"p-6 text-sm text-warn text-center",children:p("stickerErr_ENCODER_MISSING")});const de=((xe=y.job)==null?void 0:xe.state)==="done"?y.job.sticker:null;if(de)return s.jsxs("div",{className:"flex flex-col gap-4 max-w-md mx-auto",children:[s.jsx("div",{className:"aspect-square rounded-2xl border border-line overflow-hidden bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:20px_20px]",children:s.jsx("img",{src:de.url,alt:de.name||p("stickerPreview"),className:"w-full h-full object-contain"})}),((it=y.job)==null?void 0:it.created)===!1&&s.jsx("p",{className:"text-sm text-ok",children:p("alreadyInLibrary")}),((ne=y.job)==null?void 0:ne.qualityReduced)&&s.jsx("p",{className:"text-sm text-warn",children:p("qualityReduced")}),((Oe=y.job)==null?void 0:Oe.created)!==!1&&s.jsx("p",{className:"text-sm text-ok",children:p("stickerCreated")}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Me,{onClick:()=>{Mi(de,"webp").then(me=>ge(me,de)).catch(me=>v(ut(p,me),"error"))},children:p("downloadWebp")}),s.jsx(Me,{onClick:()=>{de.animated&&v(p("firstFrameHint"),"info"),Mi(de,"png").then(me=>ge(me,de)).catch(me=>v(ut(p,me),"error"))},children:p("downloadPng")}),de.animated&&s.jsx(Me,{disabled:!l.gif,title:p("gifOnlyAnimated"),onClick:()=>{Mi(de,"gif").then(me=>ge(me,de)).catch(me=>v(ut(p,me),"error"))},children:p("downloadGif")}),s.jsx(Me,{onClick:()=>{Ly(de,"webp").then(me=>ge(me,de)).catch(me=>v(ut(p,me),"error"))},children:p("shareSticker")}),s.jsx(Me,{disabled:!f,title:f?void 0:p("notConnectedHint"),onClick:()=>ue(!0),children:p("sendViaWhatsapp")}),s.jsx(Me,{onClick:()=>D(!0),children:p("addToPack")}),s.jsx(Me,{variant:"primary",onClick:le,children:p("createAnother")}),s.jsx(Me,{onClick:h,children:p("goToLibrary")})]}),!f&&s.jsx("p",{className:"text-xs text-muted",children:p("notConnectedHint")}),s.jsx(qy,{open:J,busy:!1,onClose:()=>ue(!1),onPick:me=>{Q.sendStickers({ids:[de.id],jid:me}).then(_e=>{_e.sent>0?(v(p("stickerSent"),"success"),ue(!1),x()):v(p("stickerErr_NOT_CONNECTED"),"error")}).catch(_e=>v(ut(p,_e),"error"))}}),s.jsx(Hy,{open:Ne,title:p("addToPack"),packs:Y,onClose:()=>D(!1),onCreated:me=>P(_e=>[..._e,me]),onPick:me=>{Q.bulkStickers({action:"addToPack",ids:[de.id],packId:me}).then(()=>{v(p("addedToPack"),"success"),D(!1),x()}).catch(_e=>v(ut(p,_e),"error"))}})]});const fe=y.submitError||((Le=y.job)==null?void 0:Le.state)==="failed";return s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_320px] gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[!b&&s.jsxs("label",{className:`flex flex-col items-center justify-center gap-2 min-h-64 rounded-2xl border border-dashed ${W?"border-brand-blue bg-brand-blue/10":"border-line bg-panel"} p-6 cursor-pointer`,onClick:me=>{Ao()&&(me.preventDefault(),cw().then(async _e=>{if(!_e)return;const rt=await fetch(_e.url);if(!rt.ok)throw new Error("source unavailable");await E(await rt.blob(),_e.name,"PANEL_UPLOAD",_e.token)}).catch(_e=>v(ut(p,_e),"error")))},onDragOver:me=>{me.preventDefault(),Z(!0)},onDragLeave:()=>Z(!1),onDrop:me=>{if(me.preventDefault(),Z(!1),Ao())return;const _e=me.dataTransfer.files[0];_e&&E(_e,_e.name,"PANEL_UPLOAD")},children:[s.jsx(P0,{size:28,className:"text-muted"}),s.jsx("span",{className:"text-sm font-bold text-text-main",children:p("stickerDrag")}),s.jsx("span",{className:"text-xs text-muted",children:p("uploadHint")}),s.jsx("input",{type:"file",accept:"image/*,video/*,.webp,.gif",className:"sr-only",disabled:Ao(),onChange:me=>{var rt;const _e=(rt=me.target.files)==null?void 0:rt[0];me.target.value="",_e&&E(_e,_e.name,"PANEL_UPLOAD")}})]}),A&&s.jsx(_s,{text:p("loading")}),b&&z&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted",children:Xa(p("stickerUploadInfo"),{kind:lk(p,b.kind),size:Math.max(1,Math.round(b.size/1024))})}),s.jsx(ek,{mediaUrl:z,kind:b.kind,width:b.width,height:b.height,options:re,layers:M,selectedId:K,label:p("previewStage"),onPan:(me,_e)=>F(rt=>({...rt,panX:me,panY:_e})),onSelect:X,onMoveLayer:(me,_e,rt)=>k(Vt=>Vt.map($t=>$t.id===me?{...$t,x:_e,y:rt}:$t))}),s.jsx(Yw,{options:re,onChange:me=>F(_e=>({..._e,...me})),kind:b.kind,durationMs:b.durationMs,limits:l.limits,animatedOk:l.animated})]}),(y.running||((Re=y.job)==null?void 0:Re.state)==="queued"||((Te=y.job)==null?void 0:Te.state)==="running")&&s.jsxs("div",{children:[s.jsx("div",{className:"h-2 rounded-full bg-line overflow-hidden",children:s.jsx("div",{className:"h-full bg-brand-blue",style:{width:`${Math.round((((bt=y.job)==null?void 0:bt.progress)||0)*100)}%`}})}),s.jsx("p",{className:"text-xs text-muted mt-1",children:zw(p,((Pt=y.job)==null?void 0:Pt.state)==="queued"?"queued":(pt=y.job)==null?void 0:pt.stage)})]}),fe&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm text-danger",children:y.submitError?ut(p,y.submitError):Pf(p,(bn=(wt=y.job)==null?void 0:wt.error)==null?void 0:bn.code)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Me,{variant:"primary",onClick:ye,children:p("tryAgain")}),s.jsx(Me,{onClick:le,children:p("clearLbl")})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[b&&s.jsx(Vw,{options:re,onChange:me=>F(_e=>({..._e,...me})),canRemoveBackground:l.backgroundRemoval.includes("plain"),name:ie,onName:oe,packId:ce,onPack:$,packs:Y}),b&&s.jsx(tk,{layers:M,selectedId:K,onSelect:X,onChange:(me,_e)=>k(rt=>rt.map(Vt=>Vt.id===me?{...Vt,..._e}:Vt)),onDelete:me=>{k(_e=>_e.filter(rt=>rt.id!==me)),X(_e=>_e===me?null:_e)},onAddText:()=>{const me=crypto.randomUUID();k(_e=>[..._e,{id:me,text:p("textPlaceholder"),x:256,y:256,fontSize:64,color:"#ffffff",align:"center",rotate:0,outline:!0,background:!1}]),X(me)},onAddEmoji:me=>{const _e=crypto.randomUUID();k(rt=>[...rt,{id:_e,text:me,x:256,y:240,fontSize:96,color:"#ffffff",align:"center",rotate:0,outline:!1,background:!1}]),X(_e)}}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Me,{variant:"primary",disabled:!b||y.running||A,onClick:ye,children:[s.jsx(Uo,{size:16}),p("createBtn")]}),b&&s.jsx(Me,{onClick:le,disabled:y.running,children:p("clearLbl")})]})]})]})};let zo=null,Mo=!1,Fn=null;function xb(l){Fn=l}async function ik(l,i){var c;try{const o=await Ay(l,i,Dw),{jobId:d}=await Q.createStickerJob({uploadId:o.uploadId,source:"MEDIA_HUB"});for(;;){const f=await Q.getStickerJob(d);if(f.state==="done"){Fn==null||Fn({type:"saved",created:f.created!==!1,qualityReduced:f.qualityReduced===!0});return}if(f.state==="failed"){Fn==null||Fn({type:"error",code:(c=f.error)==null?void 0:c.code});return}await new Promise(h=>setTimeout(h,600))}}catch(o){Fn==null||Fn({type:"error",code:o instanceof It?o.code:void 0})}finally{Mo=!1}}function rk(){if(Mo)return zo;const l=uw();return(l==null?void 0:l.intent)==="create"?zo={blob:fetch(l.url).then(i=>{if(!i.ok)throw new Error("source unavailable");return i.blob()}),name:l.name||"sticker",source:"MEDIA_HUB",token:l.token}:(l==null?void 0:l.intent)==="save"&&!Mo&&(Mo=!0,ik(l.token,l.name||"sticker")),zo}function ok(){zo=null}const jo=({label:l,onClick:i,disabled:c,danger:o,children:d})=>s.jsx("button",{type:"button",onClick:i,disabled:c,title:l,"aria-label":l,className:`w-9 h-9 rounded-lg border flex items-center justify-center transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50 disabled:opacity-40 disabled:cursor-not-allowed ${o?"border-danger/40 text-danger hover:bg-danger/10":"border-line bg-panel-raised text-text-main hover:bg-panel-hover"}`,children:d}),Ka=({label:l,onClick:i,disabled:c})=>s.jsx("button",{type:"button",role:"menuitem",disabled:c,onClick:i,className:"w-full text-start px-3 py-2 text-xs md:text-sm font-medium rounded-lg text-text-main hover:bg-panel-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:l}),Gy=({count:l,animatedSelected:i,canRemove:c,sendReason:o,exportReason:d,onSelectAll:f,onClear:h,onFavorite:x,onUnfavorite:p,onAdd:v,onMove:y,onRemove:b,onDownload:j,onConvert:z,onShare:C,onSend:w,onDelete:O})=>{const{t:A}=We(),[q,W]=S.useState(!1),Z=S.useRef(null);if(S.useEffect(()=>{if(!q)return;const F=k=>{Z.current&&!Z.current.contains(k.target)&&W(!1)},M=k=>{k.key==="Escape"&&W(!1)};return document.addEventListener("mousedown",F),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",M)}},[q]),l===0)return null;const re=F=>()=>{W(!1),F()};return s.jsxs("div",{className:"rounded-xl border border-brand-blue/30 bg-brand-blue/10 p-3 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-bold text-text-main me-auto",children:Xa(A("nSelected"),{n:l})}),s.jsx(jo,{label:l>1?A("downloadZip"):A("download"),onClick:re(j),disabled:!!d,children:s.jsx(Ef,{size:15})}),s.jsx(jo,{label:A("sendViaWhatsapp"),onClick:re(w),disabled:!!o,children:s.jsx(Bi,{size:15,className:"rtl:-scale-x-100"})}),s.jsx(jo,{label:A("shareSticker"),onClick:re(C),children:s.jsx(Bo,{size:15})}),s.jsx(jo,{label:A("delete"),onClick:re(O),danger:!0,children:s.jsx(ws,{size:15})}),s.jsxs("div",{className:"relative",ref:Z,children:[s.jsx("button",{type:"button",onClick:()=>W(F=>!F),title:A("moreActions"),"aria-label":A("moreActions"),"aria-expanded":q,"aria-haspopup":"menu",className:"w-9 h-9 rounded-lg border border-line bg-panel-raised text-text-main hover:bg-panel-hover flex items-center justify-center transition-colors focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:s.jsx(Af,{size:15})}),q&&s.jsxs("div",{role:"menu",className:"absolute end-0 mt-1 w-52 rounded-xl border border-line bg-panel-solid shadow-2xl p-1 z-30",children:[s.jsx(Ka,{label:A("selectVisible"),onClick:re(f)}),s.jsx(Ka,{label:A("clearSelection"),onClick:re(h)}),s.jsx("div",{className:"my-1 border-t border-line"}),s.jsx(Ka,{label:A("favorite"),onClick:re(x)}),s.jsx(Ka,{label:A("unfavorite"),onClick:re(p)}),s.jsx("div",{className:"my-1 border-t border-line"}),s.jsx(Ka,{label:A("addToPack"),onClick:re(v)}),s.jsx(Ka,{label:A("moveToPack"),onClick:re(y)}),c&&s.jsx(Ka,{label:A("removeFromPack"),onClick:re(b)}),s.jsx(Ka,{label:A("convertToImage"),onClick:re(z),disabled:!!d})]})]})]}),o&&s.jsx("p",{className:"text-xs text-muted",children:o}),d&&s.jsx("p",{className:"text-xs text-muted",children:d}),i&&s.jsx("p",{className:"text-xs text-muted",children:A("firstFrameHint")})]})},Py=({sticker:l,selected:i,onToggle:c,onOpen:o,onFavorite:d})=>{const{t:f}=We(),h=l.name||f("stickerPreview");return s.jsxs("div",{className:Ot("relative aspect-square rounded-xl border bg-panel overflow-hidden",i?"border-brand-blue ring-2 ring-brand-blue/50":"border-line"),children:[s.jsx("button",{type:"button",onClick:()=>o(),className:"absolute inset-0 focus-visible:ring-2 focus-visible:ring-brand-blue/50","aria-label":f("stickerOpen"),children:s.jsx("img",{src:l.thumbUrl,alt:"",loading:"lazy",draggable:!1,className:"w-full h-full object-contain bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:16px_16px]"})}),s.jsx("button",{type:"button","aria-pressed":i,"aria-label":f("stickerSelect"),onClick:x=>c(x.shiftKey),className:Ot("absolute top-1 start-1 z-10 w-7 h-7 rounded-lg border flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",i?"bg-brand-blue border-brand-blue text-white":"bg-panel/90 border-line text-transparent hover:text-muted"),children:s.jsx(Di,{size:16,strokeWidth:3})}),l.animated&&s.jsx("span",{className:"absolute bottom-1 start-1 z-10 px-1.5 py-0.5 rounded-md bg-black/70 text-white text-[10px] font-bold pointer-events-none",children:f("gifBadge")}),s.jsx("button",{type:"button",onClick:d,"aria-pressed":l.favorite,"aria-label":l.favorite?f("unfavorite"):f("favorite"),title:l.favorite?f("favoriteBadge"):f("favorite"),className:"absolute top-1 end-1 z-10 w-7 h-7 rounded-lg bg-panel/90 border border-line flex items-center justify-center focus-visible:ring-2 focus-visible:ring-brand-blue/50",children:s.jsx(Mf,{size:14,className:l.favorite?"fill-warn text-warn":"text-muted"})}),s.jsx("span",{className:"sr-only",children:h})]})},ck=({items:l,total:i,loading:c,loadingMore:o,error:d,hasMore:f,emptyText:h,selected:x,onToggle:p,onOpen:v,onFavorite:y,onLoadMore:b,onRetry:j})=>{const{t:z}=We();return c&&l.length===0?s.jsx(_s,{text:z("loading")}):d&&l.length===0?s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:d}),s.jsx(Me,{onClick:j,children:z("retryLoad")})]}):l.length===0?s.jsx(Vf,{icon:s.jsx(Of,{size:28,className:"text-muted"}),text:h}):s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-xs text-muted",children:Xa(z("showingCount"),{shown:l.length,total:i})}),s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8 gap-2 sm:gap-3",children:l.map((C,w)=>s.jsx(Py,{sticker:C,selected:x.has(C.id),onToggle:O=>p(w,O),onOpen:()=>v(C),onFavorite:()=>y(C)},C.id))}),f&&s.jsx(Me,{onClick:b,disabled:o,className:"self-center",children:z(o?"loading":"loadMore")})]})},uk=({open:l,busy:i,count:c,inUse:o,packs:d,onClose:f,onConfirm:h,onConfirmEverywhere:x})=>{const{t:p}=We(),v=d.map(y=>y.name).join(", ");return s.jsx(Jt,{isOpen:l,onClose:f,title:p("deleteStickersTitle"),footer:s.jsxs("div",{className:"flex flex-wrap justify-end gap-2 w-full",children:[s.jsx(Me,{onClick:f,disabled:i,children:p("cancel")}),o?s.jsx(Me,{variant:"danger",onClick:x,disabled:i,children:p("deleteEverywhere")}):s.jsx(Me,{variant:"danger",onClick:h,disabled:i,children:p("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2 text-sm text-text-main",children:[s.jsx("p",{children:Xa(p("nSelected"),{n:c})}),o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:p(c===1?"inUseBody":"inUseBulkBody")}),v&&s.jsxs("p",{children:[p("inUsePacksLabel"),": ",v]}),s.jsx("p",{className:"text-muted text-xs",children:p("deleteEverywhereHint")})]}):s.jsx("p",{children:p("deleteConfirm")})]})})},gb=({label:l,onClick:i,children:c})=>s.jsx("button",{type:"button",onClick:i,title:l,"aria-label":l,className:"w-9 h-9 rounded-full bg-black/55 hover:bg-black/75 border border-white/15 text-white flex items-center justify-center backdrop-blur-sm transition-colors focus-visible:ring-2 focus-visible:ring-brand-cyan/60",children:c}),_i=({label:l,danger:i,disabled:c,title:o,onClick:d})=>s.jsx("button",{type:"button",role:"menuitem",disabled:c,title:o,onClick:d,className:`w-full text-start px-3 py-2 text-xs md:text-sm font-medium rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${i?"text-danger hover:bg-danger/10":"text-text-main hover:bg-panel-hover"}`,children:l}),dk=({sticker:l,packs:i,isConnected:c,gifEnabled:o,onClose:d,onRename:f,onFavorite:h,onAddToPack:x,onRemoveFromPack:p,onDownload:v,onShare:y,onSend:b,onDelete:j,onOpenInCreate:z})=>{const{t:C}=We(),[w,O]=S.useState(""),[A,q]=S.useState(""),[W,Z]=S.useState(!1),re=S.useRef(null);if(S.useEffect(()=>{O((l==null?void 0:l.name)||""),q(""),Z(!1)},[l]),S.useEffect(()=>{if(!W)return;const k=X=>{re.current&&!re.current.contains(X.target)&&Z(!1)},K=X=>{X.key==="Escape"&&Z(!1)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",K),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",K)}},[W]),!l)return null;const F=i.filter(k=>l.packIds.includes(k.id)),M=i.filter(k=>!l.packIds.includes(k.id));return s.jsx(Jt,{isOpen:!!l,onClose:d,title:l.name||C("stickerPreview"),maxWidth:"680px",footer:s.jsx("div",{className:"flex justify-end gap-2 w-full",children:s.jsx(Me,{onClick:d,children:C("close")})}),children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"relative mx-auto w-full max-w-[280px] aspect-square rounded-2xl border border-line overflow-hidden bg-[repeating-conic-gradient(#2a2a2e_0%_25%,#1c1c20_0%_50%)] bg-[length:20px_20px]",children:[s.jsx("img",{src:l.url,alt:l.name||C("stickerPreview"),className:"w-full h-full object-contain"}),s.jsxs("div",{className:"absolute top-2 end-2 flex flex-col gap-1.5",children:[s.jsx(gb,{label:l.animated&&o?C("downloadGif"):C("downloadWebp"),onClick:()=>v(l.animated&&o?"gif":"webp"),children:s.jsx(Ef,{size:16})}),s.jsx(gb,{label:C("shareSticker"),onClick:y,children:s.jsx(Bo,{size:16})})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Me,{variant:"primary",onClick:b,disabled:!c,title:c?void 0:C("notConnectedHint"),children:[s.jsx(Bi,{size:14,className:"rtl:-scale-x-100"}),C("sendViaWhatsapp")]}),s.jsxs(Me,{onClick:()=>h(!l.favorite),children:[s.jsx(Mf,{size:14,className:l.favorite?"fill-warn text-warn":""}),l.favorite?C("unfavorite"):C("favorite")]}),s.jsxs("div",{className:"relative ms-auto",ref:re,children:[s.jsx(Me,{onClick:()=>Z(k=>!k),className:"px-2.5","aria-expanded":W,"aria-haspopup":"menu",title:C("moreActions"),children:s.jsx(Af,{size:16})}),W&&s.jsxs("div",{role:"menu",className:"absolute end-0 mt-1 w-52 rounded-xl border border-line bg-panel-solid shadow-2xl p-1 z-30",children:[s.jsx(_i,{label:C("downloadWebp"),onClick:()=>{Z(!1),v("webp")}}),s.jsx(_i,{label:C("downloadPng"),title:l.animated?C("firstFrameHint"):void 0,onClick:()=>{Z(!1),v("png")}}),l.animated&&s.jsx(_i,{label:C("downloadGif"),disabled:!o,title:C("gifOnlyAnimated"),onClick:()=>{Z(!1),v("gif")}}),s.jsx(_i,{label:C("openInCreate"),onClick:()=>{Z(!1),z()}}),s.jsx("div",{className:"my-1 border-t border-line"}),s.jsx(_i,{label:C("delete"),danger:!0,onClick:()=>{Z(!1),j()}})]})]})]}),l.animated&&s.jsx("p",{className:"text-xs text-muted",children:C("firstFrameHint")}),!c&&s.jsx("p",{className:"text-xs text-muted",children:C("notConnectedHint")}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{value:w,onChange:k=>O(k.target.value),maxLength:Yo,"aria-label":C("stickerName"),placeholder:C("stickerNamePlaceholder"),className:Kt}),s.jsx(Me,{variant:"primary",onClick:()=>f(w.trim()),children:C("rename")})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-text-main mb-1.5",children:C("inUsePacksLabel")}),F.length===0?s.jsx("p",{className:"text-xs text-muted",children:C("notInPack")}):s.jsx("ul",{className:"flex flex-col gap-1.5",children:F.map(k=>s.jsxs("li",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm truncate",children:k.name}),s.jsx(Me,{className:"h-8",onClick:()=>p(k.id),children:C("removeFromPack")})]},k.id))}),M.length>0&&s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.jsxs("select",{value:A,onChange:k=>q(k.target.value),"aria-label":C("addToPack"),className:Kt,children:[s.jsx("option",{value:"",children:C("selectPack")}),M.map(k=>s.jsx("option",{value:k.id,children:k.name},k.id))]}),s.jsx(Me,{variant:"primary",disabled:!A,onClick:()=>A&&x(A),children:C("addToPack")})]})]})]})})};function fk(l){const{t:i}=We(),{toast:c}=Gt(),[o,d]=S.useState(null),[f,h]=S.useState(!1);return{phase:o,busy:f,requestDelete:y=>{y.length&&d({kind:"ask",ids:y})},run:async(y,b)=>{var j;h(!0);try{if(y.length===1&&!b){try{await Q.deleteSticker(y[0],!1),c(i("deleted"),"success"),d(null),l()}catch(O){if(O instanceof It&&O.code==="IN_USE"){const A=Array.isArray((j=O.data)==null?void 0:j.packs)?O.data.packs:[];d({kind:"inUse",ids:y,packs:A,otherSkipped:0})}else c(ut(i,O),"error")}return}const z=await Q.bulkStickers({action:"delete",ids:y,confirm:b}),C=z.skipped.filter(O=>O.code==="IN_USE").map(O=>O.id),w=z.skipped.length-C.length;if(!b&&C.length>0){d({kind:"inUse",ids:C,packs:[],otherSkipped:w});return}w>0?c(i("skippedOther"),"warning"):c(i("deleted"),"success"),d(null),l()}catch(z){c(ut(i,z),"error")}finally{h(!1)}},close:()=>{f||d(null)}}}function mk(l,i,c){const o=new Map(c.map(f=>[f.id,f.name])),d=new Map;for(const f of l){const h=i.find(x=>x.id===f);for(const x of(h==null?void 0:h.packIds)??[])d.set(x,o.get(x)||x)}return[...d].map(([f,h])=>({id:f,name:h}))}function Vy({items:l,packs:i,selectedIds:c,clearSelection:o,reload:d,fromPackId:f,isConnected:h,gifEnabled:x,onOpenInCreate:p,onPackCreated:v}){var ue,Ne,D;const{t:y}=We(),{toast:b}=Gt(),j=S.useRef(!1),[z,C]=S.useState(null),[w,O]=S.useState(null),[A,q]=S.useState([]),[W,Z]=S.useState([]),[re,F]=S.useState(!1),M=fk(()=>{C(null),o(),d()}),k=l.find(ae=>ae.id===z)||null,K=c.length>hb?y("stickerExportLimit"):null,X=h?c.length>Rw?y("stickerSendLimit"):null:y("notConnectedHint"),ie=((ue=M.phase)==null?void 0:ue.kind)==="inUse"?M.phase.packs.length?M.phase.packs:mk(M.phase.ids,l,i):[],oe=ae=>{ae.ok&&(ae.via==="host"?b(Xa(y("stickerShareSaved"),{dir:ae.dir}),"success"):ae.via==="share"?b(y("shareDone"),"success"):b(y("downloaded"),"success"))},ce=async ae=>{if(!j.current){j.current=!0;try{await ae()}catch(ke){b(ut(y,ke),"error")}finally{j.current=!1}}},$=ae=>l.find(ke=>ke.id===ae),Y=(ae,ke,Ce)=>ce(async()=>{if(!ae.length||ae.length>hb)return;const N=ae.length===1?$(ae[0]):null;if(ae.length===1&&!N)return;const E=ae.some(se=>{var ye;return(ye=$(se))==null?void 0:ye.animated});ke==="png"&&E&&b(y("firstFrameHint"),"info");const le=ae.length===1&&N?await(Ce?Ly(N,ke):Mi(N,ke)):await(Ce?Ow(ae,ke):Mw(ae,ke));oe(le),le.ok&&(await wf(ae),d())}),P=(ae,ke)=>ce(async()=>{if(!ae.length)return;const Ce=await Q.bulkStickers({action:ke?"favorite":"unfavorite",ids:ae});b(Ce.skipped.length?y("skippedOther"):y("saved"),Ce.skipped.length?"warning":"success"),d()}),J=(ae,ke,Ce)=>ce(async()=>{if(!Ce.length)return;const N=await Q.bulkStickers({action:ae,ids:Ce,packId:ke,...ae==="moveToPack"&&f?{fromPackId:f}:{}}),E=y(ae==="addToPack"?"addedToPack":"movedToPack");b(N.skipped.length?y("skippedOther"):E,N.skipped.length?"warning":"success"),O(null),d()});return{exportReason:K,sendReason:X,openDetail:ae=>C(ae.id),toggleFavorite:ae=>void P([ae.id],!ae.favorite),favorite:()=>void P(c,!0),unfavorite:()=>void P(c,!1),askAdd:()=>{q(c),O("add")},askMove:()=>{q(c),O("move")},remove:()=>{!f||!c.length||ce(async()=>{const ae=await Q.bulkStickers({action:"removeFromPack",ids:c,packId:f});b(ae.skipped.length?y("skippedOther"):y("removedFromPack"),ae.skipped.length?"warning":"success"),o(),d()})},download:()=>void Y(c,"webp",!1),convert:()=>void Y(c,"png",!1),share:()=>void Y(c,"webp",!0),askSend:()=>{X||!c.length||Z(c)},askDelete:()=>M.requestDelete(c),dialogs:s.jsxs(s.Fragment,{children:[s.jsx(Hy,{open:w!==null,title:y(w==="move"?"moveToPack":"addToPack"),packs:i,onClose:()=>O(null),onCreated:v,onPick:ae=>void J(w==="move"?"moveToPack":"addToPack",ae,A)}),s.jsx(qy,{open:W.length>0,busy:re,onClose:()=>Z([]),onPick:ae=>{ce(async()=>{F(!0);try{(await Q.sendStickers({ids:W,jid:ae})).sent>0?(b(W.length>1?y("stickersSent"):y("stickerSent"),"success"),Z([]),d()):b(y("stickerErr_NOT_CONNECTED"),"error")}finally{F(!1)}})}}),s.jsx(uk,{open:M.phase!==null,busy:M.busy,count:((Ne=M.phase)==null?void 0:Ne.ids.length)??0,inUse:((D=M.phase)==null?void 0:D.kind)==="inUse",packs:ie,onClose:M.close,onConfirm:()=>{M.phase&&M.run(M.phase.ids,!1)},onConfirmEverywhere:()=>{M.phase&&M.run(M.phase.ids,!0)}}),s.jsx(dk,{sticker:k,packs:i,isConnected:h,gifEnabled:x,onClose:()=>C(null),onRename:ae=>{if(k){if([...ae.trim()].length>Yo){b(y("stickerNameTooLong"),"warning");return}ce(async()=>{await Q.updateSticker(k.id,{name:ae.trim()}),b(y("renamed"),"success"),d()})}},onFavorite:ae=>{k&&ce(async()=>{await Q.updateSticker(k.id,{favorite:ae}),b(y("saved"),"success"),d()})},onAddToPack:ae=>{k&&J("addToPack",ae,[k.id])},onRemoveFromPack:ae=>{k&&ce(async()=>{await Q.bulkStickers({action:"removeFromPack",ids:[k.id],packId:ae}),b(y("removedFromPack"),"success"),d()})},onDownload:ae=>{if(k){if(ae==="gif"){ce(async()=>{const ke=await Mi(k,"gif");oe(ke),ke.ok&&(await wf([k.id]),d())});return}Y([k.id],ae,!1)}},onShare:()=>{k&&Y([k.id],"webp",!0)},onSend:()=>{k&&h&&Z([k.id])},onDelete:()=>{k&&M.requestDelete([k.id])},onOpenInCreate:()=>{k&&(C(null),p(k))}})]})}}function Yy(l){const[i,c]=S.useState(new Set),o=S.useRef(null),d=l.join(`
504
+ `);return S.useEffect(()=>{const p=new Set(d?d.split(`
505
+ `):[]);c(v=>{let y=!1;const b=new Set;for(const j of v)p.has(j)?b.add(j):y=!0;return y?b:v})},[d]),{selected:i,toggle:(p,v)=>{const y=l[p];y&&c(b=>{const j=new Set(b);if(v&&o.current!=null){const z=Math.min(o.current,p),C=Math.max(o.current,p);for(let w=z;w<=C;w++){const O=l[w];O&&j.add(O)}return j}return j.has(y)?j.delete(y):j.add(y),o.current=p,j})},selectAll:()=>c(new Set(l)),clear:()=>{o.current=null,c(new Set)}}}function hk(l){const{t:i}=We(),{toast:c}=Gt(),[o,d]=S.useState(""),[f,h]=S.useState(""),[x,p]=S.useState(l==="recent"?"recent":"newest"),[v,y]=S.useState(l),[b,j]=S.useState(""),[z,C]=S.useState([]),[w,O]=S.useState(0),[A,q]=S.useState([]),[W,Z]=S.useState(!0),[re,F]=S.useState(!1),[M,k]=S.useState(null),K=S.useRef(0);S.useEffect(()=>{const $=setTimeout(()=>h(o),300);return()=>clearTimeout($)},[o]);const X=S.useCallback(()=>{Q.getPacks().then($=>q($.packs)).catch(()=>{})},[]);S.useEffect(()=>{X()},[X]);const ie=S.useCallback(async($,Y)=>{const P=++K.current;Y?F(!0):Z(!0),k(null);try{const J=await Q.getStickers({q:f||void 0,sort:x,filter:v,pack:b||void 0,offset:$,limit:Lw});if(P!==K.current)return;C(ue=>Y?[...ue,...J.items]:J.items),O(J.total)}catch(J){if(P!==K.current)return;const ue=ut(i,J);k(ue),c(ue,"error")}finally{P===K.current&&(Z(!1),F(!1))}},[f,x,v,b,i,c]);S.useEffect(()=>{ie(0,!1)},[ie]);const oe=S.useCallback(()=>{X(),ie(0,!1)},[ie,X]),ce=S.useCallback(()=>{re||z.length>=w||ie(z.length,!0)},[z.length,ie,re,w]);return{q:o,setQ:d,sort:x,setSort:p,filter:v,setFilter:y,pack:b,setPack:j,items:z,total:w,packs:A,loading:W,loadingMore:re,error:M,hasMore:z.length<w,reload:oe,loadMore:ce,loadPacks:X,lockedFilter:l!=="all"}}const uf=({preset:l,isConnected:i,gifEnabled:c,refreshKey:o,onOpenInCreate:d})=>{const{t:f}=We(),h=hk(l),x=h.items.map(w=>w.id),p=Yy(x),v=[...p.selected],y=h.pack&&h.pack!=="none"?h.pack:void 0,b=S.useRef(h.reload);b.current=h.reload,S.useEffect(()=>{o!==0&&b.current()},[o]);const j=Vy({items:h.items,packs:h.packs,selectedIds:v,clearSelection:p.clear,reload:h.reload,fromPackId:y,isConnected:i,gifEnabled:c,onOpenInCreate:d,onPackCreated:h.loadPacks}),z=h.q||h.pack||!h.lockedFilter&&h.filter!=="all"?f("noResults"):f(l==="favorites"?"favoritesEmpty":l==="recent"?"recentEmpty":"emptyLibrary"),C=h.items.some(w=>p.selected.has(w.id)&&w.animated);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2",children:[s.jsx("input",{type:"search",value:h.q,onChange:w=>h.setQ(w.target.value),placeholder:f("searchStickers"),"aria-label":f("searchStickers"),className:Kt}),s.jsxs("select",{"aria-label":f("sortBy"),value:h.sort,onChange:w=>h.setSort(w.target.value),className:Kt,children:[s.jsx("option",{value:"newest",children:f("sortNewest")}),s.jsx("option",{value:"oldest",children:f("sortOldest")}),s.jsx("option",{value:"name",children:f("sortName")}),s.jsx("option",{value:"recent",children:f("sortRecent")})]}),!h.lockedFilter&&s.jsxs("select",{"aria-label":f("filterBy"),value:h.filter,onChange:w=>h.setFilter(w.target.value),className:Kt,children:[s.jsx("option",{value:"all",children:f("allStickers")}),s.jsx("option",{value:"favorites",children:f("favorites")}),s.jsx("option",{value:"recent",children:f("recent")}),s.jsx("option",{value:"animated",children:f("animated")}),s.jsx("option",{value:"static",children:f("static")})]}),s.jsxs("select",{"aria-label":f("packFilter"),value:h.pack,onChange:w=>h.setPack(w.target.value),className:Kt,children:[s.jsx("option",{value:"",children:f("anyPack")}),s.jsx("option",{value:"none",children:f("noPack")}),h.packs.map(w=>s.jsx("option",{value:w.id,children:w.name},w.id))]})]}),h.items.length>0&&v.length===0&&s.jsx("div",{children:s.jsx(Me,{variant:"quiet",className:"h-8 px-2",onClick:p.selectAll,children:f("selectAll")})}),s.jsx(Gy,{count:v.length,animatedSelected:C,canRemove:!!y,sendReason:v.length?j.sendReason:null,exportReason:v.length?j.exportReason:null,onSelectAll:p.selectAll,onClear:p.clear,onFavorite:j.favorite,onUnfavorite:j.unfavorite,onAdd:j.askAdd,onMove:j.askMove,onRemove:j.remove,onDownload:j.download,onConvert:j.convert,onShare:j.share,onSend:j.askSend,onDelete:j.askDelete}),s.jsx(ck,{items:h.items,total:h.total,loading:h.loading,loadingMore:h.loadingMore,error:h.error,hasMore:h.hasMore,emptyText:z,selected:p.selected,onToggle:p.toggle,onOpen:j.openDetail,onFavorite:j.toggleFavorite,onLoadMore:h.loadMore,onRetry:h.reload}),j.dialogs]})},pk=({packId:l,isConnected:i,gifEnabled:c,onBack:o,onOpenInCreate:d})=>{const{t:f}=We(),{toast:h}=Gt(),[x,p]=S.useState(null),[v,y]=S.useState([]),[b,j]=S.useState([]),[z,C]=S.useState(!0),[w,O]=S.useState(null),[A,q]=S.useState(0),[W,Z]=S.useState(!1),re=S.useRef(""),F=v.map(Y=>Y.id),M=Yy(F),k=[...M.selected];S.useEffect(()=>{if(A<0)return;let Y=!0;return O(null),Promise.all([Q.getPack(l),Q.getPacks()]).then(([P,J])=>{Y&&(p(P.pack),y(P.items),j(J.packs))}).catch(P=>{Y&&O(ut(f,P))}).finally(()=>{Y&&C(!1)}),()=>{Y=!1}},[l,A,f]);const K=()=>{C(v.length===0),q(Y=>Y+1)},X=Vy({items:v,packs:b,selectedIds:k,clearSelection:M.clear,reload:K,fromPackId:l,isConnected:i,gifEnabled:c,onOpenInCreate:d,onPackCreated:K}),ie=async Y=>{const P=v;y(Y),Z(!0);try{await Q.reorderPack(l,Y.map(J=>J.id))}catch(J){y(P),h(ut(f,J),"error")}finally{Z(!1)}},oe=(Y,P)=>{const J=Y+P;if(W||J<0||J>=v.length)return;const ue=v.slice(),[Ne]=ue.splice(Y,1);Ne&&(ue.splice(J,0,Ne),ie(ue))},ce=Y=>{const P=v.findIndex(D=>D.id===re.current),J=v.findIndex(D=>D.id===Y);if(re.current="",W||P<0||J<0||P===J)return;const ue=v.slice(),[Ne]=ue.splice(P,1);Ne&&(ue.splice(J,0,Ne),ie(ue))},$=v.some(Y=>M.selected.has(Y.id)&&Y.animated);return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Me,{onClick:o,children:[s.jsx(fN,{size:16,className:"rtl:-scale-x-100"}),f("backToPacks")]}),x&&s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-base font-bold text-text-main truncate",children:x.name}),s.jsx("p",{className:"text-xs text-muted",children:Xa(f("stickerCount"),{n:x.count})})]})]}),z&&v.length===0&&s.jsx(_s,{text:f("loading")}),w&&v.length===0&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-16",children:[s.jsx("p",{className:"text-sm text-danger",children:w}),s.jsx(Me,{onClick:K,children:f("retryLoad")})]}),!z&&!w&&v.length===0&&s.jsx(Vf,{icon:s.jsx(Sg,{size:28,className:"text-muted"}),text:f("packEmpty")}),v.length>0&&s.jsxs(s.Fragment,{children:[k.length===0&&s.jsx("div",{children:s.jsx(Me,{variant:"quiet",className:"h-8 px-2",onClick:M.selectAll,children:f("selectAll")})}),s.jsx(Gy,{count:k.length,animatedSelected:$,canRemove:!0,sendReason:k.length?X.sendReason:null,exportReason:k.length?X.exportReason:null,onSelectAll:M.selectAll,onClear:M.clear,onFavorite:X.favorite,onUnfavorite:X.unfavorite,onAdd:X.askAdd,onMove:X.askMove,onRemove:X.remove,onDownload:X.download,onConvert:X.convert,onShare:X.share,onSend:X.askSend,onDelete:X.askDelete}),s.jsx("ul",{className:"flex flex-col gap-2",children:v.map((Y,P)=>s.jsxs("li",{className:"flex items-center gap-2 rounded-xl border border-line bg-panel p-2",onDragOver:J=>J.preventDefault(),onDrop:J=>{J.preventDefault(),ce(Y.id)},children:[s.jsx("div",{className:"w-16 shrink-0",children:s.jsx(Py,{sticker:Y,selected:M.selected.has(Y.id),onToggle:J=>M.toggle(P,J),onOpen:()=>X.openDetail(Y),onFavorite:()=>X.toggleFavorite(Y)})}),s.jsx("p",{className:"flex-1 min-w-0 text-sm font-semibold truncate",children:Y.name||f("stickerPreview")}),s.jsx(pb,{label:f("reorderUp"),disabled:W||P===0,onClick:()=>oe(P,-1),children:s.jsx(hN,{size:14})}),s.jsx(pb,{label:f("reorderDown"),disabled:W||P===v.length-1,onClick:()=>oe(P,1),children:s.jsx(dN,{size:14})}),s.jsx("button",{type:"button",draggable:!W,"aria-label":f("reorderDragHint"),title:f("reorderDragHint"),className:"inline-flex items-center justify-center w-10 h-10 rounded-lg border border-line text-muted cursor-grab",onDragStart:J=>{re.current=Y.id,J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("text/plain",Y.id)},children:s.jsx(Sg,{size:16})})]},Y.id))})]}),X.dialogs]})},xk=({isConnected:l,gifEnabled:i,onOpenInCreate:c})=>{const{t:o}=We(),{toast:d}=Gt(),[f,h]=S.useState([]),[x,p]=S.useState(!0),[v,y]=S.useState(null),[b,j]=S.useState(""),[z,C]=S.useState(null),[w,O]=S.useState(!1),[A,q]=S.useState(null),[W,Z]=S.useState(null),[re,F]=S.useState(""),[M,k]=S.useState(null),[K,X]=S.useState(!1),[ie,oe]=S.useState(null),[ce,$]=S.useState(""),Y=S.useCallback(()=>{y(null),Q.getPacks().then(D=>h(D.packs)).catch(D=>y(ut(o,D))).finally(()=>p(!1))},[o]);S.useEffect(()=>{Y()},[Y]);const P=async()=>{if(Oi(b)){C(o("packNameLength"));return}O(!0),C(null);try{await Q.createPack(b.trim()),j(""),d(o("packCreated"),"success"),Y()}catch(D){d(ut(o,D),"error")}finally{O(!1)}},J=async()=>{if(W){if(Oi(re)){d(o("packNameLength"),"warning");return}O(!0);try{await Q.updatePack(W.id,re.trim()),d(o("packRenamed"),"success"),Z(null),Y()}catch(D){d(ut(o,D),"error")}finally{O(!1)}}},ue=async()=>{if(M){O(!0);try{await Q.deletePack(M.id,K),d(o("packDeleted"),"success"),k(null),X(!1),Y()}catch(D){d(ut(o,D),"error")}finally{O(!1)}}},Ne=async()=>{if(ie){if(!ce){d(o("noDestinationPack"),"warning");return}O(!0);try{await Q.mergePack(ie.id,ce),d(o("packsMerged"),"success"),oe(null),$(""),Y()}catch(D){d(ut(o,D),"error")}finally{O(!1)}}};return A?s.jsx(pk,{packId:A,isConnected:l,gifEnabled:i,onOpenInCreate:c,onBack:()=>{q(null),Y()}}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[s.jsx("input",{value:b,onChange:D=>{const ae=D.target.value;j(ae),z&&C(Oi(ae)?o("packNameLength"):null)},onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),P())},placeholder:o("newPackPlaceholder"),"aria-label":o("packName"),maxLength:Uy+20,className:Kt}),s.jsxs(Me,{variant:"primary",onClick:()=>void P(),disabled:w,children:[s.jsx(Uo,{size:16}),o("createPack")]})]}),z&&s.jsx("p",{className:"text-xs text-danger",children:z}),x&&s.jsx(_s,{text:o("loading")}),v&&!x&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[s.jsx("p",{className:"text-sm text-danger",children:v}),s.jsx(Me,{onClick:Y,children:o("retryLoad")})]}),!x&&!v&&f.length===0&&s.jsx(Vf,{icon:s.jsx(kg,{size:28,className:"text-muted"}),text:o("noPacks")}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f.map(D=>s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-3 flex items-center gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>q(D.id),className:"flex items-center gap-3 flex-1 min-w-0 text-start focus-visible:ring-2 focus-visible:ring-brand-blue/50 rounded-xl","aria-label":o("openPack"),children:[D.coverUrl?s.jsx("img",{src:D.coverUrl,alt:"",loading:"lazy",className:"w-14 h-14 rounded-xl object-cover bg-panel-hover shrink-0"}):s.jsx("span",{className:"w-14 h-14 rounded-xl bg-panel-hover text-muted flex items-center justify-center shrink-0",children:s.jsx(kg,{size:20})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-bold text-text-main truncate",children:D.name}),s.jsx("span",{className:"block text-xs text-muted",children:Xa(o("stickerCount"),{n:D.count})})]})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(Me,{className:"h-8 px-2",title:o("renamePack"),onClick:()=>{Z(D),F(D.name)},children:[s.jsx(ON,{size:14}),s.jsx("span",{className:"sr-only",children:o("renamePack")})]}),s.jsxs(Me,{className:"h-8 px-2",title:o("mergeInto"),onClick:()=>{oe(D),$("")},children:[s.jsx(AN,{size:14}),s.jsx("span",{className:"sr-only",children:o("merge")})]}),s.jsxs(Me,{className:"h-8 px-2",variant:"danger",title:o("deletePack"),onClick:()=>{k(D),X(!1)},children:[s.jsx(ws,{size:14}),s.jsx("span",{className:"sr-only",children:o("deletePack")})]})]})]},D.id))}),s.jsx(Jt,{isOpen:W!==null,onClose:()=>Z(null),title:o("renamePack"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Me,{onClick:()=>Z(null),children:o("cancel")}),s.jsx(Me,{variant:"primary",onClick:()=>void J(),disabled:w,children:o("save")})]}),children:s.jsx("input",{value:re,onChange:D=>F(D.target.value),"aria-label":o("packName"),className:Kt})}),s.jsx(Jt,{isOpen:M!==null,onClose:()=>k(null),title:o("deletePackTitle"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Me,{onClick:()=>k(null),children:o("cancel")}),s.jsx(Me,{variant:"danger",onClick:()=>void ue(),disabled:w,children:o("delete")})]}),children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("button",{type:"button","aria-pressed":!K,onClick:()=>X(!1),className:"text-start px-3 py-3 rounded-xl border border-line hover:bg-panel-hover aria-pressed:border-brand-blue",children:s.jsx("span",{className:"block text-sm font-bold",children:o("deleteKeepStickers")})}),s.jsx("button",{type:"button","aria-pressed":K,onClick:()=>X(!0),className:"text-start px-3 py-3 rounded-xl border border-line hover:bg-panel-hover aria-pressed:border-danger",children:s.jsx("span",{className:"block text-sm font-bold",children:o("deletePackAndStickers")})})]})}),s.jsx(Jt,{isOpen:ie!==null,onClose:()=>oe(null),title:o("mergeTitle"),footer:s.jsxs("div",{className:"flex justify-end gap-2 w-full",children:[s.jsx(Me,{onClick:()=>oe(null),children:o("cancel")}),s.jsx(Me,{variant:"primary",onClick:()=>void Ne(),disabled:w||!ce,children:o("confirmMerge")})]}),children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx("p",{className:"text-sm text-text-main",children:o("mergeConfirmBody")}),s.jsx("label",{className:"text-xs font-bold",htmlFor:"merge-into",children:o("mergeInto")}),s.jsxs("select",{id:"merge-into",value:ce,onChange:D=>$(D.target.value),className:Kt,children:[s.jsx("option",{value:"",children:o("selectPack")}),f.filter(D=>D.id!==(ie==null?void 0:ie.id)).map(D=>s.jsx("option",{value:D.id,children:D.name},D.id))]})]})})]})},gk=["library","packs","favorites","create","recent"];function bb(){const l=window.location.hash.replace(/^#/,"");if(l.startsWith("stickers/")){const i=l.slice(9);if(gk.includes(i))return i}return"library"}const bk=({isConnected:l})=>{const{t:i}=We(),{toast:c}=Gt(),[o,d]=S.useState(bb),[f,h]=S.useState(o==="create"),[x,p]=S.useState(null),[v,y]=S.useState(null),[b,j]=S.useState(0),[z,C]=S.useState(null),[w,O]=S.useState(0),A=S.useCallback(()=>{let M=!0;return y(null),Q.getStickerCapabilities().then(k=>{M&&p(k)}).catch(k=>{M&&y(ut(i,k))}),()=>{M=!1}},[i]);S.useEffect(()=>{if(!(b<0))return A()},[A,b]);const q=S.useCallback(M=>{d(M),M==="create"&&h(!0);const k=`stickers/${M}`;window.location.hash.replace(/^#/,"")!==k&&(window.location.hash=k)},[]);S.useEffect(()=>{const M=()=>d(bb());return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),S.useEffect(()=>{o==="create"&&h(!0)},[o]),S.useEffect(()=>(xb(M=>{if(M.type==="saved"){c(M.created?i("stickerCreated"):i("alreadyInLibrary"),M.created?"success":"info"),M.qualityReduced&&c(i("qualityReduced"),"info"),O(k=>k+1);return}c(Pf(i,M.code),"error")}),()=>xb(null)),[i,c]),S.useEffect(()=>{const M=()=>{const K=rk();K&&(C(K),h(!0),d("create"),window.location.hash.startsWith("#stickers/create")||(window.location.hash="stickers/create"))};M();const k=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",k),()=>document.removeEventListener("visibilitychange",k)},[]);const W=S.useCallback(()=>{ok(),C(null)},[]),Z=S.useCallback(async M=>{try{const k=await fetch(M.url,{credentials:"same-origin"});if(!k.ok)throw new Error(String(k.status));const K=await k.blob(),X=M.name.trim(),ie=X?X.toLowerCase().endsWith(".webp")?X:`${X}.webp`:"sticker.webp";C({blob:K,name:ie,source:"PANEL_UPLOAD",...Ao()?{existingId:M.id}:{}}),q("create")}catch(k){c(ut(i,k),"error")}},[q,i,c]),re=x!==null&&!x.webp,F=[{id:"library",label:i("library")},{id:"packs",label:i("packs")},{id:"favorites",label:i("favorites")},{id:"create",label:i("create")},{id:"recent",label:i("recent")}];return s.jsxs("div",{className:"flex flex-col gap-5 sm:gap-6",children:[s.jsxs("div",{className:"rounded-2xl border border-line bg-panel p-4 sm:p-6 shadow-sm flex items-center gap-3.5",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-brand-cyan/10 text-brand-cyan flex items-center justify-center shrink-0",children:s.jsx(Of,{size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg md:text-xl font-bold text-text-main",children:i("stickers")}),s.jsx("p",{className:"text-xs md:text-sm text-muted mt-0.5",children:i("stickersDesc")})]})]}),re&&s.jsxs("div",{className:"rounded-2xl border border-warn/30 bg-warn/10 p-4 flex items-center gap-3",children:[s.jsx(Ti,{size:20,className:"text-warn shrink-0"}),s.jsx("span",{className:"text-sm text-warn font-medium",children:i("stickerErr_ENCODER_MISSING")})]}),s.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:s.jsx("div",{className:"flex items-center gap-2 min-w-max",children:F.map(M=>s.jsx("button",{type:"button",onClick:()=>q(M.id),className:Ot("px-4 py-2.5 rounded-xl text-sm font-bold transition-all whitespace-nowrap min-h-10",o===M.id?"bg-brand-blue text-white shadow-md shadow-brand-blue/25":"text-muted hover:bg-panel-hover hover:text-text-main"),children:M.label},M.id))})}),o==="library"&&s.jsx(uf,{preset:"all",isConnected:l,gifEnabled:(x==null?void 0:x.gif)===!0,refreshKey:w,onOpenInCreate:M=>void Z(M)}),o==="favorites"&&s.jsx(uf,{preset:"favorites",isConnected:l,gifEnabled:(x==null?void 0:x.gif)===!0,refreshKey:w,onOpenInCreate:M=>void Z(M)}),o==="recent"&&s.jsx(uf,{preset:"recent",isConnected:l,gifEnabled:(x==null?void 0:x.gif)===!0,refreshKey:w,onOpenInCreate:M=>void Z(M)}),o==="packs"&&s.jsx(xk,{isConnected:l,gifEnabled:(x==null?void 0:x.gif)===!0,onOpenInCreate:M=>void Z(M)}),f&&s.jsx("div",{className:o==="create"?"":"hidden",children:s.jsx(sk,{capabilities:x,capsError:v,onRetryCaps:()=>j(M=>M+1),incoming:z,onConsumedIncoming:W,isConnected:l,onGoLibrary:()=>q("library"),onCreated:()=>O(M=>M+1)})})]})},Iy=["overview","connection","commands","ai","groups","schedules","settings","logs","stickers"];function yk(){const l=window.location.hash.replace(/^#/,"").split("/")[0];return Iy.includes(l)?l:"overview"}const vk=()=>{const{t:l}=We(),{toast:i}=Gt(),[c,o]=S.useState(yk),[d,f]=S.useState(!1),{sessionStatus:h,socket:x}=MS((w,O)=>{if(w==="status"){const A=O==null?void 0:O.state;i(`Connection state: ${A}`,"info")}}),[p,v]=S.useState(null),y=S.useCallback(async()=>{try{const w=await Q.getSession();w!=null&&w.session?v({...w.session,qr:w.qr??null,pairingCode:w.pairingCode??null}):w!=null&&w.status&&v(w.status)}catch{}},[]);S.useEffect(()=>{y()},[y]);const b=p||h?{state:(h==null?void 0:h.state)||(p==null?void 0:p.state)||"idle",...p||{},...h||{}}:null,j=(b==null?void 0:b.connected)===!0||(b==null?void 0:b.state)==="connected";S.useEffect(()=>{const w=b==null?void 0:b.state,A=w==="starting"||w==="linking"||w==="reconnecting"||w==="waiting_for_qr"&&!(b!=null&&b.qr)&&!(b!=null&&b.pairingCode)?2e3:15e3,q=setInterval(()=>{y()},A);return()=>clearInterval(q)},[b==null?void 0:b.state,b==null?void 0:b.qr,b==null?void 0:b.pairingCode,y]);const z=w=>{o(w),window.location.hash=w};S.useEffect(()=>{const w=()=>{const O=window.location.hash.replace(/^#/,"").split("/")[0];Iy.includes(O)&&o(O)};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[]);const C={overview:l("overview"),connection:l("connection"),commands:l("commands"),ai:l("ai"),groups:l("groups"),schedules:l("schedules"),settings:l("settings"),logs:l("logs"),stickers:l("stickers")};return s.jsxs("div",{className:"min-h-screen min-h-[100dvh] flex bg-bg text-text-main bg-ambient-glow overflow-x-clip relative",children:[s.jsx(Uj,{currentView:c,onSelectView:z,isOpenMobile:d,onCloseMobile:()=>f(!1)}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(YN,{onToggleMobileMenu:()=>f(w=>!w),title:C[c]||"Dashboard",status:b}),s.jsxs("main",{className:"flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8",children:[c==="overview"&&s.jsx(rw,{status:b,onNavigate:z}),c==="connection"&&s.jsx(lw,{status:b,onRefresh:y,onStatusUpdate:w=>v(O=>({...O||{},...w}))}),c==="ai"&&s.jsx(OS,{}),c==="commands"&&s.jsx(RS,{}),c==="schedules"&&s.jsx(jw,{isConnected:j,onNavigate:z}),c==="groups"&&s.jsx(sw,{}),c==="settings"&&s.jsx(Ew,{}),c==="stickers"&&s.jsx(bk,{isConnected:j}),c==="logs"&&s.jsx(iw,{socket:x})]})]})]})},Nk=()=>s.jsx(VN,{children:s.jsx(Bj,{children:s.jsx(vk,{})})}),yb=document.getElementById("root");yb&&X2.createRoot(yb).render(s.jsx(Sl.StrictMode,{children:s.jsx(Nk,{})}));