@xenon-device-management/xenon 1.22.4 → 1.23.1
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-mUVQGEc0.js → ApiKeyGate-CYGT16Vw.js} +1 -1
- package/lib/public/assets/{BugReportButton-DTEs8tGN.js → BugReportButton-GLtnb3gp.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-BRoAd1Sj.js → DeviceMosaicView-iCmCHe-6.js} +1 -1
- package/lib/public/assets/{EmptyState-ErJtYI1I.js → EmptyState-bvyGyuSS.js} +1 -1
- package/lib/public/assets/{FieldGroup-65VOAW_s.js → FieldGroup-C723rtu_.js} +1 -1
- package/lib/public/assets/{Modal-CumsTFc7.js → Modal-Zg7eLy18.js} +1 -1
- package/lib/public/assets/SegmentedControl-C-iPwIQh.js +1 -0
- package/lib/public/assets/SegmentedControl-lDNf6HQr.css +1 -0
- package/lib/public/assets/{SettingCard-BlYmGnxD.js → SettingCard-DSqKllpg.js} +1 -1
- package/lib/public/assets/{Table-Dw77VPjI.js → Table-De3y52f5.js} +1 -1
- package/lib/public/assets/{activity-W-IYNYOw.js → activity-DN1TboLQ.js} +1 -1
- package/lib/public/assets/{ai-settings-DBYtabv0.js → ai-settings-BmJ0R9zw.js} +1 -1
- package/lib/public/assets/{api-keys-DTCC8uWq.js → api-keys-CGcl82ex.js} +1 -1
- package/lib/public/assets/{apps-BanJSL1m.js → apps-CevVczVY.js} +1 -1
- package/lib/public/assets/{arrow-left-DG02ll-2.js → arrow-left-DC3nmfF_.js} +1 -1
- package/lib/public/assets/{arrow-right-DjAmMmYl.js → arrow-right-DFg4j6cS.js} +1 -1
- package/lib/public/assets/{arrow-up-right-Dk4zYVvC.js → arrow-up-right-EeoJ3-gd.js} +1 -1
- package/lib/public/assets/{auth-shell-DX60Cnp3.js → auth-shell-BI_FooIJ.js} +2 -2
- package/lib/public/assets/{builds-page-DlEfR2IF.js → builds-page-BwP_-UuV.js} +2 -2
- package/lib/public/assets/{button-BcBq3nMd.css → button-CzWCxHBf.css} +1 -1
- package/lib/public/assets/button-DaeFhzO3.js +1 -0
- package/lib/public/assets/{calendar-DbUhR1ky.js → calendar-il0Cb8ob.js} +1 -1
- package/lib/public/assets/{check-DBN5pEHK.js → check-Ph6vGLa7.js} +1 -1
- package/lib/public/assets/{chevron-left-C_NNcuSy.js → chevron-left--3h29Fd9.js} +1 -1
- package/lib/public/assets/{chevron-right-DSEJHO6A.js → chevron-right-BHA3nfXx.js} +1 -1
- package/lib/public/assets/{circle-check-DCvFQDU8.js → circle-check-HfmGeUrA.js} +1 -1
- package/lib/public/assets/{circle-x-DozngDyk.js → circle-x-Bgl5qnpH.js} +1 -1
- package/lib/public/assets/{clock-rmbxO4wJ.js → clock-CpC5s-rM.js} +1 -1
- package/lib/public/assets/{copy-BaeAL15w.js → copy-b4zyYIua.js} +1 -1
- package/lib/public/assets/device-explorer-BgWHtT3w.css +1 -0
- package/lib/public/assets/device-explorer-eZylngM8.js +246 -0
- package/lib/public/assets/{download-CA52fegs.js → download-CUjjGo6R.js} +1 -1
- package/lib/public/assets/{forgot-password-B9IbsWvo.js → forgot-password-BSdfYujI.js} +1 -1
- package/lib/public/assets/{funnel-Ba_b7Wqz.js → funnel-DtuZLTcB.js} +1 -1
- package/lib/public/assets/{index-c8lodEdC.js → index-BPWpIM8v.js} +2 -2
- package/lib/public/assets/{index-BYvkQIjW.css → index-BcvSSMbq.css} +1 -1
- package/lib/public/assets/{input-chJvT8xE.js → input-BZVV6a00.js} +1 -1
- package/lib/public/assets/{keycodes-D_POkMkt.js → keycodes-LBiKuCLy.js} +1 -1
- package/lib/public/assets/{layers-DmlmDics.js → layers-CPpWhdIa.js} +1 -1
- package/lib/public/assets/{lock-DYppIRUo.js → lock-BcQYEa37.js} +1 -1
- package/lib/public/assets/{login-BU4PznoN.js → login-BjIc6BhQ.js} +1 -1
- package/lib/public/assets/{maintenance-settings-BuAlGIXr.js → maintenance-settings-IMOYqz_F.js} +1 -1
- package/lib/public/assets/monitor-CZCWoxeK.js +6 -0
- package/lib/public/assets/{mouse-pointer-2-Bf4XBYxV.js → mouse-pointer-2-Dvk8tjlF.js} +1 -1
- package/lib/public/assets/{network-vHrQFUoR.js → network-D8htt9Ak.js} +1 -1
- package/lib/public/assets/overview-lRM0tXUt.js +1 -0
- package/lib/public/assets/{page-header-odsXTF6s.js → page-header-D0pD7LXF.js} +1 -1
- package/lib/public/assets/{plus-BxPFTMza.js → plus-D2JNDwEc.js} +1 -1
- package/lib/public/assets/{profile-page-B8xPVAnw.js → profile-page-Bmcz3kzN.js} +1 -1
- package/lib/public/assets/{reset-password-WDhJisGT.js → reset-password-BdfTmMp7.js} +1 -1
- package/lib/public/assets/{runbook-page-CCc8c4KT.js → runbook-page-DAJdXFWL.js} +1 -1
- package/lib/public/assets/{select-2OHlz_YH.js → select-DI1HMwW-.js} +1 -1
- package/lib/public/assets/{selector-detail-page-Dmmuh77c.js → selector-detail-page-BC4OVGdk.js} +1 -1
- package/lib/public/assets/{selector-health-BpX8aLag.js → selector-health-g4pAOvFI.js} +1 -1
- package/lib/public/assets/{selector-health-page-CSkHlwY0.js → selector-health-page-zf4Qoty7.js} +1 -1
- package/lib/public/assets/{session-detail-page-C8YHyGHB.js → session-detail-page-CqK5erZh.js} +1 -1
- package/lib/public/assets/{settings-DabtQQ3v.js → settings-CU8xn_w0.js} +1 -1
- package/lib/public/assets/{status-pill-outline-Ch5V_U-d.js → status-pill-outline-17FKkPYR.js} +1 -1
- package/lib/public/assets/tablet-CfNdJPDn.js +6 -0
- package/lib/public/assets/{teams-Dr0FkHHP.js → teams-Cdm6oR_0.js} +1 -1
- package/lib/public/assets/{trash-2-CYQosy3T.js → trash-2-AEAsu2jz.js} +1 -1
- package/lib/public/assets/{upload-DRltjrDF.js → upload-CTDd8f1P.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-DtUlGfEB.js → use-password-reset-mode-CKryA-em.js} +1 -1
- package/lib/public/assets/{users-Dm7GOgLZ.js → users-CEmhy5D1.js} +1 -1
- package/lib/public/assets/{users-GL3VzMF-.js → users-Dq_pfjZu.js} +1 -1
- package/lib/public/assets/{video-off-DvHtrcFg.js → video-off-B5jTZtpI.js} +1 -1
- package/lib/public/assets/{webhook-settings-BKJqCNNZ.js → webhook-settings-D53C61gu.js} +1 -1
- package/lib/public/assets/{zap-Dg_oVDEp.js → zap-CcEF0f4H.js} +1 -1
- package/lib/public/index.html +2 -2
- package/lib/src/data-service/deviceColumns.js +24 -0
- package/lib/src/data-service/prisma-store.js +9 -1
- package/lib/src/device-managers/AndroidDeviceManager.js +18 -19
- package/lib/src/device-managers/android/androidIdentity.js +45 -0
- package/lib/src/device-managers/deviceIdentity.js +14 -0
- package/lib/src/device-managers/ios/IOSDiscoveryService.js +13 -3
- package/lib/src/device-managers/ios/appleIdentity.js +102 -0
- package/lib/src/generated/client/edge.js +7 -3
- package/lib/src/generated/client/index-browser.js +4 -0
- package/lib/src/generated/client/index.d.ts +140 -0
- package/lib/src/generated/client/index.js +7 -3
- package/lib/src/generated/client/package.json +1 -1
- package/lib/src/generated/client/schema.prisma +4 -0
- package/lib/src/generated/client/wasm.js +4 -0
- package/lib/test/unit/android-identity.spec.js +44 -0
- package/lib/test/unit/apple-identity.spec.js +44 -0
- package/lib/test/unit/device-columns.spec.js +28 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260926120000_device_identity/migration.sql +6 -0
- package/prisma/schema.prisma +4 -0
- package/lib/public/assets/SegmentedControl-Dq0r4nxn.js +0 -1
- package/lib/public/assets/button-CLqhTbpf.js +0 -1
- package/lib/public/assets/device-explorer-C4d2_w5A.css +0 -1
- package/lib/public/assets/device-explorer-D7Jz-zbV.js +0 -245
- package/lib/public/assets/overview-Bg07_C5h.js +0 -1
- package/lib/public/assets/tablet-RsMViU1S.js +0 -11
package/lib/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as e,o as h}from"./index-
|
|
1
|
+
import{r as n,j as e,o as h}from"./index-BPWpIM8v.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $e,r as c,j as n,z as Le,B as Be,X as $,y as Ue,T as Ye,Y as ze}from"./index-
|
|
1
|
+
import{c as $e,r as c,j as n,z as Le,B as Be,X as $,y as Ue,T as Ye,Y as ze}from"./index-BPWpIM8v.js";import{p as Ve}from"./labels-C21SA4JG.js";import{C as Xe}from"./circle-check-HfmGeUrA.js";import{C as ye,A as ee,H as Fe,S as we,a as Ge,I as He}from"./keycodes-LBiKuCLy.js";import{V as We}from"./video-off-B5jTZtpI.js";import{C as Ke}from"./chevron-left--3h29Fd9.js";import{P as Je}from"./plus-D2JNDwEc.js";import{D as se}from"./download-CUjjGo6R.js";import{a as qe}from"./page-header-D0pD7LXF.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-BPWpIM8v.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-BPWpIM8v.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as h,t as at,R as xe,v as it,y as st}from"./index-c8lodEdC.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-BPWpIM8v.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,`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-BPWpIM8v.js";const l=({kind:o,size:n=6,className:a})=>e.jsx("span",{className:`status-dot status-dot-${o}${a?" "+a:""}`,style:{width:n,height:n},"aria-hidden":!0});function u({segments:o,value:n,onChange:a,size:s="md"}){return e.jsx("div",{className:`seg seg-${s}`,role:"tablist",children:o.map(t=>e.jsxs("button",{role:"tab","aria-selected":t.value===n,className:`seg-btn${t.value===n?" seg-btn-active":""}`,onClick:()=>a(t.value),type:"button",children:[t.tone&&e.jsx(l,{kind:t.tone}),e.jsx("span",{children:t.label}),typeof t.count=="number"&&e.jsx("span",{className:`seg-count${t.count===0?" seg-count-zero":""}`,children:t.count})]},t.value))})}export{u as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.status-dot{display:inline-block;border-radius:50%;vertical-align:middle}.status-dot-ready{background:var(--status-ready-fg)}.status-dot-busy{background:var(--status-busy-fg)}.status-dot-reserved{background:var(--status-reserved-fg)}.status-dot-error{background:var(--status-error-fg)}.status-dot-offline,.status-dot-maintenance{background:var(--status-offline-fg)}.status-code{display:inline-flex;align-items:center;gap:6px;font-family:JetBrains Mono,monospace;font-size:10px;letter-spacing:.1em;font-weight:600}.status-code-label{line-height:1}.status-code-ready{color:var(--status-ready-fg)}.status-code-busy{color:var(--status-busy-fg)}.status-code-reserved{color:var(--status-reserved-fg)}.status-code-error{color:var(--status-error-fg)}.status-code-offline,.status-code-maintenance{color:var(--status-offline-fg)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as n,j as s,D as h}from"./index-
|
|
1
|
+
import{c as n,j as s,D as h}from"./index-BPWpIM8v.js";import{B as r}from"./button-DaeFhzO3.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-BPWpIM8v.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as p,x as z,r as c,X as m,j as e,S as k,D as N,O as I,P as $}from"./index-
|
|
1
|
+
import{c as p,x as z,r as c,X as m,j as e,S as k,D as N,O as I,P as $}from"./index-BPWpIM8v.js";/* empty css */import{S,A as F}from"./SettingCard-DSqKllpg.js";import{P as B}from"./page-header-D0pD7LXF.js";import{L as T}from"./lock-BcQYEa37.js";import{C as b}from"./circle-check-HfmGeUrA.js";import{A as D}from"./activity-DN1TboLQ.js";import"./button-DaeFhzO3.js";import"./utils-CDN07tui.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as le,r as t,j as e,D as $,Q as g,A as oe}from"./index-c8lodEdC.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-Dw77VPjI.js";import{F as m}from"./FieldGroup-65VOAW_s.js";import{P as O}from"./page-header-odsXTF6s.js";import{M as B}from"./Modal-CumsTFc7.js";import{B as u}from"./button-CLqhTbpf.js";import{I as H}from"./input-chJvT8xE.js";import{S as M}from"./select-2OHlz_YH.js";import{P as v}from"./plus-BxPFTMza.js";import{T as pe}from"./trash-2-CYQosy3T.js";import{C as he}from"./check-DBN5pEHK.js";import{C as xe}from"./copy-BaeAL15w.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};
|
|
1
|
+
import{x as le,r as t,j as e,D as $,Q as g,A as oe}from"./index-BPWpIM8v.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-De3y52f5.js";import{F as m}from"./FieldGroup-C723rtu_.js";import{P as O}from"./page-header-D0pD7LXF.js";import{M as B}from"./Modal-Zg7eLy18.js";import{B as u}from"./button-DaeFhzO3.js";import{I as H}from"./input-BZVV6a00.js";import{S as M}from"./select-DI1HMwW-.js";import{P as v}from"./plus-D2JNDwEc.js";import{T as pe}from"./trash-2-AEAsu2jz.js";import{C as he}from"./check-Ph6vGLa7.js";import{C as xe}from"./copy-b4zyYIua.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as x,j as e,x as H,r,X as o,G as X,q as I,z as K,D as Z,y as J}from"./index-
|
|
1
|
+
import{c as x,j as e,x as H,r,X as o,G as X,q as I,z as K,D as Z,y as J}from"./index-BPWpIM8v.js";import{f as Q}from"./time-B8FIgwPE.js";import{c as ee,B as w}from"./button-DaeFhzO3.js";import{c as se}from"./utils-CDN07tui.js";import{P as ae}from"./page-header-D0pD7LXF.js";import{S as te}from"./select-DI1HMwW-.js";import{U as re,T as $}from"./upload-CTDd8f1P.js";import{C as ie}from"./check-Ph6vGLa7.js";import{C as ce}from"./copy-b4zyYIua.js";import{Z as ne}from"./zap-CcEF0f4H.js";import{D as le}from"./download-CUjjGo6R.js";import{T as oe}from"./trash-2-AEAsu2jz.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as i,j as e,n,S as o}from"./index-
|
|
1
|
+
import{c as i,j as e,n,S as o}from"./index-BPWpIM8v.js";import{N as l}from"./network-D8htt9Ak.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 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.
|
|
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.23.1"," · 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};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as z,j as e,z as E,w as y,T as H,q as X,r as v,u as q,i as Q,x as V,M as G,X as J}from"./index-
|
|
1
|
+
import{c as z,j as e,z as E,w as y,T as H,q as X,r as v,u as q,i as Q,x as V,M as G,X as J}from"./index-BPWpIM8v.js";import{f as R,s as $,b as T,a as A,d as K,p as W,o as Y,S as Z,h as ee,c as te,e as D,u as se}from"./status-pill-outline-17FKkPYR.js";import{A as ae}from"./activity-DN1TboLQ.js";import{C as re}from"./circle-x-Bgl5qnpH.js";import{C as ne}from"./circle-check-HfmGeUrA.js";import{I as P}from"./input-BZVV6a00.js";import{S as le}from"./select-DI1HMwW-.js";import{C as oe}from"./clock-CpC5s-rM.js";import{B as I}from"./button-DaeFhzO3.js";import{D as ie}from"./download-CUjjGo6R.js";import{s as ce}from"./labels-C21SA4JG.js";import{C as de}from"./chevron-right-BHA3nfXx.js";import{T as xe}from"./tablet-CfNdJPDn.js";import{M as ue}from"./monitor-CZCWoxeK.js";import{P as me}from"./page-header-D0pD7LXF.js";import"./time-B8FIgwPE.js";import"./utils-CDN07tui.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 pe=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],he=z("refresh-ccw",pe),fe={neutral:"bg-[var(--surface-2)] text-[var(--text-muted)] border-[var(--border)]",green:"bg-[var(--color-success)]/15 text-[var(--color-success)] border-[var(--color-success)]/30",red:"bg-[var(--red)]/15 text-[var(--red)] border-[var(--red)]/30",amber:"bg-[var(--amber)]/15 text-[var(--amber)] border-[var(--amber)]/30"},C=({value:t,tone:r="neutral",label:a})=>e.jsx("span",{title:a,"aria-label":a,className:`inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 rounded-full border text-[10px] font-mono font-medium ${fe[r]}`,children:t}),ve={passed:{Icon:ne,label:"Passed",tint:"text-[var(--color-success)]"},failed:{Icon:re,label:"Failed",tint:"text-[var(--red)]"},running:{Icon:ae,label:"Running",tint:"text-[var(--amber)]"}},S=({kind:t,value:r})=>{const{Icon:a,label:l,tint:c}=ve[t];return e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1 py-2 rounded-md border border-[var(--border)] bg-[var(--bg)]",children:[e.jsx(a,{className:`h-3.5 w-3.5 ${c}`}),e.jsx("span",{className:`text-[9px] font-mono font-semibold tracking-wider ${c}`,children:l}),e.jsx("span",{className:"text-sm font-semibold text-[var(--text)] tabular-nums",children:r})]})},L={all:"All time","24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days"},be=({builds:t,selectedBuildId:r,onSelect:a,search:l,onSearchChange:c,timeFilter:d,onTimeFilterChange:u})=>{const o=t.filter(s=>{const n=(s.name??"")+" "+s.id;if(l&&!n.toLowerCase().includes(l.toLowerCase()))return!1;if(d!=="all"){const w={"24h":864e5,"7d":6048e5,"30d":2592e6},g=Date.parse(String(s.createdAt));if(!Number.isFinite(g)||Date.now()-g>w[d])return!1}return!0}),i=l.trim().length>0||d!=="all",p=o.reduce((s,n)=>(s.passed+=n.passedCount||0,s.failed+=n.failedCount||0,s.running+=n.runningCount||0,s),{passed:0,failed:0,running:0});return e.jsxs("aside",{className:"w-[280px] shrink-0 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col",children:[e.jsxs("div",{className:"p-3 space-y-2 border-b border-[var(--border)]",children:[e.jsxs("div",{className:"relative",children:[e.jsx(E,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(P,{type:"text",value:l,onChange:s=>c(s.target.value),placeholder:"Find builds…",className:"w-full h-8 pl-8 pr-2 text-xs"})]}),e.jsx(le,{value:d,onChange:s=>u(s.target.value),selectSize:"sm",className:"w-full text-xs text-[var(--text-muted)]",children:Object.keys(L).map(s=>e.jsx("option",{value:s,children:L[s]},s))})]}),e.jsxs("div",{className:"p-3 flex items-stretch gap-2 border-b border-[var(--border)]",children:[e.jsx(S,{kind:"passed",value:p.passed}),e.jsx(S,{kind:"failed",value:p.failed}),e.jsx(S,{kind:"running",value:p.running})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o.length===0&&e.jsx("div",{className:"px-4 py-8 text-center text-xs text-[var(--text-dim)]",children:i?"No builds match.":"No builds yet — sessions will appear here after your first test run."}),o.map(s=>{const n=s.id===r;return e.jsxs("button",{type:"button",onClick:()=>a(s.id),className:`w-full text-left relative px-4 py-3 border-b border-[var(--border)] transition-colors ${n?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,children:[n&&e.jsx("span",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r bg-[var(--color-accent)]"}),e.jsx("div",{className:"text-xs font-semibold text-[var(--text)] truncate",children:s.name||"Unnamed build"}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 font-mono text-[9px] text-[var(--text-dim)]",children:[e.jsx(oe,{className:"h-3 w-3"}),R(s.createdAt)]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[s.passedCount>0&&e.jsx(C,{value:s.passedCount,tone:"green",label:`${s.passedCount} passed`}),s.failedCount>0&&e.jsx(C,{value:s.failedCount,tone:"red",label:`${s.failedCount} failed`}),s.runningCount>0&&e.jsx(C,{value:s.runningCount,tone:"amber",label:`${s.runningCount} running`}),s.sessionCount===0&&e.jsx("span",{className:"text-[10px] font-mono text-[var(--text-dim)]",children:"empty"})]}),e.jsx("div",{className:"mt-1 font-mono text-[9px] text-[var(--text-dim)] truncate",children:$(s.id,10,4)})]},s.id)})]})]})},je={neutral:"bg-[var(--text-dim)]",green:"bg-[var(--color-success)]",red:"bg-[var(--red)]",amber:"bg-[var(--amber)]",blue:"bg-[var(--blue)]"},N=({label:t,count:r,active:a,onClick:l,tone:c="neutral",bullet:d=!0})=>e.jsxs("button",{type:"button",onClick:l,"aria-pressed":a,className:`inline-flex items-center gap-2 h-8 px-3 rounded-md border text-[11px] font-semibold transition-colors cursor-pointer ${a?"bg-[var(--surface-2)] border-[var(--border-strong)] text-[var(--text)]":"bg-transparent border-transparent text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--surface-2)]/50"}`,children:[d&&c!=="neutral"&&e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${je[c]}`}),e.jsx("span",{children:t}),typeof r=="number"&&e.jsx("span",{className:"font-mono text-[10px] text-[var(--text-dim)]",children:r})]}),ge=({sessions:t,active:r,onChange:a,search:l,onSearchChange:c,totalMatching:d,totalUnfiltered:u})=>{const o=T(t);return e.jsxs("div",{className:"bg-[var(--surface)]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-4 pt-3 pb-2",children:[e.jsx(N,{label:"ALL",count:o.all,active:r==="all",onClick:()=>a("all"),tone:"neutral",bullet:!1}),e.jsx(N,{label:"PASSED",count:o.passed,active:r==="passed",onClick:()=>a("passed"),tone:"green"}),e.jsx(N,{label:"FAILED",count:o.failed,active:r==="failed",onClick:()=>a("failed"),tone:"red"}),e.jsx(N,{label:"RUNNING",count:o.running,active:r==="running",onClick:()=>a("running"),tone:"amber"})]}),e.jsxs("div",{className:"flex items-center gap-4 px-4 pb-3 border-b border-[var(--border)]",children:[e.jsxs("div",{className:"relative flex-1 max-w-xl",children:[e.jsx(E,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(P,{type:"text",value:l,onChange:i=>c(i.target.value),placeholder:"Search sessions by ID, name, or device…",className:"w-full h-8 pl-8 pr-2 text-xs"})]}),e.jsxs("span",{className:"text-[10px] font-mono text-[var(--text-dim)] whitespace-nowrap",children:[d," of ",u," sessions"]})]})]})};function Ne(t){return(t.split("-")[0]||t).slice(0,8).toUpperCase()}const ye=({build:t,failedCount:r,selectedCount:a,onRetryFailed:l,onExport:c})=>{const d=r>0||a>0,[u,o]=y.useState(!1),i=y.useRef(null);y.useEffect(()=>{const s=n=>{i.current&&!i.current.contains(n.target)&&o(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const p=d?`Retry ${a||r} session${(a||r)===1?"":"s"}`:"No failed sessions to retry";return e.jsxs("header",{className:"flex items-start justify-between gap-4 px-4 py-3 border-b border-[var(--border)] bg-[var(--surface)]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--text-dim)]",children:[e.jsx("span",{children:"Build"}),e.jsxs("span",{className:"font-mono text-[var(--color-accent)]",title:t.id,children:["#",Ne(t.id)]})]}),e.jsx("h2",{className:"mt-0.5 text-sm font-semibold text-[var(--text)]",children:t.name||"Unnamed build"})]}),e.jsxs("div",{className:"flex items-center gap-2",ref:i,children:[e.jsxs(I,{type:"button",variant:"secondary",size:"sm",onClick:l,disabled:!d,title:p,className:"gap-1.5",children:[e.jsx(he,{className:"h-3.5 w-3.5"}),"Retry failed"]}),e.jsxs("div",{className:"relative",children:[e.jsxs(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>o(s=>!s),className:"gap-1.5",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),"Export"]}),u&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-40 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden z-20",children:[e.jsx("button",{type:"button",onClick:()=>{o(!1),c("json")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as JSON"}),e.jsx("button",{type:"button",onClick:()=>{o(!1),c("csv")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as CSV"})]})]})]})]})};function we({platform:t}){const r=(t||"").toLowerCase();return r.includes("tv")?e.jsx(H,{className:"h-3.5 w-3.5"}):r.includes("pad")||r.includes("tablet")?e.jsx(xe,{className:"h-3.5 w-3.5"}):r.includes("android")||r.includes("ios")?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(ue,{className:"h-3.5 w-3.5"})}function Ce(t){switch(A(t)){case"running":return{label:"Running",tone:"running"};case"failed":return{label:"Failed",tone:"failed"};case"passed":return{label:"Passed",tone:"passed"};default:return{label:ce(t),tone:"offline"}}}const Se=({session:t,selected:r,onToggleSelect:a,onOpen:l})=>{const c=A(t.status)==="failed",d=Ce(t.status),u=K(t),o=c&&t.failure_reason?t.failure_reason:t.name??"";return e.jsxs("tr",{onClick:l,className:"group border-b border-[var(--border)] hover:bg-[var(--surface-2)] cursor-pointer transition-colors align-top",children:[e.jsx("td",{className:"px-3 py-3",onClick:i=>i.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:r,onChange:a,"aria-label":`Select session ${t.id}`})}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsxs("div",{className:"font-mono text-xs text-[var(--color-accent)]",title:t.id,children:["#",$(t.id,14,4)]}),o&&e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate max-w-[420px]",title:o,children:o})]}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[var(--text)]",children:[e.jsx(we,{platform:t.device_platform}),e.jsx("span",{className:"truncate max-w-[160px]",children:u})]}),t.node_id&&e.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-[var(--text-dim)]",children:["node-",t.node_id]})]}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsx("div",{className:"text-xs text-[var(--text)]",children:W(t)}),t.device_version&&e.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-[var(--text-dim)]",children:Y(t)})]}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(Z,{label:d.label,tone:d.tone})}),e.jsx("td",{className:"px-3 py-3 font-mono text-[11px] text-[var(--text-muted)] whitespace-nowrap",children:R(t.startTime)}),e.jsx("td",{className:"px-3 py-3 font-mono text-[11px] text-[var(--text-muted)] whitespace-nowrap text-right",children:ee(te(t))}),e.jsx("td",{className:"px-3 py-3 text-right",children:e.jsx(de,{className:"inline h-4 w-4 text-[var(--text-dim)] group-hover:text-[var(--text)]"})})]})},ke=({sessions:t,statusFilter:r,searchQuery:a,selectedIds:l,onToggleSelect:c,onToggleSelectAll:d,onOpenRow:u,buildHasNoSessions:o})=>{const i=v.useMemo(()=>D(t,r,a),[t,r,a]);if(o)return e.jsx("div",{className:"px-4 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions in this build yet. Trigger one from your test runner."});if(i.length===0)return e.jsx("div",{className:"px-4 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions match the current filters."});const p=i.length>0&&i.every(n=>l.has(n.id)),s=i.some(n=>l.has(n.id));return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left table-fixed",children:[e.jsx("thead",{className:"sticky top-0 bg-[var(--surface)] border-b border-[var(--border)] z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 w-[36px]",children:e.jsx("input",{type:"checkbox","aria-label":"Select all visible",checked:p,ref:n=>{n&&(n.indeterminate=s&&!p)},onChange:()=>d(i.map(n=>n.id))})}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium",children:"Session"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium",children:"Device · Node"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[108px]",children:"Platform"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[104px]",children:"Status"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[160px]",children:"Start Time"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium text-right w-[92px]",children:"Duration"}),e.jsx("th",{className:"px-3 py-2 w-[32px]"})]})}),e.jsx("tbody",{children:i.map(n=>e.jsx(Se,{session:n,selected:l.has(n.id),onToggleSelect:()=>c(n.id),onOpen:()=>u(n)},n.id))})]})})},He=()=>{const t=q(),{buildId:r}=Q(),a=se(),{toast:l}=V(),[c,d]=v.useState("all"),[u,o]=v.useState("all"),[i,p]=v.useState(""),[s,n]=v.useState(new Set);y.useEffect(()=>{r&&r!==a.selectedBuildId&&(a.selectBuild(r),n(new Set))},[r,a]);const w=x=>t(`/builds/${x}`),g=x=>t(`/builds/${a.selectedBuildId}/sessions/${x.id}`),F=v.useCallback(x=>{n(m=>{const h=new Set(m);return h.has(x)?h.delete(x):h.add(x),h})},[]),M=v.useCallback(x=>{n(m=>{const h=x.length>0&&x.every(f=>m.has(f)),b=new Set(m);return h?x.forEach(f=>b.delete(f)):x.forEach(f=>b.add(f)),b})},[]),k=a.builds.find(x=>x.id===a.selectedBuildId)||null,O=T(a.sessions),U=()=>{l("Bulk retry lands in a future release.","info")},_=async x=>{if(a.selectedBuildId)try{const m=s.size>0?Array.from(s):void 0,{blob:h,filename:b}=await J.exportBuild(a.selectedBuildId,x,m),f=URL.createObjectURL(h),j=document.createElement("a");j.href=f,j.download=b,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(f);const B=m?m.length:"all";l(`Exported ${B} session${B===1?"":"s"} as ${x.toUpperCase()}.`,"success")}catch(m){const h=m instanceof Error?m.message:String(m);l(`Export failed: ${h}`,"error")}};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(me,{icon:G,title:"Sessions",subtitle:"Builds and the test sessions recorded against them."}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsx(be,{builds:a.builds,selectedBuildId:a.selectedBuildId,onSelect:w,search:a.searchQuery,onSearchChange:a.setSearchQuery,timeFilter:c,onTimeFilterChange:d}),e.jsx("section",{className:"flex-1 flex flex-col min-w-0",children:k?e.jsxs(e.Fragment,{children:[e.jsx(ye,{build:k,failedCount:O.failed,selectedCount:s.size,onRetryFailed:U,onExport:_}),e.jsx(ge,{sessions:a.sessions,active:u,onChange:o,search:i,onSearchChange:p,totalMatching:D(a.sessions,u,i).length,totalUnfiltered:a.sessions.length}),e.jsx(ke,{sessions:a.sessions,statusFilter:u,searchQuery:i,selectedIds:s,onToggleSelect:F,onToggleSelectAll:M,onOpenRow:g,buildHasNoSessions:a.sessions.length===0})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-[var(--text-dim)]",children:"Select a build from the left to see its sessions."})})]})]})};export{He as BuildsPage,He as default};
|
|
6
|
+
*/const pe=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],he=z("refresh-ccw",pe),fe={neutral:"bg-[var(--surface-2)] text-[var(--text-muted)] border-[var(--border)]",green:"bg-[var(--color-success)]/15 text-[var(--color-success)] border-[var(--color-success)]/30",red:"bg-[var(--red)]/15 text-[var(--red)] border-[var(--red)]/30",amber:"bg-[var(--amber)]/15 text-[var(--amber)] border-[var(--amber)]/30"},C=({value:t,tone:r="neutral",label:a})=>e.jsx("span",{title:a,"aria-label":a,className:`inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 rounded-full border text-[10px] font-mono font-medium ${fe[r]}`,children:t}),ve={passed:{Icon:ne,label:"Passed",tint:"text-[var(--color-success)]"},failed:{Icon:re,label:"Failed",tint:"text-[var(--red)]"},running:{Icon:ae,label:"Running",tint:"text-[var(--amber)]"}},S=({kind:t,value:r})=>{const{Icon:a,label:l,tint:c}=ve[t];return e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1 py-2 rounded-md border border-[var(--border)] bg-[var(--bg)]",children:[e.jsx(a,{className:`h-3.5 w-3.5 ${c}`}),e.jsx("span",{className:`text-[9px] font-mono font-semibold tracking-wider ${c}`,children:l}),e.jsx("span",{className:"text-sm font-semibold text-[var(--text)] tabular-nums",children:r})]})},L={all:"All time","24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days"},be=({builds:t,selectedBuildId:r,onSelect:a,search:l,onSearchChange:c,timeFilter:d,onTimeFilterChange:u})=>{const o=t.filter(s=>{const n=(s.name??"")+" "+s.id;if(l&&!n.toLowerCase().includes(l.toLowerCase()))return!1;if(d!=="all"){const w={"24h":864e5,"7d":6048e5,"30d":2592e6},g=Date.parse(String(s.createdAt));if(!Number.isFinite(g)||Date.now()-g>w[d])return!1}return!0}),i=l.trim().length>0||d!=="all",p=o.reduce((s,n)=>(s.passed+=n.passedCount||0,s.failed+=n.failedCount||0,s.running+=n.runningCount||0,s),{passed:0,failed:0,running:0});return e.jsxs("aside",{className:"w-[280px] shrink-0 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col",children:[e.jsxs("div",{className:"p-3 space-y-2 border-b border-[var(--border)]",children:[e.jsxs("div",{className:"relative",children:[e.jsx(E,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(P,{type:"text",value:l,onChange:s=>c(s.target.value),placeholder:"Find builds…",className:"w-full h-8 pl-8 pr-2 text-xs"})]}),e.jsx(le,{value:d,onChange:s=>u(s.target.value),selectSize:"sm",className:"w-full text-xs text-[var(--text-muted)]",children:Object.keys(L).map(s=>e.jsx("option",{value:s,children:L[s]},s))})]}),e.jsxs("div",{className:"p-3 flex items-stretch gap-2 border-b border-[var(--border)]",children:[e.jsx(S,{kind:"passed",value:p.passed}),e.jsx(S,{kind:"failed",value:p.failed}),e.jsx(S,{kind:"running",value:p.running})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o.length===0&&e.jsx("div",{className:"px-4 py-8 text-center text-xs text-[var(--text-dim)]",children:i?"No builds match.":"No builds yet — sessions will appear here after your first test run."}),o.map(s=>{const n=s.id===r;return e.jsxs("button",{type:"button",onClick:()=>a(s.id),className:`w-full text-left relative px-4 py-3 border-b border-[var(--border)] transition-colors ${n?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,children:[n&&e.jsx("span",{className:"absolute left-0 top-2 bottom-2 w-[3px] rounded-r bg-[var(--color-accent)]"}),e.jsx("div",{className:"text-xs font-semibold text-[var(--text)] truncate",children:s.name||"Unnamed build"}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 font-mono text-[9px] text-[var(--text-dim)]",children:[e.jsx(oe,{className:"h-3 w-3"}),R(s.createdAt)]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[s.passedCount>0&&e.jsx(C,{value:s.passedCount,tone:"green",label:`${s.passedCount} passed`}),s.failedCount>0&&e.jsx(C,{value:s.failedCount,tone:"red",label:`${s.failedCount} failed`}),s.runningCount>0&&e.jsx(C,{value:s.runningCount,tone:"amber",label:`${s.runningCount} running`}),s.sessionCount===0&&e.jsx("span",{className:"text-[10px] font-mono text-[var(--text-dim)]",children:"empty"})]}),e.jsx("div",{className:"mt-1 font-mono text-[9px] text-[var(--text-dim)] truncate",children:$(s.id,10,4)})]},s.id)})]})]})},je={neutral:"bg-[var(--text-dim)]",green:"bg-[var(--color-success)]",red:"bg-[var(--red)]",amber:"bg-[var(--amber)]",blue:"bg-[var(--blue)]"},N=({label:t,count:r,active:a,onClick:l,tone:c="neutral",bullet:d=!0})=>e.jsxs("button",{type:"button",onClick:l,"aria-pressed":a,className:`inline-flex items-center gap-2 h-8 px-3 rounded-md border text-[11px] font-semibold transition-colors cursor-pointer ${a?"bg-[var(--surface-2)] border-[var(--border-strong)] text-[var(--text)]":"bg-transparent border-transparent text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--surface-2)]/50"}`,children:[d&&c!=="neutral"&&e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${je[c]}`}),e.jsx("span",{children:t}),typeof r=="number"&&e.jsx("span",{className:"font-mono text-[10px] text-[var(--text-dim)]",children:r})]}),ge=({sessions:t,active:r,onChange:a,search:l,onSearchChange:c,totalMatching:d,totalUnfiltered:u})=>{const o=T(t);return e.jsxs("div",{className:"bg-[var(--surface)]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-4 pt-3 pb-2",children:[e.jsx(N,{label:"ALL",count:o.all,active:r==="all",onClick:()=>a("all"),tone:"neutral",bullet:!1}),e.jsx(N,{label:"PASSED",count:o.passed,active:r==="passed",onClick:()=>a("passed"),tone:"green"}),e.jsx(N,{label:"FAILED",count:o.failed,active:r==="failed",onClick:()=>a("failed"),tone:"red"}),e.jsx(N,{label:"RUNNING",count:o.running,active:r==="running",onClick:()=>a("running"),tone:"amber"})]}),e.jsxs("div",{className:"flex items-center gap-4 px-4 pb-3 border-b border-[var(--border)]",children:[e.jsxs("div",{className:"relative flex-1 max-w-xl",children:[e.jsx(E,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--text-dim)]"}),e.jsx(P,{type:"text",value:l,onChange:i=>c(i.target.value),placeholder:"Search sessions by ID, name, or device…",className:"w-full h-8 pl-8 pr-2 text-xs"})]}),e.jsxs("span",{className:"text-[10px] font-mono text-[var(--text-dim)] whitespace-nowrap",children:[d," of ",u," sessions"]})]})]})};function Ne(t){return(t.split("-")[0]||t).slice(0,8).toUpperCase()}const ye=({build:t,failedCount:r,selectedCount:a,onRetryFailed:l,onExport:c})=>{const d=r>0||a>0,[u,o]=y.useState(!1),i=y.useRef(null);y.useEffect(()=>{const s=n=>{i.current&&!i.current.contains(n.target)&&o(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const p=d?`Retry ${a||r} session${(a||r)===1?"":"s"}`:"No failed sessions to retry";return e.jsxs("header",{className:"flex items-start justify-between gap-4 px-4 py-3 border-b border-[var(--border)] bg-[var(--surface)]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--text-dim)]",children:[e.jsx("span",{children:"Build"}),e.jsxs("span",{className:"font-mono text-[var(--color-accent)]",title:t.id,children:["#",Ne(t.id)]})]}),e.jsx("h2",{className:"mt-0.5 text-sm font-semibold text-[var(--text)]",children:t.name||"Unnamed build"})]}),e.jsxs("div",{className:"flex items-center gap-2",ref:i,children:[e.jsxs(I,{type:"button",variant:"secondary",size:"sm",onClick:l,disabled:!d,title:p,className:"gap-1.5",children:[e.jsx(he,{className:"h-3.5 w-3.5"}),"Retry failed"]}),e.jsxs("div",{className:"relative",children:[e.jsxs(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>o(s=>!s),className:"gap-1.5",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),"Export"]}),u&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-40 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden z-20",children:[e.jsx("button",{type:"button",onClick:()=>{o(!1),c("json")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as JSON"}),e.jsx("button",{type:"button",onClick:()=>{o(!1),c("csv")},className:"w-full text-left px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--surface-2)]",children:"Export as CSV"})]})]})]})]})};function we({platform:t}){const r=(t||"").toLowerCase();return r.includes("tv")?e.jsx(H,{className:"h-3.5 w-3.5"}):r.includes("pad")||r.includes("tablet")?e.jsx(xe,{className:"h-3.5 w-3.5"}):r.includes("android")||r.includes("ios")?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(ue,{className:"h-3.5 w-3.5"})}function Ce(t){switch(A(t)){case"running":return{label:"Running",tone:"running"};case"failed":return{label:"Failed",tone:"failed"};case"passed":return{label:"Passed",tone:"passed"};default:return{label:ce(t),tone:"offline"}}}const Se=({session:t,selected:r,onToggleSelect:a,onOpen:l})=>{const c=A(t.status)==="failed",d=Ce(t.status),u=K(t),o=c&&t.failure_reason?t.failure_reason:t.name??"";return e.jsxs("tr",{onClick:l,className:"group border-b border-[var(--border)] hover:bg-[var(--surface-2)] cursor-pointer transition-colors align-top",children:[e.jsx("td",{className:"px-3 py-3",onClick:i=>i.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:r,onChange:a,"aria-label":`Select session ${t.id}`})}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsxs("div",{className:"font-mono text-xs text-[var(--color-accent)]",title:t.id,children:["#",$(t.id,14,4)]}),o&&e.jsx("div",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] truncate max-w-[420px]",title:o,children:o})]}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[var(--text)]",children:[e.jsx(we,{platform:t.device_platform}),e.jsx("span",{className:"truncate max-w-[160px]",children:u})]}),t.node_id&&e.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-[var(--text-dim)]",children:["node-",t.node_id]})]}),e.jsxs("td",{className:"px-3 py-3",children:[e.jsx("div",{className:"text-xs text-[var(--text)]",children:W(t)}),t.device_version&&e.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-[var(--text-dim)]",children:Y(t)})]}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(Z,{label:d.label,tone:d.tone})}),e.jsx("td",{className:"px-3 py-3 font-mono text-[11px] text-[var(--text-muted)] whitespace-nowrap",children:R(t.startTime)}),e.jsx("td",{className:"px-3 py-3 font-mono text-[11px] text-[var(--text-muted)] whitespace-nowrap text-right",children:ee(te(t))}),e.jsx("td",{className:"px-3 py-3 text-right",children:e.jsx(de,{className:"inline h-4 w-4 text-[var(--text-dim)] group-hover:text-[var(--text)]"})})]})},ke=({sessions:t,statusFilter:r,searchQuery:a,selectedIds:l,onToggleSelect:c,onToggleSelectAll:d,onOpenRow:u,buildHasNoSessions:o})=>{const i=v.useMemo(()=>D(t,r,a),[t,r,a]);if(o)return e.jsx("div",{className:"px-4 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions in this build yet. Trigger one from your test runner."});if(i.length===0)return e.jsx("div",{className:"px-4 py-12 text-center text-xs text-[var(--text-dim)]",children:"No sessions match the current filters."});const p=i.length>0&&i.every(n=>l.has(n.id)),s=i.some(n=>l.has(n.id));return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left table-fixed",children:[e.jsx("thead",{className:"sticky top-0 bg-[var(--surface)] border-b border-[var(--border)] z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 w-[36px]",children:e.jsx("input",{type:"checkbox","aria-label":"Select all visible",checked:p,ref:n=>{n&&(n.indeterminate=s&&!p)},onChange:()=>d(i.map(n=>n.id))})}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium",children:"Session"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium",children:"Device · Node"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[108px]",children:"Platform"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[104px]",children:"Status"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium w-[160px]",children:"Start Time"}),e.jsx("th",{className:"px-3 py-2 text-[11px] text-[var(--text-dim)] font-medium text-right w-[92px]",children:"Duration"}),e.jsx("th",{className:"px-3 py-2 w-[32px]"})]})}),e.jsx("tbody",{children:i.map(n=>e.jsx(Se,{session:n,selected:l.has(n.id),onToggleSelect:()=>c(n.id),onOpen:()=>u(n)},n.id))})]})})},Xe=()=>{const t=q(),{buildId:r}=Q(),a=se(),{toast:l}=V(),[c,d]=v.useState("all"),[u,o]=v.useState("all"),[i,p]=v.useState(""),[s,n]=v.useState(new Set);y.useEffect(()=>{r&&r!==a.selectedBuildId&&(a.selectBuild(r),n(new Set))},[r,a]);const w=x=>t(`/builds/${x}`),g=x=>t(`/builds/${a.selectedBuildId}/sessions/${x.id}`),F=v.useCallback(x=>{n(m=>{const h=new Set(m);return h.has(x)?h.delete(x):h.add(x),h})},[]),M=v.useCallback(x=>{n(m=>{const h=x.length>0&&x.every(f=>m.has(f)),b=new Set(m);return h?x.forEach(f=>b.delete(f)):x.forEach(f=>b.add(f)),b})},[]),k=a.builds.find(x=>x.id===a.selectedBuildId)||null,O=T(a.sessions),U=()=>{l("Bulk retry lands in a future release.","info")},_=async x=>{if(a.selectedBuildId)try{const m=s.size>0?Array.from(s):void 0,{blob:h,filename:b}=await J.exportBuild(a.selectedBuildId,x,m),f=URL.createObjectURL(h),j=document.createElement("a");j.href=f,j.download=b,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(f);const B=m?m.length:"all";l(`Exported ${B} session${B===1?"":"s"} as ${x.toUpperCase()}.`,"success")}catch(m){const h=m instanceof Error?m.message:String(m);l(`Export failed: ${h}`,"error")}};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(me,{icon:G,title:"Sessions",subtitle:"Builds and the test sessions recorded against them."}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsx(be,{builds:a.builds,selectedBuildId:a.selectedBuildId,onSelect:w,search:a.searchQuery,onSearchChange:a.setSearchQuery,timeFilter:c,onTimeFilterChange:d}),e.jsx("section",{className:"flex-1 flex flex-col min-w-0",children:k?e.jsxs(e.Fragment,{children:[e.jsx(ye,{build:k,failedCount:O.failed,selectedCount:s.size,onRetryFailed:U,onExport:_}),e.jsx(ge,{sessions:a.sessions,active:u,onChange:o,search:i,onSearchChange:p,totalMatching:D(a.sessions,u,i).length,totalUnfiltered:a.sessions.length}),e.jsx(ke,{sessions:a.sessions,statusFilter:u,searchQuery:i,selectedIds:s,onToggleSelect:F,onToggleSelectAll:M,onOpenRow:g,buildHasNoSessions:a.sessions.length===0})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-[var(--text-dim)]",children:"Select a build from the left to see its sessions."})})]})]})};export{Xe as BuildsPage,Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.btn-base{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:Inter,sans-serif;font-weight:600;letter-spacing:-.005em;border-radius:var(--radius-md);border:1px solid transparent;cursor:pointer;transition:background var(--motion-fast),border-color var(--motion-fast),color var(--motion-fast);white-space:nowrap;-webkit-user-select:none;user-select:none}.btn-base:disabled{opacity:.5;cursor:not-allowed}.btn-size-sm{height:26px;padding:0 10px;font-size:11px}.btn-size-md{height:32px;padding:0 14px;font-size:12px}.btn-size-lg{height:40px;padding:0 18px;font-size:14px}.btn-size-icon{height:32px;width:32px;padding:0}.btn-primary{background:var(--color-accent);color:var(--color-on-accent);border-color:var(--color-accent)}.btn-primary:hover:not(:disabled){background:var(--color-accent-soft);border-color:var(--color-accent-soft)}.btn-secondary{background:transparent;color:var(--text);border-color:var(--border-strong)}.btn-secondary:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.btn-ghost{background:transparent;color:var(--text);border-color:transparent}.btn-ghost:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.btn-link{background:transparent;color:var(--status-reserved-fg);border:none;padding:0;height:auto}.btn-link:hover:not(:disabled){text-decoration:underline}.btn-danger{background:transparent;color:var(--status-error-fg);border-color:var(--status-error-border)}.btn-danger:hover:not(:disabled){background:var(--status-error-bg);border-color:var(--status-error-fg)}
|
|
1
|
+
.btn-base{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:Inter,sans-serif;font-weight:600;letter-spacing:-.005em;border-radius:var(--radius-md);border:1px solid transparent;cursor:pointer;transition:background var(--motion-fast),border-color var(--motion-fast),color var(--motion-fast);white-space:nowrap;-webkit-user-select:none;user-select:none}.btn-base:disabled{opacity:.5;cursor:not-allowed}.btn-size-sm{height:26px;padding:0 10px;font-size:11px}.btn-size-md{height:32px;padding:0 14px;font-size:12px}.btn-size-lg{height:40px;padding:0 18px;font-size:14px}.btn-size-icon{height:32px;width:32px;padding:0}.btn-primary{background:var(--color-accent);color:var(--color-on-accent);border-color:var(--color-accent)}.btn-primary:hover:not(:disabled){background:var(--color-accent-soft);border-color:var(--color-accent-soft)}.btn-secondary{background:transparent;color:var(--text);border-color:var(--border-strong)}.btn-secondary:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.btn-ghost{background:transparent;color:var(--text);border-color:transparent}.btn-ghost:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.btn-tonal{background:rgb(var(--rgb-accent) / .12);color:var(--color-accent);border-color:rgb(var(--rgb-accent) / .35)}.btn-tonal:hover:not(:disabled){background:var(--color-accent);color:var(--color-on-accent);border-color:var(--color-accent)}.btn-link{background:transparent;color:var(--status-reserved-fg);border:none;padding:0;height:auto}.btn-link:hover:not(:disabled){text-decoration:underline}.btn-danger{background:transparent;color:var(--status-error-fg);border-color:var(--status-error-border)}.btn-danger:hover:not(:disabled){background:var(--status-error-bg);border-color:var(--status-error-fg)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,j as z}from"./index-BPWpIM8v.js";import{a as j,c as g}from"./utils-CDN07tui.js";const v=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,b=j,k=(a,e)=>t=>{var l;if((e==null?void 0:e.variants)==null)return b(a,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:d,defaultVariants:r}=e,y=Object.keys(d).map(n=>{const s=t==null?void 0:t[n],o=r==null?void 0:r[n];if(s===null)return null;const i=v(s)||v(o);return d[n][i]}),c=t&&Object.entries(t).reduce((n,s)=>{let[o,i]=s;return i===void 0||(n[o]=i),n},{}),f=e==null||(l=e.compoundVariants)===null||l===void 0?void 0:l.reduce((n,s)=>{let{class:o,className:i,...V}=s;return Object.entries(V).every(N=>{let[m,u]=N;return Array.isArray(u)?u.includes({...r,...c}[m]):{...r,...c}[m]===u})?[...n,o,i]:n},[]);return b(a,y,f,t==null?void 0:t.class,t==null?void 0:t.className)},C=k("btn-base",{variants:{variant:{default:"btn-primary",primary:"btn-primary",secondary:"btn-secondary",outline:"btn-secondary",ghost:"btn-ghost",tonal:"btn-tonal",link:"btn-link",destructive:"btn-danger",danger:"btn-danger"},size:{default:"btn-size-md",md:"btn-size-md",sm:"btn-size-sm",lg:"btn-size-lg",icon:"btn-size-icon"}},defaultVariants:{variant:"primary",size:"md"}}),O=x.forwardRef(({className:a,variant:e,size:t,...l},d)=>z.jsx("button",{className:g(C({variant:e,size:t,className:a})),ref:d,...l}));O.displayName="Button";export{O as B,k as c};
|