@xenon-device-management/xenon 1.20.6 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/public/assets/ApiKeyGate-X0iRD7Nl.js +1 -0
- package/lib/public/assets/BugReportButton-DFLx1uf_.css +1 -0
- package/lib/public/assets/{BugReportButton-DcdvldI8.js → BugReportButton-Dyp86Mkc.js} +3 -3
- package/lib/public/assets/DeviceMosaicView-YMVCkJcd.js +2 -0
- package/lib/public/assets/{EmptyState-WaKqkpVO.js → EmptyState-cUeeFpl-.js} +1 -1
- package/lib/public/assets/{FieldGroup-CTskPUp9.js → FieldGroup-D6AD5K4v.js} +1 -1
- package/lib/public/assets/Modal-CkhpaXeX.css +1 -0
- package/lib/public/assets/{Modal-_3Pw7BE8.js → Modal-D10BsRiS.js} +1 -1
- package/lib/public/assets/{SegmentedControl-w5tN7KCI.js → SegmentedControl-8rSE0yiT.js} +1 -1
- package/lib/public/assets/SettingCard-B2P4WH4f.js +11 -0
- package/lib/public/assets/SettingCard-CiKM8yKg.css +1 -0
- package/lib/public/assets/{Table-DUdmIKaG.js → Table-DDdKqpxK.js} +1 -1
- package/lib/public/assets/{activity-COm_xcSJ.js → activity-Dc54BbBS.js} +1 -1
- package/lib/public/assets/ai-settings-Bek_MtPE.js +21 -0
- package/lib/public/assets/api-keys-AgKl_eOE.js +1 -0
- package/lib/public/assets/apps-CUZaKBJA.js +21 -0
- package/lib/public/assets/apps-lzi4Ooq8.css +1 -0
- package/lib/public/assets/{arrow-left-2VCW_Ahb.js → arrow-left-S9QFWfje.js} +1 -1
- package/lib/public/assets/{arrow-right-LedMfmI5.js → arrow-right-BmJg4ZXp.js} +1 -1
- package/lib/public/assets/{arrow-up-right-B2Tt2XiQ.js → arrow-up-right-DHIQnpYr.js} +1 -1
- package/lib/public/assets/auth-shell-mfAUQg2o.js +6 -0
- package/lib/public/assets/builds-page-B1dlKzVZ.js +6 -0
- package/lib/public/assets/{button-Dv6XiuT2.js → button-BCEivrYY.js} +1 -1
- package/lib/public/assets/button-BcBq3nMd.css +1 -0
- package/lib/public/assets/calendar-1SaE1aV0.js +6 -0
- package/lib/public/assets/{check-DnO0TDwc.js → check-tKjk56tm.js} +1 -1
- package/lib/public/assets/{chevron-right-CBRP6FCs.js → chevron-right-DwcKH6Yc.js} +1 -1
- package/lib/public/assets/{circle-check-B_Cs9XLu.js → circle-check-CdQ00EQ7.js} +1 -1
- package/lib/public/assets/{circle-x-C6IHKEj0.js → circle-x-Dizt41--.js} +1 -1
- package/lib/public/assets/{clock-DW0b6rCV.js → clock-CFc0jww0.js} +1 -1
- package/lib/public/assets/{copy-Boei7OqW.js → copy-BkkYDV8f.js} +1 -1
- package/lib/public/assets/device-explorer-C_84uNMS.css +1 -0
- package/lib/public/assets/device-explorer-gcEBuHxU.js +265 -0
- package/lib/public/assets/{download-Bf7xumh6.js → download-BdX5olQ3.js} +1 -1
- package/lib/public/assets/forgot-password-Cv496sk3.js +1 -0
- package/lib/public/assets/{funnel-Dja4qJSR.js → funnel-DsKlMHds.js} +1 -1
- package/lib/public/assets/index-DGGlkAuh.css +1 -0
- package/lib/public/assets/index-DjWgs7qB.js +209 -0
- package/lib/public/assets/input-B5edaXfx.css +1 -0
- package/lib/public/assets/{input-DcW9abl7.js → input-Bb56ce8h.js} +1 -1
- package/lib/public/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/lib/public/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/lib/public/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- package/lib/public/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-700-normal-CjBOestx.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-700-normal-DrXBdSj3.woff +0 -0
- package/lib/public/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/lib/public/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/lib/public/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- package/lib/public/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2 +0 -0
- package/lib/public/assets/inter-cyrillic-ext-700-normal-LO58E6JB.woff +0 -0
- package/lib/public/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/lib/public/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/lib/public/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/lib/public/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/lib/public/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- package/lib/public/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- package/lib/public/assets/inter-greek-700-normal-BUv2fZ6O.woff +0 -0
- package/lib/public/assets/inter-greek-700-normal-C3JjAnD8.woff2 +0 -0
- package/lib/public/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/lib/public/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/lib/public/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/lib/public/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/lib/public/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- package/lib/public/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- package/lib/public/assets/inter-greek-ext-700-normal-BoQ6DsYi.woff +0 -0
- package/lib/public/assets/inter-greek-ext-700-normal-qfdV9bQt.woff2 +0 -0
- package/lib/public/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/lib/public/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/lib/public/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/lib/public/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/lib/public/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/lib/public/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/lib/public/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
- package/lib/public/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
- package/lib/public/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/lib/public/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/lib/public/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/lib/public/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/lib/public/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- package/lib/public/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- package/lib/public/assets/inter-latin-ext-700-normal-Ca8adRJv.woff2 +0 -0
- package/lib/public/assets/inter-latin-ext-700-normal-TidjK2hL.woff +0 -0
- package/lib/public/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/lib/public/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/lib/public/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/lib/public/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/lib/public/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- package/lib/public/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- package/lib/public/assets/inter-vietnamese-700-normal-BZaoP0fm.woff +0 -0
- package/lib/public/assets/inter-vietnamese-700-normal-DlLaEgI2.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- package/lib/public/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/lib/public/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/lib/public/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/lib/public/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- package/lib/public/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/lib/public/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/lib/public/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- package/lib/public/assets/labels-C21SA4JG.js +1 -0
- package/lib/public/assets/{layers-D-yZE6bU.js → layers-CLEiWc3Q.js} +1 -1
- package/lib/public/assets/{lock-DxBvYOqy.js → lock-B5DBh7I-.js} +1 -1
- package/lib/public/assets/login-CvGFxzTo.js +16 -0
- package/lib/public/assets/maintenance-settings-aOiaY5QP.js +6 -0
- package/lib/public/assets/{mouse-pointer-2-CQ2mdF_7.js → mouse-pointer-2-CMMuXxm8.js} +1 -1
- package/lib/public/assets/{network-Q7vbjzz0.js → network-BzgNm5G_.js} +1 -1
- package/lib/public/assets/overview-BjXhP2-A.js +1 -0
- package/lib/public/assets/page-header-CIHfvMfu.js +1 -0
- package/lib/public/assets/{plus-CG9Sn9fy.js → plus-DSFN1MZL.js} +1 -1
- package/lib/public/assets/profile-page-Cagzxqm_.js +6 -0
- package/lib/public/assets/reset-password-CNGXEBPP.js +1 -0
- package/lib/public/assets/{runbook-page-BcfSJRZ-.css → runbook-page-BFqSC-Ta.css} +1 -1
- package/lib/public/assets/{runbook-page-BFtGGu9a.js → runbook-page-DHxfWVhF.js} +3 -3
- package/lib/public/assets/{select-4T1fp-kZ.js → select-C8hFZkwI.js} +1 -1
- package/lib/public/assets/select-_gbV-uJG.css +1 -0
- package/lib/public/assets/selector-detail-page-CcxpAy9r.js +1 -0
- package/lib/public/assets/selector-health-BlICzZlk.css +1 -0
- package/lib/public/assets/{selector-health-CHoH1-zy.js → selector-health-DmH5KxWA.js} +1 -1
- package/lib/public/assets/selector-health-page-vFLn1P9L.js +16 -0
- package/lib/public/assets/session-detail-page-BCCjt7ou.js +8 -0
- package/lib/public/assets/settings-Bp7o3FoT.css +1 -0
- package/lib/public/assets/settings-Dajy1PHb.js +1 -0
- package/lib/public/assets/status-pill-outline-ZwPT8_D3.js +1 -0
- package/lib/public/assets/{tablet-BIbMGb4H.js → tablet-4EjjJ-_t.js} +1 -1
- package/lib/public/assets/teams-CUIp3Wqn.js +1 -0
- package/lib/public/assets/{trash-2-BV8DaKx_.js → trash-2-EA7H_2h0.js} +1 -1
- package/lib/public/assets/upload-BLa3vHMO.js +11 -0
- package/lib/public/assets/use-password-reset-mode-othVAbAe.js +1 -0
- package/lib/public/assets/users-C9JqbmAV.js +11 -0
- package/lib/public/assets/users-CVAU-huh.js +1 -0
- package/lib/public/assets/webhook-settings-CAfLaykw.css +1 -0
- package/lib/public/assets/{webhook-settings-Zw7gAR8Q.js → webhook-settings-D1G916Hz.js} +1 -1
- package/lib/public/assets/{zap-70Tau1Ms.js → zap-CeBkeV9f.js} +1 -1
- package/lib/public/index.html +15 -3
- package/lib/public/logo-light.svg +17 -0
- package/lib/src/app/routers/auth.js +22 -16
- package/lib/src/app/routers/users.js +46 -0
- package/lib/src/config.js +3 -1
- package/lib/src/services/EmailService.js +24 -0
- package/lib/src/services/PasswordResetService.js +15 -0
- package/lib/src/services/ServerManager.js +2 -0
- package/lib/src/services/passwordResetLink.js +32 -0
- package/lib/src/services/passwordResetMode.js +6 -0
- package/lib/test/unit/EmailService.test.js +48 -0
- package/lib/test/unit/passwordResetMode.test.js +16 -0
- package/lib/test/unit/reset-link.test.js +239 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/public/assets/ApiKeyGate-DLjhUnbW.js +0 -1
- package/lib/public/assets/BugReportButton-DeF8gwF1.css +0 -1
- package/lib/public/assets/DeviceMosaicView-QAGuRZ5c.js +0 -2
- package/lib/public/assets/Modal-qvYudaqQ.css +0 -1
- package/lib/public/assets/SegmentedControl-M7StbYAD.css +0 -1
- package/lib/public/assets/SettingCard-C7wPlNh9.css +0 -1
- package/lib/public/assets/SettingCard-DfBXHTv_.js +0 -11
- package/lib/public/assets/ai-settings-BU3nbQqb.js +0 -21
- package/lib/public/assets/api-keys-4r82-Fxk.js +0 -1
- package/lib/public/assets/apps-CTrGClro.css +0 -1
- package/lib/public/assets/apps-Hmf7tLyy.js +0 -21
- package/lib/public/assets/auth-shell-0ptFq2vz.css +0 -1
- package/lib/public/assets/auth-shell-C7CVm6ff.js +0 -6
- package/lib/public/assets/builds-page-CkgpzpKT.js +0 -6
- package/lib/public/assets/button-DtC0WGPu.css +0 -1
- package/lib/public/assets/device-explorer-B-VTi-kT.css +0 -1
- package/lib/public/assets/device-explorer-C2eGFL8e.js +0 -255
- package/lib/public/assets/forgot-password-XdFIVIyv.js +0 -1
- package/lib/public/assets/index-Cp6E2WlI.js +0 -209
- package/lib/public/assets/index-QH6vvWUd.css +0 -1
- package/lib/public/assets/input-9Hi18BMC.css +0 -1
- package/lib/public/assets/login-DpyIc43Q.js +0 -16
- package/lib/public/assets/maintenance-settings-BVmYluz-.js +0 -6
- package/lib/public/assets/overview-CO7lf19V.js +0 -1
- package/lib/public/assets/page-header-D6LOac8M.js +0 -1
- package/lib/public/assets/profile-page-Dj3ti_hX.js +0 -6
- package/lib/public/assets/reset-password-DGI2b25K.js +0 -1
- package/lib/public/assets/select-BrbMzFJu.css +0 -1
- package/lib/public/assets/selector-detail-page-D-JcFIuG.js +0 -1
- package/lib/public/assets/selector-health-C4Sv_nTk.css +0 -1
- package/lib/public/assets/selector-health-page-Y8-92ZJH.js +0 -16
- package/lib/public/assets/session-detail-page-CEt5xX0B.js +0 -8
- package/lib/public/assets/settings-Cxx_aYWT.css +0 -1
- package/lib/public/assets/settings-DlaK_K8m.js +0 -1
- package/lib/public/assets/shield-alert-DZYVu3c1.js +0 -6
- package/lib/public/assets/shield-gWYgGksG.js +0 -11
- package/lib/public/assets/status-pill-outline-vu2WkEaH.js +0 -1
- package/lib/public/assets/teams-D3WwRLh1.js +0 -1
- package/lib/public/assets/upload-DquxFe9d.js +0 -16
- package/lib/public/assets/useSocket-BJPN65_X.js +0 -1
- package/lib/public/assets/users-Qw1INyd-.js +0 -11
- package/lib/public/assets/users-cwrwUhwo.js +0 -1
- package/lib/public/assets/webhook-settings-tW1oXXrJ.css +0 -1
package/lib/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as e,o as h}from"./index-DjWgs7qB.js";function y({children:c}){const[i,s]=n.useState(null),[o,l]=n.useState(""),[a,r]=n.useState(null);if(n.useEffect(()=>{fetch("/xenon/api/health").then(()=>fetch("/xenon/api/sessions",{credentials:"include"})).then(t=>s(t.status!==401)).catch(()=>s(!1))},[]),i===null)return e.jsx("div",{style:{padding:40},children:"Loading…"});if(i)return e.jsx(e.Fragment,{children:c});async function u(t){t.preventDefault(),r(null);const d=await fetch("/xenon/api/auth/dashboard-session",{method:"POST",headers:{"Content-Type":"application/json",...h},credentials:"include",body:JSON.stringify({apiKey:o.trim()})});if(d.ok)s(!0);else{const p=await d.json().catch(()=>({}));r(p.error||"Invalid key")}}return e.jsxs("div",{style:{maxWidth:420,margin:"120px auto",padding:24},children:[e.jsx("h2",{children:"Sign in to Xenon"}),e.jsxs("p",{children:["Paste an API key. First-time setup: the bootstrap key is in"," ",e.jsx("code",{children:"~/.cache/xenon/bootstrap-key.txt"})," on the server."]}),e.jsxs("form",{onSubmit:u,children:[e.jsx("input",{type:"password",value:o,onChange:t=>l(t.target.value),placeholder:"API key",style:{width:"100%",padding:8,boxSizing:"border-box"},autoFocus:!0}),e.jsx("button",{type:"submit",style:{marginTop:12,padding:"8px 16px"},children:"Continue"})]}),a&&e.jsx("p",{style:{color:"crimson",marginTop:12},children:a})]})}export{y as ApiKeyGate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:10px;font-family:Inter,sans-serif;font-size:11px;font-weight:500;line-height:1.4;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:1px solid transparent}.pill-neutral{background:var(--surface-2);color:var(--text)}.pill-accent{background:var(--accent-subtle);color:var(--color-accent);border-color:var(--accent-border)}.pill-ready{background:var(--status-ready-bg);color:var(--status-ready-fg);border-color:var(--status-ready-border)}.pill-busy{background:var(--status-busy-bg);color:var(--status-busy-fg);border-color:var(--status-busy-border)}.pill-reserved{background:var(--status-reserved-bg);color:var(--status-reserved-fg);border-color:var(--status-reserved-border)}.pill-error{background:var(--status-error-bg);color:var(--status-error-fg);border-color:var(--status-error-border)}.pill-offline{background:var(--status-offline-bg);color:var(--status-offline-fg);border-color:var(--status-offline-border)}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{c as m,j as o,r as
|
|
1
|
+
import{c as m,j as o,r as f,x as g,f as b}from"./index-DjWgs7qB.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const x=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],h=m("bug",x),v=({tone:e="neutral",children:r,title:s})=>o.jsx("span",{className:`pill pill-${e}`,title:s,children:r});async function y(e){const r=new URLSearchParams({mode:e.mode});e.mode==="slice"&&e.windowSec&&r.set("windowSec",String(e.windowSec));const s=`/xenon/api/sessions/${encodeURIComponent(e.sessionId)}/bug-report?${r.toString()}`,t=await fetch(s,{method:"POST"});if(!t.ok){let u=`HTTP ${t.status}`;try{const p=await t.json();p&&p.error&&(u=p.error)}catch{}throw new Error(u)}const a=t.headers.get("content-disposition")||"",n=/filename="([^"]+)"/.exec(a),
|
|
6
|
+
*/const x=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],h=m("bug",x),v=({tone:e="neutral",children:r,title:s})=>o.jsx("span",{className:`pill pill-${e}`,title:s,children:r});async function y(e){const r=new URLSearchParams({mode:e.mode});e.mode==="slice"&&e.windowSec&&r.set("windowSec",String(e.windowSec));const s=`/xenon/api/sessions/${encodeURIComponent(e.sessionId)}/bug-report?${r.toString()}`,t=await fetch(s,{method:"POST"});if(!t.ok){let u=`HTTP ${t.status}`;try{const p=await t.json();p&&p.error&&(u=p.error)}catch{}throw new Error(u)}const a=t.headers.get("content-disposition")||"",n=/filename="([^"]+)"/.exec(a),c=n?n[1]:`bugreport-${e.sessionId}.zip`,d=await t.blob(),l=URL.createObjectURL(d),i=document.createElement("a");i.href=l,i.download=c,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(l)}const j=({sessionId:e,mode:r,windowSec:s,variant:t})=>{const[a,n]=f.useState(!1),{toast:c}=g();async function d(){if(!a){n(!0);try{await y({sessionId:e,mode:r,windowSec:s}),c("Bug report downloaded","success")}catch(l){c(`Bug report failed: ${l.message}`,"error")}finally{n(!1)}}}return t==="floating"?o.jsxs("button",{type:"button",onClick:d,disabled:a,title:`Capture last ${s??60}s as bug report`,"aria-label":"Generate bug report",className:`fixed bottom-4 right-4 z-30 inline-flex items-center gap-2 px-3 py-2 rounded-full
|
|
7
7
|
bg-[var(--surface-2)] border border-[var(--border)] text-xs text-[var(--text)]
|
|
8
|
-
shadow-lg hover:bg-[var(--surface-raised)] disabled:opacity-50`,children:[a?o.jsx(b,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(h,{className:"h-3.5 w-3.5"}),"Bug report"]}):o.jsxs("button",{type:"button",onClick:
|
|
8
|
+
shadow-lg hover:bg-[var(--surface-raised)] disabled:opacity-50`,children:[a?o.jsx(b,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(h,{className:"h-3.5 w-3.5"}),"Bug report"]}):o.jsxs("button",{type:"button",onClick:d,disabled:a,title:"Download a zip of this session for ticketing",className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded text-xs
|
|
9
9
|
bg-[var(--surface-2)] hover:bg-[var(--surface-raised)] border border-[var(--border)]
|
|
10
10
|
text-[var(--text)] disabled:opacity-50`,children:[a?o.jsx(b,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(h,{className:"h-3.5 w-3.5"}),"Download bug report"]})};export{j as B,v as P};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as u,j as r,X as D,T as Se,W as je}from"./index-DjWgs7qB.js";import{p as Te}from"./labels-C21SA4JG.js";import{A as K,I as Ce}from"./keycodes-bIEJfQzr.js";import{a as Ae}from"./page-header-CIHfvMfu.js";function Ie(e,t){return e!=="auto"?e:t<=1?"1":t===2?"2x1":t<=4?"2x2":"3x2"}const ke={selected:new Set,layout:"2x2",tiles:[],groupId:null,compositeEnabled:!1,downloadableVideoCount:0,recordingPhase:"idle",recording:!1,startedAt:null,annotateMode:!1,shape:"RECT",color:"#ff3333",overlayAnnotations:{},errorBanner:null,banner:null};function De(e,t){var n;switch(t.type){case"SET_LAYOUT":return{...e,layout:t.layout};case"TOGGLE_SELECTED":{const o=new Set(e.selected);return o.has(t.udid)?o.delete(t.udid):o.add(t.udid),{...e,selected:o}}case"CLEAR_SELECTED":return{...e,selected:new Set};case"SET_TILES":return{...e,tiles:t.tiles};case"ADD_TILE":return e.tiles.some(o=>o.udid===t.tile.udid)?e:{...e,tiles:[...e.tiles,t.tile]};case"PATCH_TILE_DIMS":{let o=!1;const i=e.tiles.map(f=>f.udid!==t.udid||f.screenWidth&&f.screenHeight?f:(o=!0,{...f,screenWidth:t.screenWidth,screenHeight:t.screenHeight,aspect:f.aspect??t.aspect}));return o?{...e,tiles:i}:e}case"REMOVE_TILE":return e.recordingPhase!=="idle"?e:{...e,tiles:e.tiles.filter(o=>o.udid!==t.udid)};case"BIND_RECORDING_IDS":{const o=e.tiles.map(i=>({...i,recordingId:t.map[i.udid]??i.recordingId}));return{...e,tiles:o}}case"SET_RECORDING_PHASE":{const o=t.phase;return{...e,recordingPhase:o,recording:o==="recording"||o==="stopping"}}case"START_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:t.tileIds[i.udid]??i.recordingId}));return{...e,groupId:t.groupId,compositeEnabled:t.compositeEnabled===!0,downloadableVideoCount:0,recordingPhase:"recording",recording:!0,annotateMode:!0,startedAt:t.startedAt,overlayAnnotations:{},tiles:o}}case"STOP_RECORDING":{const o=e.tiles.map(i=>({...i,recordingId:void 0}));return{...e,recording:!1,recordingPhase:"idle",annotateMode:!1,overlayAnnotations:{},downloadableVideoCount:t.downloadableVideoCount??e.downloadableVideoCount,compositeEnabled:t.compositeEnabled!==void 0?t.compositeEnabled:e.compositeEnabled,tiles:o}}case"SET_ANNOTATE_MODE":return{...e,annotateMode:t.enabled};case"SET_SHAPE":return{...e,shape:t.shape};case"SET_COLOR":return{...e,color:t.color};case"SET_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{...e.overlayAnnotations,[t.recordingId]:t.annotations}};case"CLEAR_OVERLAY_ANNOTATIONS":return{...e,overlayAnnotations:{}};case"SET_ERROR_BANNER":return{...e,errorBanner:t.message,banner:t.message?{tone:"error",message:t.message}:null};case"SET_BANNER":return{...e,banner:t.banner,errorBanner:((n=t.banner)==null?void 0:n.tone)==="error"?t.banner.message:null};default:return e}}const le=u.createContext(null);function _e(){const e=u.useContext(le);if(!e)throw new Error("useMosaic must be used inside <MosaicContext.Provider>");return e}function Me(){return u.useReducer(De,ke)}function $e(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${o}:${String(i).padStart(2,"0")}`}function Pe(e){switch(e){case"automation":return"In automation";case"manual_other":return"Manual control by another user";case"manual_self":return"In your mosaic";case"recording_other_group":return"Recording in another group";default:return e?"Busy":null}}const re=[{id:"ios",label:"iOS",match:e=>e==="ios"},{id:"android",label:"Android",match:e=>e==="android"},{id:"tvos",label:"tvOS",match:e=>e==="tvos"},{id:"androidtv",label:"Android TV",match:e=>e==="androidtv"||e==="android-tv"},{id:"other",label:"Other",match:()=>!0}];function Oe(e){return Te(e)}function Le({devices:e,inMosaic:t,onToggle:n}){const[o,i]=u.useState(""),[f,g]=u.useState({}),S=u.useMemo(()=>{const h=o.trim().toLowerCase();return h?e.filter(y=>y.udid.toLowerCase().includes(h)||(y.name??"").toLowerCase().includes(h)||(y.platform??"").toLowerCase().includes(h)):e},[e,o]),v=u.useMemo(()=>{const h=re.map(c=>({id:c.id,label:c.label,rows:[]})),y=c=>h.find((j,w)=>re[w].match(c))??h[h.length-1];for(const c of S)y((c.platform??"").toLowerCase()).rows.push(c);return h.filter(c=>c.rows.length>0)},[S]);return e.length===0?r.jsx("div",{className:"text-xs text-[var(--text-dim)] p-3",children:"No devices online."}):r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx("span",{"aria-hidden":!0,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-dim)] text-xs",children:"⌕"}),r.jsx("input",{type:"text",value:o,placeholder:"Filter devices...",onChange:h=>i(h.target.value),className:"w-full pl-7 pr-2 py-1.5 text-xs rounded border border-[var(--border)] bg-transparent placeholder:text-[var(--text-dim)] focus:outline-none focus:border-[var(--color-info)]"})]}),v.map(h=>{const y=f[h.id];return r.jsxs("section",{className:"flex flex-col gap-1",children:[r.jsxs("button",{type:"button",onClick:()=>g(c=>({...c,[h.id]:!c[h.id]})),className:"flex items-center justify-between w-full text-[11px] text-[var(--text-dim)] hover:text-[rgb(var(--rgb-fg))] px-1 py-0.5",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-block transition-transform ${y?"-rotate-90":"rotate-0"}`,children:"▾"}),h.label]}),r.jsx("span",{children:h.rows.length})]}),!y&&r.jsx("ul",{className:"flex flex-col gap-1 text-sm",children:h.rows.map(c=>{const j=c.busyReason==="manual_self",w=t.has(c.udid),m=!!c.busy&&!j&&!w||!!c.offline,b=c.offline?"Offline":Pe(c.busyReason),T=!m;return r.jsx("li",{children:r.jsxs("button",{type:"button",disabled:m,draggable:!m,onDragStart:s=>{s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData("application/x-xenon-udid",c.udid),s.dataTransfer.setData("text/plain",c.udid)},onClick:()=>n(c.udid),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded text-left border transition-colors ${m?"opacity-60 cursor-not-allowed border-transparent":w?"border-[rgb(var(--rgb-accent)/0.4)] bg-[rgb(var(--rgb-accent)/0.05)] hover:bg-[rgb(var(--rgb-accent)/0.1)]":"border-transparent hover:border-[var(--border)] hover:bg-[var(--surface-2)]"}`,title:m?`${b} — release first`:w?"Click to remove from mosaic (or drag to a cell)":"Click to add to mosaic (or drag to a cell)",children:[r.jsx("span",{"aria-hidden":!0,className:`inline-flex items-center justify-center w-4 h-4 text-xs ${w?"text-[var(--color-accent-soft)]":"text-[var(--text-dim)]"}`,children:w?"●":"○"}),r.jsx("span",{"aria-hidden":!0,className:`inline-block w-1.5 h-1.5 rounded-full ${c.offline?"bg-zinc-600":T?"bg-[var(--color-success)]":"bg-yellow-500"}`}),r.jsx("span",{className:"font-medium flex-1 truncate text-[13px]",children:c.name??c.udid}),c.platform&&r.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded bg-[var(--surface-2)] text-[var(--text-dim)]",children:Oe(c.platform)})]})},c.udid)})})]},h.id)}),o&&v.length===0&&r.jsxs("div",{className:"text-xs text-[var(--text-dim)] px-1 py-2",children:['No devices match "',o,'".']}),r.jsxs("div",{className:"text-[10px] text-[var(--text-dim)] px-1 pt-2 flex items-center gap-3",children:[r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-success)] inline-block"})," available"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-500 inline-block"})," in use"]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zinc-600 inline-block"})," offline"]})]})]})}const Be=[{id:"1",label:"1",icon:r.jsx(Ye,{})},{id:"2x1",label:"2×1",icon:r.jsx(We,{})},{id:"2x2",label:"2×2",icon:r.jsx(Fe,{})},{id:"3x2",label:"3×2",icon:r.jsx(Xe,{})},{id:"auto",label:"Auto",icon:r.jsx(Ve,{})}];function Ue({value:e,onChange:t}){return r.jsx("div",{role:"tablist",className:"inline-flex border border-[var(--border)] rounded-md overflow-hidden text-xs bg-[rgb(var(--rgb-white)/0.02)]",children:Be.map(n=>{const o=e===n.id;return r.jsxs("button",{role:"tab","aria-selected":o,onClick:()=>t(n.id),className:`flex items-center gap-1.5 px-2.5 py-1.5 border-r border-[var(--border)] last:border-r-0 transition-colors ${o?"bg-[var(--surface-2)] text-[rgb(var(--rgb-fg))]":"text-[var(--text-dim)] hover:bg-[var(--surface-2)] hover:text-[rgb(var(--rgb-fg))]"}`,title:`Layout: ${n.label}`,children:[r.jsx("span",{className:"w-3.5 h-3.5 inline-flex items-center justify-center",children:n.icon}),r.jsx("span",{children:n.label})]},n.id)})})}function P(e){return r.jsx("rect",{rx:1.2,ry:1.2,fill:"currentColor",...e})}function Ye(){return r.jsx("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:P({x:2,y:2,width:10,height:10})})}function We(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:3,width:5,height:8}),P({x:7.5,y:3,width:5,height:8})]})}function Fe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1.5,y:1.5,width:5,height:5}),P({x:7.5,y:1.5,width:5,height:5}),P({x:1.5,y:7.5,width:5,height:5}),P({x:7.5,y:7.5,width:5,height:5})]})}function Xe(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",children:[P({x:1,y:1.5,width:3.3,height:5}),P({x:5.35,y:1.5,width:3.3,height:5}),P({x:9.7,y:1.5,width:3.3,height:5}),P({x:1,y:7.5,width:3.3,height:5}),P({x:5.35,y:7.5,width:3.3,height:5}),P({x:9.7,y:7.5,width:3.3,height:5})]})}function Ve(){return r.jsxs("svg",{viewBox:"0 0 14 14",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[r.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"1.5"}),r.jsx("circle",{cx:"7",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"})]})}function ne(e,t){const n=(e||"#ff3333").trim();if(/^#[0-9a-fA-F]{6}$/.test(n)){const o=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),f=parseInt(n.slice(5,7),16);return`rgba(${o},${i},${f},${t})`}return n}function oe(e,t,n,o){const i=o.geometry,f=o.color||"#ff3333",g=Math.max(4,Math.round(Math.min(t,n)*.008));if(e.lineCap="round",e.lineJoin="round",o.shape==="CIRCLE"){const c=(i.x??0)*t,j=(i.y??0)*n,w=Math.max(2,(i.w??0)*t),m=Math.max(2,(i.h??0)*n);e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.fillStyle=ne(f,.22),e.fill(),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.stroke(),e.beginPath(),e.ellipse(c,j,w,m,0,0,Math.PI*2),e.lineWidth=g,e.strokeStyle=f,e.stroke();return}if(o.shape==="ARROW"){const c=(i.x??0)*t,j=(i.y??0)*n,w=c+(i.w??0)*t,m=j+(i.h??0)*n;e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke(),e.lineWidth=g,e.strokeStyle=f,e.beginPath(),e.moveTo(c,j),e.lineTo(w,m),e.stroke();const b=Math.atan2(m-j,w-c),T=Math.max(14,g*3);e.fillStyle=f,e.beginPath(),e.moveTo(w,m),e.lineTo(w-T*Math.cos(b-.4),m-T*Math.sin(b-.4)),e.lineTo(w-T*Math.cos(b+.4),m-T*Math.sin(b+.4)),e.closePath(),e.fill();return}if(o.shape==="TEXT"&&o.text){const c=Math.max(16,Math.round(Math.min(t,n)*.035));e.font=`bold ${c}px sans-serif`,e.lineWidth=3,e.strokeStyle="rgba(0,0,0,0.65)",e.strokeText(o.text,(i.x??0)*t,(i.y??0)*n),e.fillStyle=f,e.fillText(o.text,(i.x??0)*t,(i.y??0)*n);return}const S=(i.x??0)*t,v=(i.y??0)*n,h=Math.max(2,(i.w??0)*t),y=Math.max(2,(i.h??0)*n);e.fillStyle=ne(f,.22),e.fillRect(S,v,h,y),e.lineWidth=g+2,e.strokeStyle="rgba(0,0,0,0.55)",e.strokeRect(S,v,h,y),e.lineWidth=g,e.strokeStyle=f,e.strokeRect(S,v,h,y)}function se(e,t,n,o,i){if(o<=0||i<=0)return null;if(e==="CIRCLE"){const h=Math.hypot(n.curX-n.startX,n.curY-n.startY);return h<=4?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:h/i}}}if(e==="ARROW"){const h=n.curX-n.startX,y=n.curY-n.startY;return Math.hypot(h,y)<=6?null:{shape:e,color:t,geometry:{x:n.startX/o,y:n.startY/i,w:h/o,h:y/i}}}const f=Math.min(n.startX,n.curX)/o,g=Math.min(n.startY,n.curY)/i,S=Math.abs(n.curX-n.startX)/o,v=Math.abs(n.curY-n.startY)/i;return S<=.005||v<=.005?null:{shape:e,color:t,geometry:{x:f,y:g,w:S,h:v}}}function He({enabled:e,shape:t,color:n,onCommit:o,committed:i,onCommittedChange:f}){const g=u.useRef(null),[S,v]=u.useState(null),[h,y]=u.useState([]),c=i??h,j=u.useRef(c),w=u.useRef(S),m=u.useRef(t),b=u.useRef(n),T=u.useRef(e);j.current=c,w.current=S,m.current=t,b.current=n,T.current=e;const s=u.useCallback(a=>{const p=a(j.current);j.current=p,f?f(p):y(p)},[f]),d=u.useCallback(()=>{const a=g.current;if(!a)return;const p=a.getContext("2d");if(!p)return;p.clearRect(0,0,a.width,a.height);for(const M of j.current)oe(p,a.width,a.height,M);const C=w.current;if(C){const M=se(m.current,b.current,C,a.width,a.height);M&&oe(p,a.width,a.height,M)}},[]);u.useEffect(()=>{const a=g.current;if(!a)return;const p=()=>{const M=Math.max(1,Math.round(a.clientWidth)),B=Math.max(1,Math.round(a.clientHeight));(a.width!==M||a.height!==B)&&(a.width=M,a.height=B),d()};p();const C=new ResizeObserver(p);return C.observe(a),()=>C.disconnect()},[d]),u.useEffect(()=>{d()},[S,c,d]),u.useEffect(()=>{var p;if(e)return;v(null);const a=g.current;if(a&&a.hasPointerCapture)try{for(let C=0;C<8;C++)(p=a.hasPointerCapture)!=null&&p.call(a,C)&&a.releasePointerCapture(C)}catch{}},[e]);const E=a=>{const C=g.current.getBoundingClientRect();return{px:a.clientX-C.left,py:a.clientY-C.top,w:C.width,h:C.height}},I=a=>{const p=w.current;if(!p||!T.current){v(null);return}const C=g.current;if(!C||C.width<=0){v(null);return}const M=E(a),B=se(m.current,b.current,{...p,curX:M.px,curY:M.py},M.w,M.h);B&&(s(U=>[...U,B]),o(B)),v(null)},A=a=>{if(!e||a.button!==0)return;a.preventDefault(),a.currentTarget.setPointerCapture(a.pointerId);const p=E(a);v({startX:p.px,startY:p.py,curX:p.px,curY:p.py})},R=a=>{if(!w.current)return;const p=E(a);v(C=>C&&{...C,curX:p.px,curY:p.py})},x=a=>{try{a.currentTarget.releasePointerCapture(a.pointerId)}catch{}I(a)};return r.jsx("canvas",{ref:g,style:{position:"absolute",inset:0,pointerEvents:e?"auto":"none",cursor:e?"crosshair":"default",zIndex:e?40:25},onPointerDown:A,onPointerMove:R,onPointerUp:x,onPointerCancel:x})}const Ge=3,Ke=45e3,ie=[2e3,5e3,1e4];function ze(e){const t=Math.max(0,Math.min(e,ie.length-1));return ie[t]}function Je(e){return e<Ge}function ae(e){const t=(e.lastError||"").toLowerCase();return/did not find test app|not installed|webdriveragentrunner|applicationverification/.test(t)?"WebDriverAgent is not installed on this device. Install and trust WDA, then retry.":/unsupported ios version|manualpairingtunnelstart/.test(t)?"This device’s iOS version is not supported for live streaming on this host.":/econnrefused|econnreset|connection reset|tunnel/.test(t)?"Lost the connection to the device tunnel. Reconnect the device, then retry.":e.lastError&&e.lastError.trim()?e.lastError.trim():"We couldn’t start the live stream for this device."}function qe(e){for(let t=0;t+4<e.length;t++){const n=e[t]===0&&e[t+1]===0&&e[t+2]===0&&e[t+3]===1,o=e[t]===0&&e[t+1]===0&&e[t+2]===1;if(!n&&!o)continue;const i=t+(n?4:3);if((e[i]&31)===7){const f=g=>g.toString(16).padStart(2,"0");return`avc1.${f(e[i+1])}${f(e[i+2])}${f(e[i+3])}`}}return"avc1.42e01e"}const Ze=({wsUrl:e,onFatal:t,onReady:n,className:o})=>{const i=u.useRef(null),f=u.useRef(t);f.current=t;const g=u.useRef(n);return g.current=n,u.useEffect(()=>{var T;const S=window,v=i.current;if(typeof S.VideoDecoder>"u"||!v){(T=f.current)==null||T.call(f);return}const h=v.getContext("2d");let y=!1,c=!1,j=!0,w=0;const m=new S.VideoDecoder({output:s=>{var d;if(y){s.close();return}v.width!==s.displayWidth&&(v.width=s.displayWidth,v.height=s.displayHeight),h==null||h.drawImage(s,0,0),s.close(),j&&(j=!1,(d=g.current)==null||d.call(g))},error:()=>{var s;return(s=f.current)==null?void 0:s.call(f)}}),b=new WebSocket(e);return b.binaryType="arraybuffer",b.onerror=()=>{var s;return(s=f.current)==null?void 0:s.call(f)},b.onclose=()=>{var s;y||(s=f.current)==null||s.call(f)},b.onmessage=s=>{var A;const d=s.data,E=new DataView(d).getUint8(0),I=new Uint8Array(d,1);if(E===0){if(c)return;try{m.configure({codec:qe(I),optimizeForLatency:!0}),c=!0}catch{(A=f.current)==null||A.call(f)}return}if(!(!c||m.state!=="configured"))try{m.decode(new S.EncodedVideoChunk({type:E===1?"key":"delta",timestamp:w,data:I})),w+=11111}catch{}},()=>{y=!0;try{b.close()}catch{}try{m.state!=="closed"&&m.close()}catch{}}},[e]),r.jsx("canvas",{ref:i,className:o,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})};function Qe(e,t,n){return(e==="android"||e==="androidtv"||e==="android-tv")&&t==="h264"&&n?"h264":"mjpeg"}const et=10,tt=500;function rt({udid:e,name:t,recordingId:n,annotateMode:o,shape:i,color:f,aspect:g="9 / 16",screenWidth:S,screenHeight:v,platform:h,onAnnotation:y,overlayAnnotations:c,onOverlayAnnotationsChange:j,onRemove:w}){const[m,b]=u.useState("connecting"),[T,s]=u.useState(0),[d,E]=u.useState(null),I=u.useRef(0),A=u.useRef(null),[R,x]=u.useState(""),[a,p]=u.useState([]),[C,M]=u.useState(!1),B=u.useRef(null),U=u.useRef(null),W=h==="android"||h==="androidtv"||h==="android-tv",he=h==="ios"||h==="tvos";u.useEffect(()=>{let l=!1;if(n){E(null),b("connecting"),s(Date.now()),D.startStream(e).catch(()=>{});return}const N=typeof window.VideoDecoder<"u";return(async()=>{try{const _=encodeURIComponent(e),O=await fetch(`/xenon/api/control/${_}/stream/status`);if(!O.ok)return;const k=await O.json();if(Qe(h||"",k==null?void 0:k.type,N)!=="h264"||!(k!=null&&k.h264Path))return;const L=await fetch(`/xenon/api/control/${_}/stream/ticket`,{method:"POST"});if(!L.ok)return;const{ticket:$}=await L.json();if(l||!$)return;const H=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}${k.h264Path}?ticket=${encodeURIComponent($)}`;E(H)}catch{}})(),()=>{l=!0}},[e,h,n]);const V=!o&&!!S&&!!v,Q=(l,N,_)=>{const O=S,k=v,L=Math.min(1,Math.max(0,(l-_.left)/_.width)),$=Math.min(1,Math.max(0,(N-_.top)/_.height));return{x:Math.round(L*O),y:Math.round($*k)}},pe=(l,N,_)=>{const O=Date.now()+Math.random(),k=l-_.left,L=N-_.top;p($=>[...$,{id:O,x:k,y:L}]),window.setTimeout(()=>{p($=>$.filter(X=>X.id!==O))},500)},me=l=>{if(!V||m==="unavailable"||l.button!==0)return;const N=l.currentTarget;N.setPointerCapture(l.pointerId),U.current={startX:l.clientX,startY:l.clientY,startTime:Date.now(),rect:N.getBoundingClientRect()},pe(l.clientX,l.clientY,U.current.rect),N.focus()},ge=async l=>{var H,te;const N=U.current;if(U.current=null,!N||!V)return;try{l.currentTarget.releasePointerCapture(l.pointerId)}catch{}const _=l.clientX-N.startX,O=l.clientY-N.startY,k=Math.hypot(_,O),L=Date.now()-N.startTime,$=Q(N.startX,N.startY,N.rect),X=k<et;try{if(X&&L<tt)await D.tap(e,$.x,$.y);else if(X)await((te=(H=D).touchAndHold)==null?void 0:te.call(H,e,$.x,$.y,L));else{const G=Q(l.clientX,l.clientY,N.rect);await D.swipe(e,$.x,$.y,G.x,G.y)}}catch(G){console.error(`[DeviceTile] gesture failed for ${e}`,G)}},be=()=>{U.current=null},xe=async l=>{if(!V||m==="unavailable"||l.metaKey||l.ctrlKey||l.altKey)return;const N=l.key;try{if(N.length===1){l.preventDefault(),await D.typeText(e,N);return}if(N==="Backspace"){l.preventDefault(),W?await D.pressKey(e,67):await D.typeText(e,"\b");return}if(N==="Enter"){l.preventDefault(),W?await D.pressKey(e,66):await D.typeText(e,`
|
|
2
|
+
`);return}if(N==="Tab"){l.preventDefault(),await D.typeText(e," ");return}N==="Escape"&&W&&(l.preventDefault(),await D.pressKey(e,K.BACK))}catch(_){console.error(`[DeviceTile] keystroke "${N}" failed for ${e}`,_)}},ye=()=>D.pressKey(e,W?K.HOME:Ce.HOME).catch(l=>console.error(`[DeviceTile] home failed for ${e}`,l)),ve=()=>D.pressKey(e,K.BACK).catch(l=>console.error(`[DeviceTile] back failed for ${e}`,l)),we=()=>D.pressKey(e,K.APP_SWITCH).catch(l=>console.error(`[DeviceTile] app-switch failed for ${e}`,l)),Ee=async()=>{try{const l=await D.getScreenshot(e),N=(l==null?void 0:l.screenshot)??(l==null?void 0:l.value)??l;if(!N)return;const _=await fetch(`data:image/png;base64,${N}`).then(L=>L.blob()),O=URL.createObjectURL(_),k=document.createElement("a");k.href=O,k.download=`${t||e}-${Date.now()}.png`,document.body.appendChild(k),k.click(),k.remove(),setTimeout(()=>URL.revokeObjectURL(O),1e3)}catch(l){console.error(`[DeviceTile] screenshot failed for ${e}`,l)}};u.useEffect(()=>{console.log(`[DeviceTile] Rendering ${e} in state: ${m}`)},[e,m]);const Ne=`/xenon/api/control/${encodeURIComponent(e)}/stream?t=${T}`,ee=u.useCallback(async()=>{try{const l=await fetch(`/xenon/api/control/${encodeURIComponent(e)}/stream/status`);if(!l.ok)throw new Error(String(l.status));const N=await l.json();x(ae({lastError:N==null?void 0:N.lastError,status:N==null?void 0:N.status}))}catch{x(ae({}))}},[e]),J=u.useCallback(()=>{const l=I.current;Je(l)?(I.current=l+1,A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{b("connecting"),s(Date.now())},ze(l))):(b("unavailable"),ee())},[ee]);u.useEffect(()=>{if(m!=="connecting")return;const l=setTimeout(J,Ke);return()=>clearTimeout(l)},[m,T,J]),u.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]);const Re=()=>{A.current&&clearTimeout(A.current),I.current=0,x(""),b("connecting"),s(Date.now())},F=!!n,q=t||e.slice(0,16)+"…";return r.jsxs("div",{className:"flex items-stretch justify-center w-full h-full min-h-0 min-w-0 gap-2",children:[r.jsxs("div",{className:"relative bg-[var(--black)] rounded-lg overflow-hidden border border-[var(--border)] group max-h-full max-w-full self-center",style:{aspectRatio:g,height:"100%"},children:[m==="connecting"&&r.jsxs("div",{className:"flex flex-col items-center justify-center bg-neutral-900/80 text-neutral-400 absolute inset-0 z-20 pointer-events-none",children:[r.jsx("div",{className:"relative flex items-center justify-center",children:r.jsx("div",{className:"w-12 h-12 border-4 border-neutral-800 border-t-neutral-400 rounded-full animate-spin"})}),r.jsx("div",{className:"mt-4 font-bold text-neutral-200",children:"Starting Stream…"}),r.jsx("div",{className:"text-[10px] mt-1 text-neutral-500 opacity-60 font-mono",children:e}),r.jsx("div",{className:"text-[10px] mt-4 text-neutral-400 bg-white/5 px-2 py-1 rounded",children:"Waiting for device connection..."})]}),m==="unavailable"&&r.jsx("div",{className:"flex items-center justify-center bg-black text-neutral-400 absolute inset-0 z-20",children:r.jsxs("div",{className:"text-center p-6",children:[r.jsx("div",{className:"text-5xl mb-4 opacity-20",children:"📵"}),r.jsx("div",{className:"font-bold text-white text-lg",children:"Connection Failed"}),r.jsx("p",{className:"text-xs mt-2 text-neutral-500 leading-relaxed max-w-[240px] mx-auto",children:R||"We couldn’t start the live stream for this device."}),r.jsx("button",{className:"mt-6 text-sm font-semibold px-6 py-2.5 rounded-full bg-red-600 hover:bg-red-500 text-white transition-all active:scale-95",onClick:Re,children:"Retry connection"})]})}),d?r.jsx(Ze,{wsUrl:d,className:"absolute inset-0 w-full h-full object-contain bg-black select-none pointer-events-none",onReady:()=>b("live"),onFatal:()=>{console.warn(`[DeviceTile] H.264 fatal for ${e}; falling back to MJPEG`),E(null),b("connecting"),s(Date.now())}}):r.jsx("img",{src:Ne,alt:q,className:"absolute inset-0 w-full h-full object-contain bg-black select-none pointer-events-none",draggable:!1,style:{opacity:m==="live"?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>{console.log(`[DeviceTile] Image LOADED for ${e}`),I.current=0,A.current&&clearTimeout(A.current),b("live")},onError:l=>{console.error(`[DeviceTile] Image ERROR for ${e}`,l),J()}},T),V&&m!=="unavailable"&&r.jsx("div",{ref:B,className:`absolute inset-0 z-[35] touch-none outline-none ${C?"ring-2 ring-[rgb(var(--rgb-accent)/0.6)] ring-inset rounded-lg":""}`,tabIndex:0,onPointerDown:me,onPointerUp:ge,onPointerCancel:be,onKeyDown:xe,onFocus:()=>M(!0),onBlur:()=>M(!1)}),r.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none overflow-hidden",children:a.map(l=>r.jsx("span",{className:"absolute block w-10 h-10 rounded-full border-2 border-[var(--color-accent-soft)] animate-ping",style:{left:l.x-20,top:l.y-20}},l.id))}),F&&r.jsx(He,{enabled:o,shape:i,color:f,committed:c,onCommittedChange:j,onCommit:l=>y(n,l)}),F&&o&&m==="live"&&r.jsx("div",{className:"absolute bottom-3 left-3 right-3 z-30 pointer-events-none",children:r.jsx("div",{className:"px-2 py-1 rounded bg-black/70 text-[10px] text-amber-100 border border-amber-500/40 text-center",children:"Annotate on — drag on the preview. Shapes stay on screen and appear in Download video from that moment. Toggle Annotate off to tap the device."})}),F&&r.jsx("div",{className:"absolute top-3 left-3 z-30 pointer-events-none",children:r.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-red-600 text-white text-[9px] font-black shadow-lg",children:"REC"})}),r.jsxs("div",{className:"absolute top-3 left-3 z-30 flex flex-col gap-1.5 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[m==="live"&&r.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-[var(--color-success)] text-[var(--color-on-success)] text-[11px] font-semibold shadow-lg w-fit",children:"Live"}),r.jsx("span",{className:"px-2 py-1 rounded bg-black/80 text-white text-[11px] font-medium backdrop-blur-md border border-white/10 shadow-xl truncate max-w-[180px]",children:q})]})]}),r.jsx(nt,{streamState:m,recording:F,isIOS:he,isAndroid:W,platform:h,onClose:!F&&w?()=>w(e):void 0,sendHome:ye,sendBack:ve,sendAppSwitch:we,captureScreenshot:Ee,displayName:q})]})}function nt({streamState:e,recording:t,isIOS:n,isAndroid:o,platform:i,onClose:f,sendHome:g,sendBack:S,sendAppSwitch:v,captureScreenshot:h,displayName:y}){const c=e==="live";return!f&&!c?null:r.jsxs("div",{className:"self-stretch w-9 flex flex-col items-center justify-between gap-1 py-2 rounded-lg bg-black/40 border border-white/10 backdrop-blur-md text-white",children:[r.jsx("div",{className:"flex flex-col items-center gap-1",children:f&&r.jsx("button",{type:"button","aria-label":`Remove ${y} from mosaic`,title:"Remove from mosaic",onClick:f,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-red-600/70 transition-colors text-base leading-none",children:"×"})}),c&&r.jsxs("div",{className:"flex flex-col items-center gap-1.5 my-auto",children:[(o||n)&&r.jsx("button",{type:"button",title:`Home${i?` (${i})`:""}`,onClick:g,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"⌂"}),o&&r.jsx("button",{type:"button",title:"Back",onClick:S,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"‹"}),o&&r.jsx("button",{type:"button",title:"Recent apps",onClick:v,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"▢"})]}),c&&r.jsx("div",{className:"flex flex-col items-center gap-1",children:r.jsx("button",{type:"button",title:"Screenshot",onClick:h,className:"w-7 h-7 flex items-center justify-center rounded-md hover:bg-white/15 transition-colors text-sm",children:"⎙"})})]})}const ot={1:"1fr","2x1":"1fr 1fr","2x2":"1fr 1fr","3x2":"1fr 1fr 1fr"},st={1:"1fr","2x1":"1fr","2x2":"1fr 1fr","3x2":"1fr 1fr"},it={1:1,"2x1":2,"2x2":4,"3x2":6};function at({layout:e,tiles:t,annotateMode:n,shape:o,color:i,onAnnotation:f,overlayAnnotationsByRecording:g,onOverlayAnnotationsChange:S,onRemove:v,onDropDevice:h}){const y=Ie(e,t.length),c=it[y];t.length;const j=t.length,w=e==="auto"?Math.max(j,1):c,m=Math.max(0,w-j);return r.jsxs("div",{style:{display:"grid",gap:8,gridTemplateColumns:ot[y],gridTemplateRows:st[y]},className:"h-full",children:[t.map(b=>r.jsx(rt,{udid:b.udid,name:b.name,mjpegPort:b.mjpegPort,recordingId:b.recordingId,aspect:b.aspect,screenWidth:b.screenWidth,screenHeight:b.screenHeight,platform:b.platform,annotateMode:n,shape:o,color:i,overlayAnnotations:b.recordingId?g==null?void 0:g[b.recordingId]:void 0,onOverlayAnnotationsChange:b.recordingId&&S?T=>S(b.recordingId,T):void 0,onAnnotation:f,onRemove:v},b.udid)),Array.from({length:m},(b,T)=>r.jsx(ct,{onDropDevice:h},`empty-${T}`))]})}function ct({onDropDevice:e}){const[t,n]=u.useState(!1);return r.jsxs("div",{onDragOver:o=>{e&&(o.preventDefault(),o.dataTransfer.dropEffect="copy",t||n(!0))},onDragLeave:()=>n(!1),onDrop:o=>{if(n(!1),!e)return;o.preventDefault();const i=o.dataTransfer.getData("application/x-xenon-udid")||o.dataTransfer.getData("text/plain");i&&e(i)},className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors ${t?"border-[rgb(var(--rgb-accent)/0.6)] bg-[rgb(var(--rgb-accent)/0.05)]":"border-[var(--border)] bg-[rgb(var(--rgb-white)/0.02)]"} text-[var(--text-dim)] min-h-[120px]`,children:[r.jsx("div",{"aria-hidden":"true",className:`w-8 h-8 rounded-full flex items-center justify-center text-xl ${t?"bg-[rgb(var(--rgb-accent)/0.15)] text-[var(--color-accent-soft)]":"bg-[rgb(var(--rgb-fg)/0.05)] text-[rgb(var(--rgb-fg)/0.6)]"}`,children:"+"}),r.jsx("div",{className:"text-xs font-medium",children:"Drag device here"}),r.jsx("div",{className:"text-[10px] opacity-70",children:"or click one in the panel"})]})}const Y="/xenon/api/recordings";class de extends Error{constructor(t){super(t.message??t.error),this.body=t}}async function z(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:t?JSON.stringify(t):void 0});if(n.status===409)throw new de(await n.json());if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}function lt(e,t){return z(Y,{udids:e,...t})}function dt(e){return z(`${Y}/${encodeURIComponent(e)}/stop`)}function ue(e,t,n,o,i){return z(`${Y}/${encodeURIComponent(e)}/bookmark`,{recordingId:t,timecodeMs:n,label:o,note:i})}function ut(e,t){return z(`${Y}/${encodeURIComponent(e)}/annotation`,t)}function ft(e){return`${Y}/${encodeURIComponent(e)}/videos.zip`}function ht(e,t){return`${Y}/${encodeURIComponent(e)}/video.mp4`}function pt(e){return`${Y}/${encodeURIComponent(e)}/composite.mp4`}function mt(e,t){return t==="starting"?"Starting…":e<=0?"Record":e===1?"● Record":`● Record ${e} devices`}function gt({selectedUdids:e}){const{state:t,dispatch:n}=_e(),[o,i]=u.useState(()=>Date.now());u.useEffect(()=>{if(t.recordingPhase!=="recording"&&t.recordingPhase!=="stopping")return;i(Date.now());const R=window.setInterval(()=>i(Date.now()),250);return()=>window.clearInterval(R)},[t.recordingPhase]);const f=t.startedAt&&(t.recordingPhase==="recording"||t.recordingPhase==="stopping")?o-t.startedAt:0,g=t.recordingPhase==="starting"||t.recordingPhase==="stopping",S=t.recordingPhase==="idle"&&e.length>0&&!g,h=(t.recordingPhase==="recording"||t.recording&&t.tiles.some(R=>!!R.recordingId))&&!g,y=h,c=!!t.groupId&&t.recordingPhase==="idle",j=e.length>1||t.downloadableVideoCount>1,w=c&&t.compositeEnabled,m=c&&!t.compositeEnabled&&(t.downloadableVideoCount===1||t.downloadableVideoCount===0&&e.length<=1),b=async()=>{var R;if(S){n({type:"SET_RECORDING_PHASE",phase:"starting"}),n({type:"SET_BANNER",banner:null});try{const x=await lt(e);if(!((R=x.recordings)!=null&&R.length)){n({type:"SET_RECORDING_PHASE",phase:"idle"}),n({type:"SET_BANNER",banner:{tone:"error",message:"Recording did not start. Check that live preview is working, then try again."}});return}const a={};for(const C of x.recordings)a[C.udid]=C.id;const p=e.length-x.recordings.length;n({type:"START_RECORDING",groupId:x.groupId,startedAt:Date.now(),tileIds:a,compositeEnabled:x.compositeEnabled===!0}),p>0?n({type:"SET_BANNER",banner:{tone:"error",message:`Recording started on ${x.recordings.length} of ${e.length} devices (${p} failed).`}}):n({type:"SET_BANNER",banner:null})}catch(x){if(n({type:"SET_RECORDING_PHASE",phase:"idle"}),x instanceof de)if(x.body.error==="device_busy"){const a=(x.body.busyDevices??[]).map(p=>`${p.udid} (${p.reason})`).join(", ");n({type:"SET_BANNER",banner:{tone:"error",message:`Cannot start — these devices are busy: ${a}`}})}else n({type:"SET_BANNER",banner:{tone:"error",message:`Server-wide recording cap reached (${x.body.active}/${x.body.limit}).`}});else n({type:"SET_BANNER",banner:{tone:"error",message:`Recording failed: ${x.message}`}})}}},T=async()=>{if(!(!t.groupId||t.recordingPhase!=="recording")){n({type:"SET_RECORDING_PHASE",phase:"stopping"});try{const R=await dt(t.groupId),x=(R.recordings??[]).filter(p=>p.status==="STOPPED"&&(p.sizeBytes??0)>=1024),a=(R.recordings??[]).filter(p=>p.status!=="STOPPED");n({type:"STOP_RECORDING",downloadableVideoCount:x.length,compositeEnabled:t.compositeEnabled}),x.length===0?n({type:"SET_BANNER",banner:{tone:"error",message:a.length>0?`Recording failed on ${a.length} device(s). Nothing to download.`:"Recording stopped but no playable video was produced."}}):a.length>0?n({type:"SET_BANNER",banner:{tone:"info",message:`${x.length} video(s) ready · ${a.length} failed. Use Download below.`}}):n({type:"SET_BANNER",banner:{tone:"info",message:x.length===1?"Video ready — download below.":`${x.length} videos ready — download below.`}})}catch(R){n({type:"STOP_RECORDING"}),n({type:"SET_BANNER",banner:{tone:"error",message:`Stop failed: ${R.message}`}})}}},s=async()=>{var p;if(!t.groupId||t.recordingPhase!=="recording")return;const R=window.prompt("Bookmark label?");if(!R)return;const x=t.startedAt?Date.now()-t.startedAt:0,a=(p=t.tiles.find(C=>C.recordingId))==null?void 0:p.recordingId;if(a)try{await ue(t.groupId,a,x,R)}catch(C){n({type:"SET_BANNER",banner:{tone:"error",message:`Bookmark failed: ${C.message}`}})}},d=()=>{y&&n({type:"SET_ANNOTATE_MODE",enabled:!t.annotateMode})},E=()=>{y&&n({type:"CLEAR_OVERLAY_ANNOTATIONS"})},I=Object.values(t.overlayAnnotations).some(R=>((R==null?void 0:R.length)??0)>0),A=[{id:"RECT",label:"Rect"},{id:"CIRCLE",label:"Circle"},{id:"ARROW",label:"Arrow"},{id:"FREEHAND",label:"Draw"}];return r.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(t.recordingPhase==="recording"||t.recordingPhase==="stopping")&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono tabular-nums bg-[rgb(var(--rgb-red-600)/0.2)] text-[var(--red-200)] border border-[rgb(var(--rgb-red)/0.4)]",title:"Recording elapsed time",children:[r.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[var(--red)] animate-pulse"}),"REC ",$e(f),t.recordingPhase==="stopping"?" · Stopping…":""]}),r.jsx("button",{type:"button",onClick:b,disabled:!S,title:e.length===0?"Add a device to the mosaic first":"Record every device currently in the mosaic",className:"px-3 py-1.5 text-sm rounded bg-[var(--red-600)] text-white disabled:opacity-40 disabled:cursor-not-allowed",children:mt(e.length,t.recordingPhase)}),r.jsx("button",{type:"button",onClick:T,disabled:!h,className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] disabled:opacity-40 disabled:cursor-not-allowed",children:t.recordingPhase==="stopping"?"Stopping…":"⏹ Stop"}),r.jsx("button",{type:"button",onClick:s,disabled:!h,className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] disabled:opacity-40 disabled:cursor-not-allowed",children:"🔖 Bookmark"}),r.jsx("button",{type:"button",onClick:d,disabled:!y,title:y?t.annotateMode?"Exit annotate mode (tap/swipe resumes)":"Draw on the live screen — saved with the recording":"Start recording to annotate",className:`px-3 py-1.5 text-sm rounded border ${t.annotateMode?"bg-[var(--color-info)] text-white border-transparent":"border-[var(--border)]"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"✎ Annotate"}),t.annotateMode&&y&&r.jsxs("div",{className:"flex items-center gap-1 ml-1 pl-2 border-l border-[var(--border)]",children:[A.map(R=>r.jsx("button",{type:"button",onClick:()=>n({type:"SET_SHAPE",shape:R.id}),className:`px-2 py-1 text-xs rounded border ${t.shape===R.id?"bg-[var(--surface-2)] border-[var(--color-info)] text-[rgb(var(--rgb-fg))]":"border-[var(--border)] opacity-80 hover:opacity-100"}`,children:R.label},R.id)),r.jsx("input",{type:"color",value:t.color,onChange:R=>n({type:"SET_COLOR",color:R.target.value}),title:"Annotation color",className:"w-7 h-7 rounded border border-[var(--border)] bg-transparent cursor-pointer"})]}),y&&I&&r.jsx("button",{type:"button",onClick:E,title:"Clear drawn annotations from the live preview",className:"px-2 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",children:"Clear marks"}),c&&m&&r.jsx("a",{href:ht(t.groupId),className:"ml-1 px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:!0,children:"⤓ Download video"}),c&&!m&&r.jsxs("a",{href:ft(t.groupId),className:"ml-1 px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:`videos-${t.groupId}.zip`,title:"ZIP of mp4 files only (no JSON extras)",children:["⤓ Download ",j?"videos":"video"]}),w&&r.jsx("a",{href:pt(t.groupId),className:"px-3 py-1.5 text-sm rounded border border-[var(--border)] hover:bg-[var(--surface-2)]",download:`side-by-side-${t.groupId}.mp4`,title:"All devices in one side-by-side video",children:"⤓ Side-by-side"})]})}function bt({remainingSec:e,onContinue:t,onReleaseNow:n}){return r.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"idle-warning-title",className:"fixed inset-0 z-40 bg-black/60 flex items-center justify-center",children:r.jsxs("div",{className:"bg-[var(--bg)] border border-[var(--border)] rounded-lg w-full max-w-md p-6",children:[r.jsx("h3",{id:"idle-warning-title",className:"text-base font-semibold mb-2",children:"Are you still there?"}),r.jsxs("p",{className:"text-sm text-[var(--text-dim)] mb-4",children:["Your devices will be released in"," ",r.jsxs("span",{className:"text-[var(--text)] font-mono font-semibold",children:[e,"s"]})," due to inactivity. Click ",r.jsx("strong",{children:"Continue Session"})," to keep them locked."]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx("button",{type:"button",onClick:n,className:"h-9 px-3 rounded-md border border-[var(--border)] text-sm text-[var(--text-dim)] hover:text-[var(--text)]",children:"Release now"}),r.jsx("button",{type:"button",autoFocus:!0,onClick:t,className:"h-9 px-4 rounded-md bg-[var(--color-accent)] text-[var(--color-on-accent)] text-sm font-medium",children:"Continue session"})]})]})})}function fe(e,t,n){return!n||!e?!1:e===`manual_${n}_${t}`}function xt(e,t){return e.busy?fe(e.session_id,e.udid,t):!1}const ce=["mousemove","mousedown","keydown","touchstart","wheel"];function yt({idleAfterMs:e,warningSec:t,onWarning:n,onTimeout:o,enabled:i}){const[f,g]=u.useState(!1),[S,v]=u.useState(null),h=u.useRef(null),y=u.useRef(null),c=u.useRef(!1),j=u.useRef(n),w=u.useRef(o);j.current=n,w.current=o;function m(){h.current&&(clearTimeout(h.current),h.current=null),y.current&&(clearInterval(y.current),y.current=null)}function b(){c.current=!0,g(!0),v(t),j.current(t);let d=t;y.current=setInterval(()=>{d-=1,d<=0?(m(),c.current=!1,g(!1),v(null),w.current()):v(d)},1e3)}function T(){m(),c.current=!1,g(!1),v(null);const d=e-t*1e3;h.current=setTimeout(b,Math.max(0,d))}function s(){i&&T()}return u.useEffect(()=>{if(!i){m(),c.current=!1,g(!1),v(null);return}function d(){c.current||T()}return ce.forEach(E=>window.addEventListener(E,d,{passive:!0})),T(),()=>{ce.forEach(E=>window.removeEventListener(E,d)),m()}},[i,e,t]),{warning:f,remainingSec:S,reset:s}}const vt=5*60*1e3,wt=30;function Z(e){if(!e)return"9 / 16";const t=Number(e.screenWidth),n=Number(e.screenHeight);if(Number.isFinite(t)&&Number.isFinite(n)&&t>0&&n>0)return`${t} / ${n}`;const o=(e.platform||"").toLowerCase();return o==="tvos"||o==="androidtv"||o==="android-tv"?"16 / 9":"9 / 16"}function Et(e,t){if(e.busy)return e.session_id?e.session_id.startsWith("manual_")?fe(e.session_id,e.udid,t)?"manual_self":"manual_other":"automation":"unknown"}function Nt(e,t){return{udid:e.udid,name:e.name,platform:e.platform,busy:e.busy,busyReason:Et(e,t),mjpegServerPort:e.mjpegServerPort,offline:!!e.offline}}function Ct(){const[e,t]=Me(),[n,o]=u.useState([]),[i,f]=u.useState(0),[g,S]=u.useState(null),v=u.useRef(!1);u.useEffect(()=>{let s=!1;return fetch("/xenon/api/auth/me",{credentials:"include"}).then(d=>d.ok?d.json():null).then(d=>{!s&&(d!=null&&d.userId)&&S(d.userId)}).catch(()=>{}),()=>{s=!0}},[]),u.useEffect(()=>{let s=!1;const d=async()=>{try{const I=await D.getDevices();s||o(Array.isArray(I)?I:[])}catch{}};d();const E=window.setInterval(d,5e3);return()=>{s=!0,window.clearInterval(E)}},[i]),u.useEffect(()=>{let s=!1;if(!(!g||v.current))return v.current=!0,(async()=>{try{const d=await D.getDevices(),E=(Array.isArray(d)?d:[]).filter(x=>xt(x,g));if(E.length===0)return;const A=(await Promise.all(E.map(async x=>{try{const a=await fetch(`/xenon/api/control/${encodeURIComponent(x.udid)}/stream/status`);if(!a.ok)return null;const p=await a.json();return(p==null?void 0:p.status)==="running"?x:null}catch{return null}}))).filter(x=>x!==null);if(s||A.length===0)return;const R=A.map(x=>{const a=Number(x.screenWidth),p=Number(x.screenHeight);return{udid:x.udid,name:x.name,mjpegPort:0,aspect:Z(x),screenWidth:Number.isFinite(a)&&a>0?a:void 0,screenHeight:Number.isFinite(p)&&p>0?p:void 0,platform:x.platform}});t({type:"SET_TILES",tiles:R})}catch{}})(),()=>{s=!0}},[g,t]),u.useEffect(()=>{for(const s of e.tiles){if(s.screenWidth&&s.screenHeight)continue;const d=n.find(A=>A.udid===s.udid);if(!d)continue;const E=Number(d.screenWidth),I=Number(d.screenHeight);Number.isFinite(E)&&E>0&&Number.isFinite(I)&&I>0&&t({type:"PATCH_TILE_DIMS",udid:s.udid,screenWidth:E,screenHeight:I,aspect:Z(d)})}},[n,e.tiles,t]),u.useEffect(()=>{const s=async d=>{var x,a;if(d.key!=="b"&&d.key!=="B")return;const E=(x=d.target)==null?void 0:x.tagName;if(E==="INPUT"||E==="TEXTAREA"||E==="SELECT"||!e.recording||!e.groupId)return;const I=window.prompt("Bookmark label?");if(!I)return;const A=e.startedAt?Date.now()-e.startedAt:0,R=(a=e.tiles.find(p=>p.recordingId))==null?void 0:a.recordingId;if(R)try{await ue(e.groupId,R,A,I)}catch(p){t({type:"SET_ERROR_BANNER",message:`Bookmark failed: ${p.message}`})}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e.recording,e.groupId,e.startedAt,e.tiles,t]);const h=u.useMemo(()=>new Set(e.tiles.map(s=>s.udid)),[e.tiles]),y=u.useMemo(()=>n.map(s=>Nt(s,g)),[n,g]),c=s=>{const d=Number(s.screenWidth),E=Number(s.screenHeight);return{udid:s.udid,name:s.name,mjpegPort:0,aspect:Z(s),screenWidth:Number.isFinite(d)&&d>0?d:void 0,screenHeight:Number.isFinite(E)&&E>0?E:void 0,platform:s.platform}},j=async s=>{if(e.tiles.some(A=>A.udid===s)){await w(s);return}if(e.recording){t({type:"SET_ERROR_BANNER",message:"Stop recording before changing the mosaic layout."});return}const E=n.find(A=>A.udid===s);if(!E)return;t({type:"ADD_TILE",tile:c(E)});const I=await D.startStream(s).catch(()=>null);je(I)&&t({type:"REMOVE_TILE",udid:s})},w=async s=>{t({type:"REMOVE_TILE",udid:s});try{await fetch(`/xenon/api/control/${encodeURIComponent(s)}/stream/stop`,{method:"POST"})}catch{}f(d=>d+1)},m=async(s,d)=>{if(e.groupId)try{await ut(e.groupId,{recordingId:s,timecodeMs:e.startedAt?Date.now()-e.startedAt:0,shape:d.shape,geometry:JSON.stringify(d.geometry),color:d.color,text:d.text})}catch(E){t({type:"SET_ERROR_BANNER",message:`Annotation failed: ${E.message}`})}},b=()=>{for(const s of e.tiles){const d=`/xenon/api/control/${encodeURIComponent(s.udid)}/stream/stop`;try{navigator.sendBeacon?navigator.sendBeacon(d):fetch(d,{method:"POST",keepalive:!0}).catch(()=>{})}catch{}}e.tiles.forEach(s=>t({type:"REMOVE_TILE",udid:s.udid}))},T=yt({idleAfterMs:vt,warningSec:wt,enabled:e.tiles.length>0,onWarning:()=>{},onTimeout:()=>{b()}});return r.jsxs(le.Provider,{value:{state:e,dispatch:t},children:[r.jsxs("div",{className:"flex flex-col h-full p-4 gap-3",children:[r.jsxs("header",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ae,{icon:Se,children:"Live devices"}),r.jsx(Ue,{value:e.layout,onChange:s=>t({type:"SET_LAYOUT",layout:s})})]}),r.jsx(gt,{selectedUdids:e.tiles.map(s=>s.udid)})]}),e.banner&&r.jsxs("div",{role:"alert",className:`text-sm rounded border px-3 py-2 flex items-center gap-2 ${e.banner.tone==="error"?"border-[rgb(var(--rgb-red)/0.4)] bg-[rgb(var(--rgb-red)/0.1)] text-[var(--red-100)]":"border-[rgb(var(--rgb-success)/0.4)] bg-[rgb(var(--rgb-success)/0.1)] text-[var(--text)]"}`,children:[r.jsx("span",{className:"flex-1",children:e.banner.message}),r.jsx("button",{type:"button",className:"text-xs opacity-80 hover:opacity-100",onClick:()=>t({type:"SET_BANNER",banner:null}),children:"Dismiss"})]}),r.jsxs("div",{className:"grid grid-cols-[260px_1fr] gap-3 flex-1 min-h-0",children:[r.jsxs("aside",{className:"flex flex-col gap-2 border border-[var(--border)] rounded p-3 overflow-y-auto min-h-0",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-xs text-[var(--text-dim)]",children:"Devices"}),r.jsx("button",{className:"text-xs underline opacity-70 hover:opacity-100",onClick:()=>f(s=>s+1),children:"Refresh"})]}),r.jsx(Le,{devices:y,inMosaic:h,onToggle:j}),r.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-dim)] leading-relaxed",children:"Click a device to add it to the mosaic. Record captures every device in the mosaic. After Stop, download the video (mp4) — not a proof bundle."})]}),r.jsx("main",{className:"border border-[var(--border)] rounded p-2 overflow-y-auto h-full min-h-0",children:r.jsx(at,{layout:e.layout,tiles:e.tiles,annotateMode:e.annotateMode,shape:e.shape,color:e.color,overlayAnnotationsByRecording:e.overlayAnnotations,onOverlayAnnotationsChange:(s,d)=>t({type:"SET_OVERLAY_ANNOTATIONS",recordingId:s,annotations:d}),onAnnotation:m,onRemove:w,onDropDevice:j})})]})]}),T.warning&&T.remainingSec!==null&&r.jsx(bt,{remainingSec:T.remainingSec,onContinue:T.reset,onReleaseNow:b})]})}export{Ct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DjWgs7qB.js";const i=({icon:e,title:m,description:t,action:a})=>s.jsxs("div",{className:"empty-state",children:[e&&s.jsx("div",{className:"empty-state-icon",children:e}),s.jsx("div",{className:"empty-state-title",children:m}),t&&s.jsx("div",{className:"empty-state-desc",children:t}),a&&s.jsx("div",{className:"empty-state-action",children:a})]});export{i as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-DjWgs7qB.js";const r=({label:e,description:l,children:c,error:a,htmlFor:d})=>s.jsxs("div",{className:"fg",children:[s.jsx("label",{className:"fg-label",htmlFor:d,children:e}),l&&s.jsx("div",{className:"fg-desc",children:l}),s.jsx("div",{className:"fg-control",children:c}),a&&s.jsx("div",{className:"fg-error",children:a})]});export{r as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:rgb(var(--rgb-black) / .55);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:8000;animation:modal-overlay-in .15s ease-out}.modal-overlay[data-state=closed]{animation:modal-overlay-out .15s ease-in}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:8001;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:12px;box-shadow:0 20px 50px rgb(var(--rgb-black) / calc(.45 * var(--shadow-k)));max-width:90vw;max-height:90vh;display:flex;flex-direction:column;font-family:Inter,sans-serif;animation:modal-card-in .15s ease-out}.modal[data-state=closed]{animation:modal-card-out .15s ease-in}@keyframes modal-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes modal-overlay-out{0%{opacity:1}to{opacity:0}}@keyframes modal-card-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.97)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes modal-card-out{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-50%) scale(.97)}}.modal-header{padding:16px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px}.modal-title{color:var(--text);font-weight:600;font-size:15px;display:flex;align-items:center;gap:10px;flex:1;min-width:0}.modal-close{background:transparent;border:none;color:var(--text);cursor:pointer;padding:6px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;transition:background .12s ease,color .12s ease}.modal-close:hover{background:rgb(var(--rgb-fg) / .06);color:var(--text)}.modal-close:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.modal-body{padding:20px;color:var(--text);overflow-y:auto;flex:1;min-height:0}.modal-footer{padding:14px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as h,i as at,R as xe,k as it,o as st}from"./index-Cp6E2WlI.js";function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function De(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function I(...e){return i.useCallback(De(...e),e)}function Oe(e){const t=ct(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(lt);if(d){const u=d.props.children,f=s.map(v=>v===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:v);return h.jsx(t,{...c,ref:o,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function ct(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=ft(o),s=dt(a,o.props);return o.type!==i.Fragment&&(s.ref=r?De(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ut=Symbol("radix.slottable");function lt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ut}function dt(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=vt.reduce((e,t)=>{const n=Oe(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mt(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ht(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function pt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const u=v=>{var y;const{scope:m,children:g,...w}=v,l=((y=m==null?void 0:m[e])==null?void 0:y[d])||s,p=i.useMemo(()=>w,Object.values(w));return h.jsx(l.Provider,{value:p,children:g})};u.displayName=a+"Provider";function f(v,m){var l;const g=((l=m==null?void 0:m[e])==null?void 0:l[d])||s,w=i.useContext(g);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=(s==null?void 0:s[e])||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,gt(o,...t)]}function gt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:u})=>{const v=d(a)[`__scope${u}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function B(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var U=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function yt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Et="DismissableLayer",ce="dismissableLayer.update",bt="dismissableLayer.pointerDownOutside",Ct="dismissableLayer.focusOutside",he,Ae=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Te=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,u=i.useContext(Ae),[f,v]=i.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=i.useState({}),w=I(t,E=>v(E)),l=Array.from(u.layers),[p]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(p),b=f?l.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,R=Rt(E=>{const T=E.target,L=[...u.branches].some(W=>W.contains(T));!S||L||(o==null||o(E),c==null||c(E),E.defaultPrevented||s==null||s())},m),N=Nt(E=>{const T=E.target;[...u.branches].some(W=>W.contains(T))||(a==null||a(E),c==null||c(E),E.defaultPrevented||s==null||s())},m);return yt(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},m),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(he=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),pe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=he)}},[f,m,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),pe())},[f,u]),i.useEffect(()=>{const E=()=>g({});return document.addEventListener(ce,E),()=>document.removeEventListener(ce,E)},[]),h.jsx(D.div,{...d,ref:w,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,N.onFocusCapture),onBlurCapture:A(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,R.onPointerDownCapture)})});Te.displayName=Et;var St="DismissableLayerBranch",wt=i.forwardRef((e,t)=>{const n=i.useContext(Ae),r=i.useRef(null),o=I(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});wt.displayName=St;function Rt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){Me(bt,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Nt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Me(Ct,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){const e=new CustomEvent(ce);document.dispatchEvent(e)}function Me(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mt(o,a):o.dispatchEvent(a)}var Pt=xe[" useId ".trim().toString()]||(()=>{}),xt=0;function ee(e){const[t,n]=i.useState(Pt());return U(()=>{n(r=>r??String(xt++))},[e]),e||(t?`radix-${t}`:"")}var Dt=xe[" useInsertionEffect ".trim().toString()]||U;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=At({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=i.useCallback(f=>{var v;if(s){const m=Tt(f)?f(e):f;m!==e&&((v=c.current)==null||v.call(c,m))}else a(f)},[s,e,a,c]);return[d,u]}function At({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Dt(()=>{a.current=t},[t]),i.useEffect(()=>{var c;o.current!==n&&((c=a.current)==null||c.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Tt(e){return typeof e=="function"}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Ie=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),u=B(o),f=B(a),v=i.useRef(null),m=I(t,l=>d(l)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let l=function(C){if(g.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:O(v.current,{select:!0})},p=function(C){if(g.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||O(v.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&O(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",p);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",p),b.disconnect()}}},[r,s,g.paused]),i.useEffect(()=>{if(s){Ee.add(g);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(te,ge);s.addEventListener(te,u),s.dispatchEvent(y),y.defaultPrevented||(It(jt(Le(s)),{select:!0}),document.activeElement===l&&O(s))}return()=>{s.removeEventListener(te,u),setTimeout(()=>{const y=new CustomEvent(ne,ge);s.addEventListener(ne,f),s.dispatchEvent(y),y.defaultPrevented||O(l??document.body,{select:!0}),s.removeEventListener(ne,f),Ee.remove(g)},0)}}},[s,u,f,g]);const w=i.useCallback(l=>{if(!n&&!r||g.paused)return;const p=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(p&&y){const b=l.currentTarget,[C,S]=Lt(b);C&&S?!l.shiftKey&&y===S?(l.preventDefault(),n&&O(C,{select:!0})):l.shiftKey&&y===C&&(l.preventDefault(),n&&O(S,{select:!0})):y===b&&l.preventDefault()}},[n,r,g.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:m,onKeyDown:w})});Ie.displayName=Mt;function It(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=Le(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function Le(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=kt();function kt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=be(e,t),e.unshift(t)},remove(t){var n;e=be(e,t),(n=e[0])==null||n.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jt(e){return e.filter(t=>t.tagName!=="A")}var Wt="Portal",_e=i.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=i.useState(!1);U(()=>a(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?it.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});_e.displayName=Wt;function Bt(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=Ut(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=I(r.ref,$t(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function Ut(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Bt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=V(r.current);a.current=s==="mounted"?u:"none"},[s]),U(()=>{const u=r.current,f=o.current;if(f!==e){const m=a.current,g=V(u);e?d("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),U(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,v=g=>{const l=V(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&l&&(d("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=g=>{g.target===t&&(a.current=V(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function V(e){return(e==null?void 0:e.animationName)||"none"}function $t(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var re=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),re++,()=>{re===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),re--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var x=function(){return x=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},x.apply(this,arguments)};function Fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Kt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var H="right-scroll-bar-position",z="width-before-scroll-bar",Gt="with-scroll-bars-hidden",Xt="--removed-body-scroll-bar-size";function oe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ht=typeof window<"u"?i.useLayoutEffect:i.useEffect,Se=new WeakMap;function zt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return oe(o,r)})});return Ht(function(){var r=Se.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||oe(s,null)}),a.forEach(function(s){o.has(s)||oe(s,c)})}Se.set(n,e)},[e]),n}function Zt(e){return e}function qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){c.push(f),u()},filter:function(f){return c=c.filter(f),n}}}};return o}function Qt(e){e===void 0&&(e={});var t=qt(null);return t.options=x({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=Fe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,x({},n))};ke.isSideCarExport=!0;function Jt(e,t){return e.useMedium(t),ke}var je=Qt(),ae=function(){},Q=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ae,onWheelCapture:ae,onTouchMoveCapture:ae}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,v=e.shards,m=e.sideCar,g=e.noRelative,w=e.noIsolation,l=e.inert,p=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,S=Fe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,N=zt([n,t]),E=x(x({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(R,{sideCar:je,removeScrollBar:u,shards:v,noRelative:g,noIsolation:w,inert:l,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:C}),c?i.cloneElement(i.Children.only(s),x(x({},E),{ref:N})):i.createElement(b,x({},E,{className:d,ref:N}),s))});Q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Q.classNames={fullWidth:z,zeroRight:H};var en=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=en();return t&&e.setAttribute("nonce",t),e}function nn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var on=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tn())&&(nn(t,n),rn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},an=function(){var e=on();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},We=function(){var e=an(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sn={left:0,top:0,right:0,gap:0},ie=function(e){return parseInt(e||"",10)||0},cn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ie(n),ie(r),ie(o)]},un=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sn;var t=cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ln=We(),j="data-scroll-locked",dn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as i,j as h,t as at,R as xe,v as it,y as st}from"./index-DjWgs7qB.js";function me(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function De(...e){return t=>{let n=!1;const r=e.map(o=>{const a=me(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():me(e[o],null)}}}}function I(...e){return i.useCallback(De(...e),e)}function Oe(e){const t=ct(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),d=s.find(lt);if(d){const u=d.props.children,f=s.map(v=>v===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:v);return h.jsx(t,{...c,ref:o,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return h.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function ct(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=ft(o),s=dt(a,o.props);return o.type!==i.Fragment&&(s.ref=r?De(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ut=Symbol("radix.slottable");function lt(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ut}function dt(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const d=a(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=vt.reduce((e,t)=>{const n=Oe(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mt(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ht(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,d=i.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function pt(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),d=n.length;n=[...n,c];const u=v=>{var y;const{scope:m,children:g,...w}=v,l=((y=m==null?void 0:m[e])==null?void 0:y[d])||s,p=i.useMemo(()=>w,Object.values(w));return h.jsx(l.Provider,{value:p,children:g})};u.displayName=a+"Provider";function f(v,m){var l;const g=((l=m==null?void 0:m[e])==null?void 0:l[d])||s,w=i.useContext(g);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${a}\``)}return[u,f]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const d=(s==null?void 0:s[e])||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,gt(o,...t)]}function gt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:d,scopeName:u})=>{const v=d(a)[`__scope${u}`];return{...s,...v}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function B(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var U=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function yt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Et="DismissableLayer",ce="dismissableLayer.update",bt="dismissableLayer.pointerDownOutside",Ct="dismissableLayer.focusOutside",he,Ae=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Te=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...d}=e,u=i.useContext(Ae),[f,v]=i.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=i.useState({}),w=I(t,E=>v(E)),l=Array.from(u.layers),[p]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=l.indexOf(p),b=f?l.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,R=Rt(E=>{const T=E.target,L=[...u.branches].some(W=>W.contains(T));!S||L||(o==null||o(E),c==null||c(E),E.defaultPrevented||s==null||s())},m),N=Nt(E=>{const T=E.target;[...u.branches].some(W=>W.contains(T))||(a==null||a(E),c==null||c(E),E.defaultPrevented||s==null||s())},m);return yt(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},m),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(he=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),pe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=he)}},[f,m,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),pe())},[f,u]),i.useEffect(()=>{const E=()=>g({});return document.addEventListener(ce,E),()=>document.removeEventListener(ce,E)},[]),h.jsx(D.div,{...d,ref:w,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,N.onFocusCapture),onBlurCapture:A(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,R.onPointerDownCapture)})});Te.displayName=Et;var St="DismissableLayerBranch",wt=i.forwardRef((e,t)=>{const n=i.useContext(Ae),r=i.useRef(null),o=I(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(D.div,{...e,ref:o})});wt.displayName=St;function Rt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let d=function(){Me(bt,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Nt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Me(Ct,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pe(){const e=new CustomEvent(ce);document.dispatchEvent(e)}function Me(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mt(o,a):o.dispatchEvent(a)}var Pt=xe[" useId ".trim().toString()]||(()=>{}),xt=0;function ee(e){const[t,n]=i.useState(Pt());return U(()=>{n(r=>r??String(xt++))},[e]),e||(t?`radix-${t}`:"")}var Dt=xe[" useInsertionEffect ".trim().toString()]||U;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=At({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=i.useCallback(f=>{var v;if(s){const m=Tt(f)?f(e):f;m!==e&&((v=c.current)==null||v.call(c,m))}else a(f)},[s,e,a,c]);return[d,u]}function At({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Dt(()=>{a.current=t},[t]),i.useEffect(()=>{var c;o.current!==n&&((c=a.current)==null||c.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Tt(e){return typeof e=="function"}var te="focusScope.autoFocusOnMount",ne="focusScope.autoFocusOnUnmount",ge={bubbles:!1,cancelable:!0},Mt="FocusScope",Ie=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,d]=i.useState(null),u=B(o),f=B(a),v=i.useRef(null),m=I(t,l=>d(l)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let l=function(C){if(g.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:O(v.current,{select:!0})},p=function(C){if(g.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||O(v.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&O(s)};document.addEventListener("focusin",l),document.addEventListener("focusout",p);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",p),b.disconnect()}}},[r,s,g.paused]),i.useEffect(()=>{if(s){Ee.add(g);const l=document.activeElement;if(!s.contains(l)){const y=new CustomEvent(te,ge);s.addEventListener(te,u),s.dispatchEvent(y),y.defaultPrevented||(It(jt(Le(s)),{select:!0}),document.activeElement===l&&O(s))}return()=>{s.removeEventListener(te,u),setTimeout(()=>{const y=new CustomEvent(ne,ge);s.addEventListener(ne,f),s.dispatchEvent(y),y.defaultPrevented||O(l??document.body,{select:!0}),s.removeEventListener(ne,f),Ee.remove(g)},0)}}},[s,u,f,g]);const w=i.useCallback(l=>{if(!n&&!r||g.paused)return;const p=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,y=document.activeElement;if(p&&y){const b=l.currentTarget,[C,S]=Lt(b);C&&S?!l.shiftKey&&y===S?(l.preventDefault(),n&&O(C,{select:!0})):l.shiftKey&&y===C&&(l.preventDefault(),n&&O(S,{select:!0})):y===b&&l.preventDefault()}},[n,r,g.paused]);return h.jsx(D.div,{tabIndex:-1,...c,ref:m,onKeyDown:w})});Ie.displayName=Mt;function It(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function Lt(e){const t=Le(e),n=ye(t,e),r=ye(t.reverse(),e);return[n,r]}function Le(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){for(const n of e)if(!_t(n,{upTo:t}))return n}function _t(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ft(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ft(e)&&t&&e.select()}}var Ee=kt();function kt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=be(e,t),e.unshift(t)},remove(t){var n;e=be(e,t),(n=e[0])==null||n.resume()}}}function be(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jt(e){return e.filter(t=>t.tagName!=="A")}var Wt="Portal",_e=i.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=i.useState(!1);U(()=>a(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?it.createPortal(h.jsx(D.div,{...r,ref:t}),c):null});_e.displayName=Wt;function Bt(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var q=e=>{const{present:t,children:n}=e,r=Ut(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=I(r.ref,$t(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};q.displayName="Presence";function Ut(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Bt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=V(r.current);a.current=s==="mounted"?u:"none"},[s]),U(()=>{const u=r.current,f=o.current;if(f!==e){const m=a.current,g=V(u);e?d("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),U(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,v=g=>{const l=V(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&l&&(d("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=g=>{g.target===t&&(a.current=V(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function V(e){return(e==null?void 0:e.animationName)||"none"}function $t(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var re=0;function Vt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ce()),document.body.insertAdjacentElement("beforeend",e[1]??Ce()),re++,()=>{re===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),re--}},[])}function Ce(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var x=function(){return x=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},x.apply(this,arguments)};function Fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Kt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var H="right-scroll-bar-position",z="width-before-scroll-bar",Gt="with-scroll-bars-hidden",Xt="--removed-body-scroll-bar-size";function oe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Ht=typeof window<"u"?i.useLayoutEffect:i.useEffect,Se=new WeakMap;function zt(e,t){var n=Yt(null,function(r){return e.forEach(function(o){return oe(o,r)})});return Ht(function(){var r=Se.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||oe(s,null)}),a.forEach(function(s){o.has(s)||oe(s,c)})}Se.set(n,e)},[e]),n}function Zt(e){return e}function qt(e,t){t===void 0&&(t=Zt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var d=function(){var f=c;c=[],f.forEach(a)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(f){c.push(f),u()},filter:function(f){return c=c.filter(f),n}}}};return o}function Qt(e){e===void 0&&(e={});var t=qt(null);return t.options=x({async:!0,ssr:!1},e),t}var ke=function(e){var t=e.sideCar,n=Fe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,x({},n))};ke.isSideCarExport=!0;function Jt(e,t){return e.useMedium(t),ke}var je=Qt(),ae=function(){},Q=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ae,onWheelCapture:ae,onTouchMoveCapture:ae}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,v=e.shards,m=e.sideCar,g=e.noRelative,w=e.noIsolation,l=e.inert,p=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,S=Fe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,N=zt([n,t]),E=x(x({},S),o);return i.createElement(i.Fragment,null,f&&i.createElement(R,{sideCar:je,removeScrollBar:u,shards:v,noRelative:g,noIsolation:w,inert:l,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:C}),c?i.cloneElement(i.Children.only(s),x(x({},E),{ref:N})):i.createElement(b,x({},E,{className:d,ref:N}),s))});Q.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Q.classNames={fullWidth:z,zeroRight:H};var en=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=en();return t&&e.setAttribute("nonce",t),e}function nn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var on=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tn())&&(nn(t,n),rn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},an=function(){var e=on();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},We=function(){var e=an(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},sn={left:0,top:0,right:0,gap:0},ie=function(e){return parseInt(e||"",10)||0},cn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ie(n),ie(r),ie(o)]},un=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sn;var t=cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ln=We(),j="data-scroll-locked",dn=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(Gt,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-DjWgs7qB.js";function r({segments:a,value:n,onChange:l,size:s="md"}){return t.jsx("div",{className:`seg seg-${s}`,role:"tablist",children:a.map(e=>t.jsxs("button",{role:"tab","aria-selected":e.value===n,className:`seg-btn${e.value===n?" seg-btn-active":""}`,onClick:()=>l(e.value),type:"button",children:[t.jsx("span",{children:e.label}),typeof e.count=="number"&&t.jsx("span",{className:"seg-count",children:e.count})]},e.value))})}export{r as S};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as n,j as s,D as h}from"./index-DjWgs7qB.js";import{B as r}from"./button-BCEivrYY.js";/**
|
|
2
|
+
* @license lucide-react v0.555.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const x=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],j=n("rotate-ccw",x);/**
|
|
7
|
+
* @license lucide-react v0.555.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const m=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],p=n("save",m),f=({onSave:c,onDiscard:d,onRestoreDefaults:e,isSaving:a,isValidating:i=!1,isDirty:t=!1,saveLabel:l="Save Configuration",restoreLabel:o="Restore Defaults"})=>s.jsxs("div",{className:"settings-footer",children:[s.jsxs("div",{className:"footer-left",children:[t&&s.jsxs("span",{className:"footer-dirty","aria-live":"polite",children:[s.jsx("span",{className:"footer-dirty__dot"}),s.jsx("span",{children:"Unsaved changes"})]}),t&&e&&s.jsx("span",{className:"footer-divider","aria-hidden":"true"}),e&&s.jsxs(r,{variant:"danger",size:"lg",onClick:e,disabled:a||i,children:[s.jsx(j,{size:16}),o]})]}),s.jsxs("div",{className:"footer-right",children:[s.jsx(r,{variant:"secondary",size:"lg",onClick:d,disabled:a,children:"Discard"}),s.jsxs(r,{variant:"primary",size:"lg",onClick:c,disabled:a||i,children:[a?s.jsx(h,{className:"animate-spin",size:18}):s.jsx(p,{size:18}),a?"Saving...":l]})]})]}),g=({icon:c,title:d,titleExtra:e,description:a,hint:i,children:t})=>s.jsxs("div",{className:"setting-card",children:[s.jsxs("div",{className:"setting-card-header",children:[c,s.jsx("h4",{children:d}),e]}),a&&s.jsx("p",{className:"setting-card-description",children:a}),s.jsx("div",{className:"setting-card-field",children:t}),i&&s.jsx("div",{className:"setting-card-hint",children:i})]});export{f as A,g as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.setting-card{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-lg);padding:20px;position:relative;transition:border-color .2s,box-shadow .2s,background .2s;overflow:hidden;display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow-sm)}.setting-card:hover{border-color:rgb(var(--rgb-accent) / .25);background:var(--surface-2);box-shadow:var(--shadow-md)}.setting-card:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;opacity:.15;z-index:0;background:linear-gradient(to bottom,rgb(var(--rgb-fg) / 0),rgb(var(--rgb-fg) / 0) 50%,rgb(var(--rgb-well) / calc(.15 * var(--well-k))) 50%,rgb(var(--rgb-well) / calc(.15 * var(--well-k))));background-size:100% 4px;border-radius:inherit}.setting-card:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--radius-lg);padding:1px;background:linear-gradient(180deg,rgb(var(--rgb-fg) / .06),rgb(var(--rgb-fg) / 0));-webkit-mask:linear-gradient(var(--white) 0 0) content-box,linear-gradient(var(--white) 0 0);mask:linear-gradient(var(--white) 0 0) content-box,linear-gradient(var(--white) 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}.setting-card-header{display:flex;align-items:center;gap:8px;color:var(--color-accent);width:100%}.setting-card-header svg{flex-shrink:0}.setting-card h4{margin:0;font-size:1rem;font-weight:700;font-family:Outfit,sans-serif;color:var(--text);letter-spacing:-.005em}.setting-card-description{color:var(--text-muted);font-size:.8125rem;margin:0;line-height:1.55;max-width:500px;font-weight:400}.setting-card-field{display:flex;flex-direction:column;gap:var(--space-2);width:100%;position:relative;z-index:1}.setting-card-hint{font-size:.7rem;color:var(--text-dim);margin-top:2px;position:relative;z-index:1;line-height:1.5;font-weight:400;letter-spacing:.01em}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-DjWgs7qB.js";const x=({className:s,...a})=>t.jsx("table",{className:`tbl${s?" "+s:""}`,...a}),j=s=>t.jsx("thead",{...s}),c=s=>t.jsx("tbody",{...s}),e=s=>t.jsx("tr",{...s}),n=s=>t.jsx("th",{...s}),T=s=>t.jsx("td",{...s});export{x as T,j as a,e as b,n as c,c as d,T as e};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{c as p,x as z,r as c,X as m,j as e,S as k,D as N,N as I,O as $}from"./index-DjWgs7qB.js";/* empty css */import{S,A as F}from"./SettingCard-B2P4WH4f.js";import{P as B}from"./page-header-CIHfvMfu.js";import{L as T}from"./lock-B5DBh7I-.js";import{C as b}from"./circle-check-CdQ00EQ7.js";import{A as D}from"./activity-Dc54BbBS.js";import"./button-BCEivrYY.js";import"./utils-CDN07tui.js";/**
|
|
2
|
+
* @license lucide-react v0.555.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const E=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],q=p("cpu",E);/**
|
|
7
|
+
* @license lucide-react v0.555.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const U=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],L=p("globe",U);/**
|
|
12
|
+
* @license lucide-react v0.555.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const G=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],O=p("server",G);/**
|
|
17
|
+
* @license lucide-react v0.555.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const R=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],V=p("sliders-vertical",R),_={aiProvider:"gemini",aiModel:"",aiBaseUrl:"",geminiModel:"",openaiModel:"",anthropicModel:"",ollamaModel:"",geminiSet:!1,openaiSet:!1,anthropicSet:!1,aiTemperature:1,aiMaxTokens:4096,aiTopP:1},X=(s,i)=>s.aiProvider===i.aiProvider&&s.aiTemperature===i.aiTemperature&&s.aiMaxTokens===i.aiMaxTokens&&s.aiTopP===i.aiTopP,o=s=>{switch(s){case"gemini":return"gemini-3-flash-preview";case"openai":return"gpt-4o";case"anthropic":return"claude-sonnet-4-6";case"ollama":return"llama3";default:return"—"}},Y=s=>{switch(s){case"ollama":return"http://localhost:11434";default:return"Provider default"}},se=()=>{const{toast:s}=z(),[i,r]=c.useState(_),[h,u]=c.useState(_),[w,g]=c.useState(!0),[x,v]=c.useState(!1),[f,j]=c.useState(!1);c.useEffect(()=>{P()},[]);const P=async()=>{g(!0);try{const a=await m.getGlobalConfig(),n={aiProvider:a.aiProvider||"gemini",aiModel:a.aiModel||"",aiBaseUrl:a.aiBaseUrl||"",geminiModel:a.geminiModel||"",openaiModel:a.openaiModel||"",anthropicModel:a.anthropicModel||"",ollamaModel:a.ollamaModel||"",geminiSet:!!a.geminiSet,openaiSet:!!a.openaiSet,anthropicSet:!!a.anthropicSet,aiTemperature:typeof a.aiTemperature=="number"?a.aiTemperature:1,aiMaxTokens:typeof a.aiMaxTokens=="number"?a.aiMaxTokens:4096,aiTopP:typeof a.aiTopP=="number"?a.aiTopP:1};r(n),u(n)}catch(a){console.error("Failed to load AISettings",a),s("Failed to access AI configuration.","error")}finally{g(!1)}},C=async()=>{v(!0);try{await m.updateGlobalConfig({aiProvider:i.aiProvider,aiTemperature:i.aiTemperature,aiMaxTokens:i.aiMaxTokens,aiTopP:i.aiTopP}),u(i),s("AI engine configuration saved.","success")}catch(a){console.error("Failed to save AISettings",a),s($(a),"error")}finally{v(!1)}},A=async()=>{j(!0);const a=Date.now();try{const n=await m.testAIConfig({aiProvider:i.aiProvider}),l=Date.now()-a;n.success?s(`${n.message} (${l}ms)`,"success"):s(n.message,"error")}catch(n){s(`Connection failed: ${(n==null?void 0:n.message)||"unknown error"}`,"error")}finally{j(!1)}},d=[{id:"gemini",name:"Google Gemini",description:`${o("gemini")} — Multimodal reasoning`,icon:e.jsx("span",{className:"ai-provider-glyph",children:"G"}),isConfigured:!!i.geminiSet},{id:"openai",name:"OpenAI",description:`${o("openai")} — OpenAI v1 compatible`,icon:e.jsx(q,{size:18}),isConfigured:!!i.openaiSet},{id:"anthropic",name:"Anthropic",description:`${o("anthropic")} — Advanced analysis`,icon:e.jsx(k,{size:18}),isConfigured:!!i.anthropicSet},{id:"ollama",name:"Ollama",description:"Local / self-hosted — no API key required",icon:e.jsx(O,{size:18}),isConfigured:!!i.ollamaModel||!!i.aiModel||!!i.aiBaseUrl}],t=d.find(a=>a.id===i.aiProvider),y=d.filter(a=>a.isConfigured).length,M=!X(i,h);return w?e.jsxs("div",{className:"settings-loading",children:[e.jsx(N,{className:"animate-spin",size:32}),e.jsx("span",{children:"Synchronizing Global State..."})]}):e.jsxs("div",{className:"settings-container",children:[e.jsx(B,{icon:I,title:"AI engine",subtitle:e.jsxs(e.Fragment,{children:["All credentials and endpoints are managed via environment variables.",e.jsxs("span",{className:"page-header-subnote",children:[e.jsx(T,{size:12}),"Select the active provider from configured options below."]})]})}),e.jsx("div",{className:"settings-content",children:e.jsxs("div",{className:"settings-grid settings-grid--two-equal",children:[e.jsx(S,{icon:e.jsx(k,{size:16}),title:"Provider registry",titleExtra:e.jsxs("span",{className:`provider-count-pill ${y>0?"is-ok":"is-empty"}`,children:[y," / ",d.length," configured"]}),description:"Providers are activated via environment variables. Select a configured engine to activate.",children:e.jsx("div",{className:"provider-list",children:d.map(a=>{const n=i.aiProvider===a.id,l=a.isConfigured;return e.jsxs("button",{type:"button",className:`provider-row ${n?"is-active":""} ${l?"":"is-disabled"}`,onClick:()=>l&&r({...i,aiProvider:a.id}),disabled:!l,title:l?`Activate ${a.name}`:`Set XENON_${a.id.toUpperCase()}_API_KEY to enable`,children:[e.jsx("div",{className:"provider-row__icon",children:a.icon}),e.jsxs("div",{className:"provider-row__body",children:[e.jsx("div",{className:"provider-row__name",children:a.name}),e.jsx("div",{className:"provider-row__desc",children:a.description}),e.jsx("div",{className:"provider-row__status",children:n?e.jsxs("span",{className:"provider-status provider-status--active",children:[e.jsx(b,{size:11}),a.isConfigured?"Active":"Active — no key"]}):a.isConfigured?e.jsxs("span",{className:"provider-status provider-status--ready",children:[e.jsx(b,{size:11}),"READY"]}):e.jsxs("span",{className:"provider-status provider-status--off",children:[e.jsx(T,{size:10}),"Not set"]})})]})]},a.id)})})}),e.jsxs(S,{icon:e.jsx(L,{size:16}),title:"Runtime configuration",description:"Environmental overrides for AI model endpoints and identifiers.",children:[e.jsxs("div",{className:"ai-config-display",children:[e.jsxs("div",{className:"ai-config-row",children:[e.jsx("span",{className:"ai-config-label",children:"Active provider"}),e.jsxs("span",{className:"ai-config-value",children:[t==null?void 0:t.icon,(t==null?void 0:t.name)||"—"]})]}),e.jsxs("div",{className:"ai-config-row",children:[e.jsx("span",{className:"ai-config-label",children:"Model"}),e.jsxs("span",{className:"ai-config-value mono",children:[e.jsxs("span",{children:[i.aiProvider==="gemini"&&(i.geminiModel||i.aiModel||o("gemini")),i.aiProvider==="openai"&&(i.openaiModel||i.aiModel||o("openai")),i.aiProvider==="anthropic"&&(i.anthropicModel||i.aiModel||o("anthropic")),i.aiProvider==="ollama"&&(i.ollamaModel||i.aiModel||o("ollama"))]}),e.jsx("span",{className:"ai-config-default",children:"Default"})]})]}),e.jsxs("div",{className:"ai-config-row",children:[e.jsx("span",{className:"ai-config-label",children:"Base URL"}),e.jsxs("span",{className:"ai-config-value mono",children:[e.jsx("span",{children:i.aiBaseUrl||Y(i.aiProvider)}),!i.aiBaseUrl&&e.jsx("span",{className:"ai-config-default",children:"Default"})]})]})]}),e.jsxs("div",{className:"model-params",children:[e.jsxs("div",{className:"model-params__header",children:[e.jsx(V,{size:14}),e.jsx("span",{children:"Model Parameters"})]}),e.jsxs("div",{className:"model-param",children:[e.jsxs("div",{className:"model-param__label-row",children:[e.jsx("label",{htmlFor:"ai-temp",children:"Temperature"}),e.jsx("span",{className:"model-param__value",children:i.aiTemperature.toFixed(1)})]}),e.jsx("input",{id:"ai-temp",type:"range",min:0,max:2,step:.1,value:i.aiTemperature,onChange:a=>r({...i,aiTemperature:parseFloat(a.target.value)}),className:"model-param__slider"})]}),e.jsxs("div",{className:"model-param",children:[e.jsx("div",{className:"model-param__label-row",children:e.jsx("label",{htmlFor:"ai-max-tokens",children:"Max tokens"})}),e.jsx("div",{className:"setting-input-wrapper",children:e.jsx("input",{id:"ai-max-tokens",type:"number",min:256,step:128,value:i.aiMaxTokens,onChange:a=>r({...i,aiMaxTokens:parseInt(a.target.value,10)||0})})})]}),e.jsxs("div",{className:"model-param",children:[e.jsxs("div",{className:"model-param__label-row",children:[e.jsx("label",{htmlFor:"ai-top-p",children:"Top P"}),e.jsx("span",{className:"model-param__value",children:i.aiTopP.toFixed(2)})]}),e.jsx("input",{id:"ai-top-p",type:"range",min:0,max:1,step:.01,value:i.aiTopP,onChange:a=>r({...i,aiTopP:parseFloat(a.target.value)}),className:"model-param__slider"})]})]}),e.jsxs("button",{type:"button",className:"test-connection-btn",onClick:A,disabled:f||!(t!=null&&t.isConfigured),children:[f?e.jsx(N,{size:14,className:"animate-spin"}):e.jsx(D,{size:14}),e.jsx("span",{children:"Test Connection"})]})]})]})}),(M||x)&&e.jsx(F,{onSave:C,onDiscard:()=>r(h),isSaving:x,isDirty:M,saveLabel:"Save configuration"})]})};export{se as AISettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as le,r as t,j as e,D as $,P as g,A as oe}from"./index-DjWgs7qB.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-DDdKqpxK.js";import{F as m}from"./FieldGroup-D6AD5K4v.js";import{P as O}from"./page-header-CIHfvMfu.js";import{M as B}from"./Modal-D10BsRiS.js";import{B as u}from"./button-BCEivrYY.js";import{I as H}from"./input-Bb56ce8h.js";import{S as M}from"./select-C8hFZkwI.js";import{P as v}from"./plus-DSFN1MZL.js";import{T as pe}from"./trash-2-EA7H_2h0.js";import{C as he}from"./check-tKjk56tm.js";import{C as xe}from"./copy-BkkYDV8f.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Pe=()=>{const{toast:i}=le(),[n,w]=t.useState([]),[b,J]=t.useState([]),[X,N]=t.useState(!0),[G,k]=t.useState(!1),[Q,d]=t.useState(!1),[r,y]=t.useState(null),[C,S]=t.useState(null),[T,_]=t.useState(!1),[p,A]=t.useState(""),[j,I]=t.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=t.useState(300),[E,D]=t.useState(""),[h,F]=t.useState("30d"),[x,K]=t.useState(!1),V=s=>{var a;return s?((a=b.find(c=>c.id===s))==null?void 0:a.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,a]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),a.ok&&J(await a.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};t.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(a=>j[a]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const a=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!a.ok)throw new Error(`HTTP ${a.status}`);const c=await a.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(a){i(`Create failed: ${a.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const a=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!a.ok)throw new Error(`HTTP ${a.status}`);i("Key revoked","success"),await f()}catch(a){i(`Revoke failed: ${a.message}`,"error")}finally{S(null)}},ae=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const te=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xenon:accessKey"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:te}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:V(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(a=>{const c=a.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},a)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:Q,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver ",e.jsx("code",{children:"xenon:accessKey"}),"."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:a=>I({...j,[s]:a.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xenon:team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&ae(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Pe as ApiKeys};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{c as x,j as e,x as Y,r,X as o,G as H,q as M,z as X,D as K,y as Z}from"./index-DjWgs7qB.js";import{f as J}from"./time-B8FIgwPE.js";import{c as Q,B as b}from"./button-BCEivrYY.js";import{c as ee}from"./utils-CDN07tui.js";import{P as se}from"./page-header-CIHfvMfu.js";import{S as ae}from"./select-C8hFZkwI.js";import{U as te,T as I}from"./upload-BLa3vHMO.js";import{C as re}from"./check-tKjk56tm.js";import{C as ie}from"./copy-BkkYDV8f.js";import{Z as ce}from"./zap-CeBkeV9f.js";import{D as ne}from"./download-BdX5olQ3.js";import{T as le}from"./trash-2-EA7H_2h0.js";/**
|
|
2
|
+
* @license lucide-react v0.555.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const oe=[["path",{d:"M12 6.528V3a1 1 0 0 1 1-1h0",key:"11qiee"}],["path",{d:"M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21",key:"110c12"}]],$=x("apple",oe);/**
|
|
7
|
+
* @license lucide-react v0.555.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const de=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],me=x("arrow-down-wide-narrow",de);/**
|
|
12
|
+
* @license lucide-react v0.555.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const pe=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],he=x("arrow-up-narrow-wide",pe);/**
|
|
17
|
+
* @license lucide-react v0.555.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const xe=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],E=x("rocket",xe),ue=Q("badge-base",{variants:{variant:{default:"badge-variant-default",success:"badge-variant-success",warning:"badge-variant-warning",error:"badge-variant-error",outline:"badge-variant-outline",secondary:"badge-variant-secondary"}},defaultVariants:{variant:"default"}});function F({className:n,variant:u,...c}){return e.jsx("div",{className:ee(ue({variant:u}),n),...c})}const Se=()=>{const{toast:n,removeToast:u}=Y(),[c,k]=r.useState([]),[R,_]=r.useState([]),[l,w]=r.useState(!1),[v,C]=r.useState(""),[L,A]=r.useState(!1),[U,z]=r.useState(null),[d,S]=r.useState({android:!0,ios:!0}),[y,B]=r.useState("desc"),[m,f]=r.useState(null),[j,g]=r.useState(""),p=r.useCallback(async()=>{w(!0);try{const s=await o.getApps();k(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch apps",s)}finally{w(!1)}},[]),N=r.useCallback(async()=>{try{const s=await o.getDevices();_(Array.isArray(s)?s:[])}catch(s){console.error("Failed to fetch devices",s)}},[]);r.useEffect(()=>{p(),N();const s=setInterval(N,1e4);return()=>clearInterval(s)},[p,N]);const D=async s=>{var a;const t=(a=s.target.files)==null?void 0:a[0];if(t){A(!0);try{await o.uploadApp(t),await p()}catch(i){console.error("Upload failed",i)}finally{A(!1),s.target&&(s.target.value="")}}},G=async(s,t)=>{if(window.confirm(`Permanently remove artifact "${t}"?`))try{await o.deleteApp(s),k(a=>a.filter(i=>i.id!==s))}catch(a){console.error("Delete failed",a)}},O=(s,t)=>{navigator.clipboard.writeText(s),z(`${t}-${s}`),setTimeout(()=>z(null),2e3)},P=async(s,t)=>{const a=n(`Deploying app to ${t}...`,"loading",0);try{const i=await o.installRepositoryApp(t,s);i.success?(n("App deployed successfully","success"),f(null),g("")):n(`Deployment failed: ${i.error}`,"error")}catch(i){n(`Execution Error: ${i.message}`,"error")}finally{u(a)}},h=c.filter(s=>{const t=s.name.toLowerCase().includes(v.toLowerCase())||s.packageName&&s.packageName.toLowerCase().includes(v.toLowerCase()),a=d.android&&s.platform==="android"||d.ios&&s.platform==="ios";return t&&a}).sort((s,t)=>{const a=new Date(s.createdAt).getTime(),i=new Date(t.createdAt).getTime();return y==="desc"?i-a:a-i}),V=s=>{if(!s)return"0 B";const t=1024,a=Math.floor(Math.log(s)/Math.log(t));return parseFloat((s/Math.pow(t,a)).toFixed(1))+" "+["B","KB","MB","GB"][a]},q=s=>J(s),T=s=>{S(t=>({...t,[s]:!t[s]}))},W=s=>{const t=s.toLowerCase();return t.includes("wda-signed")||t.includes("wda-resign")||t.includes("webdriveragent")};return e.jsxs("div",{className:"apps-container device-explorer-container",children:[e.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),e.jsx(se,{icon:H,title:"Apps",subtitle:"Signed builds available for installation across your device fleet."}),e.jsxs("div",{className:"device-explorer-header-container",children:[e.jsxs("div",{className:"device-explorer-header-left-container",children:[e.jsx("div",{className:"device-explorer-header-entry",children:e.jsxs("div",{className:"device-explorer-header-value",children:[e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.android&&"selected"}`,onClick:()=>T("android"),children:[e.jsx(M,{size:18,color:"currentColor"})," Android"]}),e.jsxs("button",{className:`device-explorer-header__platform-btn ${d.ios&&"selected"}`,onClick:()=>T("ios"),children:[e.jsx($,{size:18,color:"currentColor"})," iOS"]})]})}),e.jsx("div",{className:"device-explorer-header-entry",children:e.jsx("div",{className:"device-explorer-header-value",children:e.jsxs("div",{className:"device-explorer-search-wrapper",children:[e.jsx(X,{size:16,color:"#94a3b8",className:"device-explorer-search-icon"}),e.jsx("input",{type:"text",className:"device-explorer-header-text-filter",placeholder:"Filter by bundle or name...",value:v,onChange:s=>C(s.target.value)})]})})}),e.jsx("div",{className:"device-explorer-header-filter-count",children:e.jsxs(F,{variant:"secondary",children:[e.jsx("span",{className:"font-bold",children:h.length})," of"," ",e.jsx("span",{className:"font-bold",children:c.length})," ",c.length===1?"artifact":"artifacts"]})})]}),e.jsxs("div",{className:"device-explorer-header-right-container",children:[e.jsx("button",{className:"icon-btn-secondary sort-btn",onClick:()=>B(s=>s==="desc"?"asc":"desc"),title:y==="desc"?"Newest First":"Oldest First",children:y==="desc"?e.jsx(me,{size:18}):e.jsx(he,{size:18})}),e.jsxs(b,{size:"sm",variant:"default",onClick:()=>p(),disabled:l,children:[e.jsx(K,{size:14,className:`mr-1 ${l&&"animate-spin"}`}),"Refresh"]}),e.jsxs("label",{className:"upload-trigger",children:[e.jsx("input",{type:"file",accept:".apk,.ipa",onChange:D,style:{display:"none"}}),e.jsxs(b,{size:"sm",variant:"default",className:"upload-button",children:[e.jsx(te,{size:14,className:"mr-1"}),"Upload app"]})]})]})]}),e.jsx("main",{className:"apps-registry-content",children:l&&c.length===0?e.jsxs("div",{className:"empty-data-vignette",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("p",{className:"text-muted text-xs font-bold tracking-widest",children:"SYNCING REGISTRY..."})]}):e.jsxs(e.Fragment,{children:[h.length>0&&e.jsxs("div",{className:"registry-table-header",children:[e.jsx("div",{children:"Artifact bundle"}),e.jsx("div",{children:"Version"}),e.jsx("div",{children:"Size"}),e.jsx("div",{children:"Registry date"}),e.jsx("div",{style:{textAlign:"right"},children:"Management"})]}),e.jsx("div",{className:"registry-list",children:h.map(s=>{const t=R.filter(a=>a.platform===s.platform&&!a.busy&&!a.offline);return e.jsxs("div",{className:`artifact-row ${s.platform}`,children:[e.jsxs("div",{className:"col-app-info",children:[e.jsx("div",{className:"app-platform-badge",children:s.platform==="android"?e.jsx(M,{size:18}):e.jsx($,{size:18})}),e.jsxs("div",{className:"app-text-block",children:[e.jsxs("div",{className:"app-display-name",title:s.name,children:[s.name,W(s.name)&&e.jsx(F,{variant:"outline",className:"ml-2 text-[10px] h-4 py-0 border-primary text-primary",children:"WDA"})]}),e.jsxs("div",{className:"app-package-id",children:[e.jsx("code",{children:s.packageName||"internal.bundle"}),s.packageName&&e.jsx("div",{className:"copy-hint",title:`Copy ${s.packageName}`,onClick:()=>O(s.packageName,"pkg"),children:U===`pkg-${s.packageName}`?e.jsx(re,{size:10,className:"text-primary"}):e.jsx(ie,{size:10})})]})]})]}),e.jsx("div",{className:"col-version",children:s.version||"v1.0.0"}),e.jsx("div",{className:"col-size",children:V(s.size)}),e.jsx("div",{className:"col-timestamp",children:q(s.createdAt)}),e.jsxs("div",{className:"col-actions",children:[e.jsx("button",{className:`instant-deploy-trigger ${m===s.id&&"active"}`,onClick:()=>{m===s.id?(f(null),g("")):f(s.id)},children:m===s.id?e.jsxs(e.Fragment,{children:[e.jsx(Z,{size:12})," CANCEL"]}):e.jsxs(e.Fragment,{children:[e.jsx(ce,{size:12})," Deploy"]})}),m===s.id&&e.jsx("div",{className:"deployment-flyout",children:t.length>0?e.jsxs("div",{className:"deploy-actions-group",children:[e.jsxs(ae,{selectSize:"sm",className:"min-w-[280px]",autoFocus:!0,value:j,onChange:a=>g(a.target.value),children:[e.jsx("option",{value:"",children:"SELECT TARGET..."}),t.map(a=>e.jsxs("option",{value:a.udid,children:[a.name," (",a.udid,")"]},a.udid))]}),e.jsx("button",{className:"confirm-deploy-btn",disabled:!j,onClick:()=>P(s.id,j),title:"Confirm deployment",children:e.jsx(E,{size:14})})]}):e.jsx("div",{className:"target-device-select empty",children:"NO TARGETS"})}),e.jsx("button",{className:"utility-icon-btn",onClick:()=>window.open(`/xenon/api/apps/${s.id}/download`,"_blank"),children:e.jsx(ne,{size:14})}),e.jsx("button",{className:"utility-icon-btn danger",onClick:()=>G(s.id,s.name),children:e.jsx(le,{size:14})})]})]},s.id)})}),h.length===0&&c.length>0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx(I,{size:48,className:"text-primary opacity-40"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No matching artifacts"}),e.jsxs("p",{className:"empty-description",children:[c.length," ",c.length===1?"artifact is":"artifacts are"," registered, but none match the current filter."]}),e.jsx("div",{className:"empty-actions",children:e.jsx(b,{size:"sm",variant:"default",onClick:()=>{C(""),S({android:!0,ios:!0})},children:"Clear filters"})})]}),c.length===0&&!l&&e.jsxs("div",{className:"empty-registry-technical",children:[e.jsx("div",{className:"empty-icon-container",children:e.jsx(I,{size:48,className:"text-primary opacity-40 animate-pulse"})}),e.jsx("h2",{className:"empty-title brand-font",children:"No apps yet"}),e.jsxs("p",{className:"empty-description",children:["Upload ",e.jsx("code",{className:"text-primary",children:".apk"})," or"," ",e.jsx("code",{className:"text-primary",children:".ipa"})," artifacts to enable versioned installs across your device fleet."]}),e.jsx("div",{className:"empty-actions",children:e.jsxs("label",{className:"upload-trigger-massive",children:[e.jsx("input",{type:"file",accept:".apk,.ipa",onChange:D,style:{display:"none"}}),e.jsxs("div",{className:"massive-upload-content",children:[e.jsx(E,{size:24,className:"mb-2"}),e.jsx("span",{children:"Upload your first app"})]})]})})]})]})}),L&&e.jsx("div",{className:"upload-overlay-technical",children:e.jsxs("div",{className:"upload-card-technical",children:[e.jsx("div",{className:"processing-loader"}),e.jsx("h2",{className:"brand-font",style:{fontSize:"20px",marginBottom:"8px"},children:"Artifact ingestion"}),e.jsx("p",{className:"text-muted text-xs",children:"VERIFYING CHECKSUM & DEPLOYING TO REGISTRY..."})]})})]})};export{Se as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.apps-container{display:flex;flex-direction:column;height:100%;width:100%}.apps-registry-content{flex:1;overflow-y:auto;padding:var(--space-4) 24px;background:var(--bg)}.registry-table-header{display:grid;grid-template-columns:3fr 1fr 1fr 1.5fr 1.5fr;padding:12px 24px;border-bottom:2px solid var(--border);color:var(--text-dim);font-size:11px;font-weight:700;background:rgb(var(--rgb-well) / calc(.2 * var(--well-k)))}.registry-list{display:flex;flex-direction:column}.artifact-row{display:grid;grid-template-columns:3fr 1fr 1fr 1.5fr 1.5fr;align-items:center;padding:12px 24px;background:rgb(var(--rgb-well) / calc(.1 * var(--well-k)));border-bottom:1px solid var(--border);transition:all .2s ease;position:relative}.artifact-row:hover{background:rgb(var(--rgb-fg) / .02)}.artifact-row.active{background:rgb(var(--rgb-accent) / .05);border-left:3px solid var(--color-accent)}.col-app-info{display:flex;align-items:center;gap:16px;min-width:0}.app-platform-badge{width:32px;height:32px;background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--text-dim)}.artifact-row.android .app-platform-badge{color:var(--color-accent);border-color:rgb(var(--rgb-accent) / .2)}.artifact-row.ios .app-platform-badge{color:var(--text);border-color:var(--border)}.app-text-block{display:flex;flex-direction:column;min-width:0}.app-display-name{font-size:13px;font-weight:700;color:var(--text);font-family:Outfit,sans-serif;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-package-id{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--text-dim);opacity:.8;display:flex;align-items:center;gap:6px}.col-version{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--color-accent);font-weight:600}.col-size{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--text-muted)}.col-timestamp{font-size:11px;color:var(--text-dim)}.col-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px}.instant-deploy-trigger{height:28px;background:rgb(var(--rgb-accent) / .05);border:1px solid var(--color-accent);border-radius:6px;padding:0 12px;display:flex;align-items:center;gap:8px;color:var(--color-accent);font-size:11px;font-weight:700;transition:all .2s;cursor:pointer}.instant-deploy-trigger:hover:not(:disabled){background:var(--color-accent);color:var(--bg);box-shadow:none}.utility-icon-btn{width:28px;height:28px;background:rgb(var(--rgb-well) / calc(.3 * var(--well-k)));border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-dim);transition:all .2s}.utility-icon-btn:hover{border-color:var(--border);color:var(--text)}.utility-icon-btn.danger:hover{color:var(--status-error-fg)}.device-explorer-header-container{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;background:#0f0f1a66;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);z-index:100;gap:16px;flex-wrap:wrap}.device-explorer-header-left-container{display:flex;align-items:center;gap:24px;flex:1;min-width:0;flex-wrap:wrap}.device-explorer-header-right-container{display:flex;align-items:center;gap:12px}.device-explorer-header-filter-count{margin-left:8px}@media (max-width: 900px){.device-explorer-header-container{flex-direction:column;align-items:stretch;padding:12px 16px}.device-explorer-header-left-container{flex-direction:column;align-items:stretch;gap:12px}.device-explorer-header-left-container>*{width:100%;min-width:0}.device-explorer-header-right-container{justify-content:flex-end;flex-wrap:wrap}}.icon-btn-secondary{width:32px;height:32px;background:rgb(var(--rgb-fg) / .03);border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-dim);cursor:pointer;transition:all .2s ease}.icon-btn-secondary:hover{background:rgb(var(--rgb-fg) / .08);color:var(--text);border-color:var(--border)}.deployment-flyout{position:absolute;top:50%;padding:6px;right:180px;transform:translateY(-50%);background:var(--surface);border:1px solid var(--color-accent);border-radius:8px;box-shadow:0 10px 40px rgb(var(--rgb-black) / calc(.6 * var(--shadow-k)));z-index:110;display:flex;gap:4px;animation:slideInRight .2s cubic-bezier(.16,1,.3,1)}@keyframes slideInRight{0%{opacity:0;transform:translateY(-50%) translate(10px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.target-device-select{height:32px;background:rgb(var(--rgb-well) / calc(.25 * var(--well-k)));border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:11px;font-weight:600;padding:0 12px;min-width:280px;outline:none;cursor:pointer;transition:all .2s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}.target-device-select:hover{border-color:var(--color-accent);background-color:rgb(var(--rgb-well) / calc(.4 * var(--well-k)))}.target-device-select option{background:var(--surface);color:var(--text);padding:8px}.target-device-select.empty{display:flex;align-items:center;justify-content:center;padding:0 20px;height:32px;font-style:italic;opacity:.5;font-size:11px}.deploy-actions-group{display:flex;align-items:center;gap:6px}.confirm-deploy-btn{width:32px;height:32px;background:var(--color-accent);border:none;border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--color-on-accent);cursor:pointer;transition:all .2s cubic-bezier(.4,0,.2,1)}.confirm-deploy-btn:hover:not(:disabled){background:var(--color-accent-strong);transform:scale(1.05);box-shadow:none}.confirm-deploy-btn:disabled{background:rgb(var(--rgb-fg) / .1);color:rgb(var(--rgb-fg) / .2);cursor:not-allowed}.upload-overlay-technical{position:fixed;top:0;right:0;bottom:0;left:0;background:#020617d9;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:2000;display:flex;align-items:center;justify-content:center}.upload-card-technical{width:420px;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:40px;text-align:center;box-shadow:0 30px 60px rgb(var(--rgb-black) / calc(.6 * var(--shadow-k)))}.processing-loader{width:40px;height:40px;border:2px solid rgb(var(--rgb-accent) / .1);border-top-color:var(--color-accent);border-radius:50%;margin:0 auto 20px;animation:spin 1s linear infinite}.empty-registry-technical{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:100px 20px;text-align:center;max-width:600px;margin:0 auto}.empty-icon-container{width:100px;height:100px;background:radial-gradient(circle,rgb(var(--rgb-blue) / .1) 0%,transparent 70%);display:flex;align-items:center;justify-content:center;border-radius:50%;margin-bottom:24px}.empty-title{font-size:28px;font-weight:800;color:var(--text);margin-bottom:16px;letter-spacing:-.02em}.empty-description{font-size:14px;line-height:1.6;color:var(--text-muted);margin-bottom:40px}.empty-description code{background:rgb(var(--rgb-blue) / .1);padding:2px 6px;border-radius:4px;font-weight:600}.upload-trigger-massive{cursor:pointer;display:block}.massive-upload-content{display:flex;flex-direction:column;align-items:center;padding:30px 60px;background:var(--surface);border:1px solid var(--color-accent);box-shadow:none;border-radius:8px;color:var(--color-accent);font-weight:700;font-size:16px;transition:all .3s cubic-bezier(.4,0,.2,1);box-shadow:0 0 0 transparent}.massive-upload-content:hover{background:rgb(var(--rgb-blue) / .05);transform:translateY(-4px);box-shadow:none;border-style:solid}.massive-upload-content svg{transition:transform .3s ease}.massive-upload-content:hover svg{transform:translateY(-4px) scale(1.1)}.copy-hint{cursor:pointer;opacity:.4;transition:opacity .2s}.copy-hint:hover{opacity:1}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (min-width: 1401px){.apps-registry-content{padding:0 24px 24px}}.device-explorer-container{display:flex;flex-direction:column;width:100%;gap:var(--space-4)}.device-explorer-header-entry{display:flex;flex-direction:column;gap:4px;min-width:0}.device-explorer-header-value{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.device-explorer-header-value>.device-explorer-header__platform-btn+.device-explorer-header__platform-btn{margin-left:4px}.device-explorer-header__platform-btn{display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:6px;background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));border:1px solid var(--border);color:var(--text-muted);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s ease}.device-explorer-header__platform-btn:hover{background:rgb(var(--rgb-fg) / .03);color:var(--text);border-color:var(--border)}.device-explorer-header__platform-btn.selected{background:rgb(var(--rgb-accent) / .05);color:var(--color-accent);border-color:rgb(var(--rgb-accent) / .3);box-shadow:none}.device-explorer-search-wrapper{position:relative;width:320px}.device-explorer-search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);pointer-events:none;opacity:.5}.device-explorer-header-text-filter{width:100%;height:32px;padding:0 12px 0 36px;border-radius:6px;border:1px solid var(--border);background:rgb(var(--rgb-well) / calc(.4 * var(--well-k)));font-family:JetBrains Mono,monospace;font-size:12px;color:var(--text);transition:all .2s ease}.device-explorer-header-text-filter:focus{outline:none;border-color:var(--color-accent);background:rgb(var(--rgb-well) / calc(.6 * var(--well-k)));box-shadow:none}.device-explorer-header-text-filter::placeholder{color:var(--text-dim);font-size:11px}:root[data-theme=light] .device-explorer-header-container{background:rgb(var(--rgb-white) / .7)}.badge-base{display:inline-flex;align-items:center;gap:6px;border-radius:6px;border:1px solid transparent;padding:2px 8px;font-size:11px;font-weight:800;transition:all .2s ease;white-space:nowrap}.badge-variant-default{background:rgb(var(--rgb-well) / calc(.3 * var(--well-k)));color:var(--text-dim);border-color:var(--border)}.badge-variant-success{background:rgb(var(--rgb-success) / .05);color:var(--color-success);border-color:rgb(var(--rgb-success) / .2)}.badge-variant-warning{background:#ffc1070d;color:#ffc107;border-color:#ffc10733}.badge-variant-error{background:rgb(var(--rgb-red-alt) / .05);color:var(--red-alt);border-color:rgb(var(--rgb-red-alt) / .2)}.badge-variant-secondary{background:var(--surface);color:var(--text);border-color:var(--border)}.badge-variant-outline{background:transparent;color:var(--text-dim);border:1px solid var(--border)}.badge-variant-outline:hover{color:var(--text);border-color:var(--text-muted)}:root[data-theme=light] .badge-variant-warning{background:rgb(var(--rgb-amber) / .08);color:var(--amber);border-color:rgb(var(--rgb-amber) / .3)}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as i,j as e,n,S as o}from"./index-DjWgs7qB.js";import{N as l}from"./network-BzgNm5G_.js";/**
|
|
2
|
+
* @license lucide-react v0.555.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const d=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],c=i("monitor-smartphone",d),x=[{icon:o,title:"Self-healing selectors",body:"Broken locators recover through six escalating tiers before a test fails."},{icon:c,title:"Live Android & iOS devices",body:"Watch, drive and record real devices from the browser."},{icon:l,title:"Hub–node scaling",body:"One hub orchestrates device labs across machines."}];function b({children:t}){return e.jsxs("div",{className:"grid min-h-screen w-full grid-cols-1 bg-[var(--bg)] text-[var(--text)] md:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden border-r border-[rgb(var(--rgb-fg)/0.06)] bg-[var(--surface-sunken)] md:flex md:flex-col",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_90%_60%_at_0%_0%,rgb(var(--rgb-accent)/0.14),transparent_60%)]"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,rgb(var(--rgb-white)/0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgb(var(--rgb-white)/0.03)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:linear-gradient(to_bottom,black,transparent_85%)]"}),e.jsxs("div",{className:"relative flex flex-1 flex-col justify-between px-12 py-10",children:[e.jsx(n,{className:"h-8 w-auto self-start object-contain"}),e.jsxs("div",{className:"max-w-md",children:[e.jsxs("h2",{className:"text-4xl font-semibold leading-tight tracking-tight",children:["Your device lab,",e.jsx("br",{}),e.jsx("span",{className:"text-[var(--color-accent)]",children:"under control."})]}),e.jsx("p",{className:"mt-4 text-sm leading-relaxed text-[var(--text-muted)]",children:"Appium orchestration for the devices you own — with self-healing tests, live streaming and recordable proof of what ran."}),e.jsx("ul",{className:"mt-10 space-y-6",children:x.map(({icon:a,title:r,body:s})=>e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg border border-[var(--accent-border)] bg-[var(--accent-subtle)]",children:e.jsx(a,{className:"h-4 w-4 text-[var(--color-accent)]","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--text)]",children:r}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:s})]})]},r))})]}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-[rgb(var(--rgb-fg)/0.06)] pt-5 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Xenon v","1.21.0"," · Self-hosted device lab"]}),e.jsx("a",{href:"/xenon/api-docs",target:"_blank",rel:"noreferrer",className:"text-[var(--text-muted)] underline-offset-4 hover:text-[var(--text)] hover:underline",children:"API docs"})]})]})]}),e.jsx("main",{className:"flex items-center justify-center px-6 py-10",children:e.jsx("div",{className:"w-full max-w-[400px] rounded-xl border border-[var(--border)] bg-[var(--surface)] px-8 py-9 shadow-[var(--shadow-lg)]",children:t})})]})}export{b as A};
|