dsh-mobile-plugin 0.5.85 → 0.5.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dsh-mobile-credentials/lib/credentials.js +38 -0
- package/lib/impl.js +2 -1
- package/lib/mobile/sync.js +9 -1
- package/lib/panel/index.html +1 -1
- package/lib/relay/core.js +9 -6
- package/lib/relay/identity-rotate.cjs +10 -4
- package/lib/relay/pairing-payload.cjs +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://app.wnluo.com/api/public/apps/14/download-latest"><img alt="安卓 分发下载" src="https://img.shields.io/badge/%E5%AE%89%E5%8D%93-%E5%88%86%E5%8F%91%E4%B8%8B%E8%BD%BD-3DDC84?style=for-the-badge&logo=android&logoColor=white"></a>
|
|
8
8
|
<a href="https://github.com/WNLUO/dsh-mobile-plugin/releases/latest/download/ai-hub-android.apk"><img alt="安卓 GitHub 下载" src="https://img.shields.io/badge/%E5%AE%89%E5%8D%93-GitHub%E4%B8%8B%E8%BD%BD-181717?style=for-the-badge&logo=github"></a>
|
|
9
|
-
<a href="https://apps.apple.com/
|
|
9
|
+
<a href="https://apps.apple.com/app/id6821681438"><img alt="App Store" src="https://img.shields.io/badge/App_Store-%E4%B8%8B%E8%BD%BD-black?style=for-the-badge&logo=appstore&logoColor=white"></a>
|
|
10
10
|
<a href="https://testflight.apple.com/join/4fn5PCMD"><img alt="苹果测试版 下载" src="https://img.shields.io/badge/%E8%8B%B9%E6%9E%9C%E6%B5%8B%E8%AF%95%E7%89%88-%E4%B8%8B%E8%BD%BD-0D96F6?style=for-the-badge&logo=apple&logoColor=white"></a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
* `prune` 更彻底——一次把所有已结束的都清掉,包括超出窗口、原本要等下次写入才被 prune 的
|
|
29
29
|
* 残余;两者都不轮换密钥、不影响任何还能用的通行证。只读副本拒绝,与 `revoke` 同理:清了
|
|
30
30
|
* 不落盘、下次重载复活。
|
|
31
|
+
*
|
|
32
|
+
* 换身份(`rotateIdentity`)时由宿主调 `reassignInstance`:把本机签发的**全部**记录整体换到
|
|
33
|
+
* 新实例号下。凭据串整串哈希查库、记录里的 `instanceId` 只是归属,所以改归属不动凭据串本身
|
|
34
|
+
* (手机上那枚照样验得过),换号对已配对设备完全透明,不需要重新扫码。
|
|
31
35
|
*/
|
|
32
36
|
const crypto = require('node:crypto');
|
|
33
37
|
const fs = require('node:fs');
|
|
@@ -438,6 +442,39 @@ function revokeAllByInstance(instanceId) {
|
|
|
438
442
|
return count;
|
|
439
443
|
}
|
|
440
444
|
|
|
445
|
+
/**
|
|
446
|
+
* 把本机签发的**全部**凭据整体迁到新实例号下(换身份时用)。
|
|
447
|
+
*
|
|
448
|
+
* 为什么是「全部」而不是「上一代那一个」:换号只认「当前号 + 上一代号」,换到第二次时,
|
|
449
|
+
* 挂在更早一代、又没来得及换过来的手机就会被甩下、只能重新扫码。这里不看记录当前挂在哪一代,
|
|
450
|
+
* 一律改成 `toInstanceId`——库里每条记录都是本机签发的,历史各代都是本机的旧身份,统一收到
|
|
451
|
+
* 新号下,换几次都对已配对设备透明。
|
|
452
|
+
*
|
|
453
|
+
* 只改归属那一格,凭据串(及其哈希)不动:手机上那枚照旧验得过,吊销/到期/密钥验签/设备清单
|
|
454
|
+
* 也都按新号对齐。只读副本拒绝,与 `revoke` 同理。
|
|
455
|
+
*
|
|
456
|
+
* @returns {number} 改了几条(已经是目标号的跳过)
|
|
457
|
+
*/
|
|
458
|
+
function reassignInstance(toInstanceId) {
|
|
459
|
+
load();
|
|
460
|
+
if (readOnly) {
|
|
461
|
+
const error = new Error('凭据库的只读副本不能换归属;旁路子进程请经 IPC 交给主进程');
|
|
462
|
+
error.code = 'READ_ONLY';
|
|
463
|
+
throw error;
|
|
464
|
+
}
|
|
465
|
+
const target = String(toInstanceId || '');
|
|
466
|
+
if (!target) return 0;
|
|
467
|
+
let count = 0;
|
|
468
|
+
for (const record of records) {
|
|
469
|
+
if (record.instanceId === target) continue;
|
|
470
|
+
record.instanceId = target;
|
|
471
|
+
count += 1;
|
|
472
|
+
}
|
|
473
|
+
// `byHash` 按整串摘要建索引,与 `instanceId` 无关,改归属不必重建;只有写盘。
|
|
474
|
+
if (count) save();
|
|
475
|
+
return count;
|
|
476
|
+
}
|
|
477
|
+
|
|
441
478
|
/** 本实例仍有效的电脑网页授权,只返回管理清单需要的公开字段。 */
|
|
442
479
|
function listRemoteComputers(instanceId) {
|
|
443
480
|
refresh();
|
|
@@ -772,5 +809,6 @@ module.exports = {
|
|
|
772
809
|
revoke,
|
|
773
810
|
revokeDevice,
|
|
774
811
|
revokeAllByInstance,
|
|
812
|
+
reassignInstance,
|
|
775
813
|
resetForTest,
|
|
776
814
|
};
|
package/lib/impl.js
CHANGED
|
@@ -356,7 +356,8 @@ function apply(ctx) {
|
|
|
356
356
|
relayConnectedOf = tunnelConnected
|
|
357
357
|
|
|
358
358
|
// 身份冲突时换身份:实现在 relay/identity-rotate.cjs,装配层只把它挂上(含重入保护)。
|
|
359
|
-
|
|
359
|
+
// 换号后把本机签发的设备凭据整体迁到新号(凭据库归本进程),否则换第二次会甩下更早配对的手机。
|
|
360
|
+
const rotateNow = createIdentityRotator({ state, rotateIdentity: core.rotateIdentity, saveState: core.saveState, syncSidecar, syncControl: () => control.sync(), migrateCredentials: (toId) => credentials.reassignInstance(toId) })
|
|
360
361
|
|
|
361
362
|
// 总控上报:优先用**稳定外壳**持有的那份(换代不断开上报连接);外壳不在时本地创建兜底。
|
|
362
363
|
// getPort 依赖上面刚就位的 sidecar/advertisedLanPort,所以放在这里建。
|
package/lib/mobile/sync.js
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
*
|
|
14
14
|
* 三个 handler 都要求已配对(路由表里走 `guarded`),否则任何人都能领走配对资格、或往这台
|
|
15
15
|
* 电脑的收件箱塞东西。
|
|
16
|
+
*
|
|
17
|
+
* 2026-11-21 临时桥(等新 App 铺开后撤掉):旧 App 的「删除同步」让一台手机解绑时,其它手机
|
|
18
|
+
* 会拿自己刚配好的凭据去吊销。读收件箱时按本次凭据的签发时刻过滤,刚配上的手机看不到配对前
|
|
19
|
+
* 攒下的记录;老设备用老凭据读,照常看到全部记录。宿主仍然只存不读密文内容。
|
|
16
20
|
*/
|
|
17
21
|
|
|
18
22
|
const { sendJson, readJsonBody } = require('../shared/http-util');
|
|
@@ -107,7 +111,11 @@ function createSyncHandlers(deps = {}) {
|
|
|
107
111
|
if (query !== null) since = Number(query);
|
|
108
112
|
} catch { /* 畸形 URL 当 since=0,返回全部未过期的 */ }
|
|
109
113
|
if (!Number.isFinite(since) || since < 0) since = 0;
|
|
110
|
-
const
|
|
114
|
+
const issuedAt = Number(req.__dshRecord && req.__dshRecord.createdAt) || 0
|
|
115
|
+
const records = inboxStore.read(instanceIdOf(), since)
|
|
116
|
+
// 临时桥:新凭据不读配对前的旧记录,免得旧 App 把「别台解绑」当成自己也要解绑。
|
|
117
|
+
// 老凭据(issuedAt 为 0 或早于所有记录)不受影响;记录本身也不删,别的手机照常读。
|
|
118
|
+
.filter((record) => !issuedAt || Number(record.createdAt) >= issuedAt)
|
|
111
119
|
sendJson(res, 200, { ok: true, records });
|
|
112
120
|
}
|
|
113
121
|
|
package/lib/panel/index.html
CHANGED
|
@@ -100,7 +100,7 @@ Sugerimos que pergunte à sua IA para configurar uma solução de rede adequada
|
|
|
100
100
|
${_}px !important;
|
|
101
101
|
${v}px !important;
|
|
102
102
|
}
|
|
103
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,U.jsx)(xw,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:g.cloneElement(e,{ref:u})})}var Cw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=d_(ww),d=(0,g.useId)(),f=(0,g.useRef)(n),p=(0,g.useRef)(r);f_(()=>{f.current=n,p.current=r});let m=!0,h=(0,g.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,g.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),g.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,U.jsx)(Sw,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,U.jsx)(p_.Provider,{value:h,children:e})};function ww(){return new Map}function Tw(e=!0){let t=(0,g.useContext)(p_);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,g.useId)();(0,g.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,g.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Ew=e=>e.key||``;function Dw(e){let t=[];return g.Children.forEach(e,e=>{(0,g.isValidElement)(e)&&t.push(e)}),t}var Ow=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Tw(o),f=(0,g.useMemo)(()=>Dw(e),[e]),p=o&&!u?[]:f.map(Ew),m=(0,g.useRef)(!0),h=d_(()=>new Map),_=(0,g.useRef)(new Set),[v,y]=(0,g.useState)(f),[b,x]=(0,g.useState)(f);f_(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),f_(()=>{m.current=!1;for(let e=0;e<b.length;e++){let t=Ew(b[e]);p.includes(t)?(h.delete(t),_.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf(Ew(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Ew(e)))?e=f:a===`wait`&&(e=S),x(Dw(e)),y(f),null}let{forceRender:C}=(0,g.useContext)(u_);return(0,U.jsx)(U.Fragment,{children:b.map(e=>{let g=Ew(e),v=o&&!u?!1:f===b||p.includes(g);return(0,U.jsx)(Cw,{isPresent:v,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(g))return;if(h.has(g))_.current.add(g),h.set(g,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},g)})})},kw=(0,g.createContext)({strict:!1}),Aw={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},jw=!1;function Mw(){if(jw)return;let e={};for(let t in Aw)e[t]={isEnabled:e=>Aw[t].some(t=>!!e[t])};qC(e),jw=!0}function Nw(){return Mw(),JC()}function Pw(e){let t=Nw();for(let n in e)t[n]={...t[n],...e[n]};qC(t)}function Fw({children:e,features:t,strict:n=!1}){let[,r]=(0,g.useState)(!Iw(t)),i=(0,g.useRef)(void 0);if(!Iw(t)){let{renderer:e,...n}=t;i.current=e,Pw(n)}return(0,g.useEffect)(()=>{Iw(t)&&t().then(({renderer:e,...t})=>{Pw(t),i.current=e,r(!0)})},[]),(0,U.jsx)(kw.Provider,{value:{renderer:i.current,strict:n},children:e})}function Iw(e){return typeof e==`function`}var Lw=(0,g.createContext)({});function Rw(e,t){if(RC(e)){let{initial:t,animate:n}=e;return{initial:t===!1||FC(t)?t:void 0,animate:FC(n)?n:void 0}}return e.inherit===!1?{}:t}function zw(e){let{initial:t,animate:n}=Rw(e,(0,g.useContext)(Lw));return(0,g.useMemo)(()=>({initial:t,animate:n}),[Bw(t),Bw(n)])}function Bw(e){return Array.isArray(e)?e.join(` `):e}var Vw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hw(e,t,n){for(let r in t)!rS(t[r])&&!ew(r,n)&&(e[r]=t[r])}function Uw({transformTemplate:e},t){return(0,g.useMemo)(()=>{let n=Vw();return qS(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ww(e,t){let n=e.style||{},r={};return Hw(r,n,e),Object.assign(r,Uw(e,t)),r}function Gw(e,t){let n={},r=Ww(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Kw=()=>({...Vw(),attrs:{}});function qw(e,t,n,r){let i=(0,g.useMemo)(()=>{let n=Kw();return QS(n,t,aw(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Hw(t,e.style,e),i.style={...t,...i.style}}return i}var Jw=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Yw(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Jw.has(e)}function Xw(e,t){return e.startsWith(`on`)?!Yw(e):t?.(e)??!Yw(e)}function Zw(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(rS(e[a])||(Xw(a,r)||n===!0&&Yw(a)||!t&&!Yw(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Qw=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function $w(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Qw.indexOf(e)>-1||/[A-Z]/u.test(e))}function eT(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??$w(e)?qw:Gw)(t,r,i,e),l=Zw(t,typeof e==`string`,a,s),u=e===g.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,g.useMemo)(()=>rS(d)?d.get():d,[d]);return(0,g.createElement)(e,{...u,children:f})}function tT({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:nT(n,r,i,e),renderState:t()}}function nT(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=gw(a[e]);let{initial:o,animate:s}=e,c=RC(e),l=zC(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!PC(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Yx(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var rT=e=>(t,n)=>{let r=(0,g.useContext)(Lw),i=(0,g.useContext)(p_),a=()=>tT(e,t,r,i);return n?a():d_(a)},iT=rT({scrapeMotionValuesFromProps:tw,createRenderState:Vw}),aT=rT({scrapeMotionValuesFromProps:sw,createRenderState:Kw}),oT=Symbol.for(`motionComponentSymbol`);function sT(e,t,n){let r=(0,g.useRef)(n);(0,g.useInsertionEffect)(()=>{r.current=n});let i=(0,g.useRef)(null);return(0,g.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var cT=(0,g.createContext)({});function lT(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function uT(e,t,n,r,i,a){let{visualElement:o}=(0,g.useContext)(Lw),s=(0,g.useContext)(kw),c=(0,g.useContext)(p_),l=(0,g.useContext)(_w),u=l.reducedMotion,d=l.skipAnimations,f=(0,g.useRef)(null),p=(0,g.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,g.useContext)(cT);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&dT(f.current,n,i,h);let _=(0,g.useRef)(!1);(0,g.useInsertionEffect)(()=>{m&&_.current&&m.update(n,c)});let v=n[sS],y=(0,g.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return f_(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),f_(()=>{p.current=!0,m&&(_.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,g.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),m.enteringChildren=void 0)}),m}function dT(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:fT(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&lT(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function fT(e){if(e)return e.options.allowProjection===!1?fT(e.parent):e.projection}function pT(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Pw(r);let a=n?n===`svg`:$w(e),o=a?aT:iT;function s(n,s){let c,l={...(0,g.useContext)(_w),...n,layoutId:mT(n)},{isStatic:u,isValidProp:d}=l,f=zw(n),p=o(n,u);if(!u&&typeof window<`u`){hT(l,r);let t=gT(l);c=t.MeasureLayout,f.visualElement=uT(e,p,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(Lw.Provider,{value:f,children:[c&&f.visualElement?(0,U.jsx)(c,{visualElement:f.visualElement,...l}):null,eT(e,n,sT(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,g.forwardRef)(s);return c[oT]=e,c}function mT({layoutId:e}){let t=(0,g.useContext)(u_).id;return t&&e!==void 0?t+`-`+e:e}function hT(e,t){(0,g.useContext)(kw).strict}function gT(e){let{drag:t,layout:n}=Nw();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function _T(e,t){if(typeof Proxy>`u`)return pT;let n=new Map,r=(n,r)=>pT(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,pT(a,void 0,e,t)),n.get(a))})}var vT=_T(),yT=(e,t)=>t.isSVG??$w(e)?new cw(t):new rw(t,{allowProjection:e!==g.Fragment}),bT=class extends ZC{constructor(e){super(e),e.animationState||=dw(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();PC(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xT=0,ST={animation:{Feature:bT},exit:{Feature:class extends ZC{constructor(){super(...arguments),this.id=xT++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Xx(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function CT(e){return{point:{x:e.pageX,y:e.pageY}}}function wT(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&xy.postRender(()=>i(t,CT(t)))}var TT=class extends ZC{mount(){let{current:e}=this.node;e&&(this.unmount=vC(e,(e,t)=>(wT(this.node,t,`Start`),e=>wT(this.node,e,`End`))))}unmount(){}},ET=class extends ZC{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=C_(hw(this.node.current,`focus`,()=>this.onFocus()),hw(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function DT(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&xy.postRender(()=>i(t,CT(t)))}var OT=class extends ZC{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=kC(e,(e,t)=>(DT(this.node,t,`Start`),(e,{success:t})=>DT(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},kT=new WeakMap,AT=new WeakMap,jT=e=>{let t=kT.get(e.target);t&&t(e)},MT=e=>{e.forEach(jT)};function NT({root:e,...t}){let n=e||document;AT.has(n)||AT.set(n,{});let r=AT.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(MT,{root:e,...t})),r[i]}function PT(e,t,n){let r=NT(t);return kT.set(e,n),r.observe(e),()=>{kT.delete(e),r.unobserve(e)}}var FT={some:0,all:1},IT=class extends ZC{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:FT[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=PT(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(LT(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function LT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var RT={inView:{Feature:IT},tap:{Feature:OT},focus:{Feature:ET},hover:{Feature:TT}};function zT(e){return(0,g.useEffect)(()=>()=>e(),[])}var BT={renderer:yT,...ST,...RT};function VT(e){let t=d_(()=>Px(e)),{isStatic:n}=(0,g.useContext)(_w);if(n){let[,n]=(0,g.useState)(e);(0,g.useEffect)(()=>t.on(`change`,n),[])}return t}function HT(e,t){let n=VT(t()),r=()=>n.set(t());return r(),f_(()=>{let t=()=>xy.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),Sy(r)}}),n}function UT(e){Mx.current=[],e();let t=HT(Mx.current,e);return Mx.current=void 0,t}function WT(e,t,n,r){if(typeof e==`function`)return UT(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return KT(e,t,n,r);let i=typeof t==`function`?t:AC(t,n,r),a=Array.isArray(e)?GT(e,i):GT([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function GT(e,t){let n=d_(()=>[]);return HT(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function KT(e,t,n,r){let i=d_(()=>Object.keys(n)),a=d_(()=>({}));for(let o of i)a[o]=WT(e,t,n[o],r);return a}function qT(){!HC.current&&WC();let[e]=(0,g.useState)(VC.current);return e}function JT(){let e=qT(),{reducedMotion:t}=(0,g.useContext)(_w);return t===`never`?!1:t===`always`||e}function YT(e){return typeof e==`object`&&!Array.isArray(e)}function XT(e,t,n,r){return e==null?[]:typeof e==`string`&&YT(t)?MS(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ZT(e,t,n){return e*(t+1)+n*t}function QT(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function $T(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(h_(e,i),r--)}}function eE(e,t,n,r,i,a){$T(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ey(i,a,r[o]),easing:J_(n,o)})}function tE(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function nE(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var rE=`easeInOut`,iE=20;function aE(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,QT(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=QT(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=cE(e),{delay:l=0,times:u=Gy(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ox(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&dE(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=E_(b));let r=Oy(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Wy(u,T),c.length===1&&c.unshift(null),m&&`${m}${iE}`,m&&m<iE){let e=b>0?_/b:0;b=ZT(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?I_(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:J_(f,e-1))}tE(u,m,e)}let E=w+b;eE(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(rS(p)){let e=oE(p,s);_(m,h,sE(`default`,e))}else{let e=XT(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=oE(r,s);for(let e in m)_(m[e],lE(h,e),sE(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(nE);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(w_(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(rE)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function oE(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function sE(e,t){return t[e]||(t[e]=[]),t[e]}function cE(e){return Array.isArray(e)?e:[e]}function lE(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var uE=e=>typeof e==`number`,dE=e=>e.every(uE);function fE(e,t){return rS(e)||typeof e==`number`||typeof e==`string`&&!YT(t)}function pE(e,t,n,r){let i=[];if(fE(e,t))i.push(mw(e,YT(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=XT(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...uC(r,t,s,NC.get(r))):i.push(...DS(TS(r)??dC,r,t,s))}}return i}function mE(e,t,n){let r=[];return aE(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Px(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:By}).forEach(({keyframes:e,transition:t},n)=>{r.push(...pE(n,e,t))}),r}function hE(e){return Array.isArray(e)&&e.some(Array.isArray)}function gE(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),hE(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=mE(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=pE(e,i,{...c,...r},t)}let l=new Ox(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{h_(t.animations,l)})),l}return i}var _E=Object.assign(gE(),{addEffect:CS,removeEffect:wS});function vE(){let e=d_(()=>({current:null,animations:[]})),t=JT()??void 0,{skipAnimations:n}=(0,g.useContext)(_w),r=(0,g.useMemo)(()=>gE({scope:e,reduceMotion:t,skipAnimations:n}),[e,t,n]);return zT(()=>{e.animations.forEach(e=>e.stop()),e.animations.length=0}),[e,r]}var yE=vT,bE=`text-[2.5rem]`,xE={indicator:`text-primary`,track:`text-primary-soft`},SE={indicator:`text-current`,track:`text-current/20`};function CE({colors:e,reduced:t}){return(0,U.jsxs)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 40 40`,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,"aria-hidden":`true`,className:Z(`size-[1em] stroke-4!`,e.indicator),children:[(0,U.jsx)(`circle`,{cx:`20`,cy:`20`,r:`16`,className:e.track}),t?(0,U.jsx)(`circle`,{cx:`20`,cy:`20`,r:`16`,pathLength:1,strokeDasharray:`0.25 0.75`}):(0,U.jsx)(yE.circle,{cx:`20`,cy:`20`,r:`16`,pathLength:1,strokeDasharray:`0.25 0.75`,initial:{strokeDashoffset:0},animate:{strokeDashoffset:-1},transition:{duration:.9,repeat:1/0,ease:`linear`}})]})}var wE=12,TE=1.2;function EE({colors:e,reduced:t}){return(0,U.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 40 40`,fill:`currentColor`,"aria-hidden":`true`,className:Z(`size-[1em]`,e.indicator),children:Array.from({length:wE},(e,n)=>{let r={x:18,y:2,width:4,height:6,rx:2,transform:`rotate(${360/wE*n} 20 20)`};return t?(0,U.jsx)(`rect`,{...r,opacity:.25},n):(0,U.jsx)(yE.rect,{...r,initial:{opacity:0},animate:{opacity:[0,1,.5,0]},transition:{duration:TE,repeat:1/0,ease:`linear`,delay:n/wE*TE-TE,times:[0,.1,.5,1]}},n)})})}var DE=`M12.846 3.581C12.711 3.231 12.375 3 12 3C11.625 3 11.278 3.263 11.154 3.581C10.604 5.011 10.054 6.442 9.504 7.872C8.752 8.16 8.159 8.752 7.871 9.504C6.441 10.054 5.011 10.604 3.581 11.154C3.41 11.22 3.263 11.336 3.159 11.487C3.055 11.638 3 11.817 3 12C3 12.183 3.056 12.362 3.159 12.513C3.262 12.664 3.41 12.78 3.581 12.846C5.011 13.396 6.442 13.946 7.872 14.496C8.16 15.248 8.752 15.841 9.504 16.129C10.054 17.559 10.604 18.989 11.154 20.419C11.22 20.59 11.336 20.737 11.487 20.841C11.638 20.945 11.817 21 12 21C12.183 21 12.362 20.945 12.513 20.841C12.664 20.737 12.78 20.59 12.846 20.419C13.396 18.989 13.946 17.559 14.496 16.129C15.248 15.841 15.841 15.248 16.129 14.496C17.559 13.946 18.989 13.396 20.419 12.846C20.59 12.78 20.737 12.664 20.841 12.513C20.945 12.362 21 12.183 21 12C21 11.817 20.945 11.638 20.841 11.487C20.737 11.336 20.59 11.22 20.419 11.154C18.989 10.604 17.559 10.054 16.129 9.504C15.841 8.752 15.248 8.16 14.496 7.871C13.946 6.441 13.396 5.011 12.846 3.581Z`,OE=`M12.704 5C12.469 5 12.235 5 12 5C11.765 5 11.531 5 11.296 5C10.161 5.053 9.025 5.106 7.889 5.159C6.979 6.069 6.069 6.979 5.159 7.889C5.106 9.025 5.053 10.161 5 11.296C5 11.395 5 11.494 5 11.593C5 11.729 5 11.864 5 12C5 12.136 5 12.271 5 12.407C5 12.506 5 12.605 5 12.704C5.053 13.839 5.106 14.975 5.159 16.111C6.069 17.021 6.979 17.931 7.889 18.841C9.025 18.894 10.161 18.947 11.296 19C11.395 19 11.494 19 11.593 19C11.729 19 11.864 19 12 19C12.136 19 12.271 19 12.407 19C12.506 19 12.605 19 12.704 19C13.839 18.947 14.975 18.894 16.111 18.841C17.021 17.931 17.931 17.021 18.841 16.111C18.894 14.975 18.947 13.839 19 12.704C19 12.605 19 12.506 19 12.407C19 12.271 19 12.136 19 12C19 11.864 19 11.729 19 11.593C19 11.494 19 11.395 19 11.296C18.947 10.161 18.894 9.025 18.841 7.889C17.931 6.979 17.021 6.069 16.111 5.159C14.975 5.106 13.839 5.053 12.704 5Z`;function kE(e){return e.match(/-?\d+(?:\.\d+)?/g)?.map(Number)??[]}var AE=kE(DE),jE=kE(OE),ME=(AE.length-2)/6;function NE(e){let t=`M${e[0]} ${e[1]}`;for(let n=0;n<ME;n++){let r=2+n*6;t+=`C${e[r]} ${e[r+1]} ${e[r+2]} ${e[r+3]} ${e[r+4]} ${e[r+5]}`}return t+`Z`}function PE(e,t,n){return e+(t-e)*n}function FE(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}var IE=2.5,LE=.4;function RE({colors:e,reduced:t}){let n=VT(0);g.useEffect(()=>{if(t)return;let e=_E(n,1,{duration:IE,repeat:1/0,ease:`linear`});return()=>e.stop()},[t,n]);let r=WT(n,e=>{if(e<LE/2){let t=FE(e/(LE/2));return NE(AE.map((e,n)=>PE(e,jE[n],t)))}if(e<LE){let t=FE((e-LE/2)/(LE/2));return NE(jE.map((e,n)=>PE(e,AE[n],t)))}return DE}),i=WT(n,e=>e<LE?FE(e/LE)*360:360);return(0,U.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,"aria-hidden":`true`,className:Z(`size-[1em]`,e.indicator),children:t?(0,U.jsx)(`path`,{d:DE}):(0,U.jsx)(yE.path,{d:r,style:{transformOrigin:`12px 12px`,rotate:i}})})}var zE={circular:CE,dots:EE,sparkle:RE};function BE({variant:e=`circular`,currentColor:t=!1,"aria-label":n=`Loading`,className:r,...i}){let a=_h(),o=t?SE:xE,s=zE[e],c=(0,U.jsx)(s,{colors:o,reduced:a});return(0,U.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":n,className:Z(`inline-flex shrink-0 items-center justify-center align-middle`,bE,r),...i,children:a?c:(0,U.jsx)(Fw,{features:BT,strict:!0,children:c})})}function VE(e,{storage:t=`local`}={}){let[n,r,i]=Ig(t,e,``,{serializer:e=>e,deserializer:e=>e}),a=n!==`1`,o=(0,g.useCallback)(()=>r(`1`),[r]),s=(0,g.useCallback)(()=>i(),[i]);return(0,g.useMemo)(()=>({open:a,dismiss:o,reset:s}),[a,o,s])}var HE=Uu(Z(`group/alert relative rounded-xl border p-5 text-foreground backdrop-blur-xl`,`grid w-full items-start`,`[grid-template-columns:auto_1fr_auto] [grid-template-areas:'icon_title_close'_'._description_.'_'._actions_actions']`,`@min-[460px]:data-[layout=inline]:items-center`,`@min-[460px]:data-[layout=inline]:[grid-template-columns:auto_auto_1fr_auto_auto]`,`@min-[460px]:data-[layout=inline]:[grid-template-areas:'icon_title_description_actions_close']`),{variants:{variant:{default:`bg-background border-border`,primary:`bg-primary-subtle border-primary-soft`,secondary:`bg-secondary-subtle border-secondary-soft`,error:`bg-error-subtle border-error-soft`,success:`bg-success-subtle border-success-soft`,warning:`bg-warning-subtle border-warning-soft`,info:`bg-info-subtle border-info-soft`}},defaultVariants:{variant:`default`}}),UE={default:`text-foreground-intense`,primary:`text-primary`,secondary:`text-secondary-emphasis`,error:`text-error-emphasis`,success:`text-success-emphasis`,warning:`text-warning-emphasis`,info:`text-info-emphasis`},WE=g.createContext(`default`),GE={opacity:0,scale:.88,filter:`blur(12px)`,height:0},KE={opacity:0},qE={default:{duration:.32,ease:[.4,0,.2,1]},height:{duration:.3,ease:[.4,0,.2,1],delay:.18}};function JE({variant:e,layout:t=`block`,dismissible:n=!1,open:r,onOpenChange:i,persistKey:a,persistStorage:o=`local`,closeLabel:s=`Dismiss`,role:c=`alert`,className:l,children:u,style:d,...f}){let p=_h(),[m,h]=g.useState(!0),_=VE(a??``,{storage:o}),v=r!==void 0,y=!v&&a!=null,b=v?r:y?_.open:m,x=g.useCallback(()=>{if(v){i?.(!1);return}y?_.dismiss():h(!1),i?.(!1)},[v,y,_,i]);return(0,U.jsx)(WE.Provider,{value:e??`default`,children:(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(Ow,{initial:!1,children:b&&(0,U.jsx)(yE.div,{initial:!1,exit:p?KE:GE,transition:p?{duration:0}:qE,className:`@container overflow-hidden`,children:(0,U.jsxs)(`div`,{role:c,"data-slot":`alert`,"data-layout":t,style:d,className:Z(HE({variant:e}),l),...f,children:[u,n&&(0,U.jsx)(`button`,{type:`button`,"aria-label":s,"data-slot":`alert-close`,onClick:x,className:Z(`text-foreground-muted cursor-pointer rounded-md p-1 transition-colors outline-none [grid-area:close]`,`hover:text-foreground-intense`,`focus-visible:ring-ring focus-visible:ring-2`,`self-start @min-[460px]:group-data-[layout=inline]/alert:self-center`,`ms-3 -me-1 -mt-1 @min-[460px]:group-data-[layout=inline]/alert:my-0`),children:(0,U.jsx)(YE,{})})]})},`alert`)})})})}function YE(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,className:`size-4`,children:(0,U.jsx)(`path`,{d:`M11.523 3.522c.264-.264.691-.264.955 0s.264.691 0 .955L8.955 8l3.522 3.522c.264.264.264.691 0 .955s-.691.264-.955 0L8 8.955l-3.522 3.522c-.264.264-.691.264-.955 0s-.264-.691 0-.955L7.045 8 3.522 4.478c-.264-.264-.264-.691 0-.955s.691-.264.955 0L8 7.045l3.523-3.522z`})})}function XE({className:e,...t}){let n=g.useContext(WE);return(0,U.jsx)(`span`,{"data-slot":`alert-icon`,className:Z(`me-3 flex h-lh shrink-0 items-center [grid-area:icon] [&_svg:not([class*='size-'])]:size-5`,UE[n],e),...t})}function ZE({className:e,as:t=`h5`,...n}){return(0,U.jsx)(t,{"data-slot":`alert-title`,className:Z(`text-foreground-intense self-center font-semibold [grid-area:title]`,`text-base @min-[460px]:group-data-[layout=inline]/alert:me-3 @min-[460px]:group-data-[layout=inline]/alert:text-sm`,e),...n})}function QE({className:e,...t}){return(0,U.jsx)(`p`,{"data-slot":`alert-description`,className:Z(`text-foreground text-sm [grid-area:description]`,`mt-2 @min-[460px]:group-data-[layout=inline]/alert:mt-0`,e),...t})}function $E(e){return Hr(e.defaultTagName??`div`,e,e)}var eD=[`before:pointer-events-none`,`before:absolute`,`before:inset-0`,`before:-z-1`,`before:rounded-[inherit]`,`[a,button]:before:transition-[opacity,background-color,border-color]`,`[a,button]:before:duration-250`,`motion-reduce:[a,button]:before:transition-none`],tD=Uu(`relative isolate inline-flex shrink-0 items-center justify-center rounded-full whitespace-nowrap outline-offset-1 select-none [&_svg]:shrink-0 [a,button]:transform-gpu [a,button]:cursor-pointer [a,button]:transition [a,button]:duration-250 [a,button]:ease-[cubic-bezier(0.175,0.885,0.32,1.5)] [a,button]:not-data-popup-open:active:translate-y-px [a,button]:not-data-popup-open:active:scale-[0.97] [a,button]:not-data-popup-open:active:duration-100 [a,button]:not-data-popup-open:active:ease-in-out motion-reduce:[a,button]:transition-none`,{variants:{variant:{primary:Z(eD,`bg-primary text-primary-foreground outline-ring-primary [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--primary)_0%,var(--primary-muted)_75%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),"primary-outline":Z(eD,`text-primary before:border before:border-primary outline-ring-primary`,`[a,button]:hover:before:bg-primary [a,button]:hover:text-primary-foreground`,`[a,button]:data-pressed:before:bg-primary [a,button]:data-pressed:text-primary-foreground`,`[a,button]:data-popup-open:before:bg-primary [a,button]:data-popup-open:text-primary-foreground`),secondary:Z(eD,`bg-secondary-muted text-secondary-foreground outline-ring-secondary [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--secondary)_0%,var(--secondary-muted)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),soft:Z(eD,`text-foreground-intense before:bg-background-muted before:backdrop-blur-md [a,button]:before:border [a,button]:before:border-transparent outline-ring`,`data-[slot=breadcrumb-link]:not-data-active:text-foreground-muted data-[slot=breadcrumb-link]:hover:text-foreground-intense`,`[a,button]:hover:before:bg-background-subtle [a,button]:hover:before:border-border`,`[a,button]:data-pressed:before:bg-background-subtle [a,button]:data-pressed:before:border-border`,`[a,button]:data-popup-open:before:bg-background-subtle [a,button]:data-popup-open:before:border-border`,`data-active:before:bg-background-subtle data-active:border data-active:before:border-border`),outline:Z(eD,`bg-background text-foreground-intense before:bg-background before:border-border before:border outline-ring`,`data-[slot=breadcrumb-link]:not-data-active:text-foreground-muted data-[slot=breadcrumb-link]:hover:text-foreground-intense`,`[a,button]:hover:before:bg-background-subtle [a,button]:hover:before:border-border-strong`,`[a,button]:data-pressed:before:bg-background-subtle [a,button]:data-pressed:before:border-border-strong`,`[a,button]:data-popup-open:before:bg-background-subtle [a,button]:data-popup-open:before:border-border-strong`,`data-active:before:bg-background-subtle data-active:before:border-border-strong`),error:Z(eD,`bg-error-muted text-error-foreground outline-ring-error [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--error-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),success:Z(eD,`bg-success-muted text-success-foreground outline-ring-success [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--success-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),warning:Z(eD,`bg-warning-muted text-warning-foreground outline-ring-warning [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--warning-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),info:Z(eD,`bg-info-muted text-info-foreground outline-ring-info [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--info-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),light:Z(eD,`text-white before:bg-white/10 before:border-white/10 before:border before:backdrop-blur-md outline-ring-light`,`[a,button]:hover:before:bg-white/15 [a,button]:hover:before:border-white/15`,`[a,button]:data-pressed:before:bg-white/15 [a,button]:data-pressed:before:border-white/15`,`[a,button]:data-popup-open:before:bg-white/15 [a,button]:data-popup-open:before:border-white/15`,`data-active:before:bg-white/15 data-active:before:border-white/15`)},size:{xs:`h-4 w-fit gap-0.5 px-1.5 text-[.625rem] has-data-[icon=end]:pe-1.25 has-data-[icon=start]:ps-1.25 [&_svg:not([class*='size-'])]:size-2.5 [&_svg:not([class*='stroke-'])]:stroke-2`,sm:`h-5 w-fit gap-0.5 px-2 text-xs has-data-[icon=end]:pe-1.5 has-data-[icon=start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='stroke-'])]:stroke-[1.85]`,md:`h-6 w-fit gap-0.75 px-2.5 text-xs has-data-[icon=end]:pe-1.75 has-data-[icon=start]:ps-1.75 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,lg:`h-7 w-fit gap-1 px-3 text-sm has-data-[icon=end]:pe-2.25 has-data-[icon=start]:ps-2.25 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,"icon-sm":`h-5 w-5 [&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='stroke-'])]:stroke-[1.85]`,"icon-md":`h-6 w-6 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,"icon-lg":`h-7 w-7 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`}},defaultVariants:{variant:`primary`,size:`md`}});function nD({className:e,variant:t,size:n,render:r,...i}){let a=g.isValidElement(r)?r.props:void 0,o=g.isValidElement(r)&&(r.type===`a`||r.type===`button`)||i.onClick!=null||a?.href!=null||a?.onClick!=null||a?.tabIndex!=null;return $E({defaultTagName:`span`,render:r,state:{variant:t,size:n},props:Or({"data-slot":`badge`,...o?Bu():{},className:Z(tD({variant:t,size:n}),e)},i)})}function rD(e,t,n,r,i){return g.isValidElement(t)?g.cloneElement(t,{...i,...t.props,className:Z(n,t.props.className,r)}):g.createElement(e,{...i,className:Z(n,r)})}var iD=`[--card-radius:var(--radius-xl)]`,aD=`rounded-[calc(var(--card-radius)*4/3)]`,oD={none:`rounded-(--card-radius)`,solid:Z(aD,`bg-background-muted/60 p-2 backdrop-blur-xl dark:bg-background-subtle`),glass:Z(aD,`border border-white/15 bg-white/10 p-2 backdrop-blur-sm`)},sD={none:`border`,solid:`border-border-muted border`,glass:``};function cD({frame:e=!1,inset:t=!0,className:n,contentProps:r,render:i,children:a,...o}){let s=e===!0?`solid`:e===!1?`none`:e;return rD(`div`,i,Z(`group/card flex flex-col`,iD,oD[s]),n,{"data-slot":`card`,"data-frame":s,...t?{"data-inset":``}:{},...o,children:(0,U.jsx)(`div`,{"data-slot":`card-content`,...r,className:Z(`bg-background flex min-h-0 flex-1 flex-col overflow-hidden rounded-(--card-radius)`,t&&`p-2`,sD[s],r?.className),children:a})})}function lD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:Z(`flex flex-1 flex-col gap-1.5 p-6 group-data-inset/card:px-4`,e),...t})}function uD({className:e,render:t,...n}){return rD(`h3`,t,`text-foreground-intense text-lg font-semibold`,e,{"data-slot":`card-title`,...n})}var dD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=vd(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Hr(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:It,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),fD=`--nested-dialogs`,pD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=vd(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ud(),ai({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Gs(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Hr(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Ws,hidden:!m,onKeyDown(e){Jd.has(e.key)&&e.stopPropagation()},style:{[fD]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Zf});return(0,U.jsx)(Oo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),mD=F(function(e){return Lf(`dialog`,e)}),hD=Object.assign(function(e){return(0,U.jsx)(mD,{...e})},{createHandle:Fp});function gD({className:e,children:t,closeButton:n=!0,closeLabel:r=`Close`,backdrop:i=!0,frame:a=!0,backdropProps:o,viewportProps:s,...c}){let l=a&&i,{portal:u,popup:d}=zp(c);return(0,U.jsxs)(gf,{...u,children:[i&&(0,U.jsx)(dD,{"data-slot":`dialog-backdrop`,...o,className:Z(`fixed inset-0 z-50 bg-black/30 backdrop-blur-sm supports-[-webkit-touch-callout:none]:absolute`,`motion-safe:transition-opacity motion-safe:duration-250 motion-safe:ease-out`,`data-ending-style:motion-safe:opacity-0 data-starting-style:motion-safe:opacity-0`,o?.className)}),(0,U.jsx)(Qf,{"data-slot":`dialog-viewport`,...s,className:Z(`fixed inset-0 z-50 flex items-center justify-center overflow-hidden p-4`,s?.className),children:(0,U.jsx)(pD,{"data-slot":`dialog-popup`,...l?{"data-frame":``}:{},className:Z(`group/dialog-popup relative flex max-h-full min-h-0 w-150 max-w-full flex-col`,`rounded-2xl border`,l?`border-white/15 bg-white/10 p-1.5 backdrop-blur-sm`:`bg-background border-border-overlay`,!l&&`shadow-2xl`,`isolate transform-gpu outline-none`,`motion-safe:transition-[opacity,scale] motion-safe:duration-250 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-95 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,`data-nested-dialog-open:pointer-events-none data-nested-dialog-open:scale-95 data-nested-dialog-open:opacity-0`,e),...d,children:(0,U.jsxs)(`div`,{"data-slot":`dialog-content`,className:Z(`relative flex min-h-0 flex-col overflow-hidden not-has-[>[data-slot=dialog-footer]]:pb-6 not-has-[>[data-slot=dialog-header]]:pt-6 [&>[data-slot=dialog-header]+[data-slot=dialog-footer]]:pt-0`,l&&`bg-background rounded-[calc(var(--radius-2xl)*5/6)]`),children:[t,n&&(0,U.jsx)(Od,{"aria-label":r,"data-slot":`dialog-close-button`,className:Z(Gu({variant:`outline`,size:`icon-sm`}),`absolute inset-e-3 top-3 z-10`),children:(0,U.jsx)(SD,{})})]})})})]})}function _D({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:Z(`flex shrink-0 flex-col gap-2 p-6`,e),...t})}function vD({className:e,...t}){return(0,U.jsx)(Uf,{"data-slot":`dialog-title`,className:Z(`text-foreground-intense text-2xl font-semibold`,e),...t})}function yD({className:e,...t}){return(0,U.jsx)(Nd,{"data-slot":`dialog-description`,className:Z(`text-foreground-muted text-sm`,e),...t})}function bD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-body`,className:Z(`min-h-0 flex-1 px-6`,e),...t})}function xD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-footer`,className:Z(`flex flex-col-reverse gap-2 p-6 sm:flex-row sm:justify-end`,e),...t})}function SD(e){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,U.jsx)(`path`,{d:`M11.594 3.594c.225-.225.588-.225.813 0s.225.588 0 .812L8.813 8l3.594 3.594c.225.225.225.588 0 .813s-.588.225-.812 0L8 8.812l-3.594 3.594c-.225.225-.588.225-.812 0s-.225-.588 0-.812L7.188 8 3.594 4.406c-.225-.225-.225-.588 0-.812s.588-.225.813 0L8 7.187l3.594-3.594z`})})}var CD=g.createContext(void 0);function wD(){let e=g.useContext(CD);if(e===void 0)throw Error(S(63));return e}var TD=`data-valid`,ED=`data-invalid`,DD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},OD={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kD={valid(e){return e===null?null:e?{[TD]:``}:{[ED]:``}}},AD=`data-checked`,jD=`data-unchecked`,MD={...kD,checked(e){return e?{[AD]:``}:{[jD]:``}}},ND={invalid:void 0,name:void 0,validityData:{state:DD,errors:[],error:``,value:``,initialValue:null},setValidityData:p,disabled:void 0,setTouched:p,setDirty:p,setFilled:p,setFocused:p,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:OD,registerFieldControl:p,validation:{getValidationProps:(e,t=h)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:p,getInputControl:()=>null,commit:async()=>{},change:p}},PD=g.createContext(ND);function FD(e=!0){let t=g.useContext(PD);if(t.setValidityData===p&&!e)throw Error(S(28));return t}function ID(e,t,n,r,i=!0,a){let{registerFieldControl:o}=FD(),s=y(()=>Symbol());b(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),b(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var LD=g.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:p,validationMode:`onSubmit`,submitCountRef:{current:0}});function RD(){return g.useContext(LD)}var zD=g.createContext({controlId:void 0,registerControlId:p,resetControlId:p,labelId:void 0,setLabelId:p,messageIds:[],setMessageIds:p,getDescriptionProps:e=>e});function BD(){return g.useContext(zD)}function VD(e,t,n,r=!0,i){let[a,o]=g.useState(),s=Md(i?`${i}-label`:void 0),c=e??t??a;return b(()=>{let i=e||t||!r?void 0:HD(n.current,s);a!==i&&o(i)}),c}function HD(e,t){let n=UD(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function UD(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function WD(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=BD(),o=Md(),s=y(()=>Symbol()),c=g.useRef(!1),l=g.useRef(!1),u=q(()=>{c.current&&i!==p&&(c.current=!1,i(s.current,void 0))});return b(()=>{if(!n||i===p){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),b(()=>u,[u]),(n?r:void 0)??t??o}var GD=g.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:_,uncheckedValue:v,value:y,style:x,...S}=e,{clearErrors:C}=RD(),{state:w,setTouched:T,setDirty:E,validityData:D,setFilled:O,setFocused:k,validationMode:A,disabled:j,name:M,validation:N}=FD(),{labelId:P}=BD(),F=j||m,I=M??l,L=g.useRef(null),R=gr(L,c,N.inputRef),z=g.useRef(null),B=Md(),V=WD({id:s}),H=u?void 0:V,[ee,te]=vf({controlled:n,default:!!i,name:`Switch`,state:`checked`});ID(z,B,ee,void 0,!F,l),b(()=>{O(ee)},[ee,O]),Kf(ee,()=>{C(I),E(ee!==D.initialValue),N.change(ee)});let{getButtonProps:ne,buttonRef:W}=ua({disabled:F,native:u}),re=VD(a,P,L,!u,H),G={id:u?V:B,role:`switch`,"aria-checked":ee,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":re,onFocus(){F||k(!0)},onBlur(){let e=L.current;e&&!F&&(T(!0),k(!1),A===`onBlur`&&N.commit(e.checked))},onClick(e){if(f||F)return;e.preventDefault();let t=L.current;t&&la(t,e)}},K={...N.getValidationProps(F),checked:ee,disabled:F,form:o,id:H,name:I,required:p,style:I?mr:pr,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:R,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=ja(ha,e.nativeEvent);d?.(t,n),!n.isCanceled&&te(t)},onClick(e){e.stopPropagation()},onFocus(){z.current?.focus()},...y===void 0?h:{value:y}},ie=g.useMemo(()=>({...w,checked:ee,disabled:F,readOnly:f,required:p}),[w,ee,F,f,p]),ae=Hr(`span`,e,{state:ie,ref:[t,z,W],props:[G,S,ne,e=>N.getValidationProps(F,e)],stateAttributesMapping:MD});return(0,U.jsxs)(CD.Provider,{value:ie,children:[ae,!ee&&I&&v!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:I,value:v,disabled:F}),(0,U.jsx)(`input`,{...K,suppressHydrationWarning:!0})]})}),KD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Hr(`span`,e,{state:wD(),ref:t,stateAttributesMapping:MD,props:a})}),qD={sm:{root:`h-4 w-7.5`,thumb:`size-3`,thumbWidthKeyframes:[`0.75rem`,`1.25rem`,`0.75rem`],thumbXKeyframes:[0,`0.3125rem`,`0.875rem`],check:`size-2.5`},md:{root:`h-5 w-9.5`,thumb:`size-4`,thumbWidthKeyframes:[`1rem`,`1.6875rem`,`1rem`],thumbXKeyframes:[0,`0.4375rem`,`1.125rem`],check:`size-3`},lg:{root:`h-6 w-11.5`,thumb:`size-5`,thumbWidthKeyframes:[`1.25rem`,`2.125rem`,`1.25rem`],thumbXKeyframes:[0,`0.5rem`,`1.375rem`],check:`size-4`}},JD={duration:.25,ease:[.4,0,.2,1]};function YD(e,t){return t===1?[...e]:e.map(e=>typeof e==`number`?-e:`-${e}`)}function XD({renderProps:e,state:t,dirSign:n,sizeConfig:r,reduced:i}){let{checked:a}=t,{ref:o,onDrag:s,onDragStart:c,onDragEnd:l,onAnimationStart:u,onAnimationEnd:d,...f}=e,p=g.useMemo(()=>{let e=YD(r.thumbXKeyframes,n);return a?e:e.reverse()},[a,n,r]),m=p[p.length-1],[h,_]=vE(),v=zu(o,h),y=g.useRef(a);return g.useEffect(()=>{let e=y.current!==a;y.current=a,e&&!i?_(h.current,{x:p,width:r.thumbWidthKeyframes},JD):_(h.current,{x:m},{duration:0})},[a,r,_,h,i,p,m]),(0,U.jsx)(yE.span,{...f,ref:v,initial:{x:m},children:(0,U.jsx)(yE.svg,{className:Z(`text-foreground-intense`,r.check),xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{strokeDasharray:12},initial:!1,animate:{strokeDashoffset:a?0:12},transition:i?{duration:0}:{strokeDashoffset:{duration:a?.3:0,ease:`easeOut`,delay:a?.25:0}},children:(0,U.jsx)(`path`,{d:`M3 6l2 2 4-4`})})})}function ZD({className:e,size:t=`md`,...n}){let r=Uc()===`rtl`?-1:1,i=qD[t],a=_h(),o=n[`aria-invalid`],s=o===!0||o===`true`;return(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(GD,{"data-slot":`switch`,className:Z(`bg-background-strong outline-ring flex shrink-0 rounded-full border border-transparent p-px outline-offset-1`,i.root,`transition-background duration-200 motion-reduce:transition-none`,`data-checked:bg-primary data-checked:outline-ring-primary`,`data-disabled:not-data-checked:border-border-strong data-disabled:opacity-disabled data-disabled:cursor-not-allowed data-disabled:not-data-checked:border-dashed`,`data-invalid:border-error data-invalid:not-data-checked:bg-error-subtle data-invalid:outline-ring-error`,e),...n,...s?{"data-invalid":``}:{},children:(0,U.jsx)(KD,{"data-slot":`switch-thumb`,className:Z(`group flex items-center justify-center rounded-full bg-white shadow-2xs`,i.thumb,`data-checked:bg-primary-foreground`),render:(e,t)=>(0,U.jsx)(XD,{renderProps:e,state:t,dirSign:r,sizeConfig:i,reduced:a})})})})}var QD=3e4,$D=1e3;function eO(e,t=Date.now()){let n=e?.tailcat?.expiresAt??0;if(!Number.isFinite(n)||n<=0)return null;let r=n*1e3-t;return r<=0?null:Math.max(r-QD,$D)}var tO=class extends Error{constructor(e,t,n){super(e),G(this,`code`,void 0),G(this,`status`,void 0),this.name=`ApiError`,this.code=t,this.status=n}};async function nO(e){let t=null;try{t=await e.json()}catch{t=null}let n=t?.error;if(typeof n==`string`&&n)return new tO(n,`http_${e.status}`,e.status);if(n&&typeof n==`object`){let t=n,r=typeof t.code==`string`&&t.code?t.code:`http_${e.status}`;return new tO(typeof t.message==`string`&&t.message?t.message:$(`panel.net.requestFailed`,{status:e.status}),r,e.status)}return new tO($(`panel.net.requestFailed`,{status:e.status}),`http_${e.status}`,e.status)}async function rO(e){let t=e.split(`?`)[0]===`/api/relay/pairing`,n=t?3e4:e===`/api/relay/status`?12e3:0,r=n?new AbortController:null,i=r?window.setTimeout(()=>r.abort(),n):null;try{let n=await fetch(e,{headers:{accept:`application/json`},...r?{signal:r.signal}:{}});if(!n.ok)throw await nO(n);let i=await n.json();if(t&&(i?.ok!==!0||typeof i.svg!=`string`||!i.svg.includes(`<svg`)))throw new tO($(`panel.pairing.qrFailed`),`pairing_invalid`,n.status);return i}catch(e){throw r?.signal.aborted?new tO($(t?`panel.console.pairingTimeout`:`panel.console.statusTimeout`),t?`pairing_timeout`:`status_timeout`,0):e}finally{i!==null&&window.clearTimeout(i)}}async function iO(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify(t??{})});if(!r.ok)throw await nO(r);let i=await r.json();return n?.keepApplyError||aO(i),i}function aO(e){let t=e?.applyError;if(typeof t==`string`&&t)throw new tO($(`panel.shell.applyFailed`,{message:t}),`apply_failed`,200)}function oO(e){return iO(`/api/relay/frp/import`,{config:e})}function sO(){return iO(`/api/relay/frp/stop`)}function cO(e){return e instanceof tO?e.message:e instanceof Error?e.message||$(`panel.net.requestFailedNoStatus`):String(e)}var lO={ok:4e3,soft:6e3,error:9e3};function uO(){let e=(0,g.useRef)(ud());return e.current=ud(),(0,g.useCallback)((t,n)=>{e.current.add({title:n,type:t,timeout:lO[t],priority:t===`error`?`high`:`low`})},[])}var dO={status:`/api/relay/update/status`,check:`/api/relay/update/check`,apply:`/api/relay/update/apply`,auto:`/api/relay/update/auto`,otaStatus:`/api/relay/update/ota/status`,otaCheck:`/api/relay/update/ota/check`,otaApply:`/api/relay/update/ota/apply`},fO=e=>e&&typeof e==`object`?e:{},pO=e=>typeof e==`string`&&e!==``?e:null,mO=e=>typeof e==`boolean`?e:null,hO=e=>typeof e==`number`&&Number.isFinite(e)?e:null;async function gO(e,t){let n=await fetch(e,{credentials:`same-origin`,headers:{accept:`application/json`,...t?.body?{"content-type":`application/json`}:{}},...t}),r=null;try{r=await n.json()}catch{r=null}let i=fO(r),a=fO(i.error);if(!n.ok){let e=pO(a.code)??`http_${n.status}`;throw new tO(pO(a.message)??$(`panel.net.hostHttp`,{status:n.status}),e,n.status)}return i}function _O(e){return e instanceof tO?e.status===404:e instanceof SyntaxError}function vO(e){return e instanceof tO&&e.code===`update_unavailable`}function yO(e){let t=fO(e);return Object.keys(t).length===0?null:{installedVersion:pO(t.installedVersion),latestVersion:pO(t.latestVersion),updateAvailable:t.updateAvailable===!0,source:pO(t.source),checkedAt:pO(t.checkedAt)}}function bO(e){let t=fO(e),n=fO(t.failure),r=pO(n.code);return{installed:mO(t.installed),skipped:mO(t.skipped),state:pO(t.state),beforeVersion:pO(t.beforeVersion),installedVersion:pO(t.installedVersion),swapped:mO(t.swapped),restartRequired:mO(t.restartRequired),refreshRequired:mO(t.refreshRequired),failure:r?{code:r,message:pO(n.message)??r}:null}}function xO(e){let t=fO(e);return{available:t.available===!0,version:pO(t.version),installedVersion:pO(t.installedVersion),source:pO(t.source),previousVersion:pO(t.previousVersion),activatedAt:pO(t.activatedAt),lastError:pO(t.lastError),inFlight:hO(t.inFlight)??0,swapping:t.swapping===!0,autoUpdate:t.autoUpdate===!0,autoIntervalMs:hO(t.autoIntervalMs)??6e5,marketBase:pO(t.marketBase),marketLastCheckedAt:pO(t.marketLastCheckedAt),marketLastError:pO(t.marketLastError),marketResult:yO(t.marketResult),lastApply:t.lastApply?bO(t.lastApply):null,appliedAt:pO(t.appliedAt),runningShellHash:pO(t.runningShellHash),installedShellHash:pO(t.installedShellHash),shellChanged:t.shellChanged===!0}}async function SO(){return xO((await gO(dO.status)).data)}async function CO(){let e=fO((await gO(dO.check,{method:`POST`,body:JSON.stringify({})})).data);return{update:yO(e.update),status:e.status?xO(e.status):null}}async function wO(e=!1){let t=fO((await gO(dO.apply,{method:`POST`,body:JSON.stringify({force:e})})).data),n=fO(t.status);return{...bO(t),status:Object.keys(n).length>0?xO(n):null}}async function TO(e){let t=fO((await gO(dO.auto,{method:`POST`,body:JSON.stringify({enabled:e})})).data);return{enabled:t.enabled===!0,status:t.status?xO(t.status):null}}function EO({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,className:e??`size-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.2`}),(0,U.jsx)(`path`,{d:`M6.3 6.1a1.75 1.75 0 0 1 3.4.55c0 1.15-1.7 1.35-1.7 2.55`}),(0,U.jsx)(`path`,{d:`M8 11.5h.01`})]})}function DO(){let[e,t]=(0,g.useState)(null),[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),c=uO();(0,g.useEffect)(()=>{let e=!0;return SO().then(n=>{e&&t(n)}).catch(()=>{}),()=>{e=!1}},[]);let l=(0,g.useCallback)(async n=>{r(!0);try{let r=await TO(n);t(e=>r.status??(e&&{...e,autoUpdate:r.enabled}));let i=Math.round((r.status?.autoIntervalMs??e?.autoIntervalMs??6e5)/6e4);c(`soft`,r.enabled?$(`panel.update.autoOn`,{minutes:i}):$(`panel.update.autoOff`))}catch(e){c(`error`,$(`panel.update.autoToggleFailed`,{message:cO(e)}));try{t(await SO())}catch{}}finally{r(!1)}},[e?.autoIntervalMs,c]);if(!e)return null;let u=e.autoUpdate===!0,d=Math.round((e.autoIntervalMs??6e5)/6e4);return(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border-muted pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground`,children:$(`panel.update.autoUpdate`)}),(0,U.jsx)(`button`,{type:`button`,"aria-label":$(`panel.update.autoHelp`),title:$(`panel.update.autoHelp`),className:`shrink-0 cursor-pointer text-foreground-muted transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,onClick:()=>a(!0),children:(0,U.jsx)(EO,{})})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[n?(0,U.jsx)(BE,{}):null,(0,U.jsx)(ZD,{size:`md`,checked:u,disabled:n,onCheckedChange:e=>{e?l(!0):s(!0)},"aria-label":$(`panel.update.autoUpdate`)})]})]}),(0,U.jsx)(hD,{open:i,onOpenChange:a,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.update.autoUpdate`)})}),(0,U.jsx)(bD,{className:`whitespace-pre-line text-sm leading-6 text-foreground-muted`,children:$(`panel.update.autoDetail`,{minutes:d})}),(0,U.jsx)(xD,{className:`flex justify-end`,children:(0,U.jsx)(Q,{variant:`outline`,onClick:()=>a(!1),children:$(`panel.common.close`)})})]})}),(0,U.jsx)(hD,{open:o,onOpenChange:s,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.update.autoOffTitle`)})}),(0,U.jsx)(bD,{className:`text-sm leading-6 text-foreground-muted`,children:$(`panel.update.autoOffBody`)}),(0,U.jsxs)(xD,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,onClick:()=>{s(!1),l(!1)},children:$(`panel.update.autoOffConfirm`)}),(0,U.jsx)(Q,{variant:`primary`,onClick:()=>s(!1),children:$(`panel.update.autoOffKeep`)})]})]})})]})}var OO=g.createContext(void 0);function kO(e){let t=g.useContext(OO);if(t===void 0&&!e)throw Error(S(72));return t}var AO={...dc,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},jO=class extends le{constructor(e,t,n){let r=new ic;super(MO(e,r,t,n),NO(r),AO),G(this,`setOpen`,(e,t)=>{Qs(this,e,t,{extraState:{openChangeReason:t.reason}})})}cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ja(ga,e))}};function MO(e,t,n,r=!1){return{...ac(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function NO(e){return{popupRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var PO=F(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ks((e,t)=>new jO({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,_=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),ec(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=tc(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=g.useRef(null);b(()=>{m&&t&&p.setOpen(!1,ja(Oa))},[m,t,p]),b(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[S,C,T,w,p]),b(()=>{h&&(_??p.set(`payload`,void 0))},[p,_,h]),g.useImperativeHandle(o,()=>({unmount:x,close:()=>p.setOpen(!1,ja(ka))}),[x,p]);let D=h||v||!t&&a!==`none`;return(0,U.jsxs)(OO.Provider,{value:p,children:[l&&(0,U.jsx)(qs,{handle:l,store:p}),D&&(0,U.jsx)(FO,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function FO({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Fo(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Mo(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=g.useMemo(()=>Or(a.reference,i.reference),[a.reference,i.reference]);return nc(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??h}),null}var IO=g.createContext(void 0);function LO(){return g.useContext(IO)}var RO=`data-base-ui-tooltip-trigger`;function zO(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(_e(n))return n}}let t=e.target;return _e(t)?t:null}function BO(e){let t=e;for(;t;){let e=t.closest(`[${RO}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&_e(n.host)?n.host:null}return null}var VO=I(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=kO(!0),m=fc(a)??p;if(!m)throw Error(S(82));let h=Md(d),_=m.useState(`isTriggerActive`,h),v=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=g.useRef(null),x=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=$s(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),T=LO(),{activeIdRef:E,delayRef:D,isInstantPhase:O,hasProvider:k}=Ya(y,{open:v}),A=xc(y);m.useSyncedValue(`isInstantPhase`,O);let j=m.useState(`disabled`),M=s??j,N=Ba(M),P=m.useState(`trackCursorAxis`),F=m.useState(`disableHoverablePopup`),I=g.useRef(!1),L=Ke(),R=g.useRef(void 0);function z(){return k&&E.current!=null?0:c??T??600}function B(e){let t=b.current;if(!t||!e)return!1;let n=BO(e);return n!==null&&n!==t&&J(t,n)}function V(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let H=wc(y,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?Vc():null,restMs:z,delay(){return u==null&&k?{close:Ua(D.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),ee=gc(y,{enabled:!M}).reference,te=e=>{let t=I.current,n=zO(e),r=V(n),i=b.current,a=i&&n&&J(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,ja(_a,e));return}if(t&&!r&&a&&!N.current&&!m.select(`open`)&&i&&Qt(R.current)){let t=()=>{!I.current&&!N.current&&!m.select(`open`)&&m.setOpen(!0,ja(_a,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},U=m.useState(`triggerProps`,w);return Hr(`button`,e,{state:{open:v},ref:[t,C,b],props:[H,ee,w||P!==`none`?U:void 0,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){B(zO(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Lt]:M?``:void 0,[RO]:M?void 0:``},f],stateAttributesMapping:Nt})}),HO=g.createContext(void 0);function UO(){let e=g.useContext(HO);if(e===void 0)throw Error(S(70));return e}var WO=g.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return kO().useState(`mounted`)||n?(0,U.jsx)(HO.Provider,{value:n,children:(0,U.jsx)(Ra,{ref:t,...r})}):null}),GO=g.createContext(void 0);function KO(){let e=g.useContext(GO);if(e===void 0)throw Error(S(71));return e}var qO=g.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=pi,style:_,...v}=e,y=kO(),b=UO(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=rl({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=sl(e,g.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,U.jsx)(GO.Provider,{value:O,children:k})}),JO=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=kO(),{side:s,align:c}=KO(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);ai({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Sc(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Hr(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Ws,f,ol(d),a],stateAttributesMapping:It})}),YO=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=kO(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=KO();return Hr(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Ft})});function XO(e){return(0,U.jsx)(PO,{...e})}function ZO(e){return(0,U.jsx)(VO,{"data-slot":`tooltip-trigger`,...e})}function QO({className:e,arrow:t=!0,children:n,...r}){let{positioner:i,portal:a,popup:o}=bh(r);return(0,U.jsx)(WO,{...a,children:(0,U.jsx)(qO,{side:`top`,align:`center`,alignOffset:0,sideOffset:t?8:4,...i,className:Z(`isolate z-50`,i.className),children:(0,U.jsxs)(JO,{"data-slot":`tooltip-content`,className:Z(`bg-background-inverse text-foreground-inverse rounded-xs px-3 py-1.5 text-xs shadow-md`,`motion-safe:origin-(--transform-origin) motion-safe:transition-[opacity,scale] motion-safe:duration-200 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-90 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,`data-instant:motion-safe:transition-none`,e),...o,children:[n,t&&(0,U.jsx)(YO,{"data-slot":`tooltip-arrow`,className:Z(`bg-background-inverse fill-background-inverse size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]`,`data-[side=top]:-bottom-2.5`,`data-[side=bottom]:top-1`,`data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2`,`data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2`,`data-[side=inline-start]:-inset-e-1 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-translate-y-1/2`,`data-[side=inline-end]:-inset-s-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-translate-y-1/2`)})]})})})}function $O({tone:e}){return(0,U.jsx)(`span`,{className:fg(`inline-block size-2 shrink-0 rounded-full`,pg[e]),"aria-hidden":!0})}function ek({label:e,hint:t,labelExtra:n,tone:r,mono:i,nowrap:a,children:o}){return(0,U.jsxs)(`div`,{className:fg(`flex justify-between gap-4 border-b border-border-muted py-2 last:border-b-0`,a?`items-center whitespace-nowrap`:`items-baseline`),children:[(0,U.jsx)(`dt`,{className:a?`shrink-0 text-xs text-foreground-muted`:`min-w-[5.5rem] flex-1 text-sm text-foreground-muted`,children:t||n?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,n,t?(0,U.jsxs)(XO,{children:[(0,U.jsx)(ZO,{delay:250,render:(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,className:`shrink-0 cursor-pointer text-foreground-muted transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none motion-reduce:transition-none`,children:(0,U.jsx)(EO,{})})}),(0,U.jsx)(QO,{className:`max-w-72`,children:(0,U.jsx)(`p`,{children:t})})]}):null]}):e}),(0,U.jsx)(`dd`,{className:fg(`text-right text-sm`,a?`shrink-0 whitespace-nowrap text-xs`:`min-w-0 max-w-[62%] break-words`,i?`font-mono text-xs text-foreground-strong`:`text-foreground`,r&&mg[r]),children:o})]})}var tk=`[&>div]:min-h-9`,nk=`[&>div]:min-h-12 [&>div]:py-0 [&>div]:items-center`;function rk({children:e,className:t}){return(0,U.jsx)(`dl`,{className:fg(`mt-1`,t),children:e})}function ik({tone:e,text:t,detail:n}){return(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)($O,{tone:e}),(0,U.jsx)(`span`,{children:t}),n?(0,U.jsx)(`span`,{className:`line-clamp-2 text-xs text-foreground-muted`,title:n,children:n}):null]})}var ak=`M4.3 12.55 L9.25 17.5 L19.7 6.5`,ok={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};async function sk(e){if(typeof e==`string`)return e;if(typeof e==`function`)return await e();let t=e.current;if(!t)throw Error("CopyButton: the `value` ref is not attached to an element");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??``}async function ck(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{if(!document.execCommand(`copy`))throw Error(`Copying to clipboard is not supported`)}finally{t.remove()}}function lk({value:e,timeout:t=2e3,label:n=`Copy`,copiedLabel:r=`Copied`,onCopy:i,onCopyError:a,icon:o,onClick:s,variant:c=`ghost`,size:l=`icon-sm`,className:u,children:d,...f}){let[p,m]=g.useState(!1),h=g.useRef(void 0);return g.useEffect(()=>()=>clearTimeout(h.current),[]),(0,U.jsxs)(Q,{"data-slot":`copy-button`,"data-copied":p||void 0,type:`button`,variant:c,size:l,"aria-label":p?r:n,onClick:async n=>{if(s?.(n),n.defaultPrevented)return;let r;try{r=await sk(e),await ck(r)}catch(e){a?.(e);return}i?.(r),m(!0),clearTimeout(h.current),h.current=setTimeout(()=>m(!1),t)},className:Z(`group/copy`,u),...f,children:[(0,U.jsxs)(`span`,{"data-icon":d==null?void 0:`start`,className:`grid place-items-center *:[grid-area:1/1]`,children:[(0,U.jsx)(`span`,{className:Z(`grid place-items-center transition-[opacity,scale] delay-150 duration-150 ease-out group-data-copied/copy:delay-0`,`group-data-copied/copy:scale-50 group-data-copied/copy:opacity-0`,`motion-reduce:transition-none`),children:o??(0,U.jsx)(`svg`,{...ok,children:(0,U.jsx)(`path`,{d:`M4.012 16.737c-.307-.175-.562-.427-.739-.732S3.001 15.353 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1M7 9.667c0-.707.281-1.386.781-1.886S8.96 7 9.667 7h8.666c.35 0 .697.069 1.021.203s.618.33.865.578.444.542.578.865A2.67 2.67 0 0 1 21 9.667v8.666a2.67 2.67 0 0 1-.781 1.886 2.67 2.67 0 0 1-1.886.781H9.667a2.67 2.67 0 0 1-1.021-.203c-.324-.134-.618-.331-.865-.578s-.444-.542-.578-.865S7 18.683 7 18.333V9.667z`})})}),(0,U.jsx)(`svg`,{...ok,children:(0,U.jsx)(`path`,{d:ak,pathLength:1,strokeDasharray:`1 2`,className:Z(`[stroke-dashoffset:1.02] group-data-copied/copy:[stroke-dashoffset:0]`,`transition-[stroke-dashoffset] duration-200 ease-in`,`group-data-copied/copy:delay-100 group-data-copied/copy:duration-350 group-data-copied/copy:ease-out`,`motion-reduce:transition-none`)})})]}),typeof d==`string`&&p?r:d,(0,U.jsx)(`span`,{role:`status`,className:`sr-only`,children:p?r:``})]})}function uk({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,className:e??`size-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.2`}),(0,U.jsx)(`path`,{d:`M8 4.8v4.4`}),(0,U.jsx)(`path`,{d:`M8 11.4h.01`})]})}var dk=`https://app.wnluo.com/api/sdk/feedback`,fk=`dsh-mobile`,pk=`plugin`,mk=`dsh-mobile-plugin`,hk=`diagnosis.txt`,gk=`dsh-mobile-plugin.feedback.deviceId`,_k=3e4,vk=new Map;function yk(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`}function bk(){try{let e=localStorage.getItem(gk);if(e)return e;let t=yk();return localStorage.setItem(gk,t),t}catch{return yk()}}function xk(e){return vk.has(e)||vk.set(e,yk()),vk.get(e)}async function Sk(){try{return(await rO(`/api/relay/status`)).appVersion||``}catch{return``}}async function Ck(e){let t=e.version??await Sk(),n=xk(e.summary),r={product_slug:fk,source:pk,component_id:mk,component_version:t,device_source:`install`,files:{name:hk,type:`text/plain`},...e.context||{}},i=new FormData;for(let e of[`package_id`,`platform`,`version_name`,`build_number`,`model`,`system_version`,`channel`])i.append(e,``);i.append(`device_id`,bk()),i.append(`content`,e.summary),i.append(`product_slug`,fk),i.append(`source`,pk),i.append(`component_id`,mk),i.append(`component_version`,t),i.append(`submission_id`,n),i.append(`context`,JSON.stringify(r)),i.append(`files`,new Blob([e.detail],{type:`text/plain`}),hk);let a=new AbortController,o=window.setTimeout(()=>a.abort(),_k);try{let t=await fetch(dk,{method:`POST`,body:i,signal:a.signal}),r=null;try{r=await t.json()}catch{r=null}if(!t.ok)throw Error(r?.error||`HTTP ${t.status}`);let o=r?.data?.thread_key;if(!o)throw Error($(`panel.feedback.noKey`));return vk.delete(e.summary),{threadKey:o,submissionId:n}}catch(e){throw e instanceof Error&&e.name===`AbortError`?Error($(`panel.feedback.timeout`)):e}finally{window.clearTimeout(o)}}function wk({issue:e}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(``),l=uO();async function u(){if(!r){i(!0),o(``),c(``);try{let t=await Ck({summary:`${e.title}\n${e.detail}`,detail:`${e.title}\n${e.detail}`,context:{title:e.title,detail:e.detail}});o(t.threadKey)}catch(e){c($(`panel.feedback.failed`,{error:e.message||String(e)}))}finally{i(!1)}}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":e.title,title:e.title,className:`shrink-0 cursor-pointer rounded text-error transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,onClick:()=>n(!0),children:(0,U.jsx)(uk,{})}),(0,U.jsx)(hD,{open:t,onOpenChange:n,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:e.title})}),(0,U.jsxs)(bD,{children:[(0,U.jsx)(`p`,{className:`whitespace-pre-wrap break-all text-sm leading-6 text-foreground-muted`,children:e.detail}),(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-foreground-muted`,children:$(`panel.feedback.consent`)}),s?(0,U.jsx)(`p`,{className:`mt-2 text-sm text-error`,children:s}):null,a?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`p`,{className:`text-xs leading-5 text-foreground-muted`,children:$(`panel.feedback.receipt`,{key:a})}),(0,U.jsx)(lk,{value:a,label:$(`panel.feedback.copyKey`),copiedLabel:$(`panel.feedback.keyCopied`),size:`sm`,variant:`outline`,onCopyError:()=>l(`error`,$(`panel.feedback.keyCopyFailed`)),children:$(`panel.feedback.copyKey`)})]}):null]}),(0,U.jsxs)(xD,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void u(),children:$(r?`panel.feedback.sending`:`panel.feedback.sendThis`)}),(0,U.jsx)(lk,{value:e.detail,label:$(`panel.common.copy`),copiedLabel:$(`panel.links.sponsorCopied`),size:`sm`,variant:`outline`,onCopyError:()=>l(`error`,$(`panel.onboarding.copiedFailed`)),children:$(`panel.common.copy`)}),(0,U.jsx)(Q,{variant:`ghost`,onClick:()=>n(!1),children:$(`panel.common.close`)})]})]})})]})}function Tk(e){return e.available?e.enabled?e.error?`panel.tailcat.error`:e.ready?`panel.tailcat.ready`:`panel.tailcat.starting`:`panel.tailcat.disabled`:`panel.tailcat.unavailableShort`}function Ek(e){return e.available?e.enabled?e.path===`direct`&&e.active?`panel.p2p.open`:e.error?`panel.p2p.error`:e.path===`failed`?`panel.p2p.blocked`:e.ready?e.path===`waiting`?`panel.p2p.waiting`:`panel.p2p.punching`:e.started?`panel.p2p.punching`:`panel.p2p.waiting`:`panel.p2p.disabled`:`panel.p2p.unavailableShort`}function Dk(e){return!e.available||!e.enabled?`off`:e.path===`direct`&&e.active?`ok`:e.error||e.path===`failed`?`error`:`warn`}function Ok(e){return!e.available||!e.enabled?`off`:e.error?`error`:e.ready?`ok`:`warn`}function kk({status:e,addressBook:t,busy:n,onStopFrp:r,onManageTailcat:i,onManageP2P:a,restartError:o}){let s=e.tunnel,c=e.tailcat??null,l=e.p2p??null,u=(t?.manualTcp??``).trim(),d=e.frp??null,f=d?.enabled===!0||d?.enabled===void 0&&d?.configPresent===!0,p=d?.configPresent===!0||f||!!(d?.running||d?.starting||d?.retrying),m,h;return d?.running?(m=`ok`,h=$(`panel.connection.tcpRunning`)):d?.starting||d?.retrying?(m=`warn`,h=$(`panel.frp.retrying`)):d?.error?(m=`error`,h=$(`panel.connection.tcpFailed`)):f?(m=`warn`,h=$(`panel.connection.tcpEnabledNotRunning`)):p?(m=`off`,h=$(`panel.connection.tcpSet`)):u?(m=`ok`,h=$(`panel.connection.tcpManual`)):(m=`off`,h=$(`panel.connection.tcpOff`)),(0,U.jsxs)(cD,{frame:`solid`,children:[(0,U.jsxs)(rk,{children:[(0,U.jsxs)(ek,{label:$(`panel.connection.platform`),children:[e.platform,` `,e.osVersion,` · `,e.arch]}),(0,U.jsx)(ek,{label:$(`panel.connection.tunnel`),tone:gg(s.state),labelExtra:s.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.tunnel`),detail:s.error}}):void 0,children:(0,U.jsx)(ik,{tone:gg(s.state),text:_g(s.state)})}),c?(0,U.jsx)(ek,{label:$(`panel.tailcat.title`),tone:Ok(c),labelExtra:!c.available||c.error?(0,U.jsx)(wk,{issue:{title:$(`panel.tailcat.title`),detail:c.available?c.error??``:$(`panel.tailcat.unavailable`)}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:Ok(c),text:$(Tk(c))}),(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:i,children:$(`panel.tailcat.manage`)})]})}):null,l?(0,U.jsx)(ek,{label:$(`panel.p2p.title`),tone:Dk(l),labelExtra:!l.available||l.error?(0,U.jsx)(wk,{issue:{title:$(`panel.p2p.title`),detail:l.available?l.error??``:$(`panel.p2p.unavailable`)}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:Dk(l),text:$(Ek(l))}),(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:a,children:$(`panel.p2p.manage`)})]})}):null,(0,U.jsx)(ek,{label:$(`panel.connection.tcp`),tone:m,labelExtra:d?.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.tcp`),detail:d.error}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:m,text:h}),d&&(d.enabled||d.running||d.starting||d.retrying||d.enabled===void 0&&d.configPresent)?(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,disabled:n!==``,onClick:r,children:$(`panel.frp.stop`)}):null]})}),(0,U.jsx)(ek,{label:$(`panel.connection.sidecar`),labelExtra:o?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.sidecar`),detail:o}}):void 0,children:(0,U.jsx)(ik,{tone:o||e.sidecar.state!==`healthy`?`error`:`ok`,text:o?$(`panel.pairing.sidecarRestartFailed`):bg(e.sidecar.state),...!o&&e.sidecar.restarts>0?{detail:$(`panel.connection.sidecarRestarts`,{count:e.sidecar.restarts})}:{}})}),(0,U.jsx)(ek,{label:$(`panel.connection.mirror`),labelExtra:e.mirror.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.mirror`),detail:e.mirror.error}}):void 0,children:(0,U.jsx)(ik,{tone:e.mirror.ok?`ok`:e.mirror.error?`error`:`warn`,text:e.mirror.ok?$(`panel.connection.mirrorOk`):$(`panel.connection.mirrorOff`),detail:hg(e.mirror.pushedAt)})})]}),e.lan.recovery?.state===`awaiting-device`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.lanWaiting`)})})}):e.lan.recovery?.state===`verified`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),children:(0,U.jsx)(ik,{tone:`ok`,text:$(`panel.connection.lanVerified`)})})}):null,e.lan.enabled&&(e.lan.error||e.lan.discovery?.error)?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),labelExtra:(0,U.jsx)(wk,{issue:{title:$(`panel.connection.lan`),detail:(e.lan.error||e.lan.discovery?.error)??``}}),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.lan.error`)})})}):null,(0,U.jsx)(Ak,{status:e})]})}function Ak({status:e}){let t=e.tunnel.admissionHint;return t?t===`register-secret`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.relayNeedsSecret`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.relayNeedsSecret`),detail:$(`panel.connection.relayNeedsSecretBody`)})})}):(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.relayRejected`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.relayRejected`),detail:$(`panel.connection.relayRejectedBody`)})})}):null}var jk=`dsh-mobile-plugin:panel-action`;function Mk(){return typeof window<`u`&&window.parent!==window}function Nk(e){Mk()&&window.parent.postMessage({type:jk,action:e},`*`)}function Pk(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M13 5H5.8A1.8 1.8 0 0 0 4 6.8v11.4A1.8 1.8 0 0 0 5.8 20h11.4a1.8 1.8 0 0 0 1.8-1.8V11`}),(0,U.jsx)(`path`,{d:`M14 4h6v6`}),(0,U.jsx)(`path`,{d:`M20 4l-8.5 8.5`})]})}function Fk(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M6 6l12 12`}),(0,U.jsx)(`path`,{d:`M18 6L6 18`})]})}function Ik(){return Mk()?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.console.openBrowser`),title:$(`panel.console.openBrowser`),onClick:()=>Nk(`open-browser`),children:(0,U.jsx)(Pk,{})}),(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.common.close`),title:$(`panel.common.close`),onClick:()=>Nk(`close`),children:(0,U.jsx)(Fk,{})})]}):null}function Lk(e){return Lf(`alert-dialog`,e)}var Rk=class extends Pp{};function zk(){return new Rk}var Bk=Object.assign(function(e){return(0,U.jsx)(Lk,{...e})},{createHandle:zk});function Vk({className:e,children:t,backdrop:n=!0,frame:r=!0,backdropProps:i,viewportProps:a,...o}){let{portal:s,popup:c}=zp(o),l=i?.forceRender===!0,u=r&&n;return(0,U.jsxs)(gf,{...s,children:[n&&(0,U.jsx)(dD,{"data-slot":`alert-dialog-backdrop`,...i,className:Z(`fixed inset-0 z-50 bg-black/30 backdrop-blur-sm supports-[-webkit-touch-callout:none]:absolute`,`motion-safe:transition-opacity motion-safe:duration-250 motion-safe:ease-out`,`data-ending-style:motion-safe:opacity-0 data-starting-style:motion-safe:opacity-0`,i?.className)}),(0,U.jsx)(Qf,{"data-slot":`alert-dialog-viewport`,...a,className:Z(`fixed inset-0 z-50 flex items-center justify-center overflow-hidden p-4`,a?.className),children:(0,U.jsx)(pD,{"data-slot":`alert-dialog-popup`,...u?{"data-frame":``}:{},className:Z(`group/alert-dialog-popup relative flex max-h-full min-h-0 w-100 max-w-full flex-col`,`rounded-2xl border`,u?Z(`border-white/15 bg-white/10 p-1.5 backdrop-blur-sm`,!l&&`data-nested:border-border-overlay data-nested:bg-background data-nested:p-0 data-nested:shadow-2xl data-nested:backdrop-blur-none`):`bg-background border-border-overlay`,!u&&`shadow-2xl`,`isolate transform-gpu outline-none`,`motion-safe:transition-[opacity,scale] motion-safe:duration-250 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-95 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,e),...c,children:(0,U.jsx)(`div`,{"data-slot":`alert-dialog-content`,className:Z(`flex min-h-0 flex-col overflow-hidden not-has-[>[data-slot=alert-dialog-footer]]:pb-6 not-has-[>[data-slot=alert-dialog-header]]:pt-6 [&>[data-slot=alert-dialog-header]+[data-slot=alert-dialog-footer]]:pt-0`,u&&Z(`bg-background rounded-[calc(var(--radius-2xl)*5/6)]`,!l&&`group-data-nested/alert-dialog-popup:rounded-none group-data-nested/alert-dialog-popup:bg-transparent`)),children:t})})})]})}function Hk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Z(`flex shrink-0 flex-col gap-2 p-6`,e),...t})}function Uk({className:e,...t}){return(0,U.jsx)(Uf,{"data-slot":`alert-dialog-title`,className:Z(`text-foreground-intense text-xl font-semibold`,e),...t})}function Wk({className:e,...t}){return(0,U.jsx)(Nd,{"data-slot":`alert-dialog-description`,className:Z(`text-foreground-muted text-sm`,e),...t})}function Gk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:Z(`min-h-0 flex-1 px-6`,e),...t})}function Kk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Z(`flex flex-col-reverse gap-2 p-6 sm:flex-row sm:justify-end`,e),...t})}function qk(e,t){if(!e)return``;let n=Math.max(0,t-e);if(n<6e4)return $(`panel.devices.justNow`);let r=Math.floor(n/6e4);if(r<60)return $(`panel.devices.minutesAgo`,{count:r});let i=Math.floor(r/60);return i<24?$(`panel.devices.hoursAgo`,{count:i}):$(`panel.devices.daysAgo`,{count:Math.floor(i/24)})}function Jk(e,t){return e?Yk(e,t)?$(`panel.devices.online`):qk(e,t):$(`panel.devices.noRecord`)}function Yk(e,t){return e>0&&t-e<=3e5}function Xk(e){return{ios:`iOS`,android:`Android`,linux:`Linux`,darwin:`macOS`,win32:`Windows`}[e]??(e||$(`panel.devices.unknownPlatform`))}function Zk(e){return $(e===`relay`?`panel.devices.channelRelay`:e===`lan`?`panel.devices.channelLan`:e===`tunnel`?`panel.devices.channelTunnel`:e===`p2p`?`panel.devices.channelP2p`:e===`direct`?`panel.devices.channelDirect`:e===`ipv6`?`panel.devices.channelIpv6`:e===`tcp`?`panel.devices.channelTcp`:e===`mux`?`panel.devices.channelMux`:`panel.devices.channelUnknown`)}function Qk(e){let t=e?.model||e?.name||$(`panel.devices.unknown`);return e?.suffix?`${t} · ${e.suffix}`:t}function $k(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M9 15l6-6`}),(0,U.jsx)(`path`,{d:`M7 17l-1 1a3 3 0 0 1-4-4l2-2a3 3 0 0 1 4 0`}),(0,U.jsx)(`path`,{d:`M17 7l1-1a3 3 0 0 1 4 4l-2 2a3 3 0 0 1-4 0`})]})}function eA({busy:e,fill:t=!1}){let n=uO(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(!1),l=(0,g.useRef)(!1),u=(0,g.useRef)(null),[d,f]=(0,g.useState)(!1),[p,m]=(0,g.useState)(null),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(!1),S=(0,g.useRef)(0),C=(0,g.useCallback)(async()=>{let e=++S.current;_(!1);try{let t=await rO(`/api/relay/devices?history=1`);e===S.current&&m(t)}catch{e===S.current&&_(!0)}},[]),w=(0,g.useCallback)(async()=>{try{let e=await rO(`/api/relay/devices`),t=e.revokedCount??0,n=u.current!==null&&u.current!==t;u.current=t,i(e),n&&l.current&&C()}catch{}},[C]);(0,g.useEffect)(()=>{let e=()=>{c_()&&w()};e();let t=window.setInterval(e,3e3);return document.addEventListener(`visibilitychange`,e),()=>{window.clearInterval(t),document.removeEventListener(`visibilitychange`,e)}},[w]);let T=r?.devices??[],E=r?.serverNow??0,D=r?.revokedCount??0;(0,g.useEffect)(()=>{l.current=d},[d]),(0,g.useEffect)(()=>{d&&C()},[d,C]);function O(e){let t=qk(e.revokedAt||e.expiresAt,E)||`—`;return $(e.kind===`revoked`?`panel.devices.historyRevoked`:`panel.devices.historyExpired`,{time:t})}let k=(p?.devices??[]).filter(e=>e.kind===`revoked`||e.kind===`expired`),A=h||(p?.devices.length??0)>0&&k.length===0;async function j(e){c(!0);try{let t=await iO(`/api/relay/devices/revoke`,{deviceId:e.deviceId});o(null),await w(),d&&C(),n(`soft`,$(t.closed>0?`panel.devices.unbindDoneClosed`:`panel.devices.unbindDone`,{name:Qk(e),count:t.revoked,closed:t.closed}))}catch(e){n(`error`,$(`panel.devices.unbindFailed`,{message:cO(e)}))}finally{c(!1)}}async function M(){x(!0);try{let e=await iO(`/api/relay/devices/history/clear`,{});y(!1),await w(),d&&C(),n(`soft`,$(`panel.devices.historyClearDone`,{count:e.cleared}))}catch(e){n(`error`,$(`panel.devices.historyClearFailed`,{message:cO(e)}))}finally{x(!1)}}return T.length===0&&D===0?null:(0,U.jsxs)(cD,{frame:`solid`,className:t?`flex h-full min-h-0 flex-col`:void 0,children:[(0,U.jsxs)(`div`,{className:t?`hvscroll mt-1 min-h-0 flex-1`:`hscroll mt-1`,children:[(0,U.jsx)(`div`,{className:`min-w-max`,children:T.map(e=>{let t=Yk(e.lastSeenAt,E);return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border-muted py-2 whitespace-nowrap last:border-b-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground-strong`,children:Qk(e)}),(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 whitespace-nowrap text-xs text-foreground-muted`,children:[(0,U.jsx)(`span`,{children:Xk(e.platform)}),(0,U.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,U.jsx)(`span`,{children:Zk(e.lastChannel)}),(0,U.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?(0,U.jsx)($O,{tone:`ok`}):null,(0,U.jsx)(`span`,{children:Jk(e.lastSeenAt,E)})]})]}),(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.devices.unbind`),title:$(`panel.devices.unbind`),onClick:()=>o(e),children:(0,U.jsx)($k,{})})})]},e.deviceId)})}),(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border-muted pt-2`,children:[(0,U.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex min-w-0 cursor-pointer items-center gap-2 text-xs text-foreground-muted focus-visible:outline-none`,onClick:()=>f(e=>!e),children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[$(`panel.devices.historyTitle`),(0,U.jsx)(nD,{variant:`secondary`,size:`xs`,children:$(`panel.devices.historyCount`,{count:D})})]}),(0,U.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 shrink-0 transition-transform ${d?`rotate-90`:``}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`m4.5 2.5 3.5 3.5-3.5 3.5`})})]}),D>0?(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,className:`shrink-0`,disabled:b||e!==``,onClick:()=>y(!0),children:$(`panel.devices.historyClear`)}):null]}),d?(0,U.jsxs)(`div`,{className:`mt-2`,children:[k.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,U.jsx)(`span`,{className:`text-xs text-foreground`,children:Qk(e)}),(0,U.jsxs)(`span`,{className:`text-xs text-foreground-muted`,children:[Xk(e.platform),e.osVersion?` ${e.osVersion}`:``,e.appVersion?$(`panel.devices.appVersion`,{version:e.appVersion}):``]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-muted`,children:[(0,U.jsx)(`span`,{children:$(`panel.devices.historyBoundAt`,{time:qk(e.boundAt,E)||`—`})}),(0,U.jsx)(`span`,{children:$(`panel.devices.historyLastSeen`,{time:e.lastSeenAt?qk(e.lastSeenAt,E):$(`panel.devices.noRecord`)})}),(0,U.jsx)(`span`,{children:O(e)})]})]},e.deviceId)),A?(0,U.jsx)(`p`,{className:`py-2 text-xs text-foreground-muted`,children:$(`panel.devices.historyFailed`)}):null,(0,U.jsx)(`p`,{className:`py-2 text-xs text-foreground-muted`,children:$(`panel.devices.historyRetention`,{days:30})})]}):null]})]}),(0,U.jsx)(Bk,{open:a!==null,onOpenChange:e=>{!e&&!s&&o(null)},children:(0,U.jsxs)(Vk,{children:[(0,U.jsx)(Hk,{children:(0,U.jsx)(Uk,{children:$(`panel.devices.unbindTitle`)})}),(0,U.jsxs)(Gk,{className:`flex flex-col gap-2 text-sm`,children:[(0,U.jsx)(Wk,{children:$(`panel.devices.unbindConfirm`,{name:Qk(a)})}),(0,U.jsx)(`p`,{className:`text-foreground-muted`,children:$(a?.legacy?`panel.devices.effectLegacy`:`panel.devices.effectIdentity`)})]}),(0,U.jsxs)(Kk,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,disabled:s,onClick:()=>o(null),children:$(`panel.devices.cancel`)}),(0,U.jsx)(Q,{variant:`destructive`,disabled:s,onClick:()=>{a&&j(a)},children:s?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(BE,{}),$(`panel.devices.unbinding`)]}):$(`panel.devices.unbind`)})]})]})}),(0,U.jsx)(Bk,{open:v,onOpenChange:e=>{!e&&!b&&y(!1)},children:(0,U.jsxs)(Vk,{children:[(0,U.jsx)(Hk,{children:(0,U.jsx)(Uk,{children:$(`panel.devices.historyClearTitle`)})}),(0,U.jsxs)(Gk,{className:`flex flex-col gap-2 text-sm`,children:[(0,U.jsx)(Wk,{children:$(`panel.devices.historyClearConfirm`,{count:D})}),(0,U.jsx)(`p`,{className:`text-foreground-muted`,children:$(`panel.devices.historyClearHint`)})]}),(0,U.jsxs)(Kk,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,disabled:b,onClick:()=>y(!1),children:$(`panel.devices.cancel`)}),(0,U.jsx)(Q,{variant:`destructive`,disabled:b,onClick:()=>void M(),children:b?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(BE,{}),$(`panel.devices.historyClearing`)]}):$(`panel.devices.historyClear`)})]})]})})]})}var tA=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAnP0lEQVR42u19eZhV1ZXvWnuf6d5bd6gJqKIoJkVBQAw4hGesoK2i8nz6UJN0px/a2qaN2PnsaMxLYoja3Rk6xjh0OmWi8TMOL5ikE4dEjYYPRyIQoNRShmIogRqo4Y517z3D3u8P9tHN4Zx7q6DAAu/+vvPVdOsOZ631W/NaAJVTOZVTOZVTOZVTOZVTOZVTOZVTOZVTOZXziThY+fwHHP5JuwH0E/Z5ibiwBLHlx1TOcSLlBzA6IgIhBFpbW9WWlhajpaXFaG1tVSmlgIh+DIEVFXBsfjYCAA4AAOecNExpOCmfzM8qFovTHcdp4JxHOecEABxCiEMISRFCujRN2xWLxbace+65HY8++miBc+4yAj/e1AQex1DPEBHmzJkzbseOHRfl8/nPOo7TzDnXBBEtALDF5XiISxCxqCjKXsMw1tfU1LzS2dm5U2IEVmGAsW3XOAsXLoxu2LDh/xSLxUsZY7UAkBeXS2wmfXUEI8i/Y+K5dEppTtO0NVOnTv1te3t7t3TfeIUBxpjkIyKrrq4+I51Of9O27akAkAWAgkQsl+AysV0UkJGAS0jBAcCglKYjkcivM5nMnwQa4LHOBOR4knxEZOFw+AuDg4Ottm1PAoCkILAiLgww7tDzN/ln93FZx3HU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IRwOPy+2aZVKZQb5+yYAhAkhqWg0ujyZTLYdp0ZfybV0yWTydV3X7wpYSwcBm7+Ggw4uDap0Xf+9CAmT0VIBDADIwMDAelVVn4H9mymKJULAMjO4Wb8Epcr7TU1N16ZSqY3HsdFXTpCoaZp3GIbxC9i/iYQFrMwr1QHtpxIsAKhVFGXdFVdc8Wv4qEJq9AJBnHNoPKHxjVwydyHnvFnEA5yABI/rKoYQ0dY07ZeXX37ZN9988819nyDYD1pIRDjnv9M0rUrsBlB9egRLLaxkPsupagkhexoaGq559dVXe0eSFh7x+JgpU6ZMVhTlWaEO0rB/qOEu+GhKxg4A6EDEtaqq/jgej8/zTMX4pB+36Bai0egSQsg6icCWiLJmxb1NSaN2+uDAiaHdYoZyr6IoKydMmDB5JPcYD2ftGyEEwuHwZYVCYQljbAYAVHHOHURMEUK2a5q2NhKJrOrv69/GOIORzLH/BB0KAM6KFSuUH/zgB5dYlnUpY2wOANSIvkiOiFzsVjzgElvEBlVV3aTr+rPZbPZPomB22OiKh7v7T25/Xrt2bSSfz7N58+YVHn300YKnzQo+yZA/HCaQi20XLFgQy2azB/jxlFLuGebAN27cmCaEMOle45EuCg2yIxwfBsGjVJN/vKgEEnAvD5UGR4UBYARt2ZVzZGhTudeVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVs//8fzjsXcePS1GRAAAAAElFTkSuQmCC`,nA=`https://github.com/WNLUO/dsh-mobile-server`,rA=`https://github.com/WNLUO/dsh-mobile-plugin`,iA=[{platform:`android`,channels:[{nameKey:`panel.links.distPlatform`,hintKey:`panel.links.domesticRecommended`,url:`https://app.wnluo.com/api/public/apps/14/download-latest`},{name:`GitHub`,hintKey:`panel.links.overseasRecommended`,url:`https://github.com/WNLUO/dsh-mobile-plugin/releases/latest/download/ai-hub-android.apk`}]},{platform:`apple`,channels:[{name:`App Store`,hintKey:`panel.links.appStore`,url:`https://apps.apple.com/cn/app/ai-hub/id6821681438`},{name:`TestFlight`,hintKey:`panel.links.testFlight`,url:`https://testflight.apple.com/join/4fn5PCMD`}]}],aA=[{nameKey:`panel.links.publicRelay`,url:`https://ai-hub-de-1.wnluo.com`}];aA[0].url;function oA(e){let t=e=>e.trim().replace(/\/+$/,``),n=t(e);return!!n&&aA.some(e=>t(e.url)===n)}function sA(e){return e.name===`GitHub`?(0,U.jsx)(mA,{}):e.name===`App Store`||e.name===`TestFlight`?(0,U.jsx)(pA,{}):(0,U.jsx)(gA,{})}function cA(e){return e===`android`?(0,U.jsx)(fA,{}):(0,U.jsx)(pA,{})}function lA({channel:e}){return(0,U.jsxs)(`a`,{className:`flex items-center gap-3 rounded-lg border border-border-muted px-3 py-2.5 transition-colors hover:bg-background-muted`,href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:[(0,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-background-muted text-foreground`,children:sA(e)}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground-intense`,children:e.name??(e.nameKey?$(e.nameKey):``)}),(0,U.jsx)(`span`,{className:`truncate text-xs text-foreground-muted`,children:$(e.hintKey)})]})]})}function uA(){return(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:iA.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pb-0.5 text-xs text-foreground-muted`,children:[cA(e.platform),(0,U.jsx)(`span`,{children:$(e.platform===`android`?`panel.links.android`:`panel.links.apple`)})]}),e.channels.map(e=>(0,U.jsx)(lA,{channel:e},e.url))]},e.platform))})}function dA({size:e=`md`,variant:t=`outline`,className:n}){let[r,i]=(0,g.useState)(!1),a=(0,g.useRef)(null);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:t,size:e,className:n,onClick:()=>i(!0),children:[(0,U.jsx)(hA,{}),$(`panel.download.open`)]}),(0,U.jsx)(hD,{open:r,onOpenChange:i,children:(0,U.jsxs)(gD,{className:`max-w-xl`,closeLabel:$(`panel.common.close`),initialFocus:a,children:[(0,U.jsx)(_D,{children:(0,U.jsxs)(vD,{className:`flex flex-wrap items-center gap-2.5 pr-8`,children:[(0,U.jsx)(`img`,{src:tA,alt:``,className:`size-8 rounded-lg bg-white p-0.5`}),(0,U.jsx)(`span`,{className:`min-w-0 break-words`,children:$(`panel.download.title`)})]})}),(0,U.jsx)(`div`,{ref:a,tabIndex:-1,className:`outline-none`,children:(0,U.jsx)(bD,{children:(0,U.jsx)(uA,{})})})]})})]})}function fA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-3.5 stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M17.523 15.3414c-.5511 0-.9993-.4486-.9993-.9997s.4483-.9993.9993-.9993c.5511 0 .9993.4483.9993.9993.0001.5511-.4482.9997-.9993.9997m-11.046 0c-.5511 0-.9993-.4486-.9993-.9997s.4482-.9993.9993-.9993c.551 0 .9993.4483.9993.9993 0 .5511-.4483.9997-.9993.9997m11.4045-6.02 1.9973-3.4592a.416.416 0 0 0-.1521-.5676.416.416 0 0 0-.5676.1521l-2.0223 3.503C15.5902 8.2439 13.8533 7.8508 12 7.8508s-3.5902.3931-5.1367 1.0989L4.841 5.4467a.4161.4161 0 0 0-.5677-.1521.4157.4157 0 0 0-.1521.5676l1.9973 3.4592C2.6889 11.1867.3432 14.6589 0 18.761h24c-.3435-4.1021-2.6892-7.5743-6.1185-9.4396`})})}function pA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-4 stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701`})})}function mA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px] stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function hA(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px]`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.85`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`2.5`}),(0,U.jsx)(`path`,{d:`M12 6v9m-3-3 3 3 3-3M10 19h4`})]})}function gA(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px]`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.85`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M12 4v10`}),(0,U.jsx)(`path`,{d:`m8 10.5 4 4 4-4`}),(0,U.jsx)(`path`,{d:`M4 18.5h16`})]})}var _A=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxgAAAMYAQAAAABgBnzJAAAGdElEQVR42u2dXY7yOBBFbyY8IoWlsICWiPQtYFY8UtCwAJYCEo8deR4gxPFPOgE62MzJQ0Q3kNOmnL5UuVxVGP368ZdgwIABAwYMGDBg5MjYF86xevhywUu987M6F7V0LupidS5qSVKx6k/9s847mFcwYMCA8cMRk4rKdCfdIhHGPvXPDt+BPV7CKI11NE9dMHCpN+t5sRqc7N91om4/y30OAwYMGE/r+VDDPXl3XoI9XsnYP+uae076KoXPytHu3it3PPXBE8wrGDBgwHiFng+9ck/lrSewB4yJDEesPVHvg+7E22HAgAHjGT3vDkesTUzjibfDmLx+7i+Y96LuRSTQcxgwYMB43j8PL5iHHXL0/KX22JmXXdO9VIL+uZct10k+9zkMGDBg/Ip/7mfLSQZ7vNoebfGyCwYulUJ++8wT8woGDBgwns5vn3XCHk8exf+hrsEgKW7kR/QcBgwYMNAPGG9nOOvivkQ7YXUvq90X+sHedewBAwYMGOg5jIUYA+22ve1IWD3sswerzWAPGDBgwEDPYSzpnw+S1x1h9orK+JF3L+iOfw4DBgwY6DmMBfU8ugXNqejqFIQLP3I0HnvAgAEDBnoOYyk99/ehhfamOYF4T8/xz2HAgAEDPYeh966fe3vNf6jjai+Ye+lxVgYd9oABAwYM9BzGQuvn/rp4OAavSXXkBu469oABAwYM9BzG4no+Vpf9HOs8M7KbLcHP6ryR2lX2Nm83/TnncRx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flVMfLuKLRxLgyG+HAQMGjAf1/C7bVbCmu1/gVQo0dMEecxmlU5fv4WNnvpPTc8cDd75xTCg5072DeQUDBgwYs/zzcAc180M/Fuu32OMBe9yWL+Z1mh8ebZHeZ+WsqQ889fAietzLZ17BgAEDxkQ9r0zEU/c7uBjto98KsMfv9mmIueYpflahlPWo9+5vPR/E5ZlXMGDAgDFHz6ON1/y+qpFeq9gDhrzaMeOL46GFdfafw4ABA8ZD/mCnyaOL46GFdTeXDns8YI+d+fDPypHtaS8euPDMKxgwYMCYE991g+4TX1yh54/bI7bynf9nFaod44Tap1abYV7BgAEDxvx4eyjUHorBB+Py2EPU94EBAwYMGDBgwIDx1PEfwPfvNJna2O0AAAAASUVORK5CYII=`,vA=()=>$(`panel.links.wechatQrAlt`);function yA(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z`})})}function bA({compact:e=!1}={}){let[t,n]=(0,g.useState)(!1),r=xg();return r!==`zh-Hans`&&r!==`zh-Hant`?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:`ghost`,size:e?`sm`:`lg`,className:`pointer-events-auto`,onClick:()=>n(!0),children:[(0,U.jsx)(yA,{}),$(`panel.links.joinGroup`)]}),(0,U.jsx)(hD,{open:t,onOpenChange:n,children:(0,U.jsxs)(gD,{className:`max-w-sm`,children:[(0,U.jsx)(vD,{className:`sr-only`,children:$(`panel.links.joinGroup`)}),(0,U.jsx)(bD,{className:`flex justify-center`,children:(0,U.jsx)(`img`,{src:_A,alt:vA(),className:`w-full rounded-md`})})]})})]})}var xA=Uu(``,{variants:{size:{sm:`h-6 gap-0.75 rounded-xs px-2 text-xs has-data-[icon=end]:pe-1.5 has-data-[icon=start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`h-8 gap-1 rounded-sm px-3 text-sm has-data-[icon=end]:pe-2 has-data-[icon=start]:ps-2 [&_svg:not([class*='size-'])]:size-4`,lg:`h-10 gap-1.25 rounded-md px-3.5 text-base has-data-[icon=end]:pe-2.5 has-data-[icon=start]:ps-2.5 [&_svg:not([class*='size-'])]:size-4.5`}},defaultVariants:{size:`md`}}),SA=g.createContext(null),CA={opacity:0,scale:.85,filter:`blur(8px)`},wA={opacity:0},TA={duration:.28,ease:[.4,0,.2,1]},EA={duration:0},DA={sm:`size-3`,md:`size-3.5`,lg:`size-4`};function OA({className:e,variant:t,size:n,render:r,dismissible:i=!1,open:a,onOpenChange:o,onDismiss:s,closeLabel:c=`Dismiss`,children:l,onClick:u,...d}){let f=g.useContext(SA),p=t??f?.variant??`soft`,m=n??f?.size??`md`,h=_h(),[_,v]=g.useState(!0),y=a!==void 0,b=y?a:_,x=g.useCallback(()=>{y||v(!1),o?.(!1)},[y,o]);g.useEffect(()=>{if(f&&i)return f.register(x)},[f,i,x]);let S=e=>{u?.(e),!e.defaultPrevented&&i&&x()},C=i?(0,U.jsxs)(U.Fragment,{children:[l,(0,U.jsx)(kA,{size:m}),(0,U.jsx)(`span`,{className:`sr-only`,children:c})]}):l,w=$E({defaultTagName:`button`,render:r,state:{variant:p,size:m,dismissible:i},props:Or({"data-slot":`chip`,"data-dismissible":i||void 0,type:r?void 0:`button`,...Bu(d.disabled),className:Z(Gu({variant:p}),xA({size:m}),i&&`group/chip`,e),onClick:S,children:C},d)});return i?(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(Ow,{initial:!1,onExitComplete:()=>s?.(),children:b&&(0,U.jsx)(yE.span,{initial:!1,exit:h?wA:CA,transition:h?EA:TA,className:`inline-flex align-middle`,children:w},`chip`)})}):w}function kA({size:e}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`chip-close-icon`,"data-icon":`end`,className:Z(DA[e],`opacity-60 transition-opacity duration-200 group-hover/chip:opacity-100 motion-reduce:transition-none`),children:(0,U.jsx)(`path`,{d:`M11.523 3.522c.264-.264.691-.264.955 0s.264.691 0 .955L8.955 8l3.522 3.522c.264.264.264.691 0 .955s-.691.264-.955 0L8 8.955l-3.522 3.522c-.264.264-.691.264-.955 0s-.264-.691 0-.955L7.045 8 3.522 4.478c-.264-.264-.264-.691 0-.955s.691-.264.955 0L8 7.045l3.523-3.522z`})})}var AA=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAewAAAHsAQAAAAA4UaPNAAACeUlEQVR42u2dQW7DMAwEhX5A//+lfsA2sU0umRg9BChKYQwfDNlzEVbKkqKUYZ9ca4CDg4OD/398+DXt5360zOvtcT+vn/flY1tf46MLHPzv8REKfz48Wi6dn89P8R/PPihOCs2Dt9V8muTLW/8JuL6Jj9E8eH/Nx7O/mmJ1DM2Db6d5fbVOP+PennkefE8/b5ba1/CxUD5G8+BdNZ/zNr/c5G3A+2v+Lo2pI8In//wNPQ/eVvNXfHpI/TDz48pPapY+t9Pz4D01v8ZrWsYv179nMmWA0PPgjf18Cl2XCNvD25LMRPPgnb3N8MxkdjWh/7e/AmgevLXmtfYgx7AlOU8MC76Bt0lpmVxjE2r38jO392gevHPextM1teQml1aqsUfz4F3neamoOa/s2+9TPfQ8eGNv46l4jVvVvetbvA14b2+T0+9j1PWpVGY5IquD5sFb5200/a55mzD8MyV20Dx4b2/jlqbYezH2Ec/ibcC3mOfTDpFQdQ5azTS9g+bBW8ewVerTSngbQ2Dh58H7x7BZzyr+aJl5xQrNgzf387EaNWtCPlpyaSWaB288z4uko7Ty7dE3Q2vp6XnwtjFsOehDqmsiq2MS4VJ7AN7a20yTsFTqykYsxeoQkAVZeh68q7fR/VBpJ+xMu6VeBgg9D941hq0HGljdA6uFB/EZmgdv6+ff7H7Nx4BouhLNg+8wz4eMo/G25Ib6efANYtibauF0XqVZqb1E8+B9Ne8K1xTNq8iT1UHz4FtoPkSuZcOl8JL6efC95nldgS2nfNQt4WgefAM/b/Us4pHrE/IJCfQ8+C55m5XWqkpUy5oUeHfN8/dz4ODg4Pvi3/5iKXEUjwVUAAAAAElFTkSuQmCC`,jA=`0x62744c084c272ddba4680920edc3239cb7180718`;function MA(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z`})})}function NA({compact:e=!1}={}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:`ghost`,size:e?`sm`:`lg`,className:`pointer-events-auto`,onClick:()=>{i(!1),n(!0)},children:[(0,U.jsx)(MA,{}),$(`panel.links.sponsor`)]}),(0,U.jsx)(PA,{open:t,onOpenChange:n,copyFailed:r,setCopyFailed:i})]})}function PA({open:e,onOpenChange:t,copyFailed:n,setCopyFailed:r}){return(0,U.jsx)(hD,{open:e,onOpenChange:t,children:(0,U.jsxs)(gD,{className:`max-w-sm`,children:[(0,U.jsxs)(_D,{className:`gap-1.5`,children:[(0,U.jsx)(vD,{className:`text-xl`,children:$(`panel.links.sponsorTitle`)}),(0,U.jsx)(yD,{children:$(`panel.links.sponsorIntro`)})]}),(0,U.jsxs)(bD,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(`div`,{className:`flex justify-center`,children:(0,U.jsx)(`img`,{src:AA,alt:$(`panel.links.sponsorQrAlt`),className:`size-44 rounded-lg border border-border-muted bg-white p-2`})}),(0,U.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[(0,U.jsx)(OA,{variant:`soft`,size:`sm`,children:`USDT`}),(0,U.jsx)(OA,{variant:`soft`,size:`sm`,children:`Polygon`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-border-muted bg-background-muted p-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:$(`panel.links.sponsorAddress`)}),(0,U.jsx)(lk,{value:jA,label:$(`panel.links.sponsorCopy`),copiedLabel:$(`panel.links.sponsorCopied`),size:`sm`,variant:`outline`,onCopyError:()=>r(!0),onCopy:()=>r(!1),children:$(`panel.links.sponsorCopy`)})]}),(0,U.jsx)(`code`,{className:`block select-all break-all font-mono text-[11px] leading-4 text-foreground-strong`,children:jA}),n?(0,U.jsx)(`p`,{className:`text-[11px] leading-4 text-foreground-strong`,children:$(`panel.links.sponsorCopyFailed`)}):null]})]}),(0,U.jsx)(`div`,{className:`px-6 pt-4 pb-6`,children:(0,U.jsx)(`p`,{className:`text-center text-sm text-foreground-muted`,children:$(`panel.links.sponsorNote`)})})]})})}function FA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px] stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function IA({compact:e=!1}={}){return(0,U.jsxs)(`a`,{href:rA,target:`_blank`,rel:`noreferrer noopener`,className:`${Gu({variant:`ghost`,size:e?`sm`:`lg`})} pointer-events-auto`,children:[(0,U.jsx)(FA,{}),$(`panel.links.star`)]})}function LA({compact:e=!1}){return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,U.jsx)(IA,{compact:e}),(0,U.jsx)(NA,{compact:e}),(0,U.jsx)(bA,{compact:e}),(0,U.jsx)(dA,{size:`sm`,variant:`ghost`,className:`px-2`})]})}function RA(e){let t=Number.isFinite(e)&&e>0?e:0;return t===0?`0 MB`:t<1048576?`${Math.max(1,Math.round(t/1024))} KB`:`${(t/1024/1024).toFixed(1)} MB`}function zA(e,t=Date.now()){if(!e)return``;let n=Math.floor((t-e)/36e5);return n<1?$(`panel.inbox.ageLessThanHour`):n<24?$(`panel.inbox.ageHours`,{hours:n}):$(`panel.inbox.ageDays`,{days:Math.floor(n/24)})}function BA({framed:e=!0}){let t=uO(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1),u=(0,g.useCallback)(async()=>{try{r(await rO(`/api/relay/inbox/status`))}catch{r(null)}finally{a(!0)}},[]);(0,g.useEffect)(()=>{u()},[u]);let d=n?.deletableFiles??0,f=zA(n?.oldestAt??null),p=n?.stagingFiles??0;async function m(e){if(!c){l(!0);try{let t=await iO(`/api/relay/inbox/auto`,{enabled:e});r(e=>e&&{...e,autoClear:t.data.autoClear})}catch(e){t(`error`,$(`panel.inbox.autoFailed`,{message:cO(e)}))}finally{l(!1)}}}async function h(){if(o)return;let e=d>0?$(`panel.inbox.confirmDetail`,{count:d,hours:n?.keepHours??24,bytes:RA(n?.deletableBytes??0)}):$(`panel.inbox.confirmNothing`,{hours:n?.keepHours??24});if(window.confirm(`${$(`panel.inbox.confirmTitle`)}\n\n${e}\n\n${$(`panel.inbox.confirmIrreversible`)}`)){s(!0);try{let e=await iO(`/api/relay/inbox/clear`),n=RA(e.freedBytes);t(e.failedFiles>0?`soft`:`ok`,e.deletedFiles>0?`${$(`panel.inbox.cleared`,{bytes:n,count:e.deletedFiles})}${e.failedFiles>0?$(`panel.inbox.clearedSomeFailed`,{count:e.failedFiles}):``}`:$(`panel.inbox.nothingToClear`)),await u()}catch(e){t(`error`,$(`panel.inbox.clearFailed`,{message:cO(e)}))}finally{s(!1)}}}let _=(0,U.jsxs)(U.Fragment,{children:[i?null:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-foreground-muted`,children:[(0,U.jsx)(BE,{}),$(`panel.inbox.reading`)]}),i&&n===null?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.inbox.unreadableTitle`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.inbox.unreadableTitle`),detail:$(`panel.inbox.unreadableBody`)})})}):null,n===null?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`dl`,{className:`mt-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b border-border-muted py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.used`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:$(`panel.inbox.usedValue`,{bytes:RA(n.bytes),count:n.files})})]}),(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b border-border-muted py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.deletable`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:d>0?$(`panel.inbox.deletableValue`,{bytes:RA(n.deletableBytes),count:d}):$(`panel.common.none`)})]}),(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.keep`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:f?$(`panel.inbox.keepValueOldest`,{hours:n.keepHours,age:f}):$(`panel.inbox.keepValue`,{hours:n.keepHours})})]})]}),p>0?(0,U.jsx)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:$(`panel.inbox.staging`,{bytes:RA(n.stagingBytes??0),count:n.stagingFiles??0})}):null,(0,U.jsxs)(`label`,{className:`mt-3 flex items-center justify-between gap-4 border-t border-border-muted pt-3`,children:[(0,U.jsx)(`span`,{className:`block text-sm text-foreground`,children:$(`panel.inbox.auto`)}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[c?(0,U.jsx)(BE,{}):null,(0,U.jsx)(ZD,{size:`md`,checked:n.autoClear===!0,disabled:o||c,onCheckedChange:e=>void m(e),"aria-label":$(`panel.inbox.autoA11y`)})]})]}),(0,U.jsx)(`div`,{className:`mt-3 flex justify-center`,children:(0,U.jsx)(Q,{variant:d>0?`primary`:`outline`,size:`md`,disabled:o,onClick:()=>void h(),children:$(o?`panel.inbox.clearing`:`panel.inbox.clear`)})})]})]});return e?(0,U.jsxs)(cD,{frame:`solid`,children:[(0,U.jsx)(lD,{className:`px-4 py-3`,children:(0,U.jsx)(uD,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{children:$(`panel.inbox.title`)})})}),_]}):_}function VA(e,t){let n=(0,g.useRef)(e);(0,g.useEffect)(()=>{if(e===void 0)return;let r=n.current;r===void 0?n.current=e:e>r&&(n.current=e,t())},[e,t])}var HA=`data-checked`,UA=`data-unchecked`,WA={checked(e){return e?{[HA]:``}:{[UA]:``}},...St,...kD},GA=`data-composite-item-active`,KA=g.createContext({disabled:!1});function qA(){return g.useContext(KA)}var JA=g.createContext(void 0);function YA(){return g.useContext(JA)}function XA(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var ZA=g.createContext(void 0);function QA(){let e=g.useContext(ZA);if(e===void 0)throw Error(S(52));return e}var $A=g.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":s,value:c,inputRef:l,nativeButton:u=!1,id:d,style:f,...m}=e,_=YA(),{disabled:v,readOnly:y,required:x,form:S,checkedValue:C,touched:w=!1,validation:T,name:E,setCheckedValue:D=p,setTouched:O=p,registerInputRef:k=p}=_??{},{setTouched:A,setFilled:j,state:M,disabled:N}=FD(),P=qA(),{labelId:F,getDescriptionProps:I}=BD(),L=N||P.disabled||v||i,R=y||a,z=x||o,B=S,V=_?C===c:c===``,H=g.useRef(null),ee=g.useRef(null),te=T?.registerInput,ne=gr(l,ee,k,g.useCallback(e=>te?.(e,{controlRef:H,value:void 0}),[te]));b(()=>{ee.current?.checked&&j(!0)},[j]),b(()=>{if(ee.current){if(L&&V){k(null);return}k(ee.current)}},[V,L,k]);let W=Md(),re=WD({id:d}),G=u?void 0:re,K={role:`radio`,"aria-checked":V,"aria-labelledby":VD(s,F,ee,!u,G),[GA]:V?``:void 0,id:u?re:W,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||L||R)return;e.preventDefault();let t=ee.current;t&&la(t,e)},onFocus(e){e.defaultPrevented||L||R||!w||(ee.current?.click(),O(!1))}},{getButtonProps:ie,buttonRef:ae}=ua({disabled:L,native:u,composite:!1}),oe={type:`radio`,ref:ne,form:B,id:G,name:E,tabIndex:-1,style:E?mr:pr,"aria-hidden":!0,...c===void 0?h:{value:XA(c)},disabled:L,checked:V,required:z,readOnly:R,onChange(e){if(e.nativeEvent.defaultPrevented||L||R||c===void 0)return;let t=ja(ha,e.nativeEvent);D(c,t),!t.isCanceled&&A(!0)},onClick(e){e.stopPropagation()},onFocus(){H.current?.focus()}},q=g.useMemo(()=>({...M,required:z,disabled:L,readOnly:R,checked:V}),[M,L,R,V,z]),se=q,ce=_!==void 0,le=[t,H,ae],ue=[K,m,ie,I,T?e=>T.getValidationProps(L,e):h],de=Hr(`span`,e,{enabled:!ce,state:q,ref:le,props:ue,stateAttributesMapping:WA});return(0,U.jsxs)(ZA.Provider,{value:se,children:[ce?(0,U.jsx)(ih,{tag:`span`,render:n,className:r,style:f,state:q,refs:le,props:ue,stateAttributesMapping:WA}):de,(0,U.jsx)(`input`,{...oe,suppressHydrationWarning:!0})]})}),ej=g.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=QA(),c=s.checked,{mounted:l,transitionStatus:u,setMounted:d}=Us(c),f={...s,transitionStatus:u},p=g.useRef(null),m=a||l,h=Hr(`span`,e,{ref:[t,p],state:f,props:o,stateAttributesMapping:WA});return ai({batch:!0,enabled:!c,open:c,ref:p,onComplete(){c||d(!1)}}),m?h:null}),tj={duration:.3,ease:[.4,0,.2,1]},nj={duration:.3,ease:[.4,0,.2,1]},rj={duration:0};function ij({checked:e,reduced:t}){return(0,U.jsx)(ej,{"data-slot":`radio-indicator`,className:`flex items-center justify-center`,keepMounted:!0,children:(0,U.jsx)(yE.span,{className:`bg-primary-foreground size-[0.5em] min-h-2 min-w-2 rounded-full`,initial:!1,animate:{scale:+!!e},transition:t?rj:nj})})}function aj({renderProps:e,state:t,reduced:n}){let{checked:r}=t,{ref:i,...a}=e,[o,s]=vE(),c=zu(i,o),l=g.useRef(r);return g.useEffect(()=>{let e=l.current!==r;l.current=r,e&&!n&&s(o.current,{scale:[1,.8,1.1,1]},tj)},[r,s,o,n]),(0,U.jsx)(`span`,{"data-slot":`radio`,...a,ref:c,children:(0,U.jsx)(ij,{checked:r,reduced:n})})}function oj({className:e,...t}){let n=_h(),r=t[`aria-invalid`],i=r===!0||r===`true`;return(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)($A,{...t,...i?{"data-invalid":``}:{},className:Z(`flex size-[1em] min-h-4 min-w-4 shrink-0 cursor-default items-center justify-center`,`bg-background border-border-strong outline-ring-input rounded-full border outline-offset-1`,`transition-[background-color,border-color,box-shadow] duration-200 motion-reduce:transition-none`,`hover:not-data-checked:not-data-disabled:not-data-invalid:border-border-emphasis`,`data-checked:bg-primary data-checked:outline-ring-primary data-checked:border-transparent`,`data-disabled:not-data-checked:bg-background-subtle data-disabled:data-checked:opacity-disabled data-disabled:cursor-not-allowed data-disabled:not-data-checked:border-dashed`,`data-invalid:border-error data-invalid:not-data-checked:bg-error-subtle data-invalid:outline-ring-error`,e),render:(e,t)=>(0,U.jsx)(aj,{renderProps:e,state:t,reduced:n})})})}function sj(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=m}=e,[p,h]=g.useState(0),_=r!=null,v=g.useRef(null),y=gr(v,c),x=g.useRef([]),S=g.useRef(!1),C=g.useRef(null),w=o??p,T=q((e,t=!1)=>{if(C.current=x.current[e]??null,(s??h)(e),t){let t=x.current[e];$d(v.current,t,a,n)}}),E=q(e=>{if(e.size===0)return;if(S.current){let e=x.current,t=e.indexOf(C.current);if(t===-1){let t=e[w];!t||Mn(e,w,d)?T(cj(e,d)):C.current=t}else t!==w&&T(t);return}S.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)T(i);else if(Mn(t,w,d)){let e=jn(t,{disabledIndices:d});On(t,e)||T(e)}$d(v.current,r,a,n)});b(()=>{if(d==null||o!=null||!S.current)return;let e=x.current;if(Mn(e,w,d)){let t=jn(e,{disabledIndices:d});On(e,t)||T(t)}},[d,o,w,x,T]);let D=q((e,t,n)=>i?i(e,t,n,x):n),O=q(e=>{let o=e.key===`Home`||e.key===`End`;if(!Jd.has(e.key)||!l&&o||lj(e,f)||!v.current)return;let s=a===`rtl`,c=s?Kd:qd,p=s?qd:Kd,m=n===`vertical`?Gd:c,h=n===`vertical`?Wd:p,g=dt(e.nativeEvent);if(g!=null&&Qd(g)&&!fh(g)){let t=g.selectionStart,n=g.selectionEnd,r=g.value;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==m&&t>0)return}let y=w,b=kn(x,d),S=An(x,d);r!=null&&(y=r({disabledIndices:d,elementsRef:x,event:e,highlightedIndex:w,loopFocus:t,maxIndex:S,minIndex:b,onLoop:D,orientation:n,rtl:s}));let C=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,E=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?y=b:e.key===`End`&&(y=S)),y===w&&(C||E)&&(t&&y===S&&C?(y=b,i&&(y=i(e,w,y,x))):t&&y===b&&E?(y=S,i&&(y=i(e,w,y,x))):y=jn(x.current,{startingIndex:y,decrement:E,disabledIndices:d})),y!==w&&!On(x.current,y)&&(u&&e.stopPropagation(),(_||o||C||E)&&e.preventDefault(),T(y,!0),queueMicrotask(()=>{x.current[y]?.focus()}))});return{props:{ref:y,onFocus(e){let t=v.current,n=dt(e.nativeEvent);t&&n!=null&&Qd(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:O},highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:x,onMapChange:E,relayKeyboardEvent:O}}function cj(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Mn(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function lj(e,t){for(let n of Xd)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function uj(e){let{render:t,className:n,style:r,refs:i=m,props:a=m,state:o=h,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:_,onMapChange:v,stopEventPropagation:y=!0,rootRef:b,disabledIndices:x,modifierKeys:S,highlightItemOnHover:C=!1,tag:w=`div`,...T}=e,{props:E,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,onMapChange:A,relayKeyboardEvent:j}=sj({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:b,stopEventPropagation:y,enableHomeAndEndKeys:_,direction:Uc(),disabledIndices:x,modifierKeys:S}),M=Hr(w,e,{state:o,ref:i,props:[E,...a,T],stateAttributesMapping:s}),N=g.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:O,highlightItemOnHover:C,relayKeyboardEvent:j}),[D,O,C,j]);return(0,U.jsx)(oa.Provider,{value:N,children:(0,U.jsx)(Dm,{elementsRef:k,onMapChange:e=>{v?.(e),A(e)},children:M})})}function dj(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var fj=Object.keys(DD);function pj(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}function mj(e,t){let n=null;for(let r of e.keys())if(pj(r,t)){if(!r.validity.valid)return r;n??=r}return n}function hj(e){return{...DD,valid:!e,customError:e}}function gj(e){return e&&e.validationMessage?[e.validationMessage]:[]}function _j(e){let{elementRef:t,formRef:n}=RD(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:o,invalid:s,markedDirtyRef:c,state:l,shouldValidateOnChange:u,validationMode:d,registeredFieldIdRef:f}=e,{controlId:p,getDescriptionProps:m}=BD(),_=Ke(),v=g.useRef(null),b=y(()=>new Map).current,x=g.useRef(0),S=g.useRef(null),C=g.useCallback((e,t)=>(b.set(e,t),()=>{b.delete(e)}),[b]),w=q(()=>{let e=mj(b,t.current);return e&&b.get(e)?.controlRef.current||null}),T=q(async(e,o=!1)=>{x.current+=1;let m=x.current;function h(e,t=s){let r=f.current??p;if(r==null)return;let i=n.current.fields.get(r);if(!i)return;let a=dj(e,t);n.current.fields.set(r,{...i,validityData:a})}function g(t,n){let r=t.valid===!1?n:[];return{value:e,state:t,error:r[0]??``,errors:r,initialValue:a.initialValue}}function y(e,t){let n=e.validity.customError?e.validationMessage:``,r=t.replace(/\r\n?/g,`
|
|
103
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,U.jsx)(xw,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:g.cloneElement(e,{ref:u})})}var Cw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=d_(ww),d=(0,g.useId)(),f=(0,g.useRef)(n),p=(0,g.useRef)(r);f_(()=>{f.current=n,p.current=r});let m=!0,h=(0,g.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,g.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),g.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,U.jsx)(Sw,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,U.jsx)(p_.Provider,{value:h,children:e})};function ww(){return new Map}function Tw(e=!0){let t=(0,g.useContext)(p_);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,g.useId)();(0,g.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,g.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Ew=e=>e.key||``;function Dw(e){let t=[];return g.Children.forEach(e,e=>{(0,g.isValidElement)(e)&&t.push(e)}),t}var Ow=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Tw(o),f=(0,g.useMemo)(()=>Dw(e),[e]),p=o&&!u?[]:f.map(Ew),m=(0,g.useRef)(!0),h=d_(()=>new Map),_=(0,g.useRef)(new Set),[v,y]=(0,g.useState)(f),[b,x]=(0,g.useState)(f);f_(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),f_(()=>{m.current=!1;for(let e=0;e<b.length;e++){let t=Ew(b[e]);p.includes(t)?(h.delete(t),_.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf(Ew(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Ew(e)))?e=f:a===`wait`&&(e=S),x(Dw(e)),y(f),null}let{forceRender:C}=(0,g.useContext)(u_);return(0,U.jsx)(U.Fragment,{children:b.map(e=>{let g=Ew(e),v=o&&!u?!1:f===b||p.includes(g);return(0,U.jsx)(Cw,{isPresent:v,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(g))return;if(h.has(g))_.current.add(g),h.set(g,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},g)})})},kw=(0,g.createContext)({strict:!1}),Aw={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},jw=!1;function Mw(){if(jw)return;let e={};for(let t in Aw)e[t]={isEnabled:e=>Aw[t].some(t=>!!e[t])};qC(e),jw=!0}function Nw(){return Mw(),JC()}function Pw(e){let t=Nw();for(let n in e)t[n]={...t[n],...e[n]};qC(t)}function Fw({children:e,features:t,strict:n=!1}){let[,r]=(0,g.useState)(!Iw(t)),i=(0,g.useRef)(void 0);if(!Iw(t)){let{renderer:e,...n}=t;i.current=e,Pw(n)}return(0,g.useEffect)(()=>{Iw(t)&&t().then(({renderer:e,...t})=>{Pw(t),i.current=e,r(!0)})},[]),(0,U.jsx)(kw.Provider,{value:{renderer:i.current,strict:n},children:e})}function Iw(e){return typeof e==`function`}var Lw=(0,g.createContext)({});function Rw(e,t){if(RC(e)){let{initial:t,animate:n}=e;return{initial:t===!1||FC(t)?t:void 0,animate:FC(n)?n:void 0}}return e.inherit===!1?{}:t}function zw(e){let{initial:t,animate:n}=Rw(e,(0,g.useContext)(Lw));return(0,g.useMemo)(()=>({initial:t,animate:n}),[Bw(t),Bw(n)])}function Bw(e){return Array.isArray(e)?e.join(` `):e}var Vw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hw(e,t,n){for(let r in t)!rS(t[r])&&!ew(r,n)&&(e[r]=t[r])}function Uw({transformTemplate:e},t){return(0,g.useMemo)(()=>{let n=Vw();return qS(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ww(e,t){let n=e.style||{},r={};return Hw(r,n,e),Object.assign(r,Uw(e,t)),r}function Gw(e,t){let n={},r=Ww(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Kw=()=>({...Vw(),attrs:{}});function qw(e,t,n,r){let i=(0,g.useMemo)(()=>{let n=Kw();return QS(n,t,aw(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Hw(t,e.style,e),i.style={...t,...i.style}}return i}var Jw=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Yw(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Jw.has(e)}function Xw(e,t){return e.startsWith(`on`)?!Yw(e):t?.(e)??!Yw(e)}function Zw(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(rS(e[a])||(Xw(a,r)||n===!0&&Yw(a)||!t&&!Yw(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Qw=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function $w(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Qw.indexOf(e)>-1||/[A-Z]/u.test(e))}function eT(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??$w(e)?qw:Gw)(t,r,i,e),l=Zw(t,typeof e==`string`,a,s),u=e===g.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,g.useMemo)(()=>rS(d)?d.get():d,[d]);return(0,g.createElement)(e,{...u,children:f})}function tT({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:nT(n,r,i,e),renderState:t()}}function nT(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=gw(a[e]);let{initial:o,animate:s}=e,c=RC(e),l=zC(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!PC(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Yx(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var rT=e=>(t,n)=>{let r=(0,g.useContext)(Lw),i=(0,g.useContext)(p_),a=()=>tT(e,t,r,i);return n?a():d_(a)},iT=rT({scrapeMotionValuesFromProps:tw,createRenderState:Vw}),aT=rT({scrapeMotionValuesFromProps:sw,createRenderState:Kw}),oT=Symbol.for(`motionComponentSymbol`);function sT(e,t,n){let r=(0,g.useRef)(n);(0,g.useInsertionEffect)(()=>{r.current=n});let i=(0,g.useRef)(null);return(0,g.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var cT=(0,g.createContext)({});function lT(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function uT(e,t,n,r,i,a){let{visualElement:o}=(0,g.useContext)(Lw),s=(0,g.useContext)(kw),c=(0,g.useContext)(p_),l=(0,g.useContext)(_w),u=l.reducedMotion,d=l.skipAnimations,f=(0,g.useRef)(null),p=(0,g.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,g.useContext)(cT);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&dT(f.current,n,i,h);let _=(0,g.useRef)(!1);(0,g.useInsertionEffect)(()=>{m&&_.current&&m.update(n,c)});let v=n[sS],y=(0,g.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return f_(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),f_(()=>{p.current=!0,m&&(_.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,g.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),m.enteringChildren=void 0)}),m}function dT(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:fT(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&lT(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function fT(e){if(e)return e.options.allowProjection===!1?fT(e.parent):e.projection}function pT(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Pw(r);let a=n?n===`svg`:$w(e),o=a?aT:iT;function s(n,s){let c,l={...(0,g.useContext)(_w),...n,layoutId:mT(n)},{isStatic:u,isValidProp:d}=l,f=zw(n),p=o(n,u);if(!u&&typeof window<`u`){hT(l,r);let t=gT(l);c=t.MeasureLayout,f.visualElement=uT(e,p,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(Lw.Provider,{value:f,children:[c&&f.visualElement?(0,U.jsx)(c,{visualElement:f.visualElement,...l}):null,eT(e,n,sT(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,g.forwardRef)(s);return c[oT]=e,c}function mT({layoutId:e}){let t=(0,g.useContext)(u_).id;return t&&e!==void 0?t+`-`+e:e}function hT(e,t){(0,g.useContext)(kw).strict}function gT(e){let{drag:t,layout:n}=Nw();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function _T(e,t){if(typeof Proxy>`u`)return pT;let n=new Map,r=(n,r)=>pT(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,pT(a,void 0,e,t)),n.get(a))})}var vT=_T(),yT=(e,t)=>t.isSVG??$w(e)?new cw(t):new rw(t,{allowProjection:e!==g.Fragment}),bT=class extends ZC{constructor(e){super(e),e.animationState||=dw(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();PC(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xT=0,ST={animation:{Feature:bT},exit:{Feature:class extends ZC{constructor(){super(...arguments),this.id=xT++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Xx(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function CT(e){return{point:{x:e.pageX,y:e.pageY}}}function wT(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&xy.postRender(()=>i(t,CT(t)))}var TT=class extends ZC{mount(){let{current:e}=this.node;e&&(this.unmount=vC(e,(e,t)=>(wT(this.node,t,`Start`),e=>wT(this.node,e,`End`))))}unmount(){}},ET=class extends ZC{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=C_(hw(this.node.current,`focus`,()=>this.onFocus()),hw(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function DT(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&xy.postRender(()=>i(t,CT(t)))}var OT=class extends ZC{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=kC(e,(e,t)=>(DT(this.node,t,`Start`),(e,{success:t})=>DT(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},kT=new WeakMap,AT=new WeakMap,jT=e=>{let t=kT.get(e.target);t&&t(e)},MT=e=>{e.forEach(jT)};function NT({root:e,...t}){let n=e||document;AT.has(n)||AT.set(n,{});let r=AT.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(MT,{root:e,...t})),r[i]}function PT(e,t,n){let r=NT(t);return kT.set(e,n),r.observe(e),()=>{kT.delete(e),r.unobserve(e)}}var FT={some:0,all:1},IT=class extends ZC{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:FT[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=PT(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(LT(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function LT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var RT={inView:{Feature:IT},tap:{Feature:OT},focus:{Feature:ET},hover:{Feature:TT}};function zT(e){return(0,g.useEffect)(()=>()=>e(),[])}var BT={renderer:yT,...ST,...RT};function VT(e){let t=d_(()=>Px(e)),{isStatic:n}=(0,g.useContext)(_w);if(n){let[,n]=(0,g.useState)(e);(0,g.useEffect)(()=>t.on(`change`,n),[])}return t}function HT(e,t){let n=VT(t()),r=()=>n.set(t());return r(),f_(()=>{let t=()=>xy.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),Sy(r)}}),n}function UT(e){Mx.current=[],e();let t=HT(Mx.current,e);return Mx.current=void 0,t}function WT(e,t,n,r){if(typeof e==`function`)return UT(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return KT(e,t,n,r);let i=typeof t==`function`?t:AC(t,n,r),a=Array.isArray(e)?GT(e,i):GT([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function GT(e,t){let n=d_(()=>[]);return HT(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function KT(e,t,n,r){let i=d_(()=>Object.keys(n)),a=d_(()=>({}));for(let o of i)a[o]=WT(e,t,n[o],r);return a}function qT(){!HC.current&&WC();let[e]=(0,g.useState)(VC.current);return e}function JT(){let e=qT(),{reducedMotion:t}=(0,g.useContext)(_w);return t===`never`?!1:t===`always`||e}function YT(e){return typeof e==`object`&&!Array.isArray(e)}function XT(e,t,n,r){return e==null?[]:typeof e==`string`&&YT(t)?MS(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ZT(e,t,n){return e*(t+1)+n*t}function QT(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function $T(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(h_(e,i),r--)}}function eE(e,t,n,r,i,a){$T(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ey(i,a,r[o]),easing:J_(n,o)})}function tE(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function nE(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var rE=`easeInOut`,iE=20;function aE(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,QT(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=QT(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=cE(e),{delay:l=0,times:u=Gy(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ox(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&dE(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=E_(b));let r=Oy(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Wy(u,T),c.length===1&&c.unshift(null),m&&`${m}${iE}`,m&&m<iE){let e=b>0?_/b:0;b=ZT(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?I_(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:J_(f,e-1))}tE(u,m,e)}let E=w+b;eE(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(rS(p)){let e=oE(p,s);_(m,h,sE(`default`,e))}else{let e=XT(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=oE(r,s);for(let e in m)_(m[e],lE(h,e),sE(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(nE);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(w_(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(rE)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function oE(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function sE(e,t){return t[e]||(t[e]=[]),t[e]}function cE(e){return Array.isArray(e)?e:[e]}function lE(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var uE=e=>typeof e==`number`,dE=e=>e.every(uE);function fE(e,t){return rS(e)||typeof e==`number`||typeof e==`string`&&!YT(t)}function pE(e,t,n,r){let i=[];if(fE(e,t))i.push(mw(e,YT(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=XT(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...uC(r,t,s,NC.get(r))):i.push(...DS(TS(r)??dC,r,t,s))}}return i}function mE(e,t,n){let r=[];return aE(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Px(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:By}).forEach(({keyframes:e,transition:t},n)=>{r.push(...pE(n,e,t))}),r}function hE(e){return Array.isArray(e)&&e.some(Array.isArray)}function gE(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),hE(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=mE(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=pE(e,i,{...c,...r},t)}let l=new Ox(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{h_(t.animations,l)})),l}return i}var _E=Object.assign(gE(),{addEffect:CS,removeEffect:wS});function vE(){let e=d_(()=>({current:null,animations:[]})),t=JT()??void 0,{skipAnimations:n}=(0,g.useContext)(_w),r=(0,g.useMemo)(()=>gE({scope:e,reduceMotion:t,skipAnimations:n}),[e,t,n]);return zT(()=>{e.animations.forEach(e=>e.stop()),e.animations.length=0}),[e,r]}var yE=vT,bE=`text-[2.5rem]`,xE={indicator:`text-primary`,track:`text-primary-soft`},SE={indicator:`text-current`,track:`text-current/20`};function CE({colors:e,reduced:t}){return(0,U.jsxs)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 40 40`,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,"aria-hidden":`true`,className:Z(`size-[1em] stroke-4!`,e.indicator),children:[(0,U.jsx)(`circle`,{cx:`20`,cy:`20`,r:`16`,className:e.track}),t?(0,U.jsx)(`circle`,{cx:`20`,cy:`20`,r:`16`,pathLength:1,strokeDasharray:`0.25 0.75`}):(0,U.jsx)(yE.circle,{cx:`20`,cy:`20`,r:`16`,pathLength:1,strokeDasharray:`0.25 0.75`,initial:{strokeDashoffset:0},animate:{strokeDashoffset:-1},transition:{duration:.9,repeat:1/0,ease:`linear`}})]})}var wE=12,TE=1.2;function EE({colors:e,reduced:t}){return(0,U.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 40 40`,fill:`currentColor`,"aria-hidden":`true`,className:Z(`size-[1em]`,e.indicator),children:Array.from({length:wE},(e,n)=>{let r={x:18,y:2,width:4,height:6,rx:2,transform:`rotate(${360/wE*n} 20 20)`};return t?(0,U.jsx)(`rect`,{...r,opacity:.25},n):(0,U.jsx)(yE.rect,{...r,initial:{opacity:0},animate:{opacity:[0,1,.5,0]},transition:{duration:TE,repeat:1/0,ease:`linear`,delay:n/wE*TE-TE,times:[0,.1,.5,1]}},n)})})}var DE=`M12.846 3.581C12.711 3.231 12.375 3 12 3C11.625 3 11.278 3.263 11.154 3.581C10.604 5.011 10.054 6.442 9.504 7.872C8.752 8.16 8.159 8.752 7.871 9.504C6.441 10.054 5.011 10.604 3.581 11.154C3.41 11.22 3.263 11.336 3.159 11.487C3.055 11.638 3 11.817 3 12C3 12.183 3.056 12.362 3.159 12.513C3.262 12.664 3.41 12.78 3.581 12.846C5.011 13.396 6.442 13.946 7.872 14.496C8.16 15.248 8.752 15.841 9.504 16.129C10.054 17.559 10.604 18.989 11.154 20.419C11.22 20.59 11.336 20.737 11.487 20.841C11.638 20.945 11.817 21 12 21C12.183 21 12.362 20.945 12.513 20.841C12.664 20.737 12.78 20.59 12.846 20.419C13.396 18.989 13.946 17.559 14.496 16.129C15.248 15.841 15.841 15.248 16.129 14.496C17.559 13.946 18.989 13.396 20.419 12.846C20.59 12.78 20.737 12.664 20.841 12.513C20.945 12.362 21 12.183 21 12C21 11.817 20.945 11.638 20.841 11.487C20.737 11.336 20.59 11.22 20.419 11.154C18.989 10.604 17.559 10.054 16.129 9.504C15.841 8.752 15.248 8.16 14.496 7.871C13.946 6.441 13.396 5.011 12.846 3.581Z`,OE=`M12.704 5C12.469 5 12.235 5 12 5C11.765 5 11.531 5 11.296 5C10.161 5.053 9.025 5.106 7.889 5.159C6.979 6.069 6.069 6.979 5.159 7.889C5.106 9.025 5.053 10.161 5 11.296C5 11.395 5 11.494 5 11.593C5 11.729 5 11.864 5 12C5 12.136 5 12.271 5 12.407C5 12.506 5 12.605 5 12.704C5.053 13.839 5.106 14.975 5.159 16.111C6.069 17.021 6.979 17.931 7.889 18.841C9.025 18.894 10.161 18.947 11.296 19C11.395 19 11.494 19 11.593 19C11.729 19 11.864 19 12 19C12.136 19 12.271 19 12.407 19C12.506 19 12.605 19 12.704 19C13.839 18.947 14.975 18.894 16.111 18.841C17.021 17.931 17.931 17.021 18.841 16.111C18.894 14.975 18.947 13.839 19 12.704C19 12.605 19 12.506 19 12.407C19 12.271 19 12.136 19 12C19 11.864 19 11.729 19 11.593C19 11.494 19 11.395 19 11.296C18.947 10.161 18.894 9.025 18.841 7.889C17.931 6.979 17.021 6.069 16.111 5.159C14.975 5.106 13.839 5.053 12.704 5Z`;function kE(e){return e.match(/-?\d+(?:\.\d+)?/g)?.map(Number)??[]}var AE=kE(DE),jE=kE(OE),ME=(AE.length-2)/6;function NE(e){let t=`M${e[0]} ${e[1]}`;for(let n=0;n<ME;n++){let r=2+n*6;t+=`C${e[r]} ${e[r+1]} ${e[r+2]} ${e[r+3]} ${e[r+4]} ${e[r+5]}`}return t+`Z`}function PE(e,t,n){return e+(t-e)*n}function FE(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}var IE=2.5,LE=.4;function RE({colors:e,reduced:t}){let n=VT(0);g.useEffect(()=>{if(t)return;let e=_E(n,1,{duration:IE,repeat:1/0,ease:`linear`});return()=>e.stop()},[t,n]);let r=WT(n,e=>{if(e<LE/2){let t=FE(e/(LE/2));return NE(AE.map((e,n)=>PE(e,jE[n],t)))}if(e<LE){let t=FE((e-LE/2)/(LE/2));return NE(jE.map((e,n)=>PE(e,AE[n],t)))}return DE}),i=WT(n,e=>e<LE?FE(e/LE)*360:360);return(0,U.jsx)(`svg`,{width:`1em`,height:`1em`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,"aria-hidden":`true`,className:Z(`size-[1em]`,e.indicator),children:t?(0,U.jsx)(`path`,{d:DE}):(0,U.jsx)(yE.path,{d:r,style:{transformOrigin:`12px 12px`,rotate:i}})})}var zE={circular:CE,dots:EE,sparkle:RE};function BE({variant:e=`circular`,currentColor:t=!1,"aria-label":n=`Loading`,className:r,...i}){let a=_h(),o=t?SE:xE,s=zE[e],c=(0,U.jsx)(s,{colors:o,reduced:a});return(0,U.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":n,className:Z(`inline-flex shrink-0 items-center justify-center align-middle`,bE,r),...i,children:a?c:(0,U.jsx)(Fw,{features:BT,strict:!0,children:c})})}function VE(e,{storage:t=`local`}={}){let[n,r,i]=Ig(t,e,``,{serializer:e=>e,deserializer:e=>e}),a=n!==`1`,o=(0,g.useCallback)(()=>r(`1`),[r]),s=(0,g.useCallback)(()=>i(),[i]);return(0,g.useMemo)(()=>({open:a,dismiss:o,reset:s}),[a,o,s])}var HE=Uu(Z(`group/alert relative rounded-xl border p-5 text-foreground backdrop-blur-xl`,`grid w-full items-start`,`[grid-template-columns:auto_1fr_auto] [grid-template-areas:'icon_title_close'_'._description_.'_'._actions_actions']`,`@min-[460px]:data-[layout=inline]:items-center`,`@min-[460px]:data-[layout=inline]:[grid-template-columns:auto_auto_1fr_auto_auto]`,`@min-[460px]:data-[layout=inline]:[grid-template-areas:'icon_title_description_actions_close']`),{variants:{variant:{default:`bg-background border-border`,primary:`bg-primary-subtle border-primary-soft`,secondary:`bg-secondary-subtle border-secondary-soft`,error:`bg-error-subtle border-error-soft`,success:`bg-success-subtle border-success-soft`,warning:`bg-warning-subtle border-warning-soft`,info:`bg-info-subtle border-info-soft`}},defaultVariants:{variant:`default`}}),UE={default:`text-foreground-intense`,primary:`text-primary`,secondary:`text-secondary-emphasis`,error:`text-error-emphasis`,success:`text-success-emphasis`,warning:`text-warning-emphasis`,info:`text-info-emphasis`},WE=g.createContext(`default`),GE={opacity:0,scale:.88,filter:`blur(12px)`,height:0},KE={opacity:0},qE={default:{duration:.32,ease:[.4,0,.2,1]},height:{duration:.3,ease:[.4,0,.2,1],delay:.18}};function JE({variant:e,layout:t=`block`,dismissible:n=!1,open:r,onOpenChange:i,persistKey:a,persistStorage:o=`local`,closeLabel:s=`Dismiss`,role:c=`alert`,className:l,children:u,style:d,...f}){let p=_h(),[m,h]=g.useState(!0),_=VE(a??``,{storage:o}),v=r!==void 0,y=!v&&a!=null,b=v?r:y?_.open:m,x=g.useCallback(()=>{if(v){i?.(!1);return}y?_.dismiss():h(!1),i?.(!1)},[v,y,_,i]);return(0,U.jsx)(WE.Provider,{value:e??`default`,children:(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(Ow,{initial:!1,children:b&&(0,U.jsx)(yE.div,{initial:!1,exit:p?KE:GE,transition:p?{duration:0}:qE,className:`@container overflow-hidden`,children:(0,U.jsxs)(`div`,{role:c,"data-slot":`alert`,"data-layout":t,style:d,className:Z(HE({variant:e}),l),...f,children:[u,n&&(0,U.jsx)(`button`,{type:`button`,"aria-label":s,"data-slot":`alert-close`,onClick:x,className:Z(`text-foreground-muted cursor-pointer rounded-md p-1 transition-colors outline-none [grid-area:close]`,`hover:text-foreground-intense`,`focus-visible:ring-ring focus-visible:ring-2`,`self-start @min-[460px]:group-data-[layout=inline]/alert:self-center`,`ms-3 -me-1 -mt-1 @min-[460px]:group-data-[layout=inline]/alert:my-0`),children:(0,U.jsx)(YE,{})})]})},`alert`)})})})}function YE(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,className:`size-4`,children:(0,U.jsx)(`path`,{d:`M11.523 3.522c.264-.264.691-.264.955 0s.264.691 0 .955L8.955 8l3.522 3.522c.264.264.264.691 0 .955s-.691.264-.955 0L8 8.955l-3.522 3.522c-.264.264-.691.264-.955 0s-.264-.691 0-.955L7.045 8 3.522 4.478c-.264-.264-.264-.691 0-.955s.691-.264.955 0L8 7.045l3.523-3.522z`})})}function XE({className:e,...t}){let n=g.useContext(WE);return(0,U.jsx)(`span`,{"data-slot":`alert-icon`,className:Z(`me-3 flex h-lh shrink-0 items-center [grid-area:icon] [&_svg:not([class*='size-'])]:size-5`,UE[n],e),...t})}function ZE({className:e,as:t=`h5`,...n}){return(0,U.jsx)(t,{"data-slot":`alert-title`,className:Z(`text-foreground-intense self-center font-semibold [grid-area:title]`,`text-base @min-[460px]:group-data-[layout=inline]/alert:me-3 @min-[460px]:group-data-[layout=inline]/alert:text-sm`,e),...n})}function QE({className:e,...t}){return(0,U.jsx)(`p`,{"data-slot":`alert-description`,className:Z(`text-foreground text-sm [grid-area:description]`,`mt-2 @min-[460px]:group-data-[layout=inline]/alert:mt-0`,e),...t})}function $E(e){return Hr(e.defaultTagName??`div`,e,e)}var eD=[`before:pointer-events-none`,`before:absolute`,`before:inset-0`,`before:-z-1`,`before:rounded-[inherit]`,`[a,button]:before:transition-[opacity,background-color,border-color]`,`[a,button]:before:duration-250`,`motion-reduce:[a,button]:before:transition-none`],tD=Uu(`relative isolate inline-flex shrink-0 items-center justify-center rounded-full whitespace-nowrap outline-offset-1 select-none [&_svg]:shrink-0 [a,button]:transform-gpu [a,button]:cursor-pointer [a,button]:transition [a,button]:duration-250 [a,button]:ease-[cubic-bezier(0.175,0.885,0.32,1.5)] [a,button]:not-data-popup-open:active:translate-y-px [a,button]:not-data-popup-open:active:scale-[0.97] [a,button]:not-data-popup-open:active:duration-100 [a,button]:not-data-popup-open:active:ease-in-out motion-reduce:[a,button]:transition-none`,{variants:{variant:{primary:Z(eD,`bg-primary text-primary-foreground outline-ring-primary [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--primary)_0%,var(--primary-muted)_75%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),"primary-outline":Z(eD,`text-primary before:border before:border-primary outline-ring-primary`,`[a,button]:hover:before:bg-primary [a,button]:hover:text-primary-foreground`,`[a,button]:data-pressed:before:bg-primary [a,button]:data-pressed:text-primary-foreground`,`[a,button]:data-popup-open:before:bg-primary [a,button]:data-popup-open:text-primary-foreground`),secondary:Z(eD,`bg-secondary-muted text-secondary-foreground outline-ring-secondary [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--secondary)_0%,var(--secondary-muted)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),soft:Z(eD,`text-foreground-intense before:bg-background-muted before:backdrop-blur-md [a,button]:before:border [a,button]:before:border-transparent outline-ring`,`data-[slot=breadcrumb-link]:not-data-active:text-foreground-muted data-[slot=breadcrumb-link]:hover:text-foreground-intense`,`[a,button]:hover:before:bg-background-subtle [a,button]:hover:before:border-border`,`[a,button]:data-pressed:before:bg-background-subtle [a,button]:data-pressed:before:border-border`,`[a,button]:data-popup-open:before:bg-background-subtle [a,button]:data-popup-open:before:border-border`,`data-active:before:bg-background-subtle data-active:border data-active:before:border-border`),outline:Z(eD,`bg-background text-foreground-intense before:bg-background before:border-border before:border outline-ring`,`data-[slot=breadcrumb-link]:not-data-active:text-foreground-muted data-[slot=breadcrumb-link]:hover:text-foreground-intense`,`[a,button]:hover:before:bg-background-subtle [a,button]:hover:before:border-border-strong`,`[a,button]:data-pressed:before:bg-background-subtle [a,button]:data-pressed:before:border-border-strong`,`[a,button]:data-popup-open:before:bg-background-subtle [a,button]:data-popup-open:before:border-border-strong`,`data-active:before:bg-background-subtle data-active:before:border-border-strong`),error:Z(eD,`bg-error-muted text-error-foreground outline-ring-error [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--error-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),success:Z(eD,`bg-success-muted text-success-foreground outline-ring-success [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--success-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),warning:Z(eD,`bg-warning-muted text-warning-foreground outline-ring-warning [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--warning-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),info:Z(eD,`bg-info-muted text-info-foreground outline-ring-info [a,button]:before:bg-[radial-gradient(138.15%_78.13%_at_52.05%_50%,var(--info-muted)_0%,rgba(255,255,255,.5)_95%)] [a,button]:before:opacity-0`,`[a,button]:hover:before:opacity-100`,`[a,button]:data-pressed:before:opacity-100`,`[a,button]:data-popup-open:before:opacity-100`),light:Z(eD,`text-white before:bg-white/10 before:border-white/10 before:border before:backdrop-blur-md outline-ring-light`,`[a,button]:hover:before:bg-white/15 [a,button]:hover:before:border-white/15`,`[a,button]:data-pressed:before:bg-white/15 [a,button]:data-pressed:before:border-white/15`,`[a,button]:data-popup-open:before:bg-white/15 [a,button]:data-popup-open:before:border-white/15`,`data-active:before:bg-white/15 data-active:before:border-white/15`)},size:{xs:`h-4 w-fit gap-0.5 px-1.5 text-[.625rem] has-data-[icon=end]:pe-1.25 has-data-[icon=start]:ps-1.25 [&_svg:not([class*='size-'])]:size-2.5 [&_svg:not([class*='stroke-'])]:stroke-2`,sm:`h-5 w-fit gap-0.5 px-2 text-xs has-data-[icon=end]:pe-1.5 has-data-[icon=start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='stroke-'])]:stroke-[1.85]`,md:`h-6 w-fit gap-0.75 px-2.5 text-xs has-data-[icon=end]:pe-1.75 has-data-[icon=start]:ps-1.75 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,lg:`h-7 w-fit gap-1 px-3 text-sm has-data-[icon=end]:pe-2.25 has-data-[icon=start]:ps-2.25 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,"icon-sm":`h-5 w-5 [&_svg:not([class*='size-'])]:size-3 [&_svg:not([class*='stroke-'])]:stroke-[1.85]`,"icon-md":`h-6 w-6 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`,"icon-lg":`h-7 w-7 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75]`}},defaultVariants:{variant:`primary`,size:`md`}});function nD({className:e,variant:t,size:n,render:r,...i}){let a=g.isValidElement(r)?r.props:void 0,o=g.isValidElement(r)&&(r.type===`a`||r.type===`button`)||i.onClick!=null||a?.href!=null||a?.onClick!=null||a?.tabIndex!=null;return $E({defaultTagName:`span`,render:r,state:{variant:t,size:n},props:Or({"data-slot":`badge`,...o?Bu():{},className:Z(tD({variant:t,size:n}),e)},i)})}function rD(e,t,n,r,i){return g.isValidElement(t)?g.cloneElement(t,{...i,...t.props,className:Z(n,t.props.className,r)}):g.createElement(e,{...i,className:Z(n,r)})}var iD=`[--card-radius:var(--radius-xl)]`,aD=`rounded-[calc(var(--card-radius)*4/3)]`,oD={none:`rounded-(--card-radius)`,solid:Z(aD,`bg-background-muted/60 p-2 backdrop-blur-xl dark:bg-background-subtle`),glass:Z(aD,`border border-white/15 bg-white/10 p-2 backdrop-blur-sm`)},sD={none:`border`,solid:`border-border-muted border`,glass:``};function cD({frame:e=!1,inset:t=!0,className:n,contentProps:r,render:i,children:a,...o}){let s=e===!0?`solid`:e===!1?`none`:e;return rD(`div`,i,Z(`group/card flex flex-col`,iD,oD[s]),n,{"data-slot":`card`,"data-frame":s,...t?{"data-inset":``}:{},...o,children:(0,U.jsx)(`div`,{"data-slot":`card-content`,...r,className:Z(`bg-background flex min-h-0 flex-1 flex-col overflow-hidden rounded-(--card-radius)`,t&&`p-2`,sD[s],r?.className),children:a})})}function lD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:Z(`flex flex-1 flex-col gap-1.5 p-6 group-data-inset/card:px-4`,e),...t})}function uD({className:e,render:t,...n}){return rD(`h3`,t,`text-foreground-intense text-lg font-semibold`,e,{"data-slot":`card-title`,...n})}var dD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=vd(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Hr(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:It,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),fD=`--nested-dialogs`,pD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=vd(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ud(),ai({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Gs(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Hr(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Ws,hidden:!m,onKeyDown(e){Jd.has(e.key)&&e.stopPropagation()},style:{[fD]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Zf});return(0,U.jsx)(Oo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),mD=F(function(e){return Lf(`dialog`,e)}),hD=Object.assign(function(e){return(0,U.jsx)(mD,{...e})},{createHandle:Fp});function gD({className:e,children:t,closeButton:n=!0,closeLabel:r=`Close`,backdrop:i=!0,frame:a=!0,backdropProps:o,viewportProps:s,...c}){let l=a&&i,{portal:u,popup:d}=zp(c);return(0,U.jsxs)(gf,{...u,children:[i&&(0,U.jsx)(dD,{"data-slot":`dialog-backdrop`,...o,className:Z(`fixed inset-0 z-50 bg-black/30 backdrop-blur-sm supports-[-webkit-touch-callout:none]:absolute`,`motion-safe:transition-opacity motion-safe:duration-250 motion-safe:ease-out`,`data-ending-style:motion-safe:opacity-0 data-starting-style:motion-safe:opacity-0`,o?.className)}),(0,U.jsx)(Qf,{"data-slot":`dialog-viewport`,...s,className:Z(`fixed inset-0 z-50 flex items-center justify-center overflow-hidden p-4`,s?.className),children:(0,U.jsx)(pD,{"data-slot":`dialog-popup`,...l?{"data-frame":``}:{},className:Z(`group/dialog-popup relative flex max-h-full min-h-0 w-150 max-w-full flex-col`,`rounded-2xl border`,l?`border-white/15 bg-white/10 p-1.5 backdrop-blur-sm`:`bg-background border-border-overlay`,!l&&`shadow-2xl`,`isolate transform-gpu outline-none`,`motion-safe:transition-[opacity,scale] motion-safe:duration-250 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-95 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,`data-nested-dialog-open:pointer-events-none data-nested-dialog-open:scale-95 data-nested-dialog-open:opacity-0`,e),...d,children:(0,U.jsxs)(`div`,{"data-slot":`dialog-content`,className:Z(`relative flex min-h-0 flex-col overflow-hidden not-has-[>[data-slot=dialog-footer]]:pb-6 not-has-[>[data-slot=dialog-header]]:pt-6 [&>[data-slot=dialog-header]+[data-slot=dialog-footer]]:pt-0`,l&&`bg-background rounded-[calc(var(--radius-2xl)*5/6)]`),children:[t,n&&(0,U.jsx)(Od,{"aria-label":r,"data-slot":`dialog-close-button`,className:Z(Gu({variant:`outline`,size:`icon-sm`}),`absolute inset-e-3 top-3 z-10`),children:(0,U.jsx)(SD,{})})]})})})]})}function _D({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:Z(`flex shrink-0 flex-col gap-2 p-6`,e),...t})}function vD({className:e,...t}){return(0,U.jsx)(Uf,{"data-slot":`dialog-title`,className:Z(`text-foreground-intense text-2xl font-semibold`,e),...t})}function yD({className:e,...t}){return(0,U.jsx)(Nd,{"data-slot":`dialog-description`,className:Z(`text-foreground-muted text-sm`,e),...t})}function bD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-body`,className:Z(`min-h-0 flex-1 px-6`,e),...t})}function xD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-footer`,className:Z(`flex flex-col-reverse gap-2 p-6 sm:flex-row sm:justify-end`,e),...t})}function SD(e){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,U.jsx)(`path`,{d:`M11.594 3.594c.225-.225.588-.225.813 0s.225.588 0 .812L8.813 8l3.594 3.594c.225.225.225.588 0 .813s-.588.225-.812 0L8 8.812l-3.594 3.594c-.225.225-.588.225-.812 0s-.225-.588 0-.812L7.188 8 3.594 4.406c-.225-.225-.225-.588 0-.812s.588-.225.813 0L8 7.187l3.594-3.594z`})})}var CD=g.createContext(void 0);function wD(){let e=g.useContext(CD);if(e===void 0)throw Error(S(63));return e}var TD=`data-valid`,ED=`data-invalid`,DD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},OD={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kD={valid(e){return e===null?null:e?{[TD]:``}:{[ED]:``}}},AD=`data-checked`,jD=`data-unchecked`,MD={...kD,checked(e){return e?{[AD]:``}:{[jD]:``}}},ND={invalid:void 0,name:void 0,validityData:{state:DD,errors:[],error:``,value:``,initialValue:null},setValidityData:p,disabled:void 0,setTouched:p,setDirty:p,setFilled:p,setFocused:p,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:OD,registerFieldControl:p,validation:{getValidationProps:(e,t=h)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:p,getInputControl:()=>null,commit:async()=>{},change:p}},PD=g.createContext(ND);function FD(e=!0){let t=g.useContext(PD);if(t.setValidityData===p&&!e)throw Error(S(28));return t}function ID(e,t,n,r,i=!0,a){let{registerFieldControl:o}=FD(),s=y(()=>Symbol());b(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),b(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var LD=g.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:p,validationMode:`onSubmit`,submitCountRef:{current:0}});function RD(){return g.useContext(LD)}var zD=g.createContext({controlId:void 0,registerControlId:p,resetControlId:p,labelId:void 0,setLabelId:p,messageIds:[],setMessageIds:p,getDescriptionProps:e=>e});function BD(){return g.useContext(zD)}function VD(e,t,n,r=!0,i){let[a,o]=g.useState(),s=Md(i?`${i}-label`:void 0),c=e??t??a;return b(()=>{let i=e||t||!r?void 0:HD(n.current,s);a!==i&&o(i)}),c}function HD(e,t){let n=UD(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function UD(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function WD(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=BD(),o=Md(),s=y(()=>Symbol()),c=g.useRef(!1),l=g.useRef(!1),u=q(()=>{c.current&&i!==p&&(c.current=!1,i(s.current,void 0))});return b(()=>{if(!n||i===p){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),b(()=>u,[u]),(n?r:void 0)??t??o}var GD=g.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:_,uncheckedValue:v,value:y,style:x,...S}=e,{clearErrors:C}=RD(),{state:w,setTouched:T,setDirty:E,validityData:D,setFilled:O,setFocused:k,validationMode:A,disabled:j,name:M,validation:N}=FD(),{labelId:P}=BD(),F=j||m,I=M??l,L=g.useRef(null),R=gr(L,c,N.inputRef),z=g.useRef(null),B=Md(),V=WD({id:s}),H=u?void 0:V,[ee,te]=vf({controlled:n,default:!!i,name:`Switch`,state:`checked`});ID(z,B,ee,void 0,!F,l),b(()=>{O(ee)},[ee,O]),Kf(ee,()=>{C(I),E(ee!==D.initialValue),N.change(ee)});let{getButtonProps:ne,buttonRef:W}=ua({disabled:F,native:u}),re=VD(a,P,L,!u,H),G={id:u?V:B,role:`switch`,"aria-checked":ee,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":re,onFocus(){F||k(!0)},onBlur(){let e=L.current;e&&!F&&(T(!0),k(!1),A===`onBlur`&&N.commit(e.checked))},onClick(e){if(f||F)return;e.preventDefault();let t=L.current;t&&la(t,e)}},K={...N.getValidationProps(F),checked:ee,disabled:F,form:o,id:H,name:I,required:p,style:I?mr:pr,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:R,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=ja(ha,e.nativeEvent);d?.(t,n),!n.isCanceled&&te(t)},onClick(e){e.stopPropagation()},onFocus(){z.current?.focus()},...y===void 0?h:{value:y}},ie=g.useMemo(()=>({...w,checked:ee,disabled:F,readOnly:f,required:p}),[w,ee,F,f,p]),ae=Hr(`span`,e,{state:ie,ref:[t,z,W],props:[G,S,ne,e=>N.getValidationProps(F,e)],stateAttributesMapping:MD});return(0,U.jsxs)(CD.Provider,{value:ie,children:[ae,!ee&&I&&v!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:I,value:v,disabled:F}),(0,U.jsx)(`input`,{...K,suppressHydrationWarning:!0})]})}),KD=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Hr(`span`,e,{state:wD(),ref:t,stateAttributesMapping:MD,props:a})}),qD={sm:{root:`h-4 w-7.5`,thumb:`size-3`,thumbWidthKeyframes:[`0.75rem`,`1.25rem`,`0.75rem`],thumbXKeyframes:[0,`0.3125rem`,`0.875rem`],check:`size-2.5`},md:{root:`h-5 w-9.5`,thumb:`size-4`,thumbWidthKeyframes:[`1rem`,`1.6875rem`,`1rem`],thumbXKeyframes:[0,`0.4375rem`,`1.125rem`],check:`size-3`},lg:{root:`h-6 w-11.5`,thumb:`size-5`,thumbWidthKeyframes:[`1.25rem`,`2.125rem`,`1.25rem`],thumbXKeyframes:[0,`0.5rem`,`1.375rem`],check:`size-4`}},JD={duration:.25,ease:[.4,0,.2,1]};function YD(e,t){return t===1?[...e]:e.map(e=>typeof e==`number`?-e:`-${e}`)}function XD({renderProps:e,state:t,dirSign:n,sizeConfig:r,reduced:i}){let{checked:a}=t,{ref:o,onDrag:s,onDragStart:c,onDragEnd:l,onAnimationStart:u,onAnimationEnd:d,...f}=e,p=g.useMemo(()=>{let e=YD(r.thumbXKeyframes,n);return a?e:e.reverse()},[a,n,r]),m=p[p.length-1],[h,_]=vE(),v=zu(o,h),y=g.useRef(a);return g.useEffect(()=>{let e=y.current!==a;y.current=a,e&&!i?_(h.current,{x:p,width:r.thumbWidthKeyframes},JD):_(h.current,{x:m},{duration:0})},[a,r,_,h,i,p,m]),(0,U.jsx)(yE.span,{...f,ref:v,initial:{x:m},children:(0,U.jsx)(yE.svg,{className:Z(`text-foreground-intense`,r.check),xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{strokeDasharray:12},initial:!1,animate:{strokeDashoffset:a?0:12},transition:i?{duration:0}:{strokeDashoffset:{duration:a?.3:0,ease:`easeOut`,delay:a?.25:0}},children:(0,U.jsx)(`path`,{d:`M3 6l2 2 4-4`})})})}function ZD({className:e,size:t=`md`,...n}){let r=Uc()===`rtl`?-1:1,i=qD[t],a=_h(),o=n[`aria-invalid`],s=o===!0||o===`true`;return(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(GD,{"data-slot":`switch`,className:Z(`bg-background-strong outline-ring flex shrink-0 rounded-full border border-transparent p-px outline-offset-1`,i.root,`transition-background duration-200 motion-reduce:transition-none`,`data-checked:bg-primary data-checked:outline-ring-primary`,`data-disabled:not-data-checked:border-border-strong data-disabled:opacity-disabled data-disabled:cursor-not-allowed data-disabled:not-data-checked:border-dashed`,`data-invalid:border-error data-invalid:not-data-checked:bg-error-subtle data-invalid:outline-ring-error`,e),...n,...s?{"data-invalid":``}:{},children:(0,U.jsx)(KD,{"data-slot":`switch-thumb`,className:Z(`group flex items-center justify-center rounded-full bg-white shadow-2xs`,i.thumb,`data-checked:bg-primary-foreground`),render:(e,t)=>(0,U.jsx)(XD,{renderProps:e,state:t,dirSign:r,sizeConfig:i,reduced:a})})})})}var QD=3e4,$D=1e3;function eO(e,t=Date.now()){let n=e?.tailcat?.expiresAt??0;if(!Number.isFinite(n)||n<=0)return null;let r=n*1e3-t;return r<=0?null:Math.max(r-QD,$D)}var tO=class extends Error{constructor(e,t,n){super(e),G(this,`code`,void 0),G(this,`status`,void 0),this.name=`ApiError`,this.code=t,this.status=n}};async function nO(e){let t=null;try{t=await e.json()}catch{t=null}let n=t?.error;if(typeof n==`string`&&n)return new tO(n,`http_${e.status}`,e.status);if(n&&typeof n==`object`){let t=n,r=typeof t.code==`string`&&t.code?t.code:`http_${e.status}`;return new tO(typeof t.message==`string`&&t.message?t.message:$(`panel.net.requestFailed`,{status:e.status}),r,e.status)}return new tO($(`panel.net.requestFailed`,{status:e.status}),`http_${e.status}`,e.status)}async function rO(e){let t=e.split(`?`)[0]===`/api/relay/pairing`,n=t?3e4:e===`/api/relay/status`?12e3:0,r=n?new AbortController:null,i=r?window.setTimeout(()=>r.abort(),n):null;try{let n=await fetch(e,{headers:{accept:`application/json`},...r?{signal:r.signal}:{}});if(!n.ok)throw await nO(n);let i=await n.json();if(t&&(i?.ok!==!0||typeof i.svg!=`string`||!i.svg.includes(`<svg`)))throw new tO($(`panel.pairing.qrFailed`),`pairing_invalid`,n.status);return i}catch(e){throw r?.signal.aborted?new tO($(t?`panel.console.pairingTimeout`:`panel.console.statusTimeout`),t?`pairing_timeout`:`status_timeout`,0):e}finally{i!==null&&window.clearTimeout(i)}}async function iO(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify(t??{})});if(!r.ok)throw await nO(r);let i=await r.json();return n?.keepApplyError||aO(i),i}function aO(e){let t=e?.applyError;if(typeof t==`string`&&t)throw new tO($(`panel.shell.applyFailed`,{message:t}),`apply_failed`,200)}function oO(e){return iO(`/api/relay/frp/import`,{config:e})}function sO(){return iO(`/api/relay/frp/stop`)}function cO(e){return e instanceof tO?e.message:e instanceof Error?e.message||$(`panel.net.requestFailedNoStatus`):String(e)}var lO={ok:4e3,soft:6e3,error:9e3};function uO(){let e=(0,g.useRef)(ud());return e.current=ud(),(0,g.useCallback)((t,n)=>{e.current.add({title:n,type:t,timeout:lO[t],priority:t===`error`?`high`:`low`})},[])}var dO={status:`/api/relay/update/status`,check:`/api/relay/update/check`,apply:`/api/relay/update/apply`,auto:`/api/relay/update/auto`,otaStatus:`/api/relay/update/ota/status`,otaCheck:`/api/relay/update/ota/check`,otaApply:`/api/relay/update/ota/apply`},fO=e=>e&&typeof e==`object`?e:{},pO=e=>typeof e==`string`&&e!==``?e:null,mO=e=>typeof e==`boolean`?e:null,hO=e=>typeof e==`number`&&Number.isFinite(e)?e:null;async function gO(e,t){let n=await fetch(e,{credentials:`same-origin`,headers:{accept:`application/json`,...t?.body?{"content-type":`application/json`}:{}},...t}),r=null;try{r=await n.json()}catch{r=null}let i=fO(r),a=fO(i.error);if(!n.ok){let e=pO(a.code)??`http_${n.status}`;throw new tO(pO(a.message)??$(`panel.net.hostHttp`,{status:n.status}),e,n.status)}return i}function _O(e){return e instanceof tO?e.status===404:e instanceof SyntaxError}function vO(e){return e instanceof tO&&e.code===`update_unavailable`}function yO(e){let t=fO(e);return Object.keys(t).length===0?null:{installedVersion:pO(t.installedVersion),latestVersion:pO(t.latestVersion),updateAvailable:t.updateAvailable===!0,source:pO(t.source),checkedAt:pO(t.checkedAt)}}function bO(e){let t=fO(e),n=fO(t.failure),r=pO(n.code);return{installed:mO(t.installed),skipped:mO(t.skipped),state:pO(t.state),beforeVersion:pO(t.beforeVersion),installedVersion:pO(t.installedVersion),swapped:mO(t.swapped),restartRequired:mO(t.restartRequired),refreshRequired:mO(t.refreshRequired),failure:r?{code:r,message:pO(n.message)??r}:null}}function xO(e){let t=fO(e);return{available:t.available===!0,version:pO(t.version),installedVersion:pO(t.installedVersion),source:pO(t.source),previousVersion:pO(t.previousVersion),activatedAt:pO(t.activatedAt),lastError:pO(t.lastError),inFlight:hO(t.inFlight)??0,swapping:t.swapping===!0,autoUpdate:t.autoUpdate===!0,autoIntervalMs:hO(t.autoIntervalMs)??6e5,marketBase:pO(t.marketBase),marketLastCheckedAt:pO(t.marketLastCheckedAt),marketLastError:pO(t.marketLastError),marketResult:yO(t.marketResult),lastApply:t.lastApply?bO(t.lastApply):null,appliedAt:pO(t.appliedAt),runningShellHash:pO(t.runningShellHash),installedShellHash:pO(t.installedShellHash),shellChanged:t.shellChanged===!0}}async function SO(){return xO((await gO(dO.status)).data)}async function CO(){let e=fO((await gO(dO.check,{method:`POST`,body:JSON.stringify({})})).data);return{update:yO(e.update),status:e.status?xO(e.status):null}}async function wO(e=!1){let t=fO((await gO(dO.apply,{method:`POST`,body:JSON.stringify({force:e})})).data),n=fO(t.status);return{...bO(t),status:Object.keys(n).length>0?xO(n):null}}async function TO(e){let t=fO((await gO(dO.auto,{method:`POST`,body:JSON.stringify({enabled:e})})).data);return{enabled:t.enabled===!0,status:t.status?xO(t.status):null}}function EO({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,className:e??`size-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.2`}),(0,U.jsx)(`path`,{d:`M6.3 6.1a1.75 1.75 0 0 1 3.4.55c0 1.15-1.7 1.35-1.7 2.55`}),(0,U.jsx)(`path`,{d:`M8 11.5h.01`})]})}function DO(){let[e,t]=(0,g.useState)(null),[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),c=uO();(0,g.useEffect)(()=>{let e=!0;return SO().then(n=>{e&&t(n)}).catch(()=>{}),()=>{e=!1}},[]);let l=(0,g.useCallback)(async n=>{r(!0);try{let r=await TO(n);t(e=>r.status??(e&&{...e,autoUpdate:r.enabled}));let i=Math.round((r.status?.autoIntervalMs??e?.autoIntervalMs??6e5)/6e4);c(`soft`,r.enabled?$(`panel.update.autoOn`,{minutes:i}):$(`panel.update.autoOff`))}catch(e){c(`error`,$(`panel.update.autoToggleFailed`,{message:cO(e)}));try{t(await SO())}catch{}}finally{r(!1)}},[e?.autoIntervalMs,c]);if(!e)return null;let u=e.autoUpdate===!0,d=Math.round((e.autoIntervalMs??6e5)/6e4);return(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border-muted pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground`,children:$(`panel.update.autoUpdate`)}),(0,U.jsx)(`button`,{type:`button`,"aria-label":$(`panel.update.autoHelp`),title:$(`panel.update.autoHelp`),className:`shrink-0 cursor-pointer text-foreground-muted transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,onClick:()=>a(!0),children:(0,U.jsx)(EO,{})})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[n?(0,U.jsx)(BE,{}):null,(0,U.jsx)(ZD,{size:`md`,checked:u,disabled:n,onCheckedChange:e=>{e?l(!0):s(!0)},"aria-label":$(`panel.update.autoUpdate`)})]})]}),(0,U.jsx)(hD,{open:i,onOpenChange:a,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.update.autoUpdate`)})}),(0,U.jsx)(bD,{className:`whitespace-pre-line text-sm leading-6 text-foreground-muted`,children:$(`panel.update.autoDetail`,{minutes:d})}),(0,U.jsx)(xD,{className:`flex justify-end`,children:(0,U.jsx)(Q,{variant:`outline`,onClick:()=>a(!1),children:$(`panel.common.close`)})})]})}),(0,U.jsx)(hD,{open:o,onOpenChange:s,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.update.autoOffTitle`)})}),(0,U.jsx)(bD,{className:`text-sm leading-6 text-foreground-muted`,children:$(`panel.update.autoOffBody`)}),(0,U.jsxs)(xD,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,onClick:()=>{s(!1),l(!1)},children:$(`panel.update.autoOffConfirm`)}),(0,U.jsx)(Q,{variant:`primary`,onClick:()=>s(!1),children:$(`panel.update.autoOffKeep`)})]})]})})]})}var OO=g.createContext(void 0);function kO(e){let t=g.useContext(OO);if(t===void 0&&!e)throw Error(S(72));return t}var AO={...dc,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},jO=class extends le{constructor(e,t,n){let r=new ic;super(MO(e,r,t,n),NO(r),AO),G(this,`setOpen`,(e,t)=>{Qs(this,e,t,{extraState:{openChangeReason:t.reason}})})}cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ja(ga,e))}};function MO(e,t,n,r=!1){return{...ac(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function NO(e){return{popupRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var PO=F(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ks((e,t)=>new jO({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,_=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),ec(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=tc(h,p),C=p.useState(`isInstantPhase`),w=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=g.useRef(null);b(()=>{m&&t&&p.setOpen(!1,ja(Oa))},[m,t,p]),b(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[S,C,T,w,p]),b(()=>{h&&(_??p.set(`payload`,void 0))},[p,_,h]),g.useImperativeHandle(o,()=>({unmount:x,close:()=>p.setOpen(!1,ja(ka))}),[x,p]);let D=h||v||!t&&a!==`none`;return(0,U.jsxs)(OO.Provider,{value:p,children:[l&&(0,U.jsx)(qs,{handle:l,store:p}),D&&(0,U.jsx)(FO,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function FO({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Fo(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Mo(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=g.useMemo(()=>Or(a.reference,i.reference),[a.reference,i.reference]);return nc(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??h}),null}var IO=g.createContext(void 0);function LO(){return g.useContext(IO)}var RO=`data-base-ui-tooltip-trigger`;function zO(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(_e(n))return n}}let t=e.target;return _e(t)?t:null}function BO(e){let t=e;for(;t;){let e=t.closest(`[${RO}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&_e(n.host)?n.host:null}return null}var VO=I(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=kO(!0),m=fc(a)??p;if(!m)throw Error(S(82));let h=Md(d),_=m.useState(`isTriggerActive`,h),v=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=g.useRef(null),x=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=$s(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),T=LO(),{activeIdRef:E,delayRef:D,isInstantPhase:O,hasProvider:k}=Ya(y,{open:v}),A=xc(y);m.useSyncedValue(`isInstantPhase`,O);let j=m.useState(`disabled`),M=s??j,N=Ba(M),P=m.useState(`trackCursorAxis`),F=m.useState(`disableHoverablePopup`),I=g.useRef(!1),L=Ke(),R=g.useRef(void 0);function z(){return k&&E.current!=null?0:c??T??600}function B(e){let t=b.current;if(!t||!e)return!1;let n=BO(e);return n!==null&&n!==t&&J(t,n)}function V(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let H=wc(y,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?Vc():null,restMs:z,delay(){return u==null&&k?{close:Ua(D.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),ee=gc(y,{enabled:!M}).reference,te=e=>{let t=I.current,n=zO(e),r=V(n),i=b.current,a=i&&n&&J(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,ja(_a,e));return}if(t&&!r&&a&&!N.current&&!m.select(`open`)&&i&&Qt(R.current)){let t=()=>{!I.current&&!N.current&&!m.select(`open`)&&m.setOpen(!0,ja(_a,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},U=m.useState(`triggerProps`,w);return Hr(`button`,e,{state:{open:v},ref:[t,C,b],props:[H,ee,w||P!==`none`?U:void 0,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){B(zO(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Lt]:M?``:void 0,[RO]:M?void 0:``},f],stateAttributesMapping:Nt})}),HO=g.createContext(void 0);function UO(){let e=g.useContext(HO);if(e===void 0)throw Error(S(70));return e}var WO=g.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return kO().useState(`mounted`)||n?(0,U.jsx)(HO.Provider,{value:n,children:(0,U.jsx)(Ra,{ref:t,...r})}):null}),GO=g.createContext(void 0);function KO(){let e=g.useContext(GO);if(e===void 0)throw Error(S(71));return e}var qO=g.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=pi,style:_,...v}=e,y=kO(),b=UO(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=rl({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=sl(e,g.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,U.jsx)(GO.Provider,{value:O,children:k})}),JO=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=kO(),{side:s,align:c}=KO(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);ai({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Sc(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Hr(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Ws,f,ol(d),a],stateAttributesMapping:It})}),YO=g.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=kO(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=KO();return Hr(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Ft})});function XO(e){return(0,U.jsx)(PO,{...e})}function ZO(e){return(0,U.jsx)(VO,{"data-slot":`tooltip-trigger`,...e})}function QO({className:e,arrow:t=!0,children:n,...r}){let{positioner:i,portal:a,popup:o}=bh(r);return(0,U.jsx)(WO,{...a,children:(0,U.jsx)(qO,{side:`top`,align:`center`,alignOffset:0,sideOffset:t?8:4,...i,className:Z(`isolate z-50`,i.className),children:(0,U.jsxs)(JO,{"data-slot":`tooltip-content`,className:Z(`bg-background-inverse text-foreground-inverse rounded-xs px-3 py-1.5 text-xs shadow-md`,`motion-safe:origin-(--transform-origin) motion-safe:transition-[opacity,scale] motion-safe:duration-200 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-90 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,`data-instant:motion-safe:transition-none`,e),...o,children:[n,t&&(0,U.jsx)(YO,{"data-slot":`tooltip-arrow`,className:Z(`bg-background-inverse fill-background-inverse size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]`,`data-[side=top]:-bottom-2.5`,`data-[side=bottom]:top-1`,`data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2`,`data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2`,`data-[side=inline-start]:-inset-e-1 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-translate-y-1/2`,`data-[side=inline-end]:-inset-s-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-translate-y-1/2`)})]})})})}function $O({tone:e}){return(0,U.jsx)(`span`,{className:fg(`inline-block size-2 shrink-0 rounded-full`,pg[e]),"aria-hidden":!0})}function ek({label:e,hint:t,labelExtra:n,tone:r,mono:i,nowrap:a,children:o}){return(0,U.jsxs)(`div`,{className:fg(`flex justify-between gap-4 border-b border-border-muted py-2 last:border-b-0`,a?`items-center whitespace-nowrap`:`items-baseline`),children:[(0,U.jsx)(`dt`,{className:a?`shrink-0 text-xs text-foreground-muted`:`min-w-[5.5rem] flex-1 text-sm text-foreground-muted`,children:t||n?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,n,t?(0,U.jsxs)(XO,{children:[(0,U.jsx)(ZO,{delay:250,render:(0,U.jsx)(`button`,{type:`button`,"aria-label":t,title:t,className:`shrink-0 cursor-pointer text-foreground-muted transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none motion-reduce:transition-none`,children:(0,U.jsx)(EO,{})})}),(0,U.jsx)(QO,{className:`max-w-72`,children:(0,U.jsx)(`p`,{children:t})})]}):null]}):e}),(0,U.jsx)(`dd`,{className:fg(`text-right text-sm`,a?`shrink-0 whitespace-nowrap text-xs`:`min-w-0 max-w-[62%] break-words`,i?`font-mono text-xs text-foreground-strong`:`text-foreground`,r&&mg[r]),children:o})]})}var tk=`[&>div]:min-h-9`,nk=`[&>div]:min-h-12 [&>div]:py-0 [&>div]:items-center`;function rk({children:e,className:t}){return(0,U.jsx)(`dl`,{className:fg(`mt-1`,t),children:e})}function ik({tone:e,text:t,detail:n}){return(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)($O,{tone:e}),(0,U.jsx)(`span`,{children:t}),n?(0,U.jsx)(`span`,{className:`line-clamp-2 text-xs text-foreground-muted`,title:n,children:n}):null]})}var ak=`M4.3 12.55 L9.25 17.5 L19.7 6.5`,ok={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};async function sk(e){if(typeof e==`string`)return e;if(typeof e==`function`)return await e();let t=e.current;if(!t)throw Error("CopyButton: the `value` ref is not attached to an element");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??``}async function ck(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{if(!document.execCommand(`copy`))throw Error(`Copying to clipboard is not supported`)}finally{t.remove()}}function lk({value:e,timeout:t=2e3,label:n=`Copy`,copiedLabel:r=`Copied`,onCopy:i,onCopyError:a,icon:o,onClick:s,variant:c=`ghost`,size:l=`icon-sm`,className:u,children:d,...f}){let[p,m]=g.useState(!1),h=g.useRef(void 0);return g.useEffect(()=>()=>clearTimeout(h.current),[]),(0,U.jsxs)(Q,{"data-slot":`copy-button`,"data-copied":p||void 0,type:`button`,variant:c,size:l,"aria-label":p?r:n,onClick:async n=>{if(s?.(n),n.defaultPrevented)return;let r;try{r=await sk(e),await ck(r)}catch(e){a?.(e);return}i?.(r),m(!0),clearTimeout(h.current),h.current=setTimeout(()=>m(!1),t)},className:Z(`group/copy`,u),...f,children:[(0,U.jsxs)(`span`,{"data-icon":d==null?void 0:`start`,className:`grid place-items-center *:[grid-area:1/1]`,children:[(0,U.jsx)(`span`,{className:Z(`grid place-items-center transition-[opacity,scale] delay-150 duration-150 ease-out group-data-copied/copy:delay-0`,`group-data-copied/copy:scale-50 group-data-copied/copy:opacity-0`,`motion-reduce:transition-none`),children:o??(0,U.jsx)(`svg`,{...ok,children:(0,U.jsx)(`path`,{d:`M4.012 16.737c-.307-.175-.562-.427-.739-.732S3.001 15.353 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1M7 9.667c0-.707.281-1.386.781-1.886S8.96 7 9.667 7h8.666c.35 0 .697.069 1.021.203s.618.33.865.578.444.542.578.865A2.67 2.67 0 0 1 21 9.667v8.666a2.67 2.67 0 0 1-.781 1.886 2.67 2.67 0 0 1-1.886.781H9.667a2.67 2.67 0 0 1-1.021-.203c-.324-.134-.618-.331-.865-.578s-.444-.542-.578-.865S7 18.683 7 18.333V9.667z`})})}),(0,U.jsx)(`svg`,{...ok,children:(0,U.jsx)(`path`,{d:ak,pathLength:1,strokeDasharray:`1 2`,className:Z(`[stroke-dashoffset:1.02] group-data-copied/copy:[stroke-dashoffset:0]`,`transition-[stroke-dashoffset] duration-200 ease-in`,`group-data-copied/copy:delay-100 group-data-copied/copy:duration-350 group-data-copied/copy:ease-out`,`motion-reduce:transition-none`)})})]}),typeof d==`string`&&p?r:d,(0,U.jsx)(`span`,{role:`status`,className:`sr-only`,children:p?r:``})]})}function uk({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,className:e??`size-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.2`}),(0,U.jsx)(`path`,{d:`M8 4.8v4.4`}),(0,U.jsx)(`path`,{d:`M8 11.4h.01`})]})}var dk=`https://app.wnluo.com/api/sdk/feedback`,fk=`dsh-mobile`,pk=`plugin`,mk=`dsh-mobile-plugin`,hk=`diagnosis.txt`,gk=`dsh-mobile-plugin.feedback.deviceId`,_k=3e4,vk=new Map;function yk(){let e=globalThis.crypto;return e&&typeof e.randomUUID==`function`?e.randomUUID():`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`}function bk(){try{let e=localStorage.getItem(gk);if(e)return e;let t=yk();return localStorage.setItem(gk,t),t}catch{return yk()}}function xk(e){return vk.has(e)||vk.set(e,yk()),vk.get(e)}async function Sk(){try{return(await rO(`/api/relay/status`)).appVersion||``}catch{return``}}async function Ck(e){let t=e.version??await Sk(),n=xk(e.summary),r={product_slug:fk,source:pk,component_id:mk,component_version:t,device_source:`install`,files:{name:hk,type:`text/plain`},...e.context||{}},i=new FormData;for(let e of[`package_id`,`platform`,`version_name`,`build_number`,`model`,`system_version`,`channel`])i.append(e,``);i.append(`device_id`,bk()),i.append(`content`,e.summary),i.append(`product_slug`,fk),i.append(`source`,pk),i.append(`component_id`,mk),i.append(`component_version`,t),i.append(`submission_id`,n),i.append(`context`,JSON.stringify(r)),i.append(`files`,new Blob([e.detail],{type:`text/plain`}),hk);let a=new AbortController,o=window.setTimeout(()=>a.abort(),_k);try{let t=await fetch(dk,{method:`POST`,body:i,signal:a.signal}),r=null;try{r=await t.json()}catch{r=null}if(!t.ok)throw Error(r?.error||`HTTP ${t.status}`);let o=r?.data?.thread_key;if(!o)throw Error($(`panel.feedback.noKey`));return vk.delete(e.summary),{threadKey:o,submissionId:n}}catch(e){throw e instanceof Error&&e.name===`AbortError`?Error($(`panel.feedback.timeout`)):e}finally{window.clearTimeout(o)}}function wk({issue:e}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(``),l=uO();async function u(){if(!r){i(!0),o(``),c(``);try{let t=await Ck({summary:`${e.title}\n${e.detail}`,detail:`${e.title}\n${e.detail}`,context:{title:e.title,detail:e.detail}});o(t.threadKey)}catch(e){c($(`panel.feedback.failed`,{error:e.message||String(e)}))}finally{i(!1)}}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":e.title,title:e.title,className:`shrink-0 cursor-pointer rounded text-error transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,onClick:()=>n(!0),children:(0,U.jsx)(uk,{})}),(0,U.jsx)(hD,{open:t,onOpenChange:n,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:e.title})}),(0,U.jsxs)(bD,{children:[(0,U.jsx)(`p`,{className:`whitespace-pre-wrap break-all text-sm leading-6 text-foreground-muted`,children:e.detail}),(0,U.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-foreground-muted`,children:$(`panel.feedback.consent`)}),s?(0,U.jsx)(`p`,{className:`mt-2 text-sm text-error`,children:s}):null,a?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`p`,{className:`text-xs leading-5 text-foreground-muted`,children:$(`panel.feedback.receipt`,{key:a})}),(0,U.jsx)(lk,{value:a,label:$(`panel.feedback.copyKey`),copiedLabel:$(`panel.feedback.keyCopied`),size:`sm`,variant:`outline`,onCopyError:()=>l(`error`,$(`panel.feedback.keyCopyFailed`)),children:$(`panel.feedback.copyKey`)})]}):null]}),(0,U.jsxs)(xD,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void u(),children:$(r?`panel.feedback.sending`:`panel.feedback.sendThis`)}),(0,U.jsx)(lk,{value:e.detail,label:$(`panel.common.copy`),copiedLabel:$(`panel.links.sponsorCopied`),size:`sm`,variant:`outline`,onCopyError:()=>l(`error`,$(`panel.onboarding.copiedFailed`)),children:$(`panel.common.copy`)}),(0,U.jsx)(Q,{variant:`ghost`,onClick:()=>n(!1),children:$(`panel.common.close`)})]})]})})]})}function Tk(e){return e.available?e.enabled?e.error?`panel.tailcat.error`:e.ready?`panel.tailcat.ready`:`panel.tailcat.starting`:`panel.tailcat.disabled`:`panel.tailcat.unavailableShort`}function Ek(e){return e.available?e.enabled?e.path===`direct`&&e.active?`panel.p2p.open`:e.error?`panel.p2p.error`:e.path===`failed`?`panel.p2p.blocked`:e.ready?e.path===`waiting`?`panel.p2p.waiting`:`panel.p2p.punching`:e.started?`panel.p2p.punching`:`panel.p2p.waiting`:`panel.p2p.disabled`:`panel.p2p.unavailableShort`}function Dk(e){return!e.available||!e.enabled?`off`:e.path===`direct`&&e.active?`ok`:e.error||e.path===`failed`?`error`:`warn`}function Ok(e){return!e.available||!e.enabled?`off`:e.error?`error`:e.ready?`ok`:`warn`}function kk({status:e,addressBook:t,busy:n,onStopFrp:r,onManageTailcat:i,onManageP2P:a,restartError:o}){let s=e.tunnel,c=e.tailcat??null,l=e.p2p??null,u=(t?.manualTcp??``).trim(),d=e.frp??null,f=d?.enabled===!0||d?.enabled===void 0&&d?.configPresent===!0,p=d?.configPresent===!0||f||!!(d?.running||d?.starting||d?.retrying),m,h;return d?.running?(m=`ok`,h=$(`panel.connection.tcpRunning`)):d?.starting||d?.retrying?(m=`warn`,h=$(`panel.frp.retrying`)):d?.error?(m=`error`,h=$(`panel.connection.tcpFailed`)):f?(m=`warn`,h=$(`panel.connection.tcpEnabledNotRunning`)):p?(m=`off`,h=$(`panel.connection.tcpSet`)):u?(m=`ok`,h=$(`panel.connection.tcpManual`)):(m=`off`,h=$(`panel.connection.tcpOff`)),(0,U.jsxs)(cD,{frame:`solid`,children:[(0,U.jsxs)(rk,{children:[(0,U.jsxs)(ek,{label:$(`panel.connection.platform`),children:[e.platform,` `,e.osVersion,` · `,e.arch]}),(0,U.jsx)(ek,{label:$(`panel.connection.tunnel`),tone:gg(s.state),labelExtra:s.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.tunnel`),detail:s.error}}):void 0,children:(0,U.jsx)(ik,{tone:gg(s.state),text:_g(s.state)})}),c?(0,U.jsx)(ek,{label:$(`panel.tailcat.title`),tone:Ok(c),labelExtra:!c.available||c.error?(0,U.jsx)(wk,{issue:{title:$(`panel.tailcat.title`),detail:c.available?c.error??``:$(`panel.tailcat.unavailable`)}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:Ok(c),text:$(Tk(c))}),(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:i,children:$(`panel.tailcat.manage`)})]})}):null,l?(0,U.jsx)(ek,{label:$(`panel.p2p.title`),tone:Dk(l),labelExtra:!l.available||l.error?(0,U.jsx)(wk,{issue:{title:$(`panel.p2p.title`),detail:l.available?l.error??``:$(`panel.p2p.unavailable`)}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:Dk(l),text:$(Ek(l))}),(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:a,children:$(`panel.p2p.manage`)})]})}):null,(0,U.jsx)(ek,{label:$(`panel.connection.tcp`),tone:m,labelExtra:d?.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.tcp`),detail:d.error}}):void 0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2`,children:[(0,U.jsx)(ik,{tone:m,text:h}),d&&(d.enabled||d.running||d.starting||d.retrying||d.enabled===void 0&&d.configPresent)?(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,disabled:n!==``,onClick:r,children:$(`panel.frp.stop`)}):null]})}),(0,U.jsx)(ek,{label:$(`panel.connection.sidecar`),labelExtra:o?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.sidecar`),detail:o}}):void 0,children:(0,U.jsx)(ik,{tone:o||e.sidecar.state!==`healthy`?`error`:`ok`,text:o?$(`panel.pairing.sidecarRestartFailed`):bg(e.sidecar.state),...!o&&e.sidecar.restarts>0?{detail:$(`panel.connection.sidecarRestarts`,{count:e.sidecar.restarts})}:{}})}),(0,U.jsx)(ek,{label:$(`panel.connection.mirror`),labelExtra:e.mirror.error?(0,U.jsx)(wk,{issue:{title:$(`panel.connection.mirror`),detail:e.mirror.error}}):void 0,children:(0,U.jsx)(ik,{tone:e.mirror.ok?`ok`:e.mirror.error?`error`:`warn`,text:e.mirror.ok?$(`panel.connection.mirrorOk`):$(`panel.connection.mirrorOff`),detail:hg(e.mirror.pushedAt)})})]}),e.lan.recovery?.state===`awaiting-device`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.lanWaiting`)})})}):e.lan.recovery?.state===`verified`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),children:(0,U.jsx)(ik,{tone:`ok`,text:$(`panel.connection.lanVerified`)})})}):null,e.lan.enabled&&(e.lan.error||e.lan.discovery?.error)?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.lan`),labelExtra:(0,U.jsx)(wk,{issue:{title:$(`panel.connection.lan`),detail:(e.lan.error||e.lan.discovery?.error)??``}}),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.lan.error`)})})}):null,(0,U.jsx)(Ak,{status:e})]})}function Ak({status:e}){let t=e.tunnel.admissionHint;return t?t===`register-secret`?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.relayNeedsSecret`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.relayNeedsSecret`),detail:$(`panel.connection.relayNeedsSecretBody`)})})}):(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.connection.relayRejected`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.connection.relayRejected`),detail:$(`panel.connection.relayRejectedBody`)})})}):null}var jk=`dsh-mobile-plugin:panel-action`;function Mk(){return typeof window<`u`&&window.parent!==window}function Nk(e){Mk()&&window.parent.postMessage({type:jk,action:e},`*`)}function Pk(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M13 5H5.8A1.8 1.8 0 0 0 4 6.8v11.4A1.8 1.8 0 0 0 5.8 20h11.4a1.8 1.8 0 0 0 1.8-1.8V11`}),(0,U.jsx)(`path`,{d:`M14 4h6v6`}),(0,U.jsx)(`path`,{d:`M20 4l-8.5 8.5`})]})}function Fk(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M6 6l12 12`}),(0,U.jsx)(`path`,{d:`M18 6L6 18`})]})}function Ik(){return Mk()?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.console.openBrowser`),title:$(`panel.console.openBrowser`),onClick:()=>Nk(`open-browser`),children:(0,U.jsx)(Pk,{})}),(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.common.close`),title:$(`panel.common.close`),onClick:()=>Nk(`close`),children:(0,U.jsx)(Fk,{})})]}):null}function Lk(e){return Lf(`alert-dialog`,e)}var Rk=class extends Pp{};function zk(){return new Rk}var Bk=Object.assign(function(e){return(0,U.jsx)(Lk,{...e})},{createHandle:zk});function Vk({className:e,children:t,backdrop:n=!0,frame:r=!0,backdropProps:i,viewportProps:a,...o}){let{portal:s,popup:c}=zp(o),l=i?.forceRender===!0,u=r&&n;return(0,U.jsxs)(gf,{...s,children:[n&&(0,U.jsx)(dD,{"data-slot":`alert-dialog-backdrop`,...i,className:Z(`fixed inset-0 z-50 bg-black/30 backdrop-blur-sm supports-[-webkit-touch-callout:none]:absolute`,`motion-safe:transition-opacity motion-safe:duration-250 motion-safe:ease-out`,`data-ending-style:motion-safe:opacity-0 data-starting-style:motion-safe:opacity-0`,i?.className)}),(0,U.jsx)(Qf,{"data-slot":`alert-dialog-viewport`,...a,className:Z(`fixed inset-0 z-50 flex items-center justify-center overflow-hidden p-4`,a?.className),children:(0,U.jsx)(pD,{"data-slot":`alert-dialog-popup`,...u?{"data-frame":``}:{},className:Z(`group/alert-dialog-popup relative flex max-h-full min-h-0 w-100 max-w-full flex-col`,`rounded-2xl border`,u?Z(`border-white/15 bg-white/10 p-1.5 backdrop-blur-sm`,!l&&`data-nested:border-border-overlay data-nested:bg-background data-nested:p-0 data-nested:shadow-2xl data-nested:backdrop-blur-none`):`bg-background border-border-overlay`,!u&&`shadow-2xl`,`isolate transform-gpu outline-none`,`motion-safe:transition-[opacity,scale] motion-safe:duration-250 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]`,`data-starting-style:motion-safe:scale-95 data-starting-style:motion-safe:opacity-0`,`data-ending-style:motion-safe:scale-95 data-ending-style:motion-safe:opacity-0 data-ending-style:motion-safe:duration-100 data-ending-style:motion-safe:ease-out`,e),...c,children:(0,U.jsx)(`div`,{"data-slot":`alert-dialog-content`,className:Z(`flex min-h-0 flex-col overflow-hidden not-has-[>[data-slot=alert-dialog-footer]]:pb-6 not-has-[>[data-slot=alert-dialog-header]]:pt-6 [&>[data-slot=alert-dialog-header]+[data-slot=alert-dialog-footer]]:pt-0`,u&&Z(`bg-background rounded-[calc(var(--radius-2xl)*5/6)]`,!l&&`group-data-nested/alert-dialog-popup:rounded-none group-data-nested/alert-dialog-popup:bg-transparent`)),children:t})})})]})}function Hk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:Z(`flex shrink-0 flex-col gap-2 p-6`,e),...t})}function Uk({className:e,...t}){return(0,U.jsx)(Uf,{"data-slot":`alert-dialog-title`,className:Z(`text-foreground-intense text-xl font-semibold`,e),...t})}function Wk({className:e,...t}){return(0,U.jsx)(Nd,{"data-slot":`alert-dialog-description`,className:Z(`text-foreground-muted text-sm`,e),...t})}function Gk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:Z(`min-h-0 flex-1 px-6`,e),...t})}function Kk({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:Z(`flex flex-col-reverse gap-2 p-6 sm:flex-row sm:justify-end`,e),...t})}function qk(e,t){if(!e)return``;let n=Math.max(0,t-e);if(n<6e4)return $(`panel.devices.justNow`);let r=Math.floor(n/6e4);if(r<60)return $(`panel.devices.minutesAgo`,{count:r});let i=Math.floor(r/60);return i<24?$(`panel.devices.hoursAgo`,{count:i}):$(`panel.devices.daysAgo`,{count:Math.floor(i/24)})}function Jk(e,t){return e?Yk(e,t)?$(`panel.devices.online`):qk(e,t):$(`panel.devices.noRecord`)}function Yk(e,t){return e>0&&t-e<=3e5}function Xk(e){return{ios:`iOS`,android:`Android`,linux:`Linux`,darwin:`macOS`,win32:`Windows`}[e]??(e||$(`panel.devices.unknownPlatform`))}function Zk(e){return $(e===`relay`?`panel.devices.channelRelay`:e===`lan`?`panel.devices.channelLan`:e===`tunnel`?`panel.devices.channelTunnel`:e===`p2p`?`panel.devices.channelP2p`:e===`direct`?`panel.devices.channelDirect`:e===`ipv6`?`panel.devices.channelIpv6`:e===`tcp`?`panel.devices.channelTcp`:e===`mux`?`panel.devices.channelMux`:`panel.devices.channelUnknown`)}function Qk(e){let t=e?.model||e?.name||$(`panel.devices.unknown`);return e?.suffix?`${t} · ${e.suffix}`:t}function $k(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M9 15l6-6`}),(0,U.jsx)(`path`,{d:`M7 17l-1 1a3 3 0 0 1-4-4l2-2a3 3 0 0 1 4 0`}),(0,U.jsx)(`path`,{d:`M17 7l1-1a3 3 0 0 1 4 4l-2 2a3 3 0 0 1-4 0`})]})}function eA({busy:e,fill:t=!1}){let n=uO(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(!1),l=(0,g.useRef)(!1),u=(0,g.useRef)(null),[d,f]=(0,g.useState)(!1),[p,m]=(0,g.useState)(null),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(!1),S=(0,g.useRef)(0),C=(0,g.useCallback)(async()=>{let e=++S.current;_(!1);try{let t=await rO(`/api/relay/devices?history=1`);e===S.current&&m(t)}catch{e===S.current&&_(!0)}},[]),w=(0,g.useCallback)(async()=>{try{let e=await rO(`/api/relay/devices`),t=e.revokedCount??0,n=u.current!==null&&u.current!==t;u.current=t,i(e),n&&l.current&&C()}catch{}},[C]);(0,g.useEffect)(()=>{let e=()=>{c_()&&w()};e();let t=window.setInterval(e,3e3);return document.addEventListener(`visibilitychange`,e),()=>{window.clearInterval(t),document.removeEventListener(`visibilitychange`,e)}},[w]);let T=r?.devices??[],E=r?.serverNow??0,D=r?.revokedCount??0;(0,g.useEffect)(()=>{l.current=d},[d]),(0,g.useEffect)(()=>{d&&C()},[d,C]);function O(e){let t=qk(e.revokedAt||e.expiresAt,E)||`—`;return $(e.kind===`revoked`?`panel.devices.historyRevoked`:`panel.devices.historyExpired`,{time:t})}let k=(p?.devices??[]).filter(e=>e.kind===`revoked`||e.kind===`expired`),A=h||(p?.devices.length??0)>0&&k.length===0;async function j(e){c(!0);try{let t=await iO(`/api/relay/devices/revoke`,{deviceId:e.deviceId});o(null),await w(),d&&C(),n(`soft`,$(t.closed>0?`panel.devices.unbindDoneClosed`:`panel.devices.unbindDone`,{name:Qk(e),count:t.revoked,closed:t.closed}))}catch(e){n(`error`,$(`panel.devices.unbindFailed`,{message:cO(e)}))}finally{c(!1)}}async function M(){x(!0);try{let e=await iO(`/api/relay/devices/history/clear`,{});y(!1),await w(),d&&C(),n(`soft`,$(`panel.devices.historyClearDone`,{count:e.cleared}))}catch(e){n(`error`,$(`panel.devices.historyClearFailed`,{message:cO(e)}))}finally{x(!1)}}return T.length===0&&D===0?null:(0,U.jsxs)(cD,{frame:`solid`,className:t?`flex h-full min-h-0 flex-col`:void 0,children:[(0,U.jsxs)(`div`,{className:t?`hvscroll mt-1 min-h-0 flex-1`:`hscroll mt-1`,children:[(0,U.jsx)(`div`,{className:`min-w-max`,children:T.map(e=>{let t=Yk(e.lastSeenAt,E);return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border-muted py-2 whitespace-nowrap last:border-b-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground-strong`,children:Qk(e)}),(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 whitespace-nowrap text-xs text-foreground-muted`,children:[(0,U.jsx)(`span`,{children:Xk(e.platform)}),(0,U.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,U.jsx)(`span`,{children:Zk(e.lastChannel)}),(0,U.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?(0,U.jsx)($O,{tone:`ok`}):null,(0,U.jsx)(`span`,{children:Jk(e.lastSeenAt,E)})]})]}),(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:(0,U.jsx)(Q,{variant:`ghost`,size:`icon-md`,"aria-label":$(`panel.devices.unbind`),title:$(`panel.devices.unbind`),onClick:()=>o(e),children:(0,U.jsx)($k,{})})})]},e.deviceId)})}),(0,U.jsxs)(`div`,{className:`mt-1 border-t border-border-muted pt-2`,children:[(0,U.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex min-w-0 cursor-pointer items-center gap-2 text-xs text-foreground-muted focus-visible:outline-none`,onClick:()=>f(e=>!e),children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[$(`panel.devices.historyTitle`),(0,U.jsx)(nD,{variant:`secondary`,size:`xs`,children:$(`panel.devices.historyCount`,{count:D})})]}),(0,U.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 shrink-0 transition-transform ${d?`rotate-90`:``}`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`m4.5 2.5 3.5 3.5-3.5 3.5`})})]}),D>0?(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,className:`shrink-0`,disabled:b||e!==``,onClick:()=>y(!0),children:$(`panel.devices.historyClear`)}):null]}),d?(0,U.jsxs)(`div`,{className:`mt-2`,children:[k.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,U.jsx)(`span`,{className:`text-xs text-foreground`,children:Qk(e)}),(0,U.jsxs)(`span`,{className:`text-xs text-foreground-muted`,children:[Xk(e.platform),e.osVersion?` ${e.osVersion}`:``,e.appVersion?$(`panel.devices.appVersion`,{version:e.appVersion}):``]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-muted`,children:[(0,U.jsx)(`span`,{children:$(`panel.devices.historyBoundAt`,{time:qk(e.boundAt,E)||`—`})}),(0,U.jsx)(`span`,{children:$(`panel.devices.historyLastSeen`,{time:e.lastSeenAt?qk(e.lastSeenAt,E):$(`panel.devices.noRecord`)})}),(0,U.jsx)(`span`,{children:O(e)})]})]},e.deviceId)),A?(0,U.jsx)(`p`,{className:`py-2 text-xs text-foreground-muted`,children:$(`panel.devices.historyFailed`)}):null,(0,U.jsx)(`p`,{className:`py-2 text-xs text-foreground-muted`,children:$(`panel.devices.historyRetention`,{days:30})})]}):null]})]}),(0,U.jsx)(Bk,{open:a!==null,onOpenChange:e=>{!e&&!s&&o(null)},children:(0,U.jsxs)(Vk,{children:[(0,U.jsx)(Hk,{children:(0,U.jsx)(Uk,{children:$(`panel.devices.unbindTitle`)})}),(0,U.jsxs)(Gk,{className:`flex flex-col gap-2 text-sm`,children:[(0,U.jsx)(Wk,{children:$(`panel.devices.unbindConfirm`,{name:Qk(a)})}),(0,U.jsx)(`p`,{className:`text-foreground-muted`,children:$(a?.legacy?`panel.devices.effectLegacy`:`panel.devices.effectIdentity`)})]}),(0,U.jsxs)(Kk,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,disabled:s,onClick:()=>o(null),children:$(`panel.devices.cancel`)}),(0,U.jsx)(Q,{variant:`destructive`,disabled:s,onClick:()=>{a&&j(a)},children:s?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(BE,{}),$(`panel.devices.unbinding`)]}):$(`panel.devices.unbind`)})]})]})}),(0,U.jsx)(Bk,{open:v,onOpenChange:e=>{!e&&!b&&y(!1)},children:(0,U.jsxs)(Vk,{children:[(0,U.jsx)(Hk,{children:(0,U.jsx)(Uk,{children:$(`panel.devices.historyClearTitle`)})}),(0,U.jsxs)(Gk,{className:`flex flex-col gap-2 text-sm`,children:[(0,U.jsx)(Wk,{children:$(`panel.devices.historyClearConfirm`,{count:D})}),(0,U.jsx)(`p`,{className:`text-foreground-muted`,children:$(`panel.devices.historyClearHint`)})]}),(0,U.jsxs)(Kk,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(Q,{variant:`outline`,disabled:b,onClick:()=>y(!1),children:$(`panel.devices.cancel`)}),(0,U.jsx)(Q,{variant:`destructive`,disabled:b,onClick:()=>void M(),children:b?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(BE,{}),$(`panel.devices.historyClearing`)]}):$(`panel.devices.historyClear`)})]})]})})]})}var tA=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAnP0lEQVR42u19eZhV1ZXvWnuf6d5bd6gJqKIoJkVBQAw4hGesoK2i8nz6UJN0px/a2qaN2PnsaMxLYoja3Rk6xjh0OmWi8TMOL5ikE4dEjYYPRyIQoNRShmIogRqo4Y517z3D3u8P9tHN4Zx7q6DAAu/+vvPVdOsOZ631W/NaAJVTOZVTOZVTOZVTOZVTOZVTOZVTOZVTOZXziThY+fwHHP5JuwH0E/Z5ibiwBLHlx1TOcSLlBzA6IgIhBFpbW9WWlhajpaXFaG1tVSmlgIh+DIEVFXBsfjYCAA4AAOecNExpOCmfzM8qFovTHcdp4JxHOecEABxCiEMISRFCujRN2xWLxbace+65HY8++miBc+4yAj/e1AQex1DPEBHmzJkzbseOHRfl8/nPOo7TzDnXBBEtALDF5XiISxCxqCjKXsMw1tfU1LzS2dm5U2IEVmGAsW3XOAsXLoxu2LDh/xSLxUsZY7UAkBeXS2wmfXUEI8i/Y+K5dEppTtO0NVOnTv1te3t7t3TfeIUBxpjkIyKrrq4+I51Of9O27akAkAWAgkQsl+AysV0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KMo2H8sfAvx+P2QwRf9/IRaL3Sz0/vEu/QegQCwW+xoishLwD2W6pYKYwjUEQ4SQXR0dHfvKeRtkhJMyIRwOPy+2aZVKZQb5+yYAhAkhqWg0ujyZTLYdp0ZfybV0yWTydV3X7wpYSwcBm7+Ggw4uDap0Xf+9CAmT0VIBDADIwMDAelVVn4H9mymKJULAMjO4Wb8Epcr7TU1N16ZSqY3HsdFXTpCoaZp3GIbxC9i/iYQFrMwr1QHtpxIsAKhVFGXdFVdc8Wv4qEJq9AJBnHNoPKHxjVwydyHnvFnEA5yABI/rKoYQ0dY07ZeXX37ZN9988819nyDYD1pIRDjnv9M0rUrsBlB9egRLLaxkPsupagkhexoaGq559dVXe0eSFh7x+JgpU6ZMVhTlWaEO0rB/qOEu+GhKxg4A6EDEtaqq/jgej8/zTMX4pB+36Bai0egSQsg6icCWiLJmxb1NSaN2+uDAiaHdYoZyr6IoKydMmDB5JPcYD2ftGyEEwuHwZYVCYQljbAYAVHHOHURMEUK2a5q2NhKJrOrv69/GOIORzLH/BB0KAM6KFSuUH/zgB5dYlnUpY2wOANSIvkiOiFzsVjzgElvEBlVV3aTr+rPZbPZPomB22OiKh7v7T25/Xrt2bSSfz7N58+YVHn300YKnzQo+yZA/HCaQi20XLFgQy2azB/jxlFLuGebAN27cmCaEMOle45EuCg2yIxwfBsGjVJN/vKgEEnAvD5UGR4UBYARt2ZVzZGhTudeVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVUzmVs//8fzjsXcePS1GRAAAAAElFTkSuQmCC`,nA=`https://github.com/WNLUO/dsh-mobile-server`,rA=`https://github.com/WNLUO/dsh-mobile-plugin`,iA=[{platform:`android`,channels:[{nameKey:`panel.links.distPlatform`,hintKey:`panel.links.domesticRecommended`,url:`https://app.wnluo.com/api/public/apps/14/download-latest`},{name:`GitHub`,hintKey:`panel.links.overseasRecommended`,url:`https://github.com/WNLUO/dsh-mobile-plugin/releases/latest/download/ai-hub-android.apk`}]},{platform:`apple`,channels:[{name:`App Store`,hintKey:`panel.links.appStore`,url:`https://apps.apple.com/app/id6821681438`},{name:`TestFlight`,hintKey:`panel.links.testFlight`,url:`https://testflight.apple.com/join/4fn5PCMD`}]}],aA=[{nameKey:`panel.links.publicRelay`,url:`https://ai-hub-de-1.wnluo.com`}];aA[0].url;function oA(e){let t=e=>e.trim().replace(/\/+$/,``),n=t(e);return!!n&&aA.some(e=>t(e.url)===n)}function sA(e){return e.name===`GitHub`?(0,U.jsx)(mA,{}):e.name===`App Store`||e.name===`TestFlight`?(0,U.jsx)(pA,{}):(0,U.jsx)(gA,{})}function cA(e){return e===`android`?(0,U.jsx)(fA,{}):(0,U.jsx)(pA,{})}function lA({channel:e}){return(0,U.jsxs)(`a`,{className:`flex items-center gap-3 rounded-lg border border-border-muted px-3 py-2.5 transition-colors hover:bg-background-muted`,href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:[(0,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-background-muted text-foreground`,children:sA(e)}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`text-sm text-foreground-intense`,children:e.name??(e.nameKey?$(e.nameKey):``)}),(0,U.jsx)(`span`,{className:`truncate text-xs text-foreground-muted`,children:$(e.hintKey)})]})]})}function uA(){return(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2`,children:iA.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pb-0.5 text-xs text-foreground-muted`,children:[cA(e.platform),(0,U.jsx)(`span`,{children:$(e.platform===`android`?`panel.links.android`:`panel.links.apple`)})]}),e.channels.map(e=>(0,U.jsx)(lA,{channel:e},e.url))]},e.platform))})}function dA({size:e=`md`,variant:t=`outline`,className:n}){let[r,i]=(0,g.useState)(!1),a=(0,g.useRef)(null);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:t,size:e,className:n,onClick:()=>i(!0),children:[(0,U.jsx)(hA,{}),$(`panel.download.open`)]}),(0,U.jsx)(hD,{open:r,onOpenChange:i,children:(0,U.jsxs)(gD,{className:`max-w-xl`,closeLabel:$(`panel.common.close`),initialFocus:a,children:[(0,U.jsx)(_D,{children:(0,U.jsxs)(vD,{className:`flex flex-wrap items-center gap-2.5 pr-8`,children:[(0,U.jsx)(`img`,{src:tA,alt:``,className:`size-8 rounded-lg bg-white p-0.5`}),(0,U.jsx)(`span`,{className:`min-w-0 break-words`,children:$(`panel.download.title`)})]})}),(0,U.jsx)(`div`,{ref:a,tabIndex:-1,className:`outline-none`,children:(0,U.jsx)(bD,{children:(0,U.jsx)(uA,{})})})]})})]})}function fA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-3.5 stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M17.523 15.3414c-.5511 0-.9993-.4486-.9993-.9997s.4483-.9993.9993-.9993c.5511 0 .9993.4483.9993.9993.0001.5511-.4482.9997-.9993.9997m-11.046 0c-.5511 0-.9993-.4486-.9993-.9997s.4482-.9993.9993-.9993c.551 0 .9993.4483.9993.9993 0 .5511-.4483.9997-.9993.9997m11.4045-6.02 1.9973-3.4592a.416.416 0 0 0-.1521-.5676.416.416 0 0 0-.5676.1521l-2.0223 3.503C15.5902 8.2439 13.8533 7.8508 12 7.8508s-3.5902.3931-5.1367 1.0989L4.841 5.4467a.4161.4161 0 0 0-.5677-.1521.4157.4157 0 0 0-.1521.5676l1.9973 3.4592C2.6889 11.1867.3432 14.6589 0 18.761h24c-.3435-4.1021-2.6892-7.5743-6.1185-9.4396`})})}function pA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-4 stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701`})})}function mA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px] stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function hA(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px]`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.85`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`2.5`}),(0,U.jsx)(`path`,{d:`M12 6v9m-3-3 3 3 3-3M10 19h4`})]})}function gA(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px]`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.85`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M12 4v10`}),(0,U.jsx)(`path`,{d:`m8 10.5 4 4 4-4`}),(0,U.jsx)(`path`,{d:`M4 18.5h16`})]})}var _A=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxgAAAMYAQAAAABgBnzJAAAGdElEQVR42u2dXY7yOBBFbyY8IoWlsICWiPQtYFY8UtCwAJYCEo8deR4gxPFPOgE62MzJQ0Q3kNOmnL5UuVxVGP368ZdgwIABAwYMGDBg5MjYF86xevhywUu987M6F7V0LupidS5qSVKx6k/9s847mFcwYMCA8cMRk4rKdCfdIhHGPvXPDt+BPV7CKI11NE9dMHCpN+t5sRqc7N91om4/y30OAwYMGE/r+VDDPXl3XoI9XsnYP+uae076KoXPytHu3it3PPXBE8wrGDBgwHiFng+9ck/lrSewB4yJDEesPVHvg+7E22HAgAHjGT3vDkesTUzjibfDmLx+7i+Y96LuRSTQcxgwYMB43j8PL5iHHXL0/KX22JmXXdO9VIL+uZct10k+9zkMGDBg/Ip/7mfLSQZ7vNoebfGyCwYulUJ++8wT8woGDBgwns5vn3XCHk8exf+hrsEgKW7kR/QcBgwYMNAPGG9nOOvivkQ7YXUvq90X+sHedewBAwYMGOg5jIUYA+22ve1IWD3sswerzWAPGDBgwEDPYSzpnw+S1x1h9orK+JF3L+iOfw4DBgwY6DmMBfU8ugXNqejqFIQLP3I0HnvAgAEDBnoOYyk99/ehhfamOYF4T8/xz2HAgAEDPYeh966fe3vNf6jjai+Ye+lxVgYd9oABAwYM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vIdR9oUDkhmHHzj3MuOcNDr0HAYMGDD0RJ2iynhlYO1CsE5d2OgFsMcDDNuzDrjX85z0VVqflVMfLuKLRxLgyG+HAQMGjAf1/C7bVbCmu1/gVQo0dMEecxmlU5fv4WNnvpPTc8cDd75xTCg5072DeQUDBgwYs/zzcAc180M/Fuu32OMBe9yWL+Z1mh8ebZHeZ+WsqQ889fAietzLZ17BgAEDxkQ9r0zEU/c7uBjto98KsMfv9mmIueYpflahlPWo9+5vPR/E5ZlXMGDAgDFHz6ON1/y+qpFeq9gDhrzaMeOL46GFdfafw4ABA8ZD/mCnyaOL46GFdTeXDns8YI+d+fDPypHtaS8euPDMKxgwYMCYE991g+4TX1yh54/bI7bynf9nFaod44Tap1abYV7BgAEDxvx4eyjUHorBB+Py2EPU94EBAwYMGDBgwIDx1PEfwPfvNJna2O0AAAAASUVORK5CYII=`,vA=()=>$(`panel.links.wechatQrAlt`);function yA(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z`})})}function bA({compact:e=!1}={}){let[t,n]=(0,g.useState)(!1),r=xg();return r!==`zh-Hans`&&r!==`zh-Hant`?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:`ghost`,size:e?`sm`:`lg`,className:`pointer-events-auto`,onClick:()=>n(!0),children:[(0,U.jsx)(yA,{}),$(`panel.links.joinGroup`)]}),(0,U.jsx)(hD,{open:t,onOpenChange:n,children:(0,U.jsxs)(gD,{className:`max-w-sm`,children:[(0,U.jsx)(vD,{className:`sr-only`,children:$(`panel.links.joinGroup`)}),(0,U.jsx)(bD,{className:`flex justify-center`,children:(0,U.jsx)(`img`,{src:_A,alt:vA(),className:`w-full rounded-md`})})]})})]})}var xA=Uu(``,{variants:{size:{sm:`h-6 gap-0.75 rounded-xs px-2 text-xs has-data-[icon=end]:pe-1.5 has-data-[icon=start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,md:`h-8 gap-1 rounded-sm px-3 text-sm has-data-[icon=end]:pe-2 has-data-[icon=start]:ps-2 [&_svg:not([class*='size-'])]:size-4`,lg:`h-10 gap-1.25 rounded-md px-3.5 text-base has-data-[icon=end]:pe-2.5 has-data-[icon=start]:ps-2.5 [&_svg:not([class*='size-'])]:size-4.5`}},defaultVariants:{size:`md`}}),SA=g.createContext(null),CA={opacity:0,scale:.85,filter:`blur(8px)`},wA={opacity:0},TA={duration:.28,ease:[.4,0,.2,1]},EA={duration:0},DA={sm:`size-3`,md:`size-3.5`,lg:`size-4`};function OA({className:e,variant:t,size:n,render:r,dismissible:i=!1,open:a,onOpenChange:o,onDismiss:s,closeLabel:c=`Dismiss`,children:l,onClick:u,...d}){let f=g.useContext(SA),p=t??f?.variant??`soft`,m=n??f?.size??`md`,h=_h(),[_,v]=g.useState(!0),y=a!==void 0,b=y?a:_,x=g.useCallback(()=>{y||v(!1),o?.(!1)},[y,o]);g.useEffect(()=>{if(f&&i)return f.register(x)},[f,i,x]);let S=e=>{u?.(e),!e.defaultPrevented&&i&&x()},C=i?(0,U.jsxs)(U.Fragment,{children:[l,(0,U.jsx)(kA,{size:m}),(0,U.jsx)(`span`,{className:`sr-only`,children:c})]}):l,w=$E({defaultTagName:`button`,render:r,state:{variant:p,size:m,dismissible:i},props:Or({"data-slot":`chip`,"data-dismissible":i||void 0,type:r?void 0:`button`,...Bu(d.disabled),className:Z(Gu({variant:p}),xA({size:m}),i&&`group/chip`,e),onClick:S,children:C},d)});return i?(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)(Ow,{initial:!1,onExitComplete:()=>s?.(),children:b&&(0,U.jsx)(yE.span,{initial:!1,exit:h?wA:CA,transition:h?EA:TA,className:`inline-flex align-middle`,children:w},`chip`)})}):w}function kA({size:e}){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`chip-close-icon`,"data-icon":`end`,className:Z(DA[e],`opacity-60 transition-opacity duration-200 group-hover/chip:opacity-100 motion-reduce:transition-none`),children:(0,U.jsx)(`path`,{d:`M11.523 3.522c.264-.264.691-.264.955 0s.264.691 0 .955L8.955 8l3.522 3.522c.264.264.264.691 0 .955s-.691.264-.955 0L8 8.955l-3.522 3.522c-.264.264-.691.264-.955 0s-.264-.691 0-.955L7.045 8 3.522 4.478c-.264-.264-.264-.691 0-.955s.691-.264.955 0L8 7.045l3.523-3.522z`})})}var AA=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAewAAAHsAQAAAAA4UaPNAAACeUlEQVR42u2dQW7DMAwEhX5A//+lfsA2sU0umRg9BChKYQwfDNlzEVbKkqKUYZ9ca4CDg4OD/398+DXt5360zOvtcT+vn/flY1tf46MLHPzv8REKfz48Wi6dn89P8R/PPihOCs2Dt9V8muTLW/8JuL6Jj9E8eH/Nx7O/mmJ1DM2Db6d5fbVOP+PennkefE8/b5ba1/CxUD5G8+BdNZ/zNr/c5G3A+2v+Lo2pI8In//wNPQ/eVvNXfHpI/TDz48pPapY+t9Pz4D01v8ZrWsYv179nMmWA0PPgjf18Cl2XCNvD25LMRPPgnb3N8MxkdjWh/7e/AmgevLXmtfYgx7AlOU8MC76Bt0lpmVxjE2r38jO392gevHPextM1teQml1aqsUfz4F3neamoOa/s2+9TPfQ8eGNv46l4jVvVvetbvA14b2+T0+9j1PWpVGY5IquD5sFb5200/a55mzD8MyV20Dx4b2/jlqbYezH2Ec/ibcC3mOfTDpFQdQ5azTS9g+bBW8ewVerTSngbQ2Dh58H7x7BZzyr+aJl5xQrNgzf387EaNWtCPlpyaSWaB288z4uko7Ty7dE3Q2vp6XnwtjFsOehDqmsiq2MS4VJ7AN7a20yTsFTqykYsxeoQkAVZeh68q7fR/VBpJ+xMu6VeBgg9D941hq0HGljdA6uFB/EZmgdv6+ff7H7Nx4BouhLNg+8wz4eMo/G25Ib6efANYtibauF0XqVZqb1E8+B9Ne8K1xTNq8iT1UHz4FtoPkSuZcOl8JL6efC95nldgS2nfNQt4WgefAM/b/Us4pHrE/IJCfQ8+C55m5XWqkpUy5oUeHfN8/dz4ODg4Pvi3/5iKXEUjwVUAAAAAElFTkSuQmCC`,jA=`0x62744c084c272ddba4680920edc3239cb7180718`;function MA(){return(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z`})})}function NA({compact:e=!1}={}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Q,{variant:`ghost`,size:e?`sm`:`lg`,className:`pointer-events-auto`,onClick:()=>{i(!1),n(!0)},children:[(0,U.jsx)(MA,{}),$(`panel.links.sponsor`)]}),(0,U.jsx)(PA,{open:t,onOpenChange:n,copyFailed:r,setCopyFailed:i})]})}function PA({open:e,onOpenChange:t,copyFailed:n,setCopyFailed:r}){return(0,U.jsx)(hD,{open:e,onOpenChange:t,children:(0,U.jsxs)(gD,{className:`max-w-sm`,children:[(0,U.jsxs)(_D,{className:`gap-1.5`,children:[(0,U.jsx)(vD,{className:`text-xl`,children:$(`panel.links.sponsorTitle`)}),(0,U.jsx)(yD,{children:$(`panel.links.sponsorIntro`)})]}),(0,U.jsxs)(bD,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(`div`,{className:`flex justify-center`,children:(0,U.jsx)(`img`,{src:AA,alt:$(`panel.links.sponsorQrAlt`),className:`size-44 rounded-lg border border-border-muted bg-white p-2`})}),(0,U.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[(0,U.jsx)(OA,{variant:`soft`,size:`sm`,children:`USDT`}),(0,U.jsx)(OA,{variant:`soft`,size:`sm`,children:`Polygon`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-border-muted bg-background-muted p-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:$(`panel.links.sponsorAddress`)}),(0,U.jsx)(lk,{value:jA,label:$(`panel.links.sponsorCopy`),copiedLabel:$(`panel.links.sponsorCopied`),size:`sm`,variant:`outline`,onCopyError:()=>r(!0),onCopy:()=>r(!1),children:$(`panel.links.sponsorCopy`)})]}),(0,U.jsx)(`code`,{className:`block select-all break-all font-mono text-[11px] leading-4 text-foreground-strong`,children:jA}),n?(0,U.jsx)(`p`,{className:`text-[11px] leading-4 text-foreground-strong`,children:$(`panel.links.sponsorCopyFailed`)}):null]})]}),(0,U.jsx)(`div`,{className:`px-6 pt-4 pb-6`,children:(0,U.jsx)(`p`,{className:`text-center text-sm text-foreground-muted`,children:$(`panel.links.sponsorNote`)})})]})})}function FA(){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-[18px] stroke-0`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function IA({compact:e=!1}={}){return(0,U.jsxs)(`a`,{href:rA,target:`_blank`,rel:`noreferrer noopener`,className:`${Gu({variant:`ghost`,size:e?`sm`:`lg`})} pointer-events-auto`,children:[(0,U.jsx)(FA,{}),$(`panel.links.star`)]})}function LA({compact:e=!1}){return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,U.jsx)(IA,{compact:e}),(0,U.jsx)(NA,{compact:e}),(0,U.jsx)(bA,{compact:e}),(0,U.jsx)(dA,{size:`sm`,variant:`ghost`,className:`px-2`})]})}function RA(e){let t=Number.isFinite(e)&&e>0?e:0;return t===0?`0 MB`:t<1048576?`${Math.max(1,Math.round(t/1024))} KB`:`${(t/1024/1024).toFixed(1)} MB`}function zA(e,t=Date.now()){if(!e)return``;let n=Math.floor((t-e)/36e5);return n<1?$(`panel.inbox.ageLessThanHour`):n<24?$(`panel.inbox.ageHours`,{hours:n}):$(`panel.inbox.ageDays`,{days:Math.floor(n/24)})}function BA({framed:e=!0}){let t=uO(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1),u=(0,g.useCallback)(async()=>{try{r(await rO(`/api/relay/inbox/status`))}catch{r(null)}finally{a(!0)}},[]);(0,g.useEffect)(()=>{u()},[u]);let d=n?.deletableFiles??0,f=zA(n?.oldestAt??null),p=n?.stagingFiles??0;async function m(e){if(!c){l(!0);try{let t=await iO(`/api/relay/inbox/auto`,{enabled:e});r(e=>e&&{...e,autoClear:t.data.autoClear})}catch(e){t(`error`,$(`panel.inbox.autoFailed`,{message:cO(e)}))}finally{l(!1)}}}async function h(){if(o)return;let e=d>0?$(`panel.inbox.confirmDetail`,{count:d,hours:n?.keepHours??24,bytes:RA(n?.deletableBytes??0)}):$(`panel.inbox.confirmNothing`,{hours:n?.keepHours??24});if(window.confirm(`${$(`panel.inbox.confirmTitle`)}\n\n${e}\n\n${$(`panel.inbox.confirmIrreversible`)}`)){s(!0);try{let e=await iO(`/api/relay/inbox/clear`),n=RA(e.freedBytes);t(e.failedFiles>0?`soft`:`ok`,e.deletedFiles>0?`${$(`panel.inbox.cleared`,{bytes:n,count:e.deletedFiles})}${e.failedFiles>0?$(`panel.inbox.clearedSomeFailed`,{count:e.failedFiles}):``}`:$(`panel.inbox.nothingToClear`)),await u()}catch(e){t(`error`,$(`panel.inbox.clearFailed`,{message:cO(e)}))}finally{s(!1)}}}let _=(0,U.jsxs)(U.Fragment,{children:[i?null:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-foreground-muted`,children:[(0,U.jsx)(BE,{}),$(`panel.inbox.reading`)]}),i&&n===null?(0,U.jsx)(rk,{children:(0,U.jsx)(ek,{label:$(`panel.inbox.unreadableTitle`),children:(0,U.jsx)(ik,{tone:`warn`,text:$(`panel.inbox.unreadableTitle`),detail:$(`panel.inbox.unreadableBody`)})})}):null,n===null?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`dl`,{className:`mt-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b border-border-muted py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.used`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:$(`panel.inbox.usedValue`,{bytes:RA(n.bytes),count:n.files})})]}),(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b border-border-muted py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.deletable`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:d>0?$(`panel.inbox.deletableValue`,{bytes:RA(n.deletableBytes),count:d}):$(`panel.common.none`)})]}),(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-2`,children:[(0,U.jsx)(`dt`,{className:`shrink-0 text-sm text-foreground-muted`,children:$(`panel.inbox.keep`)}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-sm break-all`,children:f?$(`panel.inbox.keepValueOldest`,{hours:n.keepHours,age:f}):$(`panel.inbox.keepValue`,{hours:n.keepHours})})]})]}),p>0?(0,U.jsx)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:$(`panel.inbox.staging`,{bytes:RA(n.stagingBytes??0),count:n.stagingFiles??0})}):null,(0,U.jsxs)(`label`,{className:`mt-3 flex items-center justify-between gap-4 border-t border-border-muted pt-3`,children:[(0,U.jsx)(`span`,{className:`block text-sm text-foreground`,children:$(`panel.inbox.auto`)}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[c?(0,U.jsx)(BE,{}):null,(0,U.jsx)(ZD,{size:`md`,checked:n.autoClear===!0,disabled:o||c,onCheckedChange:e=>void m(e),"aria-label":$(`panel.inbox.autoA11y`)})]})]}),(0,U.jsx)(`div`,{className:`mt-3 flex justify-center`,children:(0,U.jsx)(Q,{variant:d>0?`primary`:`outline`,size:`md`,disabled:o,onClick:()=>void h(),children:$(o?`panel.inbox.clearing`:`panel.inbox.clear`)})})]})]});return e?(0,U.jsxs)(cD,{frame:`solid`,children:[(0,U.jsx)(lD,{className:`px-4 py-3`,children:(0,U.jsx)(uD,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{children:$(`panel.inbox.title`)})})}),_]}):_}function VA(e,t){let n=(0,g.useRef)(e);(0,g.useEffect)(()=>{if(e===void 0)return;let r=n.current;r===void 0?n.current=e:e>r&&(n.current=e,t())},[e,t])}var HA=`data-checked`,UA=`data-unchecked`,WA={checked(e){return e?{[HA]:``}:{[UA]:``}},...St,...kD},GA=`data-composite-item-active`,KA=g.createContext({disabled:!1});function qA(){return g.useContext(KA)}var JA=g.createContext(void 0);function YA(){return g.useContext(JA)}function XA(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var ZA=g.createContext(void 0);function QA(){let e=g.useContext(ZA);if(e===void 0)throw Error(S(52));return e}var $A=g.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":s,value:c,inputRef:l,nativeButton:u=!1,id:d,style:f,...m}=e,_=YA(),{disabled:v,readOnly:y,required:x,form:S,checkedValue:C,touched:w=!1,validation:T,name:E,setCheckedValue:D=p,setTouched:O=p,registerInputRef:k=p}=_??{},{setTouched:A,setFilled:j,state:M,disabled:N}=FD(),P=qA(),{labelId:F,getDescriptionProps:I}=BD(),L=N||P.disabled||v||i,R=y||a,z=x||o,B=S,V=_?C===c:c===``,H=g.useRef(null),ee=g.useRef(null),te=T?.registerInput,ne=gr(l,ee,k,g.useCallback(e=>te?.(e,{controlRef:H,value:void 0}),[te]));b(()=>{ee.current?.checked&&j(!0)},[j]),b(()=>{if(ee.current){if(L&&V){k(null);return}k(ee.current)}},[V,L,k]);let W=Md(),re=WD({id:d}),G=u?void 0:re,K={role:`radio`,"aria-checked":V,"aria-labelledby":VD(s,F,ee,!u,G),[GA]:V?``:void 0,id:u?re:W,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||L||R)return;e.preventDefault();let t=ee.current;t&&la(t,e)},onFocus(e){e.defaultPrevented||L||R||!w||(ee.current?.click(),O(!1))}},{getButtonProps:ie,buttonRef:ae}=ua({disabled:L,native:u,composite:!1}),oe={type:`radio`,ref:ne,form:B,id:G,name:E,tabIndex:-1,style:E?mr:pr,"aria-hidden":!0,...c===void 0?h:{value:XA(c)},disabled:L,checked:V,required:z,readOnly:R,onChange(e){if(e.nativeEvent.defaultPrevented||L||R||c===void 0)return;let t=ja(ha,e.nativeEvent);D(c,t),!t.isCanceled&&A(!0)},onClick(e){e.stopPropagation()},onFocus(){H.current?.focus()}},q=g.useMemo(()=>({...M,required:z,disabled:L,readOnly:R,checked:V}),[M,L,R,V,z]),se=q,ce=_!==void 0,le=[t,H,ae],ue=[K,m,ie,I,T?e=>T.getValidationProps(L,e):h],de=Hr(`span`,e,{enabled:!ce,state:q,ref:le,props:ue,stateAttributesMapping:WA});return(0,U.jsxs)(ZA.Provider,{value:se,children:[ce?(0,U.jsx)(ih,{tag:`span`,render:n,className:r,style:f,state:q,refs:le,props:ue,stateAttributesMapping:WA}):de,(0,U.jsx)(`input`,{...oe,suppressHydrationWarning:!0})]})}),ej=g.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=QA(),c=s.checked,{mounted:l,transitionStatus:u,setMounted:d}=Us(c),f={...s,transitionStatus:u},p=g.useRef(null),m=a||l,h=Hr(`span`,e,{ref:[t,p],state:f,props:o,stateAttributesMapping:WA});return ai({batch:!0,enabled:!c,open:c,ref:p,onComplete(){c||d(!1)}}),m?h:null}),tj={duration:.3,ease:[.4,0,.2,1]},nj={duration:.3,ease:[.4,0,.2,1]},rj={duration:0};function ij({checked:e,reduced:t}){return(0,U.jsx)(ej,{"data-slot":`radio-indicator`,className:`flex items-center justify-center`,keepMounted:!0,children:(0,U.jsx)(yE.span,{className:`bg-primary-foreground size-[0.5em] min-h-2 min-w-2 rounded-full`,initial:!1,animate:{scale:+!!e},transition:t?rj:nj})})}function aj({renderProps:e,state:t,reduced:n}){let{checked:r}=t,{ref:i,...a}=e,[o,s]=vE(),c=zu(i,o),l=g.useRef(r);return g.useEffect(()=>{let e=l.current!==r;l.current=r,e&&!n&&s(o.current,{scale:[1,.8,1.1,1]},tj)},[r,s,o,n]),(0,U.jsx)(`span`,{"data-slot":`radio`,...a,ref:c,children:(0,U.jsx)(ij,{checked:r,reduced:n})})}function oj({className:e,...t}){let n=_h(),r=t[`aria-invalid`],i=r===!0||r===`true`;return(0,U.jsx)(Fw,{features:BT,strict:!0,children:(0,U.jsx)($A,{...t,...i?{"data-invalid":``}:{},className:Z(`flex size-[1em] min-h-4 min-w-4 shrink-0 cursor-default items-center justify-center`,`bg-background border-border-strong outline-ring-input rounded-full border outline-offset-1`,`transition-[background-color,border-color,box-shadow] duration-200 motion-reduce:transition-none`,`hover:not-data-checked:not-data-disabled:not-data-invalid:border-border-emphasis`,`data-checked:bg-primary data-checked:outline-ring-primary data-checked:border-transparent`,`data-disabled:not-data-checked:bg-background-subtle data-disabled:data-checked:opacity-disabled data-disabled:cursor-not-allowed data-disabled:not-data-checked:border-dashed`,`data-invalid:border-error data-invalid:not-data-checked:bg-error-subtle data-invalid:outline-ring-error`,e),render:(e,t)=>(0,U.jsx)(aj,{renderProps:e,state:t,reduced:n})})})}function sj(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=m}=e,[p,h]=g.useState(0),_=r!=null,v=g.useRef(null),y=gr(v,c),x=g.useRef([]),S=g.useRef(!1),C=g.useRef(null),w=o??p,T=q((e,t=!1)=>{if(C.current=x.current[e]??null,(s??h)(e),t){let t=x.current[e];$d(v.current,t,a,n)}}),E=q(e=>{if(e.size===0)return;if(S.current){let e=x.current,t=e.indexOf(C.current);if(t===-1){let t=e[w];!t||Mn(e,w,d)?T(cj(e,d)):C.current=t}else t!==w&&T(t);return}S.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)T(i);else if(Mn(t,w,d)){let e=jn(t,{disabledIndices:d});On(t,e)||T(e)}$d(v.current,r,a,n)});b(()=>{if(d==null||o!=null||!S.current)return;let e=x.current;if(Mn(e,w,d)){let t=jn(e,{disabledIndices:d});On(e,t)||T(t)}},[d,o,w,x,T]);let D=q((e,t,n)=>i?i(e,t,n,x):n),O=q(e=>{let o=e.key===`Home`||e.key===`End`;if(!Jd.has(e.key)||!l&&o||lj(e,f)||!v.current)return;let s=a===`rtl`,c=s?Kd:qd,p=s?qd:Kd,m=n===`vertical`?Gd:c,h=n===`vertical`?Wd:p,g=dt(e.nativeEvent);if(g!=null&&Qd(g)&&!fh(g)){let t=g.selectionStart,n=g.selectionEnd,r=g.value;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==m&&t>0)return}let y=w,b=kn(x,d),S=An(x,d);r!=null&&(y=r({disabledIndices:d,elementsRef:x,event:e,highlightedIndex:w,loopFocus:t,maxIndex:S,minIndex:b,onLoop:D,orientation:n,rtl:s}));let C=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,E=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?y=b:e.key===`End`&&(y=S)),y===w&&(C||E)&&(t&&y===S&&C?(y=b,i&&(y=i(e,w,y,x))):t&&y===b&&E?(y=S,i&&(y=i(e,w,y,x))):y=jn(x.current,{startingIndex:y,decrement:E,disabledIndices:d})),y!==w&&!On(x.current,y)&&(u&&e.stopPropagation(),(_||o||C||E)&&e.preventDefault(),T(y,!0),queueMicrotask(()=>{x.current[y]?.focus()}))});return{props:{ref:y,onFocus(e){let t=v.current,n=dt(e.nativeEvent);t&&n!=null&&Qd(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:O},highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:x,onMapChange:E,relayKeyboardEvent:O}}function cj(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Mn(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function lj(e,t){for(let n of Xd)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function uj(e){let{render:t,className:n,style:r,refs:i=m,props:a=m,state:o=h,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:_,onMapChange:v,stopEventPropagation:y=!0,rootRef:b,disabledIndices:x,modifierKeys:S,highlightItemOnHover:C=!1,tag:w=`div`,...T}=e,{props:E,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,onMapChange:A,relayKeyboardEvent:j}=sj({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:b,stopEventPropagation:y,enableHomeAndEndKeys:_,direction:Uc(),disabledIndices:x,modifierKeys:S}),M=Hr(w,e,{state:o,ref:i,props:[E,...a,T],stateAttributesMapping:s}),N=g.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:O,highlightItemOnHover:C,relayKeyboardEvent:j}),[D,O,C,j]);return(0,U.jsx)(oa.Provider,{value:N,children:(0,U.jsx)(Dm,{elementsRef:k,onMapChange:e=>{v?.(e),A(e)},children:M})})}function dj(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var fj=Object.keys(DD);function pj(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}function mj(e,t){let n=null;for(let r of e.keys())if(pj(r,t)){if(!r.validity.valid)return r;n??=r}return n}function hj(e){return{...DD,valid:!e,customError:e}}function gj(e){return e&&e.validationMessage?[e.validationMessage]:[]}function _j(e){let{elementRef:t,formRef:n}=RD(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:o,invalid:s,markedDirtyRef:c,state:l,shouldValidateOnChange:u,validationMode:d,registeredFieldIdRef:f}=e,{controlId:p,getDescriptionProps:m}=BD(),_=Ke(),v=g.useRef(null),b=y(()=>new Map).current,x=g.useRef(0),S=g.useRef(null),C=g.useCallback((e,t)=>(b.set(e,t),()=>{b.delete(e)}),[b]),w=q(()=>{let e=mj(b,t.current);return e&&b.get(e)?.controlRef.current||null}),T=q(async(e,o=!1)=>{x.current+=1;let m=x.current;function h(e,t=s){let r=f.current??p;if(r==null)return;let i=n.current.fields.get(r);if(!i)return;let a=dj(e,t);n.current.fields.set(r,{...i,validityData:a})}function g(t,n){let r=t.valid===!1?n:[];return{value:e,state:t,error:r[0]??``,errors:r,initialValue:a.initialValue}}function y(e,t){let n=e.validity.customError?e.validationMessage:``,r=t.replace(/\r\n?/g,`
|
|
104
104
|
`);e.setCustomValidity(r),S.current=[e,r,n]}function C(){let e=S.current;S.current=null,e&&(!e[0].willValidate||e[0].validationMessage===e[1])&&e[0].setCustomValidity(e[2])}function w(e,t,n){let i=g(e,t);h(i,n),r(i)}function T(e){let t=fj.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of fj)if(e!==`valid`){if(e===`valueMissing`&&t[e])n=!0;else if(t[e])return t}return n&&!c.current&&(t.valid=!0,t.valueMissing=!1),t}function E(){return b.size>0?mj(b,t.current):v.current}let D=E();function O(){return D=E(),D?.willValidate?T(D):hj(!1)}if(o){if(l.valid!==!1||!D)return;if(!D.validity.valueMissing){C();let e=E(),t=e?.validity.customError?gj(e):[];w(hj(t.length>0),t,!1);return}for(let e of fj)if(e!==`valid`&&e!==`valueMissing`&&e!==`customError`&&D.validity[e])return}_.clear(),C();let k=O(),A=gj(D),j=u();if(A.length===0||j){let t=Array.from(n.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}),r=i(e,t),o;if(typeof r==`object`&&r&&`then`in r){if(k.valid===!1?w(k,A):(d===`onSubmit`||!a.state.customError)&&(k.valid=null,w(k,A)),o=await r,m!==x.current)return;k=O()}else o=r;A=o?[].concat(o).filter(Boolean):[],A.length>0?(k.valid=!1,k.customError=!0,D?.willValidate&&y(D,A.join(`
|
|
105
105
|
`))):A=gj(D)}w(k,A)}),E=q((e,t=!1)=>{if(_.clear(),x.current+=1,t)return;let n=u();n&&e!==``&&o?_.start(o,()=>{T(e)}):T(e,!n)}),D=g.useCallback((e,t={})=>Or(m(t),l.valid===!1&&!l.disabled&&!e?{"aria-invalid":!0}:h),[m,l.disabled,l.valid]);return g.useMemo(()=>({getValidationProps:D,inputRef:v,registeredInputs:b,registerInput:C,getInputControl:w,commit:T,change:E}),[D,b,C,w,T,E])}var vj=g.createContext(void 0);function yj(e=!1){let t=g.useContext(vj);if(!t&&!e)throw Error(S(86));return t}var bj=[Yd],xj=g.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,form:u,name:d,inputRef:f,id:p,style:m,...h}=e,{setTouched:_,setFocused:v,validationMode:y,name:b,disabled:x,state:S,validation:C,setDirty:w,setFilled:T,validityData:E}=FD(),{labelId:D}=BD(),{clearErrors:O,elementRef:k}=RD(),A=yj(!0),j=x||i,M=b??d,N=Md(p),[P,F]=vf({controlled:c,default:l,name:`RadioGroup`,state:`value`}),[I,L]=g.useState(!1),R=q((e,t)=>{s?.(e,t),!t.isCanceled&&F(e)}),z=C.getInputControl,B=g.useMemo(()=>({get current(){return z()}}),[z]),V=g.useRef(null),H=g.useRef(null);function ee(e){let t;return f&&(typeof f==`function`?t=f(e):f.current=e),V.current=e,t}let te=q(e=>{if(!e||e.disabled)return;H.current||=e;let t=V.current,n=e.checked||t==null||t.disabled?ee(e):void 0;return()=>{H.current===e&&(H.current=null),V.current===e?n?(n(),V.current=null):ee(null):n?.()}}),ne=q(()=>{let e=k.current;if(!e)return P??null;for(let t of C.registeredInputs.keys())if(t.checked&&pj(t,e))return P??null;return null});ID(B,N,P??null,ne,!j,d),Kf(P,()=>{O(M),w(P!==E.initialValue),T(P!=null),C.change(P);let e=H.current;P==null&&e&&!e.disabled&&ee(e)});let W=D??A?.legendId,re={...S,disabled:j??!1,required:o??!1,readOnly:a??!1},G=g.useMemo(()=>({checkedValue:P,disabled:j,form:u,validation:C,name:M,readOnly:a,registerInputRef:te,required:o,setCheckedValue:R,setTouched:L,touched:I}),[P,j,u,C,M,a,te,o,R,L,I]),K={id:p,role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":j||void 0,"aria-readonly":a||void 0,"aria-labelledby":W,onFocus(){v(!0)},onBlur(e){J(e.currentTarget,e.relatedTarget)||(_(!0),v(!1),y===`onBlur`&&C.commit(P))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(L(!0),v(!0))}};return(0,U.jsx)(JA.Provider,{value:G,children:(0,U.jsx)(uj,{render:n,className:r,style:m,state:re,props:[K,h,e=>C.getValidationProps(j??!1,e)],refs:[t],stateAttributesMapping:kD,enableHomeAndEndKeys:!1,modifierKeys:bj})})});function Sj({className:e,orientation:t=`vertical`,...n}){return(0,U.jsx)(xj,{"data-slot":`radio-group`,"aria-orientation":t,className:Z(`flex`,t===`horizontal`?`flex-wrap gap-4`:`flex-col gap-2`,e),...n})}function Cj(e){return e?e.lan.length>0?e.lan:e.public:[]}function wj(e){return!e||e.lan.length===0?[]:e.public}function Tj(e){return e?.ipv6??[]}function Ej(e,t){let n=$(e===`lan`?`panel.address.lan`:e===`ipv6`?`panel.address.ipv6`:`panel.address.public`);return t?`${n} · ${t}`:n}function Dj(e,t){return`http://${e.includes(`:`)?`[${e}]`:e}:${String(t??``)}`}function Oj({book:e,error:t=``,onRetry:n,port:r,value:i,busy:a=!1,onChange:o,fallbackUrls:s=[],align:c=`end`}){let l=c===`start`?`items-start`:`items-end`,u=c===`start`?`justify-start`:`justify-end`,d=c===`start`?`text-start`:`text-end`,f=String(r??``),p=Cj(e),m=wj(e),h=Tj(e),g=e&&e.lan.length>0?`lan`:`public`,_=p.some(e=>e.address===i)?i:p[0]?.address??``;return t?(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 ${l}`,children:[(0,U.jsx)(`span`,{className:`font-sans text-foreground-muted`,children:$(`panel.address.loadFailed`)}),n?(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:n,children:$(`panel.address.retry`)}):null]}):p.length===0?h.length===0&&s.length>0?(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 ${l}`,children:[s.map(e=>(0,U.jsx)(`span`,{children:e},e)),e?(0,U.jsx)(`span`,{className:`font-sans text-xs text-foreground-muted`,children:$(`panel.address.natHint`)}):null]}):h.length===0?(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 ${l}`,children:[(0,U.jsx)(`span`,{className:`font-sans text-foreground-muted`,children:$(e?`panel.address.none`:`panel.address.empty`)}),e?(0,U.jsx)(`span`,{className:`font-sans text-xs text-foreground-muted`,children:$(`panel.address.natHint`)}):null]}):(0,U.jsx)(`span`,{className:`flex w-full flex-col gap-1 ${l}`,children:h.map(e=>(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2 ${u}`,children:[(0,U.jsx)(`span`,{className:`font-mono text-xs text-foreground-muted`,children:Dj(e.address,f)}),(0,U.jsx)(`span`,{className:`shrink-0 font-sans text-xs text-foreground-subtle`,children:`${Ej(`ipv6`,e.interface)}${$(`panel.address.ipv6Hint`)}`})]},e.address))}):(0,U.jsxs)(`span`,{className:`flex w-full flex-col gap-1 ${l}`,children:[p.length>1?(0,U.jsx)(Sj,{className:fg(`w-full gap-1`,l,a&&`pointer-events-none opacity-60`),value:_,onValueChange:e=>{typeof e==`string`&&e!==_&&o(e)},children:p.map(e=>(0,U.jsxs)(`label`,{className:`flex w-full cursor-pointer flex-wrap items-baseline gap-x-2 ${u}`,children:[(0,U.jsx)(oj,{value:e.address,"aria-label":Dj(e.address,f)}),(0,U.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:Dj(e.address,f)}),(0,U.jsx)(`span`,{className:`shrink-0 font-sans text-xs text-foreground-muted`,children:Ej(g,e.interface)})]},e.address))}):(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2 ${u}`,children:[(0,U.jsx)(`span`,{className:`font-mono`,children:Dj(p[0].address,f)}),(0,U.jsx)(`span`,{className:`shrink-0 font-sans text-xs text-foreground-muted`,children:Ej(g,p[0].interface)})]}),m.map(e=>(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2 ${u}`,children:[(0,U.jsx)(`span`,{className:`font-mono text-xs text-foreground-muted`,children:Dj(e.address,f)}),(0,U.jsx)(`span`,{className:`shrink-0 font-sans text-xs text-foreground-subtle`,children:`${Ej(`public`,e.interface)}${$(`panel.address.publicHint`)}`})]},e.address)),h.map(e=>(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2 ${u}`,children:[(0,U.jsx)(`span`,{className:`font-mono text-xs text-foreground-muted`,children:Dj(e.address,f)}),(0,U.jsx)(`span`,{className:`shrink-0 font-sans text-xs text-foreground-subtle`,children:$(`panel.address.ipv6Pick`,{kind:Ej(`ipv6`,e.interface)})})]},e.address)),e&&e.lan.length>0&&e.public.length===0&&h.length===0?(0,U.jsx)(`span`,{className:`font-sans text-xs text-foreground-muted ${d}`,children:$(`panel.address.natHint`)}):null,p.length>1?(0,U.jsx)(`span`,{className:`font-sans text-xs text-foreground-muted ${d}`,children:$(`panel.address.hint`)}):null]})}function kj({on:e,what:t,label:n,className:r,disabled:i,onClick:a}){let o=n??$(e?`panel.common.hide`:`panel.common.show`);return(0,U.jsx)(Q,{variant:`ghost`,size:`icon-sm`,className:r,"aria-label":`${o}${t}`,title:`${o}${t}`,disabled:i,onClick:a,children:(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d:`m3 3 18 18M10.58 10.59a2 2 0 0 0 2.83 2.82`}),(0,U.jsx)(`path`,{d:`M9.88 5.09A10.94 10.94 0 0 1 12 5c7 0 10 7 10 7a14.5 14.5 0 0 1-3.17 4.36M6.61 6.61A16.77 16.77 0 0 0 2 12s3 7 10 7a10.94 10.94 0 0 0 5.39-1.39`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d:`M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z`}),(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})})})}function Aj(){return(0,U.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,className:`size-6`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,U.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,U.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`}),(0,U.jsx)(`path`,{d:`M14 14h3v3M21 14v.01M14 21h.01M17 21h4v-4`})]})}function jj({status:e,pairing:t,addressBook:n,addressError:r=``,onRetryAddresses:i,version:a,versionIssues:o=[],busy:s,error:c,onRetryPairing:l,onSavePreferred:u,onEditPort:d,bare:f=!1}){let p=s!==``,m=t?.relayUrl||e.relayUrl||`—`,h=r?`error`:Nj(n,t),[_,v]=g.useState({relay:!1}),[y,b]=g.useState(!1),[x,S]=g.useState(!1);VA(e.lastPairingAt,()=>S(!1));let C=t?.pairingCode===e.pairingCode,w=g.useRef(null),[T,E]=g.useState(0);g.useEffect(()=>{let e=w.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>E(Math.round(e.getBoundingClientRect().height));t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let D=e=>v(t=>({...t,[e]:!t[e]})),O=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`${f?``:`mt-3`} flex flex-col gap-4 sm:flex-row sm:items-stretch`,children:[(0,U.jsx)(`div`,{className:`relative mx-auto aspect-square w-full max-w-[200px] shrink-0 self-center sm:mx-0 sm:h-[var(--qr-size)] sm:w-[var(--qr-size)] sm:max-w-none sm:self-start`,style:T>0?{"--qr-size":`${T}px`}:void 0,children:!t?.svg||!C?(0,U.jsx)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 rounded-md border border-border-muted bg-background-muted p-3 text-foreground-subtle`,children:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-xs`,children:$(`panel.pairing.qrFailed`)}),(0,U.jsx)(Q,{variant:`ghost`,size:`sm`,disabled:p,onClick:l,children:$(`panel.console.retryPairing`)})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(BE,{}),(0,U.jsx)(`span`,{className:`text-xs`,children:$(`panel.pairing.noQr`)})]})}):(0,U.jsxs)(`button`,{type:`button`,className:`absolute inset-0 flex cursor-zoom-in flex-col items-center justify-center gap-2 rounded-md border border-border-muted bg-background-muted p-3 text-foreground-subtle transition-colors hover:bg-background-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>S(!0),"aria-label":`${$(`panel.pairing.qrZoom`)}:${$(`panel.pairing.qr`)}`,children:[(0,U.jsx)(Aj,{}),(0,U.jsx)(`span`,{className:`text-xs`,children:$(`panel.pairing.qrHidden`)}),(0,U.jsx)(`span`,{className:`text-xs`,children:$(`panel.common.show`)})]})}),(0,U.jsx)(`div`,{ref:w,className:`flex min-w-0 flex-1 flex-col`,children:(0,U.jsxs)(rk,{className:nk,children:[(0,U.jsx)(ek,{label:$(`panel.connection.relayUrl`),nowrap:!0,children:(0,U.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:[_.relay?(0,U.jsx)(`span`,{className:`min-w-0 font-mono text-xs text-foreground-strong`,children:m}):(0,U.jsx)(`span`,{className:`text-xs text-foreground-subtle`,children:$(`panel.pairing.hidden`)}),(0,U.jsx)(kj,{on:_.relay,what:$(`panel.connection.relayUrl`),label:_.relay?$(`panel.common.hide`):$(`panel.common.show`),onClick:()=>D(`relay`)})]})}),(0,U.jsx)(ek,{label:$(`panel.pairing.port`),mono:!0,nowrap:!0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:[(0,U.jsxs)(`span`,{children:[t?.lanPort??e.lan.port,t?.lanPortAdjusted?(0,U.jsx)(`span`,{className:`ml-2 font-sans text-xs text-foreground-muted`,children:$(`panel.pairing.portFallback`)}):null]}),(0,U.jsx)(Q,{variant:`ghost`,size:`icon-sm`,"aria-label":$(`panel.pairing.portTitle`),title:$(`panel.pairing.portTitle`),disabled:p,onClick:d,children:(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`m16 3 5 5M4 15 16 3a3.54 3.54 0 0 1 5 5L9 20l-6 1 1-6Z`})})})]})}),(0,U.jsx)(ek,{label:$(`panel.pairing.phoneAddress`),nowrap:!0,children:(0,U.jsxs)(`span`,{className:`inline-flex flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:[h?null:(0,U.jsx)(`span`,{className:`text-xs text-foreground-subtle`,children:$(`panel.pairing.noAddress`)}),(0,U.jsx)(kj,{on:!1,what:$(`panel.pairing.phoneAddress`),label:$(`panel.common.show`),onClick:()=>b(!0)})]})}),(0,U.jsx)(ek,{label:$(`panel.update.runningVersion`),mono:!0,labelExtra:o.length>0?(0,U.jsx)(wk,{issue:o[0]}):void 0,children:a||$(`panel.update.unknownVersion`)})]})})]}),(0,U.jsx)(hD,{open:x,onOpenChange:S,children:(0,U.jsxs)(gD,{className:`w-[min(680px,94vw)] max-h-[90vh] max-w-none`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.pairing.qr`)})}),(0,U.jsx)(bD,{children:(0,U.jsx)(`div`,{className:`flex items-center justify-center overflow-auto rounded-md bg-white p-2 sm:p-4`,children:t?.svg&&C?(0,U.jsx)(`div`,{className:`aspect-square h-[min(64vh,560px)] w-auto max-w-full [&_svg]:h-full [&_svg]:w-full`,dangerouslySetInnerHTML:{__html:t.svg}}):null})})]})}),(0,U.jsx)(hD,{open:y,onOpenChange:b,children:(0,U.jsxs)(gD,{className:`max-w-xl`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.pairing.phoneAddress`)})}),(0,U.jsx)(bD,{children:(0,U.jsx)(Oj,{book:n,error:r,onRetry:i,port:t?.lanPort??e.lan.port,value:n?.preferred??``,busy:p,onChange:u,fallbackUrls:t?.lanUrls??[]})}),(0,U.jsx)(xD,{className:`flex justify-end`,children:(0,U.jsx)(Q,{variant:`outline`,onClick:()=>b(!1),children:$(`panel.common.close`)})})]})})]});return f?O:(0,U.jsxs)(cD,{frame:`solid`,children:[(0,U.jsx)(lD,{className:`flex-none px-4 py-3`,children:(0,U.jsx)(uD,{className:`text-base lg:text-lg`,children:$(`panel.pairing.cardTitle`)})}),O]})}function Mj({status:e,busy:t,onChangePolicy:n,onToggleRemote:r,onChangeControlReport:i}){let a=t!==``,o=e.pairingPolicy===`code`,s=e.controlReportEnabled!==!1,[c,l]=g.useState(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ek,{label:$(`panel.pairing.policy`),children:(0,U.jsx)(ZD,{size:`md`,checked:o,disabled:a,onCheckedChange:e=>n(e?`code`:`deny`),"aria-label":$(`panel.devices.allowTitle`)})}),(0,U.jsx)(ek,{label:$(`panel.connection.remoteControl`),children:(0,U.jsx)(ZD,{size:`md`,checked:e.enabled,disabled:a,onCheckedChange:e=>r(e),"aria-label":$(`panel.connection.remoteControl`)})}),(0,U.jsx)(ek,{label:$(`panel.pairing.controlReport`),nowrap:!0,labelExtra:(0,U.jsx)(`button`,{type:`button`,"aria-label":$(`panel.pairing.controlReportInfo`),title:$(`panel.pairing.controlReportInfo`),className:`shrink-0 cursor-pointer rounded text-foreground-muted transition-colors duration-200 hover:text-foreground-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none`,onClick:()=>l(!0),children:(0,U.jsx)(uk,{})}),children:(0,U.jsx)(ZD,{size:`md`,checked:s,disabled:a,"aria-label":$(`panel.pairing.controlReport`),onCheckedChange:e=>{e!==s&&i(e)}})}),(0,U.jsx)(hD,{open:c,onOpenChange:l,children:(0,U.jsxs)(gD,{className:`max-w-md`,closeLabel:$(`panel.common.close`),children:[(0,U.jsx)(_D,{children:(0,U.jsx)(vD,{children:$(`panel.pairing.controlReport`)})}),(0,U.jsxs)(bD,{className:`whitespace-pre-line text-sm leading-6 text-foreground-muted`,children:[$(`panel.pairing.controlReportDetail`),`
|
|
106
106
|
|
package/lib/relay/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// 中转地址收敛保留禁用意图,启用且无公网替代时补回公用清单;退役中转只在读盘且与现行公用同列时清理。
|
|
2
2
|
/**
|
|
3
3
|
* relay.json 的状态形状与读写,外加实例 ID / 配对码 / 隧道地址这几个纯函数。
|
|
4
4
|
*
|
|
@@ -99,9 +99,10 @@ function loadState() {
|
|
|
99
99
|
if (!Object.prototype.hasOwnProperty.call(raw, 'relayUrls')) delete merged.relayUrls;
|
|
100
100
|
const state = normalizeRelayAddresses(merged);
|
|
101
101
|
// 老设备迁移(只读盘这一次):退役的官方中转地址按 host 剔掉,早先只写了第一台内置
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
102
|
+
// 公用中转的补成整份。**只在列表里同时还有现行公用中转时才剔退役项**:退役域名曾被当作
|
|
103
|
+
// 内置公用发出去,用户也可能把自建中转搭在同名域名上(issue #26)——只剩退役地址、没有
|
|
104
|
+
// 现行公用可依的列表,当成用户显式配置原样留着,不再静默改写。写入路径本来就不碰退役项。
|
|
105
|
+
if (relayAddressesOf(state).relayUrls.some(isPublicRelayUrl)) pruneRetiredPublicRelays(state);
|
|
105
106
|
expandDefaultPublicRelays(state);
|
|
106
107
|
return state;
|
|
107
108
|
} catch {
|
|
@@ -337,8 +338,10 @@ function isRetiredPublicRelayUrl(url) {
|
|
|
337
338
|
/**
|
|
338
339
|
* 把退役的公用中转地址从配置里剔掉(就地改 `state`,返回有没有改动)。
|
|
339
340
|
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
341
|
+
* 只在列表里还有现行公用中转时被 `loadState` 调用(见那里的判断):这时退役项一定是老配置
|
|
342
|
+
* 残留,剔掉后留下现行的即可。只剩退役地址、没有现行公用可依的列表不进来 —— 那多半是用户
|
|
343
|
+
* 把自建中转搭在同名退役域名上(issue #26),不能被当成残留静默改写。主用那条恒为首项的
|
|
344
|
+
* 不变式在这里一并维持。
|
|
342
345
|
*/
|
|
343
346
|
function pruneRetiredPublicRelays(state) {
|
|
344
347
|
if (!state || typeof state !== 'object') return false;
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* 身份冲突时「换身份」的实装。
|
|
5
5
|
*
|
|
6
|
-
* 连续收到身份冲突(同一 instanceId 被别处占了令牌)后触发一次:生成新号 → 落盘 →
|
|
7
|
-
* 用新号重下配置 →
|
|
6
|
+
* 连续收到身份冲突(同一 instanceId 被别处占了令牌)后触发一次:生成新号 → 落盘 → 把本机
|
|
7
|
+
* 签发的设备凭据整体迁到新号 → 让 sidecar 用新号重下配置 → 总控用新号重连。新号唯一,换完
|
|
8
|
+
* 就不再有冲突;重入保护避免并发触发。
|
|
9
|
+
*
|
|
10
|
+
* 迁移那步是「换号对已配对设备透明」的关键:鉴权只认「当前号 + 上一代号」,若不迁移,换到
|
|
11
|
+
* 第二次时更早配对、还没换过来的手机会被甩下、只能重新扫码(见 `credentials.reassignInstance`)。
|
|
8
12
|
*
|
|
9
13
|
* 放在这里而不是装配层:装配层只把它挂上,不许多长实现(见 `test/assembly-layer.test.cjs`)。
|
|
10
14
|
*/
|
|
11
|
-
function createIdentityRotator({ state, rotateIdentity, saveState, syncSidecar, syncControl }) {
|
|
15
|
+
function createIdentityRotator({ state, rotateIdentity, saveState, syncSidecar, syncControl, migrateCredentials }) {
|
|
12
16
|
let rotating = false;
|
|
13
17
|
return async function rotateIdentityNow() {
|
|
14
18
|
if (rotating) return;
|
|
15
19
|
rotating = true;
|
|
16
20
|
try {
|
|
17
|
-
rotateIdentity(state);
|
|
21
|
+
const { instanceId } = rotateIdentity(state);
|
|
18
22
|
saveState(state);
|
|
23
|
+
// 迁移失败不阻断换号:鉴权仍认旧号,最坏退回「重扫」,不会把本机卡在冲突里。
|
|
24
|
+
try { if (typeof migrateCredentials === 'function') migrateCredentials(instanceId); } catch { /* ignore */ }
|
|
19
25
|
try { await syncSidecar(); } catch { /* 配置下发失败不影响重连,下次 sync 再补 */ }
|
|
20
26
|
try { syncControl(); } catch { /* ignore */ }
|
|
21
27
|
} finally {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// 配对二维码的 IPv6 候选为手填那条预留一席,避免被条数上限切掉。
|
|
2
|
+
// 2026-11-21:TCP 目标同时写进 lanUrls,让现网 App 在扫码配对时也能拨它(过渡桥)。
|
|
2
3
|
// 生成配对邀请,并独立发布 IPv6 监听候选。
|
|
3
4
|
'use strict';
|
|
4
5
|
|
|
@@ -44,6 +45,12 @@ function pairingPayload(state, lanPort) {
|
|
|
44
45
|
? phoneCandidates(advertisedCandidates(port), { preferred: state.preferredLanAddress, manual: state.manualLanUrl })
|
|
45
46
|
: [];
|
|
46
47
|
const urls = candidates.map(candidate => candidate.url).filter(Boolean);
|
|
48
|
+
const tcpTarget = tcpDirectTarget(state.manualTcpUrl);
|
|
49
|
+
// 过渡桥:现网 App 的扫码配对只把中转与 lanUrls 当候选,TCP 那格只是配对后的直连配置。
|
|
50
|
+
// 把同一条 TCP 目标按 http://host:port 塞进 lanUrls,它就会走裸 TCP 回环转发去打配对口;
|
|
51
|
+
// 等 App 把 TCP 正式接进选路后,这里撤掉。重复的手动直连地址不写第二遍。
|
|
52
|
+
const tcpLanUrl = tcpTarget ? `http://${tcpTarget}` : '';
|
|
53
|
+
if (tcpLanUrl && !urls.includes(tcpLanUrl)) urls.push(tcpLanUrl);
|
|
47
54
|
// 老手机只读 `relayUrl`(语义一个字没变),新手机优先读数组、没有就退化到单条。
|
|
48
55
|
// `relayUrls[0]` 恒等于 `relayUrl`,这条不变式由 core 的收敛函数保证。
|
|
49
56
|
//
|
|
@@ -78,8 +85,7 @@ function pairingPayload(state, lanPort) {
|
|
|
78
85
|
// (与直连地址是两条,别混)。App 用它当 `tcpTarget`(经本机回环 + 原生裸 TCP 出站,ATS 不参与)。
|
|
79
86
|
// 没有可用的就整格不写 —— 二维码的字节数很贵,重配对时目标由 `/connection-info` 补。
|
|
80
87
|
...(() => {
|
|
81
|
-
|
|
82
|
-
return tcp ? { tcpUrl: tcp } : {};
|
|
88
|
+
return tcpTarget ? { tcpUrl: tcpTarget } : {};
|
|
83
89
|
})(),
|
|
84
90
|
// **不再带 `lanCandidates`**:它与上面 `lanUrls` 是同一个数组,App 侧从来没读过它
|
|
85
91
|
// (`parsePairingInvite` 只取 `lanUrls`)。一份地址在二维码里出现两遍,白占几十个字符、
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.87",
|
|
4
4
|
"description": "Mobile API (/api/mobile/v1) and relay client for the DSH mobile app — desktop profile build (dsh 0.2.x, peers resolved by the host)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"icon": "./icon.png",
|