@xenon-device-management/xenon 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -26
- package/lib/package.json +2 -1
- package/lib/public/assets/{AnnotationOverlay-Btq3dZRI.js → AnnotationOverlay-2W4JvEyZ.js} +1 -1
- package/lib/public/assets/{ApiKeyGate-C9OoAgg_.js → ApiKeyGate-GmckX_7r.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-DBC_xczB.js → DeviceMosaicView-DqODzkyo.js} +1 -1
- package/lib/public/assets/{EmptyState-DqWU2-vM.js → EmptyState-7hETKEWb.js} +1 -1
- package/lib/public/assets/{FieldGroup-CveQ3xrA.js → FieldGroup-GOgssFEP.js} +1 -1
- package/lib/public/assets/{FilterMenu-BfKDSfHz.js → FilterMenu-Yvf6RGMd.js} +1 -1
- package/lib/public/assets/{Menu-CtdCybzA.js → Menu-KrPnfdsf.js} +1 -1
- package/lib/public/assets/{Modal-Bsvj1tm2.js → Modal-C6WjZFeI.js} +1 -1
- package/lib/public/assets/{RecordingPage-CRofOiyx.js → RecordingPage-CSRIhZEh.js} +1 -1
- package/lib/public/assets/{RecordingsPage-jNQHb2IR.js → RecordingsPage-CB8ST3nE.js} +1 -1
- package/lib/public/assets/{SegmentedControl-C8HtTha-.js → SegmentedControl-C9o90KId.js} +1 -1
- package/lib/public/assets/{SettingCard-D8K1LZNo.js → SettingCard-CPm3w9l2.js} +1 -1
- package/lib/public/assets/{Table-zNTX92Pn.js → Table-DwIgERRt.js} +1 -1
- package/lib/public/assets/{activity-CJ8LwZq9.js → activity-DrLbHifn.js} +1 -1
- package/lib/public/assets/{ai-settings-CgxQZqrc.js → ai-settings-DU_Ls06P.js} +1 -1
- package/lib/public/assets/{api-keys-ECpo-zTo.js → api-keys-CWYdEzJ_.js} +1 -1
- package/lib/public/assets/{apps-BjGymyf3.js → apps-BqNVdln7.js} +1 -1
- package/lib/public/assets/{arrow-left-BWfCbeHP.js → arrow-left-BtB0_Jg_.js} +1 -1
- package/lib/public/assets/{arrow-right-DC7UGf_n.js → arrow-right-C8NhdtyN.js} +1 -1
- package/lib/public/assets/{arrow-up-right-BOjwybDk.js → arrow-up-right-gMg0ffvv.js} +1 -1
- package/lib/public/assets/{auth-shell-CxMTo9aH.js → auth-shell-CiYZ3N4M.js} +2 -2
- package/lib/public/assets/{builds-page-DOCm4HkA.js → builds-page-EaaqDmLN.js} +1 -1
- package/lib/public/assets/{button-Cg08-EMT.js → button-DDau4Axv.js} +1 -1
- package/lib/public/assets/{calendar-CA1ikLJs.js → calendar-DQ83B1ed.js} +1 -1
- package/lib/public/assets/{check-BMTaH72W.js → check-K1ovTQam.js} +1 -1
- package/lib/public/assets/{chevron-right-B2QOv9Nx.js → chevron-right-Biq00pMt.js} +1 -1
- package/lib/public/assets/{circle-check-CYXBoUqT.js → circle-check-CBv88cH7.js} +1 -1
- package/lib/public/assets/{circle-x-DTwnSAnl.js → circle-x-Bmltailn.js} +1 -1
- package/lib/public/assets/{clock-C8_HViQP.js → clock-BPrld-3h.js} +1 -1
- package/lib/public/assets/{copy-Be7LNMXV.js → copy-t0QB14JI.js} +1 -1
- package/lib/public/assets/{device-explorer-BOqtfGXz.js → device-explorer-BgGZ8AvV.js} +1 -1
- package/lib/public/assets/{download-B56lwxWP.js → download-BroHxNOh.js} +1 -1
- package/lib/public/assets/{forgot-password-CCU6bzLn.js → forgot-password-Bjmf49i6.js} +1 -1
- package/lib/public/assets/{h264Stream-C-OtmIuk.js → h264Stream-DeD__6wa.js} +1 -1
- package/lib/public/assets/{index-CfxsUslp.js → index-72oF89LJ.js} +1 -1
- package/lib/public/assets/{index-B9KQ6LsY.js → index-B0JeuZbg.js} +1 -1
- package/lib/public/assets/index-B0gQkEg0.js +219 -0
- package/lib/public/assets/{input-CZHFjbSg.js → input-DIc4MSC7.js} +1 -1
- package/lib/public/assets/{line-chart-Gl_Dz3X_.js → line-chart-BcWm2vW8.js} +1 -1
- package/lib/public/assets/{list-checks-CCgjeyGY.js → list-checks-B06IJJad.js} +1 -1
- package/lib/public/assets/{lock-CkOwgDcx.js → lock-pVLvnN30.js} +1 -1
- package/lib/public/assets/{login-D5cc4w7M.js → login-CN77vy--.js} +1 -1
- package/lib/public/assets/{maintenance-settings-t7qr3fvX.js → maintenance-settings-CSdzQSkY.js} +1 -1
- package/lib/public/assets/{monitor-DEJixKQO.js → monitor-BtrN5IkI.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-CtOrk4M8.js → mouse-pointer-2-CNsQfo6w.js} +1 -1
- package/lib/public/assets/{network-Dii9qdvk.js → network-BSfA8ZxG.js} +1 -1
- package/lib/public/assets/{overview-rolAACrO.js → overview-BfTebCK5.js} +1 -1
- package/lib/public/assets/{page-header-COQZxJfR.js → page-header-D8KUX6Qg.js} +1 -1
- package/lib/public/assets/{play-DrN1Se_R.js → play-Cvc8xzic.js} +1 -1
- package/lib/public/assets/{plus-5aq-9uRx.js → plus-C9Zj84UF.js} +1 -1
- package/lib/public/assets/{profile-page-6i5kY6kF.js → profile-page-Bi27STgs.js} +1 -1
- package/lib/public/assets/{reset-password-sp2IBrc7.js → reset-password-CPsOuwSu.js} +1 -1
- package/lib/public/assets/{runbook-page-DJDjeopU.js → runbook-page-DEQ-DBOX.js} +153 -102
- package/lib/public/assets/{select-Bpyn7rWO.js → select-BWpnhWXj.js} +1 -1
- package/lib/public/assets/{selector-detail-redirect-BH74vmKv.js → selector-detail-redirect-BefSCSpe.js} +1 -1
- package/lib/public/assets/{selector-health-page-Cw_g218H.js → selector-health-page-MSk96Zz7.js} +1 -1
- package/lib/public/assets/session-detail-page-DPyBNef_.js +4 -0
- package/lib/public/assets/{settings-C3uyGhyc.js → settings-V6x-cXwy.js} +1 -1
- package/lib/public/assets/{stat-tile-xVqAKIlI.js → stat-tile-Duex-GZD.js} +1 -1
- package/lib/public/assets/{tablet-BxUScAeO.js → tablet-BBcoqBmL.js} +1 -1
- package/lib/public/assets/{teams-B5ljGkY2.js → teams-ts8p5rEh.js} +1 -1
- package/lib/public/assets/{trash-2-B701i8sy.js → trash-2-CZ2ew6AZ.js} +1 -1
- package/lib/public/assets/{upload-C2gr44RS.js → upload-Dv99y_le.js} +1 -1
- package/lib/public/assets/{use-builds-data-NeQOFEoy.js → use-builds-data-DrYC8JCF.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-DEzJq5ef.js → use-password-reset-mode-C7QkBNkP.js} +1 -1
- package/lib/public/assets/{users-D_vv_yz4.js → users-D7tKMESH.js} +1 -1
- package/lib/public/assets/{users-MY6eNe6s.js → users-gJ5Y01yo.js} +1 -1
- package/lib/public/assets/{video-off-OK1lNZQn.js → video-off-CqZVuZGs.js} +1 -1
- package/lib/public/assets/{webhook-settings-BU-C9lBf.js → webhook-settings-DI5DSW99.js} +1 -1
- package/lib/public/assets/{zap-DO9ry1iz.js → zap-ClcHFxfo.js} +1 -1
- package/lib/public/index.html +1 -1
- package/lib/schema.json +11 -7
- package/lib/src/InternalHttpClient.js +27 -5
- package/lib/src/XenonCapabilityManager.js +10 -3
- package/lib/src/app/openapi/sessions.yaml +7 -5
- package/lib/src/app/routers/auth.js +2 -1
- package/lib/src/app/routers/users.js +2 -1
- package/lib/src/app/ws/nodeSocketRelay.js +77 -11
- package/lib/src/dashboard/commandLogFields.js +42 -0
- package/lib/src/dashboard/event-manager.js +26 -154
- package/lib/src/dashboard/services/failure-analysis-service.js +8 -86
- package/lib/src/dashboard/services/failureCategories.js +264 -0
- package/lib/src/device-managers/AndroidDeviceManager.js +61 -23
- package/lib/src/device-managers/IOSDeviceManager.js +10 -0
- package/lib/src/device-utils.js +14 -6
- package/lib/src/gateway/forwardToNode.js +4 -11
- package/lib/src/gateway/hubSessionToken.js +27 -4
- package/lib/src/gateway/nodeWebDriverUrl.js +3 -5
- package/lib/src/helpers/outboundProxy.js +219 -0
- package/lib/src/index.js +21 -0
- package/lib/src/interceptors/CommandInterceptor.js +13 -15
- package/lib/src/interceptors/xenonScripts.js +28 -7
- package/lib/src/logger.js +3 -1
- package/lib/src/plugin.js +8 -3
- package/lib/src/scripts/database-check.js +3 -3
- package/lib/src/scripts/initialize-database.js +35 -33
- package/lib/src/scripts/run-migrations.js +1079 -27
- package/lib/src/services/ApiKeyService.js +16 -5
- package/lib/src/services/InterceptorService.js +6 -2
- package/lib/src/services/OrphanSweeper.js +6 -0
- package/lib/src/services/SelectorStateService.js +11 -7
- package/lib/src/services/SelectorVerificationJob.js +6 -2
- package/lib/src/services/SessionLifecycleService.js +32 -18
- package/lib/src/services/SocketClient.js +11 -0
- package/lib/src/services/SocketServer.js +361 -42
- package/lib/src/services/TeamService.js +5 -1
- package/lib/src/services/TracingService.js +171 -60
- package/lib/src/services/UserService.js +14 -3
- package/lib/src/services/UserSessionService.js +16 -4
- package/lib/src/services/healing/HealingOrchestrator.js +3 -1
- package/lib/src/services/identity/identityChanges.js +41 -0
- package/lib/src/services/logcat/SessionDeviceLogs.js +97 -10
- package/lib/src/services/logcat/deviceLogBook.js +5 -4
- package/lib/src/services/logcat/iosDriverLog.js +178 -0
- package/lib/src/services/selector-health/SelectorVisibilityResolver.js +121 -0
- package/lib/src/services/token/JwtKeyService.js +8 -2
- package/lib/src/services/token/mcpTokenTtl.js +27 -0
- package/lib/src/sessions/LocalSession.js +29 -1
- package/lib/src/sessions/RemoteSession.js +12 -2
- package/lib/src/sessions/SessionManager.js +5 -8
- package/lib/test/helpers/driver-log.js +38 -0
- package/lib/test/helpers/fake-http-proxy.js +106 -0
- package/lib/test/helpers/otlp-probe.js +107 -0
- package/lib/test/integration/androidDevices.spec.js +1 -1
- package/lib/test/integration/ios/01iOSSimulator.spec.js +1 -1
- package/lib/test/integration/ios/02iOSDevices.spec.js +1 -1
- package/lib/test/integration/selector-state-flow.spec.js +5 -5
- package/lib/test/unit/XenonCapabilityManager.spec.js +23 -0
- package/lib/test/unit/android-adb-retry.spec.js +112 -0
- package/lib/test/unit/command-log-network-capture.spec.js +191 -0
- package/lib/test/unit/dashboard-events-device-logs.spec.js +59 -11
- package/lib/test/unit/dashboard-events-team-scope.spec.js +6 -3
- package/lib/test/unit/database-check.spec.js +1 -0
- package/lib/test/unit/device-utils.spec.js +13 -4
- package/lib/test/unit/event-log-session-data.spec.js +11 -4
- package/lib/test/unit/failure-analysis.spec.js +22 -8
- package/lib/test/unit/failure-categories.spec.js +24 -22
- package/lib/test/unit/failure-categorization.spec.js +393 -0
- package/lib/test/unit/healing-tier-gate.spec.js +3 -2
- package/lib/test/unit/hub-node-gateway-appium-server.spec.js +72 -1
- package/lib/test/unit/ios-driver-log.spec.js +168 -0
- package/lib/test/unit/ios-simulator-session-readiness.spec.js +187 -0
- package/lib/test/unit/ios-simulator-session-teardown.spec.js +158 -0
- package/lib/test/unit/logcat-ws.spec.js +78 -37
- package/lib/test/unit/logger-json-levels.spec.js +44 -0
- package/lib/test/unit/mcp-token-ttl.spec.js +38 -0
- package/lib/test/unit/observability-example-loki.spec.js +25 -0
- package/lib/test/unit/openapi-for-site.spec.js +80 -0
- package/lib/test/unit/outbound-proxy.spec.js +320 -0
- package/lib/test/unit/port-exhaustion.spec.js +2 -1
- package/lib/test/unit/proxy-option.spec.js +358 -0
- package/lib/test/unit/run-migrations-database.spec.js +807 -0
- package/lib/test/unit/run-migrations-fail-fast.test.js +41 -27
- package/lib/test/unit/run-migrations.test.js +864 -0
- package/lib/test/unit/selector-health-actions.spec.js +3 -1
- package/lib/test/unit/selector-state-service.spec.js +72 -23
- package/lib/test/unit/selector-verification-clean-build.spec.js +1 -1
- package/lib/test/unit/selector-verification-job.spec.js +15 -6
- package/lib/test/unit/selector-verification-missed-regression.spec.js +2 -2
- package/lib/test/unit/selector-visibility-resolver.spec.js +209 -0
- package/lib/test/unit/session-device-logs-ios.spec.js +180 -0
- package/lib/test/unit/session-device-logs.spec.js +11 -2
- package/lib/test/unit/session-end-failure-analysis.spec.js +5 -5
- package/lib/test/unit/session-log-indexes.spec.js +1 -1
- package/lib/test/unit/socket-team-scope.integration.spec.js +749 -0
- package/lib/test/unit/socketServer.scopedEmit.spec.js +237 -5
- package/lib/test/unit/tracing-export-routing.spec.js +137 -0
- package/lib/test/unit/tracing-session-spans.spec.js +337 -0
- package/lib/test/unit/unexpected-shutdown-reason.spec.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/schema.json +11 -7
- package/scripts/dev/readme-screenshots.js +276 -23
- package/scripts/dev/screenshot-fixtures/logcat.js +157 -0
- package/scripts/dev/screenshot-fixtures/phone-screen.html +469 -0
- package/scripts/dev/screenshot-fixtures/session.js +242 -0
- package/scripts/export-openapi.js +32 -0
- package/scripts/lib/openapi-for-site.js +79 -0
- package/lib/public/assets/index-BOxe43p1.js +0 -219
- package/lib/public/assets/session-detail-page-AZJE6XXE.js +0 -4
- package/lib/src/scripts/prepare-prisma.js +0 -89
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,x as Ve,j as C,a4 as Ye,a3 as Ke,R as Z}from"./index-BOxe43p1.js";import{P as lt,b as ht,a as st,u as ce,f as Nt,i as Xe,D as Ge,g as Ut,d as Ue,e as tt,c as qe}from"./index-CfxsUslp.js";import{C as Ze}from"./check-BMTaH72W.js";const Je=["top","right","bottom","left"],U=Math.min,j=Math.max,gt=Math.round,mt=Math.floor,V=t=>({x:t,y:t}),Qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Tt(t,e,n){return j(t,U(e,n))}function K(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Ft(t){return t==="x"?"y":"x"}function Lt(t){return t==="y"?"height":"width"}function z(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function _t(t){return Ft(z(t))}function tn(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=_t(t),i=Lt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=wt(s)),[s,wt(s)]}function en(t){const e=wt(t);return[Dt(t),e,Dt(e)]}function Dt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const qt=["left","right"],Zt=["right","left"],nn=["top","bottom"],on=["bottom","top"];function rn(t,e,n){switch(t){case"top":case"bottom":return n?e?Zt:qt:e?qt:Zt;case"left":case"right":return e?nn:on;default:return[]}}function sn(t,e,n,o){const r=ot(t);let i=rn(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(Dt)))),i}function wt(t){const e=X(t);return Qe[e]+t.slice(e.length)}function cn(t){return{top:0,right:0,bottom:0,left:0,...t}}function le(t){return typeof t!="number"?cn(t):{top:t,right:t,bottom:t,left:t}}function xt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Jt(t,e,n){let{reference:o,floating:r}=t;const i=z(e),s=_t(e),c=Lt(s),l=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:a,y:o.y-r.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-r.width,y:u};break;default:d={x:o.x,y:o.y}}switch(ot(e)){case"start":d[s]-=m*(n&&f?-1:1);break;case"end":d[s]+=m*(n&&f?-1:1);break}return d}async function ln(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=K(e,t),p=le(d),h=c[m?u==="floating"?"reference":"floating":u],w=xt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:a,strategy:l})),b=u==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),v=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},A=xt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:y,strategy:l}):b);return{top:(w.top-A.top+p.top)/v.y,bottom:(A.bottom-w.bottom+p.bottom)/v.y,left:(w.left-A.left+p.left)/v.x,right:(A.right-w.right+p.right)/v.x}}const an=50,fn=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ln},l=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:u}=Jt(f,o,l),m=o,d=0;const p={};for(let g=0;g<i.length;g++){const h=i[g];if(!h)continue;const{name:w,fn:b}=h,{x:y,y:v,data:A,reset:R}=await b({x:a,y:u,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:f,platform:c,elements:{reference:t,floating:e}});a=y??a,u=v??u,p[w]={...p[w],...A},R&&d<an&&(d++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(f=R.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):R.rects),{x:a,y:u}=Jt(f,m,l)),g=-1)}return{x:a,y:u,placement:m,strategy:r,middlewareData:p}},un=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:a=0}=K(t,e)||{};if(f==null)return{};const u=le(a),m={x:n,y:o},d=_t(r),p=Lt(d),g=await s.getDimensions(f),h=d==="y",w=h?"top":"left",b=h?"bottom":"right",y=h?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[d]-m[d]-i.floating[p],A=m[d]-i.reference[d],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let P=R?R[y]:0;(!P||!await(s.isElement==null?void 0:s.isElement(R)))&&(P=c.floating[y]||i.floating[p]);const O=v/2-A/2,L=P/2-g[p]/2-1,D=U(u[w],L),M=U(u[b],L),F=D,I=P-g[p]-M,T=P/2-g[p]/2+O,$=Tt(F,T,I),E=!l.arrow&&ot(r)!=null&&T!==$&&i.reference[p]/2-(T<F?D:M)-g[p]/2<0,N=E?T<F?T-F:T-I:0;return{[d]:m[d]+N,data:{[d]:$,centerOffset:T-$-N,...E&&{alignmentOffset:N}},reset:E}}}),dn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...h}=K(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=X(r),b=z(c),y=X(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),A=m||(y||!g?[wt(c)]:en(c)),R=p!=="none";!m&&R&&A.push(...sn(c,g,p,v));const P=[c,...A],O=await l.detectOverflow(e,h),L=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(a&&L.push(O[w]),u){const T=tn(r,s,v);L.push(O[T[0]],O[T[1]])}if(D=[...D,{placement:r,overflows:L}],!L.every(T=>T<=0)){var M,F;const T=(((M=i.flip)==null?void 0:M.index)||0)+1,$=P[T];if($&&(!(u==="alignment"?b!==z($):!1)||D.every(S=>z(S.placement)===b?S.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:$}};let E=(F=D.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:F.placement;if(!E)switch(d){case"bestFit":{var I;const N=(I=D.filter(S=>{if(R){const _=z(S.placement);return _===b||_==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((S,_)=>S[1]-_[1])[0])==null?void 0:I[0];N&&(E=N);break}case"initialPlacement":E=c;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function Qt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function te(t){return Je.some(e=>t[e]>=0)}const mn=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...i}=K(t,e);switch(r){case"referenceHidden":{const s=await o.detectOverflow(e,{...i,elementContext:"reference"}),c=Qt(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:te(c)}}}case"escaped":{const s=await o.detectOverflow(e,{...i,altBoundary:!0}),c=Qt(s,n.floating);return{data:{escapedOffsets:c,escaped:te(c)}}}default:return{}}}}},ae=new Set(["left","top"]);async function pn(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),c=ot(n),l=z(n)==="y",f=ae.has(s)?-1:1,a=i&&l?-1:1,u=K(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof p=="number"&&(d=c==="end"?p*-1:p),l?{x:d*a,y:m*f}:{x:m*f,y:d*a}}const hn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,l=await pn(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},gn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:b,y}=w;return{x:b,y}}},...f}=K(t,e),a={x:n,y:o},u=await i.detectOverflow(e,f),m=z(X(r)),d=Ft(m);let p=a[d],g=a[m];if(s){const w=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=p+u[w],v=p-u[b];p=Tt(y,p,v)}if(c){const w=m==="y"?"top":"left",b=m==="y"?"bottom":"right",y=g+u[w],v=g-u[b];g=Tt(y,g,v)}const h=l.fn({...e,[d]:p,[m]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[d]:s,[m]:c}}}}}},wn=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=e,{offset:c=0,mainAxis:l=!0,crossAxis:f=!0}=K(t,e),a={x:n,y:o},u=z(r),m=Ft(u);let d=a[m],p=a[u];const g=K(c,e),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const y=m==="y"?"height":"width",v=i.reference[m]-i.floating[y]+h.mainAxis,A=i.reference[m]+i.reference[y]-h.mainAxis;d<v?d=v:d>A&&(d=A)}if(f){var w,b;const y=m==="y"?"width":"height",v=ae.has(X(r)),A=i.reference[u]-i.floating[y]+(v&&((w=s.offset)==null?void 0:w[u])||0)+(v?0:h.crossAxis),R=i.reference[u]+i.reference[y]+(v?0:((b=s.offset)==null?void 0:b[u])||0)-(v?h.crossAxis:0);p<A?p=A:p>R&&(p=R)}return{[m]:d,[u]:p}}}},xn=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:c}=e,{apply:l=()=>{},...f}=K(t,e),a=await s.detectOverflow(e,f),u=X(r),m=ot(r),d=z(r)==="y",{width:p,height:g}=i.floating;let h,w;u==="top"||u==="bottom"?(h=u,w=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,h=m==="end"?"top":"bottom");const b=g-a.top-a.bottom,y=p-a.left-a.right,v=U(g-a[h],b),A=U(p-a[w],y),R=!e.middlewareData.shift;let P=v,O=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(P=b),R&&!m){const D=j(a.left,0),M=j(a.right,0),F=j(a.top,0),I=j(a.bottom,0);d?O=p-2*(D!==0||M!==0?D+M:j(a.left,a.right)):P=g-2*(F!==0||I!==0?F+I:j(a.top,a.bottom))}await l({...e,availableWidth:O,availableHeight:P});const L=await s.getDimensions(c.floating);return p!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function bt(){return typeof window<"u"}function rt(t){return fe(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(fe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fe(t){return bt()?t instanceof Node||t instanceof k(t).Node:!1}function W(t){return bt()?t instanceof Element||t instanceof k(t).Element:!1}function G(t){return bt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function ee(t){return!bt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function at(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=H(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&r!=="inline"&&r!=="contents"}function yn(t){return/^(table|td|th)$/.test(rt(t))}function Rt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const vn=/transform|translate|scale|rotate|perspective|filter/,bn=/paint|layout|strict|content/,J=t=>!!t&&t!=="none";let St;function $t(t){const e=W(t)?H(t):t;return J(e.transform)||J(e.translate)||J(e.scale)||J(e.rotate)||J(e.perspective)||!jt()&&(J(e.backdropFilter)||J(e.filter))||vn.test(e.willChange||"")||bn.test(e.contain||"")}function Rn(t){let e=q(t);for(;G(e)&&!nt(e);){if($t(e))return e;if(Rt(e))return null;e=q(e)}return null}function jt(){return St==null&&(St=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),St}function nt(t){return/^(html|body|#document)$/.test(rt(t))}function H(t){return k(t).getComputedStyle(t)}function At(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(rt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ee(t)&&t.host||Y(t);return ee(e)?e.host:e}function ue(t){const e=q(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:G(e)&&at(e)?e:ue(e)}function ct(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ue(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=k(r);if(i){const c=It(s);return e.concat(s,s.visualViewport||[],at(r)?r:[],c&&n?ct(c):[])}else return e.concat(r,ct(r,[],n))}function It(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function de(t){const e=H(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=G(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=gt(n)!==i||gt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function kt(t){return W(t)?t:t.contextElement}function et(t){const e=kt(t);if(!G(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=de(e);let s=(i?gt(n.width):n.width)/o,c=(i?gt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const An=V(0);function me(t){const e=k(t);return!jt()||!e.visualViewport?An:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==k(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=kt(t);let s=V(1);e&&(o?W(o)&&(s=et(o)):s=et(t));const c=Cn(i,n,o)?me(i):V(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,a=r.width/s.x,u=r.height/s.y;if(i){const m=k(i),d=o&&W(o)?k(o):o;let p=m,g=It(p);for(;g&&o&&d!==p;){const h=et(g),w=g.getBoundingClientRect(),b=H(g),y=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,v=w.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;l*=h.x,f*=h.y,a*=h.x,u*=h.y,l+=y,f+=v,p=k(g),g=It(p)}}return xt({width:a,height:u,x:l,y:f})}function Ct(t,e){const n=At(t).scrollLeft;return e?e.left+n:Q(Y(t)).left+n}function pe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ct(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Sn(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=Y(o),c=e?Rt(e.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),u=G(o);if((u||!u&&!i)&&((rt(o)!=="body"||at(s))&&(l=At(o)),u)){const d=Q(o);f=et(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const m=s&&!u&&!i?pe(s,l):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+a.x+m.x,y:n.y*f.y-l.scrollTop*f.y+a.y+m.y}}function On(t){return Array.from(t.getClientRects())}function Pn(t){const e=Y(t),n=At(t),o=t.ownerDocument.body,r=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ct(t);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=j(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}const ne=25;function En(t,e){const n=k(t),o=Y(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,l=0;if(r){i=r.width,s=r.height;const a=jt();(!a||a&&e==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const f=Ct(o);if(f<=0){const a=o.ownerDocument,u=a.body,m=getComputedStyle(u),d=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-u.clientWidth-d);p<=ne&&(i-=p)}else f<=ne&&(i+=f);return{width:i,height:s,x:c,y:l}}function Tn(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=G(t)?et(t):V(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function oe(t,e,n){let o;if(e==="viewport")o=En(t,n);else if(e==="document")o=Pn(Y(t));else if(W(e))o=Tn(e,n);else{const r=me(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return xt(o)}function he(t,e){const n=q(t);return n===e||!W(n)||nt(n)?!1:H(n).position==="fixed"||he(n,e)}function Dn(t,e){const n=e.get(t);if(n)return n;let o=ct(t,[],!1).filter(c=>W(c)&&rt(c)!=="body"),r=null;const i=H(t).position==="fixed";let s=i?q(t):t;for(;W(s)&&!nt(s);){const c=H(s),l=$t(s);!l&&c.position==="fixed"&&(r=null),(i?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||at(s)&&!l&&he(t,s))?o=o.filter(a=>a!==s):r=c,s=q(s)}return e.set(t,o),o}function In(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?Rt(e)?[]:Dn(e,this._c):[].concat(n),o],c=oe(e,s[0],r);let l=c.top,f=c.right,a=c.bottom,u=c.left;for(let m=1;m<s.length;m++){const d=oe(e,s[m],r);l=j(d.top,l),f=U(d.right,f),a=U(d.bottom,a),u=j(d.left,u)}return{width:f-u,height:a-l,x:u,y:l}}function Mn(t){const{width:e,height:n}=de(t);return{width:e,height:n}}function Nn(t,e,n){const o=G(e),r=Y(e),i=n==="fixed",s=Q(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=V(0);function f(){l.x=Ct(r)}if(o||!o&&!i)if((rt(e)!=="body"||at(r))&&(c=At(e)),o){const d=Q(e,!0,i,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?pe(r,c):V(0),u=s.left+c.scrollLeft-l.x-a.x,m=s.top+c.scrollTop-l.y-a.y;return{x:u,y:m,width:s.width,height:s.height}}function Ot(t){return H(t).position==="static"}function re(t,e){if(!G(t)||H(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function ge(t,e){const n=k(t);if(Rt(t))return n;if(!G(t)){let r=q(t);for(;r&&!nt(r);){if(W(r)&&!Ot(r))return r;r=q(r)}return n}let o=re(t,e);for(;o&&yn(o)&&Ot(o);)o=re(o,e);return o&&nt(o)&&Ot(o)&&!$t(o)?n:o||Rn(t)||n}const Fn=async function(t){const e=this.getOffsetParent||ge,n=this.getDimensions,o=await n(t.floating);return{reference:Nn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ln(t){return H(t).direction==="rtl"}const _n={convertOffsetParentRelativeRectToViewportRelativeRect:Sn,getDocumentElement:Y,getClippingRect:In,getOffsetParent:ge,getElementRects:Fn,getClientRects:On,getDimensions:Mn,getScale:et,isElement:W,isRTL:Ln};function we(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $n(t,e){let n=null,o;const r=Y(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const f=t.getBoundingClientRect(),{left:a,top:u,width:m,height:d}=f;if(c||e(),!m||!d)return;const p=mt(u),g=mt(r.clientWidth-(a+m)),h=mt(r.clientHeight-(u+d)),w=mt(a),y={rootMargin:-p+"px "+-g+"px "+-h+"px "+-w+"px",threshold:j(0,U(1,l))||1};let v=!0;function A(R){const P=R[0].intersectionRatio;if(P!==l){if(!v)return s();P?s(!1,P):o=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!we(f,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(A,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,y)}n.observe(t)}return s(!0),i}function jn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=kt(t),a=r||i?[...f?ct(f):[],...e?ct(e):[]]:[];a.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const u=f&&c?$n(f,n):null;let m=-1,d=null;s&&(d=new ResizeObserver(w=>{let[b]=w;b&&b.target===f&&d&&e&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(e)})),n()}),f&&!l&&d.observe(f),e&&d.observe(e));let p,g=l?Q(t):null;l&&h();function h(){const w=Q(t);g&&!we(g,w)&&n(),g=w,p=requestAnimationFrame(h)}return n(),()=>{var w;a.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(w=d)==null||w.disconnect(),d=null,l&&cancelAnimationFrame(p)}}const kn=hn,Wn=gn,Hn=dn,Bn=xn,zn=mn,ie=un,Vn=wn,Yn=(t,e,n)=>{const o=new Map,r={platform:_n,...n},i={...r.platform,_c:o};return fn(t,e,{...r,platform:i})};var Kn=typeof document<"u",Xn=function(){},pt=Kn?x.useLayoutEffect:Xn;function yt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!yt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!yt(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function xe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function se(t,e){const n=xe(t);return Math.round(e*n)/n}function Pt(t){const e=x.useRef(t);return pt(()=>{e.current=t}),e}function Gn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=t,[a,u]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,d]=x.useState(o);yt(m,o)||d(o);const[p,g]=x.useState(null),[h,w]=x.useState(null),b=x.useCallback(S=>{S!==R.current&&(R.current=S,g(S))},[]),y=x.useCallback(S=>{S!==P.current&&(P.current=S,w(S))},[]),v=i||p,A=s||h,R=x.useRef(null),P=x.useRef(null),O=x.useRef(a),L=l!=null,D=Pt(l),M=Pt(r),F=Pt(f),I=x.useCallback(()=>{if(!R.current||!P.current)return;const S={placement:e,strategy:n,middleware:m};M.current&&(S.platform=M.current),Yn(R.current,P.current,S).then(_=>{const B={..._,isPositioned:F.current!==!1};T.current&&!yt(O.current,B)&&(O.current=B,Ve.flushSync(()=>{u(B)}))})},[m,e,n,M,F]);pt(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,u(S=>({...S,isPositioned:!1})))},[f]);const T=x.useRef(!1);pt(()=>(T.current=!0,()=>{T.current=!1}),[]),pt(()=>{if(v&&(R.current=v),A&&(P.current=A),v&&A){if(D.current)return D.current(v,A,I);I()}},[v,A,I,D,L]);const $=x.useMemo(()=>({reference:R,floating:P,setReference:b,setFloating:y}),[b,y]),E=x.useMemo(()=>({reference:v,floating:A}),[v,A]),N=x.useMemo(()=>{const S={position:n,left:0,top:0};if(!E.floating)return S;const _=se(E.floating,a.x),B=se(E.floating,a.y);return c?{...S,transform:"translate("+_+"px, "+B+"px)",...xe(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,E.floating,a.x,a.y]);return x.useMemo(()=>({...a,update:I,refs:$,elements:E,floatingStyles:N}),[a,I,$,E,N])}const Un=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:r}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?ie({element:o.current,padding:r}).fn(n):{}:o?ie({element:o,padding:r}).fn(n):{}}}},qn=(t,e)=>{const n=kn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Zn=(t,e)=>{const n=Wn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Jn=(t,e)=>({fn:Vn(t).fn,options:[t,e]}),Qn=(t,e)=>{const n=Hn(t);return{name:n.name,fn:n.fn,options:[t,e]}},to=(t,e)=>{const n=Bn(t);return{name:n.name,fn:n.fn,options:[t,e]}},eo=(t,e)=>{const n=zn(t);return{name:n.name,fn:n.fn,options:[t,e]}},no=(t,e)=>{const n=Un(t);return{name:n.name,fn:n.fn,options:[t,e]}};var oo="Arrow",ye=x.forwardRef((t,e)=>{const{children:n,width:o=10,height:r=5,...i}=t;return C.jsx(lt.svg,{...i,ref:e,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});ye.displayName=oo;var ro=ye;function io(t){const[e,n]=x.useState(void 0);return ht(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const l=i.borderBoxSize,f=Array.isArray(l)?l[0]:l;s=f.inlineSize,c=f.blockSize}else s=t.offsetWidth,c=t.offsetHeight;n({width:s,height:c})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}var Wt="Popper",[ve]=Nt(Wt),[so,be]=ve(Wt),Re=t=>{const{__scopePopper:e,children:n}=t,[o,r]=x.useState(null);return C.jsx(so,{scope:e,anchor:o,onAnchorChange:r,children:n})};Re.displayName=Wt;var Ae="PopperAnchor",Ce=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...r}=t,i=be(Ae,n),s=x.useRef(null),c=st(e,s),l=x.useRef(null);return x.useEffect(()=>{const f=l.current;l.current=(o==null?void 0:o.current)||s.current,f!==l.current&&i.onAnchorChange(l.current)}),o?null:C.jsx(lt.div,{...r,ref:c})});Ce.displayName=Ae;var Ht="PopperContent",[co,lo]=ve(Ht),Se=x.forwardRef((t,e)=>{var Bt,zt,Vt,Yt,Kt,Xt;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:a=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:d="optimized",onPlaced:p,...g}=t,h=be(Ht,n),[w,b]=x.useState(null),y=st(e,it=>b(it)),[v,A]=x.useState(null),R=io(v),P=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,L=o+(i!=="center"?"-"+i:""),D=typeof a=="number"?a:{top:0,right:0,bottom:0,left:0,...a},M=Array.isArray(f)?f:[f],F=M.length>0,I={padding:D,boundary:M.filter(uo),altBoundary:F},{refs:T,floatingStyles:$,placement:E,isPositioned:N,middlewareData:S}=Gn({strategy:"fixed",placement:L,whileElementsMounted:(...it)=>jn(...it,{animationFrame:d==="always"}),elements:{reference:h.anchor},middleware:[qn({mainAxis:r+O,alignmentAxis:s}),l&&Zn({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Jn():void 0,...I}),l&&Qn({...I}),to({...I,apply:({elements:it,rects:Gt,availableWidth:We,availableHeight:He})=>{const{width:Be,height:ze}=Gt.reference,dt=it.floating.style;dt.setProperty("--radix-popper-available-width",`${We}px`),dt.setProperty("--radix-popper-available-height",`${He}px`),dt.setProperty("--radix-popper-anchor-width",`${Be}px`),dt.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),v&&no({element:v,padding:c}),mo({arrowWidth:P,arrowHeight:O}),m&&eo({strategy:"referenceHidden",...I})]}),[_,B]=Pe(E),ut=ce(p);ht(()=>{N&&(ut==null||ut())},[N,ut]);const Le=(Bt=S.arrow)==null?void 0:Bt.x,_e=(zt=S.arrow)==null?void 0:zt.y,$e=((Vt=S.arrow)==null?void 0:Vt.centerOffset)!==0,[je,ke]=x.useState();return ht(()=>{w&&ke(window.getComputedStyle(w).zIndex)},[w]),C.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:N?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[(Yt=S.transformOrigin)==null?void 0:Yt.x,(Kt=S.transformOrigin)==null?void 0:Kt.y].join(" "),...((Xt=S.hide)==null?void 0:Xt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:C.jsx(co,{scope:n,placedSide:_,onArrowChange:A,arrowX:Le,arrowY:_e,shouldHideArrow:$e,children:C.jsx(lt.div,{"data-side":_,"data-align":B,...g,ref:y,style:{...g.style,animation:N?void 0:"none"}})})})});Se.displayName=Ht;var Oe="PopperArrow",ao={top:"bottom",right:"left",bottom:"top",left:"right"},fo=x.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,i=lo(Oe,o),s=ao[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(ro,{...r,ref:n,style:{...r.style,display:"block"}})})});fo.displayName=Oe;function uo(t){return t!==null}var mo=t=>({name:"transformOrigin",options:t,fn(e){var h,w,b;const{placement:n,rects:o,middlewareData:r}=e,s=((h=r.arrow)==null?void 0:h.centerOffset)!==0,c=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[f,a]=Pe(n),u={start:"0%",center:"50%",end:"100%"}[a],m=(((w=r.arrow)==null?void 0:w.x)??0)+c/2,d=(((b=r.arrow)==null?void 0:b.y)??0)+l/2;let p="",g="";return f==="bottom"?(p=s?u:`${m}px`,g=`${-l}px`):f==="top"?(p=s?u:`${m}px`,g=`${o.floating.height+l}px`):f==="right"?(p=`${-l}px`,g=s?u:`${d}px`):f==="left"&&(p=`${o.floating.width+l}px`,g=s?u:`${d}px`),{data:{x:p,y:g}}}});function Pe(t){const[e,n="center"]=t.split("-");return[e,n]}var po=Re,ho=Ce,go=Se,wo=Symbol.for("react.lazy"),vt=Ye[" use ".trim().toString()];function xo(t){return typeof t=="object"&&t!==null&&"then"in t}function Ee(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===wo&&"_payload"in t&&xo(t._payload)}function yo(t){const e=vo(t),n=x.forwardRef((o,r)=>{let{children:i,...s}=o;Ee(i)&&typeof vt=="function"&&(i=vt(i._payload));const c=x.Children.toArray(i),l=c.find(Ro);if(l){const f=l.props.children,a=c.map(u=>u===l?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:u);return C.jsx(e,{...s,ref:r,children:x.isValidElement(f)?x.cloneElement(f,void 0,a):null})}return C.jsx(e,{...s,ref:r,children:i})});return n.displayName=`${t}.Slot`,n}function vo(t){const e=x.forwardRef((n,o)=>{let{children:r,...i}=n;if(Ee(r)&&typeof vt=="function"&&(r=vt(r._payload)),x.isValidElement(r)){const s=Co(r),c=Ao(i,r.props);return r.type!==x.Fragment&&(c.ref=o?Xe(o,s):s),x.cloneElement(r,c)}return x.Children.count(r)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var bo=Symbol("radix.slottable");function Ro(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===bo}function Ao(t,e){const n={...e};for(const o in e){const r=t[o],i=e[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const l=i(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...t,...n}}function Co(t){var o,r;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var So=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oo=So.reduce((t,e)=>{const n=yo(`Primitive.${e}`),o=x.forwardRef((r,i)=>{const{asChild:s,...c}=r,l=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(l,{...c,ref:i})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{}),Po="Portal",Te=x.forwardRef((t,e)=>{var c;const{container:n,...o}=t,[r,i]=x.useState(!1);ht(()=>i(!0),[]);const s=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?Ke.createPortal(C.jsx(Oo.div,{...o,ref:e}),s):null});Te.displayName=Po;const Ko=({open:t,onClose:e,anchorRef:n,placement:o="bottom-end",children:r})=>{const i=x.useRef(null);if(x.useEffect(()=>{if(!t)return;const f=a=>{var u,m;t&&((u=i.current)!=null&&u.contains(a.target)||(m=n.current)!=null&&m.contains(a.target)||e())};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[t,e,n]),!t)return null;const s=o.startsWith("top")?"top":"bottom",c=o.endsWith("end")?"end":"start",l=o.startsWith("top")?8:4;return C.jsxs(po,{children:[C.jsx(ho,{virtualRef:n}),C.jsx(Te,{children:C.jsx(Ge,{onEscapeKeyDown:f=>{f.preventDefault(),e()},onPointerDownOutside:f=>{var a;if((a=n.current)!=null&&a.contains(f.target)){f.preventDefault();return}e()},children:C.jsx(go,{ref:i,side:s,align:c,sideOffset:l,className:`popover popover-${o}`,role:"dialog",children:r})})})]})};function Eo(t){const e=t+"CollectionProvider",[n,o]=Nt(e),[r,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:h,children:w}=g,b=Z.useRef(null),y=Z.useRef(new Map).current;return C.jsx(r,{scope:h,itemMap:y,collectionRef:b,children:w})};s.displayName=e;const c=t+"CollectionSlot",l=Ut(c),f=Z.forwardRef((g,h)=>{const{scope:w,children:b}=g,y=i(c,w),v=st(h,y.collectionRef);return C.jsx(l,{ref:v,children:b})});f.displayName=c;const a=t+"CollectionItemSlot",u="data-radix-collection-item",m=Ut(a),d=Z.forwardRef((g,h)=>{const{scope:w,children:b,...y}=g,v=Z.useRef(null),A=st(h,v),R=i(a,w);return Z.useEffect(()=>(R.itemMap.set(v,{ref:v,...y}),()=>void R.itemMap.delete(v))),C.jsx(m,{[u]:"",ref:A,children:b})});d.displayName=a;function p(g){const h=i(t+"CollectionConsumer",g);return Z.useCallback(()=>{const b=h.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((R,P)=>y.indexOf(R.ref.current)-y.indexOf(P.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:f,ItemSlot:d},p,o]}var To=x.createContext(void 0);function Do(t){const e=x.useContext(To);return t||e||"ltr"}var Et="rovingFocusGroup.onEntryFocus",Io={bubbles:!1,cancelable:!0},ft="RovingFocusGroup",[Mt,De,Mo]=Eo(ft),[No]=Nt(ft,[Mo]),[Fo,Lo]=No(ft),Ie=x.forwardRef((t,e)=>C.jsx(Mt.Provider,{scope:t.__scopeRovingFocusGroup,children:C.jsx(Mt.Slot,{scope:t.__scopeRovingFocusGroup,children:C.jsx(_o,{...t,ref:e})})}));Ie.displayName=ft;var _o=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:f,preventScrollOnEntryFocus:a=!1,...u}=t,m=x.useRef(null),d=st(e,m),p=Do(i),[g,h]=qe({prop:s,defaultProp:c??null,onChange:l,caller:ft}),[w,b]=x.useState(!1),y=ce(f),v=De(n),A=x.useRef(!1),[R,P]=x.useState(0);return x.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Et,y),()=>O.removeEventListener(Et,y)},[y]),C.jsx(Fo,{scope:n,orientation:o,dir:p,loop:r,currentTabStopId:g,onItemFocus:x.useCallback(O=>h(O),[h]),onItemShiftTab:x.useCallback(()=>b(!0),[]),onFocusableItemAdd:x.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:x.useCallback(()=>P(O=>O-1),[]),children:C.jsx(lt.div,{tabIndex:w||R===0?-1:0,"data-orientation":o,...u,ref:d,style:{outline:"none",...t.style},onMouseDown:tt(t.onMouseDown,()=>{A.current=!0}),onFocus:tt(t.onFocus,O=>{const L=!A.current;if(O.target===O.currentTarget&&L&&!w){const D=new CustomEvent(Et,Io);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const M=v().filter(E=>E.focusable),F=M.find(E=>E.active),I=M.find(E=>E.id===g),$=[F,I,...M].filter(Boolean).map(E=>E.ref.current);Fe($,a)}}A.current=!1}),onBlur:tt(t.onBlur,()=>b(!1))})})}),Me="RovingFocusGroupItem",Ne=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...c}=t,l=Ue(),f=i||l,a=Lo(Me,n),u=a.currentTabStopId===f,m=De(n),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:g}=a;return x.useEffect(()=>{if(o)return d(),()=>p()},[o,d,p]),C.jsx(Mt.ItemSlot,{scope:n,id:f,focusable:o,active:r,children:C.jsx(lt.span,{tabIndex:u?0:-1,"data-orientation":a.orientation,...c,ref:e,onMouseDown:tt(t.onMouseDown,h=>{o?a.onItemFocus(f):h.preventDefault()}),onFocus:tt(t.onFocus,()=>a.onItemFocus(f)),onKeyDown:tt(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){a.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const w=ko(h,a.orientation,a.dir);if(w!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let y=m().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")y.reverse();else if(w==="prev"||w==="next"){w==="prev"&&y.reverse();const v=y.indexOf(h.currentTarget);y=a.loop?Wo(y,v+1):y.slice(v+1)}setTimeout(()=>Fe(y))}}),children:typeof s=="function"?s({isCurrentTabStop:u,hasTabStop:g!=null}):s})})});Ne.displayName=Me;var $o={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jo(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ko(t,e,n){const o=jo(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return $o[o]}function Fe(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function Wo(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Ho=Ie,Bo=Ne;const Xo=({icon:t,children:e,onClick:n,danger:o,disabled:r,checked:i,checkbox:s,note:c,trailing:l})=>C.jsx(Bo,{asChild:!0,focusable:!r,active:!1,children:C.jsxs("button",{type:"button",role:i===void 0?"menuitem":s?"menuitemcheckbox":"menuitemradio","aria-checked":i,className:`menu-item${o?" menu-item-danger":""}`,onClick:n,disabled:r,children:[i!==void 0&&C.jsx("span",{className:"menu-item-check","aria-hidden":"true",children:i&&C.jsx(Ze,{size:12})}),t&&C.jsx("span",{className:"menu-item-icon",children:t}),C.jsxs("span",{className:"menu-item-label",children:[e,c&&C.jsx("span",{className:"menu-item-note",children:c})]}),l!==void 0&&C.jsx("span",{className:"menu-item-trailing",children:l})]})}),Go=()=>C.jsx("div",{className:"menu-divider",role:"separator"}),Uo=({children:t})=>C.jsx(Ho,{asChild:!0,orientation:"vertical",loop:!0,children:C.jsx("div",{className:"menu",role:"menu",children:t})});export{Uo as M,Ko as P,Xo as a,Go as b};
|
|
1
|
+
import{r as x,x as Ve,j as C,a4 as Ye,a3 as Ke,R as Z}from"./index-B0gQkEg0.js";import{P as lt,b as ht,a as st,u as ce,f as Nt,i as Xe,D as Ge,g as Ut,d as Ue,e as tt,c as qe}from"./index-72oF89LJ.js";import{C as Ze}from"./check-K1ovTQam.js";const Je=["top","right","bottom","left"],U=Math.min,j=Math.max,gt=Math.round,mt=Math.floor,V=t=>({x:t,y:t}),Qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Tt(t,e,n){return j(t,U(e,n))}function K(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Ft(t){return t==="x"?"y":"x"}function Lt(t){return t==="y"?"height":"width"}function z(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function _t(t){return Ft(z(t))}function tn(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=_t(t),i=Lt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=wt(s)),[s,wt(s)]}function en(t){const e=wt(t);return[Dt(t),e,Dt(e)]}function Dt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const qt=["left","right"],Zt=["right","left"],nn=["top","bottom"],on=["bottom","top"];function rn(t,e,n){switch(t){case"top":case"bottom":return n?e?Zt:qt:e?qt:Zt;case"left":case"right":return e?nn:on;default:return[]}}function sn(t,e,n,o){const r=ot(t);let i=rn(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(Dt)))),i}function wt(t){const e=X(t);return Qe[e]+t.slice(e.length)}function cn(t){return{top:0,right:0,bottom:0,left:0,...t}}function le(t){return typeof t!="number"?cn(t):{top:t,right:t,bottom:t,left:t}}function xt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Jt(t,e,n){let{reference:o,floating:r}=t;const i=z(e),s=_t(e),c=Lt(s),l=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:a,y:o.y-r.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-r.width,y:u};break;default:d={x:o.x,y:o.y}}switch(ot(e)){case"start":d[s]-=m*(n&&f?-1:1);break;case"end":d[s]+=m*(n&&f?-1:1);break}return d}async function ln(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=K(e,t),p=le(d),h=c[m?u==="floating"?"reference":"floating":u],w=xt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:a,strategy:l})),b=u==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),v=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},A=xt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:y,strategy:l}):b);return{top:(w.top-A.top+p.top)/v.y,bottom:(A.bottom-w.bottom+p.bottom)/v.y,left:(w.left-A.left+p.left)/v.x,right:(A.right-w.right+p.right)/v.x}}const an=50,fn=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ln},l=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:u}=Jt(f,o,l),m=o,d=0;const p={};for(let g=0;g<i.length;g++){const h=i[g];if(!h)continue;const{name:w,fn:b}=h,{x:y,y:v,data:A,reset:R}=await b({x:a,y:u,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:f,platform:c,elements:{reference:t,floating:e}});a=y??a,u=v??u,p[w]={...p[w],...A},R&&d<an&&(d++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(f=R.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):R.rects),{x:a,y:u}=Jt(f,m,l)),g=-1)}return{x:a,y:u,placement:m,strategy:r,middlewareData:p}},un=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:a=0}=K(t,e)||{};if(f==null)return{};const u=le(a),m={x:n,y:o},d=_t(r),p=Lt(d),g=await s.getDimensions(f),h=d==="y",w=h?"top":"left",b=h?"bottom":"right",y=h?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[d]-m[d]-i.floating[p],A=m[d]-i.reference[d],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let P=R?R[y]:0;(!P||!await(s.isElement==null?void 0:s.isElement(R)))&&(P=c.floating[y]||i.floating[p]);const O=v/2-A/2,L=P/2-g[p]/2-1,D=U(u[w],L),M=U(u[b],L),F=D,I=P-g[p]-M,T=P/2-g[p]/2+O,$=Tt(F,T,I),E=!l.arrow&&ot(r)!=null&&T!==$&&i.reference[p]/2-(T<F?D:M)-g[p]/2<0,N=E?T<F?T-F:T-I:0;return{[d]:m[d]+N,data:{[d]:$,centerOffset:T-$-N,...E&&{alignmentOffset:N}},reset:E}}}),dn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...h}=K(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=X(r),b=z(c),y=X(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),A=m||(y||!g?[wt(c)]:en(c)),R=p!=="none";!m&&R&&A.push(...sn(c,g,p,v));const P=[c,...A],O=await l.detectOverflow(e,h),L=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(a&&L.push(O[w]),u){const T=tn(r,s,v);L.push(O[T[0]],O[T[1]])}if(D=[...D,{placement:r,overflows:L}],!L.every(T=>T<=0)){var M,F;const T=(((M=i.flip)==null?void 0:M.index)||0)+1,$=P[T];if($&&(!(u==="alignment"?b!==z($):!1)||D.every(S=>z(S.placement)===b?S.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:$}};let E=(F=D.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:F.placement;if(!E)switch(d){case"bestFit":{var I;const N=(I=D.filter(S=>{if(R){const _=z(S.placement);return _===b||_==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((S,_)=>S[1]-_[1])[0])==null?void 0:I[0];N&&(E=N);break}case"initialPlacement":E=c;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function Qt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function te(t){return Je.some(e=>t[e]>=0)}const mn=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...i}=K(t,e);switch(r){case"referenceHidden":{const s=await o.detectOverflow(e,{...i,elementContext:"reference"}),c=Qt(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:te(c)}}}case"escaped":{const s=await o.detectOverflow(e,{...i,altBoundary:!0}),c=Qt(s,n.floating);return{data:{escapedOffsets:c,escaped:te(c)}}}default:return{}}}}},ae=new Set(["left","top"]);async function pn(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),c=ot(n),l=z(n)==="y",f=ae.has(s)?-1:1,a=i&&l?-1:1,u=K(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof p=="number"&&(d=c==="end"?p*-1:p),l?{x:d*a,y:m*f}:{x:m*f,y:d*a}}const hn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,l=await pn(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},gn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:b,y}=w;return{x:b,y}}},...f}=K(t,e),a={x:n,y:o},u=await i.detectOverflow(e,f),m=z(X(r)),d=Ft(m);let p=a[d],g=a[m];if(s){const w=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=p+u[w],v=p-u[b];p=Tt(y,p,v)}if(c){const w=m==="y"?"top":"left",b=m==="y"?"bottom":"right",y=g+u[w],v=g-u[b];g=Tt(y,g,v)}const h=l.fn({...e,[d]:p,[m]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[d]:s,[m]:c}}}}}},wn=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=e,{offset:c=0,mainAxis:l=!0,crossAxis:f=!0}=K(t,e),a={x:n,y:o},u=z(r),m=Ft(u);let d=a[m],p=a[u];const g=K(c,e),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const y=m==="y"?"height":"width",v=i.reference[m]-i.floating[y]+h.mainAxis,A=i.reference[m]+i.reference[y]-h.mainAxis;d<v?d=v:d>A&&(d=A)}if(f){var w,b;const y=m==="y"?"width":"height",v=ae.has(X(r)),A=i.reference[u]-i.floating[y]+(v&&((w=s.offset)==null?void 0:w[u])||0)+(v?0:h.crossAxis),R=i.reference[u]+i.reference[y]+(v?0:((b=s.offset)==null?void 0:b[u])||0)-(v?h.crossAxis:0);p<A?p=A:p>R&&(p=R)}return{[m]:d,[u]:p}}}},xn=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:c}=e,{apply:l=()=>{},...f}=K(t,e),a=await s.detectOverflow(e,f),u=X(r),m=ot(r),d=z(r)==="y",{width:p,height:g}=i.floating;let h,w;u==="top"||u==="bottom"?(h=u,w=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,h=m==="end"?"top":"bottom");const b=g-a.top-a.bottom,y=p-a.left-a.right,v=U(g-a[h],b),A=U(p-a[w],y),R=!e.middlewareData.shift;let P=v,O=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(P=b),R&&!m){const D=j(a.left,0),M=j(a.right,0),F=j(a.top,0),I=j(a.bottom,0);d?O=p-2*(D!==0||M!==0?D+M:j(a.left,a.right)):P=g-2*(F!==0||I!==0?F+I:j(a.top,a.bottom))}await l({...e,availableWidth:O,availableHeight:P});const L=await s.getDimensions(c.floating);return p!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function bt(){return typeof window<"u"}function rt(t){return fe(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(fe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fe(t){return bt()?t instanceof Node||t instanceof k(t).Node:!1}function W(t){return bt()?t instanceof Element||t instanceof k(t).Element:!1}function G(t){return bt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function ee(t){return!bt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function at(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=H(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&r!=="inline"&&r!=="contents"}function yn(t){return/^(table|td|th)$/.test(rt(t))}function Rt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const vn=/transform|translate|scale|rotate|perspective|filter/,bn=/paint|layout|strict|content/,J=t=>!!t&&t!=="none";let St;function $t(t){const e=W(t)?H(t):t;return J(e.transform)||J(e.translate)||J(e.scale)||J(e.rotate)||J(e.perspective)||!jt()&&(J(e.backdropFilter)||J(e.filter))||vn.test(e.willChange||"")||bn.test(e.contain||"")}function Rn(t){let e=q(t);for(;G(e)&&!nt(e);){if($t(e))return e;if(Rt(e))return null;e=q(e)}return null}function jt(){return St==null&&(St=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),St}function nt(t){return/^(html|body|#document)$/.test(rt(t))}function H(t){return k(t).getComputedStyle(t)}function At(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(rt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ee(t)&&t.host||Y(t);return ee(e)?e.host:e}function ue(t){const e=q(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:G(e)&&at(e)?e:ue(e)}function ct(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ue(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=k(r);if(i){const c=It(s);return e.concat(s,s.visualViewport||[],at(r)?r:[],c&&n?ct(c):[])}else return e.concat(r,ct(r,[],n))}function It(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function de(t){const e=H(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=G(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=gt(n)!==i||gt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function kt(t){return W(t)?t:t.contextElement}function et(t){const e=kt(t);if(!G(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=de(e);let s=(i?gt(n.width):n.width)/o,c=(i?gt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const An=V(0);function me(t){const e=k(t);return!jt()||!e.visualViewport?An:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==k(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=kt(t);let s=V(1);e&&(o?W(o)&&(s=et(o)):s=et(t));const c=Cn(i,n,o)?me(i):V(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,a=r.width/s.x,u=r.height/s.y;if(i){const m=k(i),d=o&&W(o)?k(o):o;let p=m,g=It(p);for(;g&&o&&d!==p;){const h=et(g),w=g.getBoundingClientRect(),b=H(g),y=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,v=w.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;l*=h.x,f*=h.y,a*=h.x,u*=h.y,l+=y,f+=v,p=k(g),g=It(p)}}return xt({width:a,height:u,x:l,y:f})}function Ct(t,e){const n=At(t).scrollLeft;return e?e.left+n:Q(Y(t)).left+n}function pe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ct(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Sn(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=Y(o),c=e?Rt(e.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),u=G(o);if((u||!u&&!i)&&((rt(o)!=="body"||at(s))&&(l=At(o)),u)){const d=Q(o);f=et(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const m=s&&!u&&!i?pe(s,l):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+a.x+m.x,y:n.y*f.y-l.scrollTop*f.y+a.y+m.y}}function On(t){return Array.from(t.getClientRects())}function Pn(t){const e=Y(t),n=At(t),o=t.ownerDocument.body,r=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ct(t);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=j(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}const ne=25;function En(t,e){const n=k(t),o=Y(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,l=0;if(r){i=r.width,s=r.height;const a=jt();(!a||a&&e==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const f=Ct(o);if(f<=0){const a=o.ownerDocument,u=a.body,m=getComputedStyle(u),d=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-u.clientWidth-d);p<=ne&&(i-=p)}else f<=ne&&(i+=f);return{width:i,height:s,x:c,y:l}}function Tn(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=G(t)?et(t):V(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function oe(t,e,n){let o;if(e==="viewport")o=En(t,n);else if(e==="document")o=Pn(Y(t));else if(W(e))o=Tn(e,n);else{const r=me(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return xt(o)}function he(t,e){const n=q(t);return n===e||!W(n)||nt(n)?!1:H(n).position==="fixed"||he(n,e)}function Dn(t,e){const n=e.get(t);if(n)return n;let o=ct(t,[],!1).filter(c=>W(c)&&rt(c)!=="body"),r=null;const i=H(t).position==="fixed";let s=i?q(t):t;for(;W(s)&&!nt(s);){const c=H(s),l=$t(s);!l&&c.position==="fixed"&&(r=null),(i?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||at(s)&&!l&&he(t,s))?o=o.filter(a=>a!==s):r=c,s=q(s)}return e.set(t,o),o}function In(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?Rt(e)?[]:Dn(e,this._c):[].concat(n),o],c=oe(e,s[0],r);let l=c.top,f=c.right,a=c.bottom,u=c.left;for(let m=1;m<s.length;m++){const d=oe(e,s[m],r);l=j(d.top,l),f=U(d.right,f),a=U(d.bottom,a),u=j(d.left,u)}return{width:f-u,height:a-l,x:u,y:l}}function Mn(t){const{width:e,height:n}=de(t);return{width:e,height:n}}function Nn(t,e,n){const o=G(e),r=Y(e),i=n==="fixed",s=Q(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=V(0);function f(){l.x=Ct(r)}if(o||!o&&!i)if((rt(e)!=="body"||at(r))&&(c=At(e)),o){const d=Q(e,!0,i,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?pe(r,c):V(0),u=s.left+c.scrollLeft-l.x-a.x,m=s.top+c.scrollTop-l.y-a.y;return{x:u,y:m,width:s.width,height:s.height}}function Ot(t){return H(t).position==="static"}function re(t,e){if(!G(t)||H(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function ge(t,e){const n=k(t);if(Rt(t))return n;if(!G(t)){let r=q(t);for(;r&&!nt(r);){if(W(r)&&!Ot(r))return r;r=q(r)}return n}let o=re(t,e);for(;o&&yn(o)&&Ot(o);)o=re(o,e);return o&&nt(o)&&Ot(o)&&!$t(o)?n:o||Rn(t)||n}const Fn=async function(t){const e=this.getOffsetParent||ge,n=this.getDimensions,o=await n(t.floating);return{reference:Nn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ln(t){return H(t).direction==="rtl"}const _n={convertOffsetParentRelativeRectToViewportRelativeRect:Sn,getDocumentElement:Y,getClippingRect:In,getOffsetParent:ge,getElementRects:Fn,getClientRects:On,getDimensions:Mn,getScale:et,isElement:W,isRTL:Ln};function we(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $n(t,e){let n=null,o;const r=Y(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const f=t.getBoundingClientRect(),{left:a,top:u,width:m,height:d}=f;if(c||e(),!m||!d)return;const p=mt(u),g=mt(r.clientWidth-(a+m)),h=mt(r.clientHeight-(u+d)),w=mt(a),y={rootMargin:-p+"px "+-g+"px "+-h+"px "+-w+"px",threshold:j(0,U(1,l))||1};let v=!0;function A(R){const P=R[0].intersectionRatio;if(P!==l){if(!v)return s();P?s(!1,P):o=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!we(f,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(A,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,y)}n.observe(t)}return s(!0),i}function jn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=kt(t),a=r||i?[...f?ct(f):[],...e?ct(e):[]]:[];a.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const u=f&&c?$n(f,n):null;let m=-1,d=null;s&&(d=new ResizeObserver(w=>{let[b]=w;b&&b.target===f&&d&&e&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(e)})),n()}),f&&!l&&d.observe(f),e&&d.observe(e));let p,g=l?Q(t):null;l&&h();function h(){const w=Q(t);g&&!we(g,w)&&n(),g=w,p=requestAnimationFrame(h)}return n(),()=>{var w;a.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(w=d)==null||w.disconnect(),d=null,l&&cancelAnimationFrame(p)}}const kn=hn,Wn=gn,Hn=dn,Bn=xn,zn=mn,ie=un,Vn=wn,Yn=(t,e,n)=>{const o=new Map,r={platform:_n,...n},i={...r.platform,_c:o};return fn(t,e,{...r,platform:i})};var Kn=typeof document<"u",Xn=function(){},pt=Kn?x.useLayoutEffect:Xn;function yt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!yt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!yt(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function xe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function se(t,e){const n=xe(t);return Math.round(e*n)/n}function Pt(t){const e=x.useRef(t);return pt(()=>{e.current=t}),e}function Gn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=t,[a,u]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,d]=x.useState(o);yt(m,o)||d(o);const[p,g]=x.useState(null),[h,w]=x.useState(null),b=x.useCallback(S=>{S!==R.current&&(R.current=S,g(S))},[]),y=x.useCallback(S=>{S!==P.current&&(P.current=S,w(S))},[]),v=i||p,A=s||h,R=x.useRef(null),P=x.useRef(null),O=x.useRef(a),L=l!=null,D=Pt(l),M=Pt(r),F=Pt(f),I=x.useCallback(()=>{if(!R.current||!P.current)return;const S={placement:e,strategy:n,middleware:m};M.current&&(S.platform=M.current),Yn(R.current,P.current,S).then(_=>{const B={..._,isPositioned:F.current!==!1};T.current&&!yt(O.current,B)&&(O.current=B,Ve.flushSync(()=>{u(B)}))})},[m,e,n,M,F]);pt(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,u(S=>({...S,isPositioned:!1})))},[f]);const T=x.useRef(!1);pt(()=>(T.current=!0,()=>{T.current=!1}),[]),pt(()=>{if(v&&(R.current=v),A&&(P.current=A),v&&A){if(D.current)return D.current(v,A,I);I()}},[v,A,I,D,L]);const $=x.useMemo(()=>({reference:R,floating:P,setReference:b,setFloating:y}),[b,y]),E=x.useMemo(()=>({reference:v,floating:A}),[v,A]),N=x.useMemo(()=>{const S={position:n,left:0,top:0};if(!E.floating)return S;const _=se(E.floating,a.x),B=se(E.floating,a.y);return c?{...S,transform:"translate("+_+"px, "+B+"px)",...xe(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,E.floating,a.x,a.y]);return x.useMemo(()=>({...a,update:I,refs:$,elements:E,floatingStyles:N}),[a,I,$,E,N])}const Un=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:r}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?ie({element:o.current,padding:r}).fn(n):{}:o?ie({element:o,padding:r}).fn(n):{}}}},qn=(t,e)=>{const n=kn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Zn=(t,e)=>{const n=Wn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Jn=(t,e)=>({fn:Vn(t).fn,options:[t,e]}),Qn=(t,e)=>{const n=Hn(t);return{name:n.name,fn:n.fn,options:[t,e]}},to=(t,e)=>{const n=Bn(t);return{name:n.name,fn:n.fn,options:[t,e]}},eo=(t,e)=>{const n=zn(t);return{name:n.name,fn:n.fn,options:[t,e]}},no=(t,e)=>{const n=Un(t);return{name:n.name,fn:n.fn,options:[t,e]}};var oo="Arrow",ye=x.forwardRef((t,e)=>{const{children:n,width:o=10,height:r=5,...i}=t;return C.jsx(lt.svg,{...i,ref:e,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});ye.displayName=oo;var ro=ye;function io(t){const[e,n]=x.useState(void 0);return ht(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const l=i.borderBoxSize,f=Array.isArray(l)?l[0]:l;s=f.inlineSize,c=f.blockSize}else s=t.offsetWidth,c=t.offsetHeight;n({width:s,height:c})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}var Wt="Popper",[ve]=Nt(Wt),[so,be]=ve(Wt),Re=t=>{const{__scopePopper:e,children:n}=t,[o,r]=x.useState(null);return C.jsx(so,{scope:e,anchor:o,onAnchorChange:r,children:n})};Re.displayName=Wt;var Ae="PopperAnchor",Ce=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...r}=t,i=be(Ae,n),s=x.useRef(null),c=st(e,s),l=x.useRef(null);return x.useEffect(()=>{const f=l.current;l.current=(o==null?void 0:o.current)||s.current,f!==l.current&&i.onAnchorChange(l.current)}),o?null:C.jsx(lt.div,{...r,ref:c})});Ce.displayName=Ae;var Ht="PopperContent",[co,lo]=ve(Ht),Se=x.forwardRef((t,e)=>{var Bt,zt,Vt,Yt,Kt,Xt;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:a=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:d="optimized",onPlaced:p,...g}=t,h=be(Ht,n),[w,b]=x.useState(null),y=st(e,it=>b(it)),[v,A]=x.useState(null),R=io(v),P=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,L=o+(i!=="center"?"-"+i:""),D=typeof a=="number"?a:{top:0,right:0,bottom:0,left:0,...a},M=Array.isArray(f)?f:[f],F=M.length>0,I={padding:D,boundary:M.filter(uo),altBoundary:F},{refs:T,floatingStyles:$,placement:E,isPositioned:N,middlewareData:S}=Gn({strategy:"fixed",placement:L,whileElementsMounted:(...it)=>jn(...it,{animationFrame:d==="always"}),elements:{reference:h.anchor},middleware:[qn({mainAxis:r+O,alignmentAxis:s}),l&&Zn({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Jn():void 0,...I}),l&&Qn({...I}),to({...I,apply:({elements:it,rects:Gt,availableWidth:We,availableHeight:He})=>{const{width:Be,height:ze}=Gt.reference,dt=it.floating.style;dt.setProperty("--radix-popper-available-width",`${We}px`),dt.setProperty("--radix-popper-available-height",`${He}px`),dt.setProperty("--radix-popper-anchor-width",`${Be}px`),dt.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),v&&no({element:v,padding:c}),mo({arrowWidth:P,arrowHeight:O}),m&&eo({strategy:"referenceHidden",...I})]}),[_,B]=Pe(E),ut=ce(p);ht(()=>{N&&(ut==null||ut())},[N,ut]);const Le=(Bt=S.arrow)==null?void 0:Bt.x,_e=(zt=S.arrow)==null?void 0:zt.y,$e=((Vt=S.arrow)==null?void 0:Vt.centerOffset)!==0,[je,ke]=x.useState();return ht(()=>{w&&ke(window.getComputedStyle(w).zIndex)},[w]),C.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:N?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[(Yt=S.transformOrigin)==null?void 0:Yt.x,(Kt=S.transformOrigin)==null?void 0:Kt.y].join(" "),...((Xt=S.hide)==null?void 0:Xt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:C.jsx(co,{scope:n,placedSide:_,onArrowChange:A,arrowX:Le,arrowY:_e,shouldHideArrow:$e,children:C.jsx(lt.div,{"data-side":_,"data-align":B,...g,ref:y,style:{...g.style,animation:N?void 0:"none"}})})})});Se.displayName=Ht;var Oe="PopperArrow",ao={top:"bottom",right:"left",bottom:"top",left:"right"},fo=x.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,i=lo(Oe,o),s=ao[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(ro,{...r,ref:n,style:{...r.style,display:"block"}})})});fo.displayName=Oe;function uo(t){return t!==null}var mo=t=>({name:"transformOrigin",options:t,fn(e){var h,w,b;const{placement:n,rects:o,middlewareData:r}=e,s=((h=r.arrow)==null?void 0:h.centerOffset)!==0,c=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[f,a]=Pe(n),u={start:"0%",center:"50%",end:"100%"}[a],m=(((w=r.arrow)==null?void 0:w.x)??0)+c/2,d=(((b=r.arrow)==null?void 0:b.y)??0)+l/2;let p="",g="";return f==="bottom"?(p=s?u:`${m}px`,g=`${-l}px`):f==="top"?(p=s?u:`${m}px`,g=`${o.floating.height+l}px`):f==="right"?(p=`${-l}px`,g=s?u:`${d}px`):f==="left"&&(p=`${o.floating.width+l}px`,g=s?u:`${d}px`),{data:{x:p,y:g}}}});function Pe(t){const[e,n="center"]=t.split("-");return[e,n]}var po=Re,ho=Ce,go=Se,wo=Symbol.for("react.lazy"),vt=Ye[" use ".trim().toString()];function xo(t){return typeof t=="object"&&t!==null&&"then"in t}function Ee(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===wo&&"_payload"in t&&xo(t._payload)}function yo(t){const e=vo(t),n=x.forwardRef((o,r)=>{let{children:i,...s}=o;Ee(i)&&typeof vt=="function"&&(i=vt(i._payload));const c=x.Children.toArray(i),l=c.find(Ro);if(l){const f=l.props.children,a=c.map(u=>u===l?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:u);return C.jsx(e,{...s,ref:r,children:x.isValidElement(f)?x.cloneElement(f,void 0,a):null})}return C.jsx(e,{...s,ref:r,children:i})});return n.displayName=`${t}.Slot`,n}function vo(t){const e=x.forwardRef((n,o)=>{let{children:r,...i}=n;if(Ee(r)&&typeof vt=="function"&&(r=vt(r._payload)),x.isValidElement(r)){const s=Co(r),c=Ao(i,r.props);return r.type!==x.Fragment&&(c.ref=o?Xe(o,s):s),x.cloneElement(r,c)}return x.Children.count(r)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var bo=Symbol("radix.slottable");function Ro(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===bo}function Ao(t,e){const n={...e};for(const o in e){const r=t[o],i=e[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const l=i(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...t,...n}}function Co(t){var o,r;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var So=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oo=So.reduce((t,e)=>{const n=yo(`Primitive.${e}`),o=x.forwardRef((r,i)=>{const{asChild:s,...c}=r,l=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(l,{...c,ref:i})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{}),Po="Portal",Te=x.forwardRef((t,e)=>{var c;const{container:n,...o}=t,[r,i]=x.useState(!1);ht(()=>i(!0),[]);const s=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?Ke.createPortal(C.jsx(Oo.div,{...o,ref:e}),s):null});Te.displayName=Po;const Ko=({open:t,onClose:e,anchorRef:n,placement:o="bottom-end",children:r})=>{const i=x.useRef(null);if(x.useEffect(()=>{if(!t)return;const f=a=>{var u,m;t&&((u=i.current)!=null&&u.contains(a.target)||(m=n.current)!=null&&m.contains(a.target)||e())};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[t,e,n]),!t)return null;const s=o.startsWith("top")?"top":"bottom",c=o.endsWith("end")?"end":"start",l=o.startsWith("top")?8:4;return C.jsxs(po,{children:[C.jsx(ho,{virtualRef:n}),C.jsx(Te,{children:C.jsx(Ge,{onEscapeKeyDown:f=>{f.preventDefault(),e()},onPointerDownOutside:f=>{var a;if((a=n.current)!=null&&a.contains(f.target)){f.preventDefault();return}e()},children:C.jsx(go,{ref:i,side:s,align:c,sideOffset:l,className:`popover popover-${o}`,role:"dialog",children:r})})})]})};function Eo(t){const e=t+"CollectionProvider",[n,o]=Nt(e),[r,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:h,children:w}=g,b=Z.useRef(null),y=Z.useRef(new Map).current;return C.jsx(r,{scope:h,itemMap:y,collectionRef:b,children:w})};s.displayName=e;const c=t+"CollectionSlot",l=Ut(c),f=Z.forwardRef((g,h)=>{const{scope:w,children:b}=g,y=i(c,w),v=st(h,y.collectionRef);return C.jsx(l,{ref:v,children:b})});f.displayName=c;const a=t+"CollectionItemSlot",u="data-radix-collection-item",m=Ut(a),d=Z.forwardRef((g,h)=>{const{scope:w,children:b,...y}=g,v=Z.useRef(null),A=st(h,v),R=i(a,w);return Z.useEffect(()=>(R.itemMap.set(v,{ref:v,...y}),()=>void R.itemMap.delete(v))),C.jsx(m,{[u]:"",ref:A,children:b})});d.displayName=a;function p(g){const h=i(t+"CollectionConsumer",g);return Z.useCallback(()=>{const b=h.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((R,P)=>y.indexOf(R.ref.current)-y.indexOf(P.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:f,ItemSlot:d},p,o]}var To=x.createContext(void 0);function Do(t){const e=x.useContext(To);return t||e||"ltr"}var Et="rovingFocusGroup.onEntryFocus",Io={bubbles:!1,cancelable:!0},ft="RovingFocusGroup",[Mt,De,Mo]=Eo(ft),[No]=Nt(ft,[Mo]),[Fo,Lo]=No(ft),Ie=x.forwardRef((t,e)=>C.jsx(Mt.Provider,{scope:t.__scopeRovingFocusGroup,children:C.jsx(Mt.Slot,{scope:t.__scopeRovingFocusGroup,children:C.jsx(_o,{...t,ref:e})})}));Ie.displayName=ft;var _o=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:f,preventScrollOnEntryFocus:a=!1,...u}=t,m=x.useRef(null),d=st(e,m),p=Do(i),[g,h]=qe({prop:s,defaultProp:c??null,onChange:l,caller:ft}),[w,b]=x.useState(!1),y=ce(f),v=De(n),A=x.useRef(!1),[R,P]=x.useState(0);return x.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(Et,y),()=>O.removeEventListener(Et,y)},[y]),C.jsx(Fo,{scope:n,orientation:o,dir:p,loop:r,currentTabStopId:g,onItemFocus:x.useCallback(O=>h(O),[h]),onItemShiftTab:x.useCallback(()=>b(!0),[]),onFocusableItemAdd:x.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:x.useCallback(()=>P(O=>O-1),[]),children:C.jsx(lt.div,{tabIndex:w||R===0?-1:0,"data-orientation":o,...u,ref:d,style:{outline:"none",...t.style},onMouseDown:tt(t.onMouseDown,()=>{A.current=!0}),onFocus:tt(t.onFocus,O=>{const L=!A.current;if(O.target===O.currentTarget&&L&&!w){const D=new CustomEvent(Et,Io);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const M=v().filter(E=>E.focusable),F=M.find(E=>E.active),I=M.find(E=>E.id===g),$=[F,I,...M].filter(Boolean).map(E=>E.ref.current);Fe($,a)}}A.current=!1}),onBlur:tt(t.onBlur,()=>b(!1))})})}),Me="RovingFocusGroupItem",Ne=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,children:s,...c}=t,l=Ue(),f=i||l,a=Lo(Me,n),u=a.currentTabStopId===f,m=De(n),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:g}=a;return x.useEffect(()=>{if(o)return d(),()=>p()},[o,d,p]),C.jsx(Mt.ItemSlot,{scope:n,id:f,focusable:o,active:r,children:C.jsx(lt.span,{tabIndex:u?0:-1,"data-orientation":a.orientation,...c,ref:e,onMouseDown:tt(t.onMouseDown,h=>{o?a.onItemFocus(f):h.preventDefault()}),onFocus:tt(t.onFocus,()=>a.onItemFocus(f)),onKeyDown:tt(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){a.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const w=ko(h,a.orientation,a.dir);if(w!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let y=m().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")y.reverse();else if(w==="prev"||w==="next"){w==="prev"&&y.reverse();const v=y.indexOf(h.currentTarget);y=a.loop?Wo(y,v+1):y.slice(v+1)}setTimeout(()=>Fe(y))}}),children:typeof s=="function"?s({isCurrentTabStop:u,hasTabStop:g!=null}):s})})});Ne.displayName=Me;var $o={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jo(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ko(t,e,n){const o=jo(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return $o[o]}function Fe(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function Wo(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Ho=Ie,Bo=Ne;const Xo=({icon:t,children:e,onClick:n,danger:o,disabled:r,checked:i,checkbox:s,note:c,trailing:l})=>C.jsx(Bo,{asChild:!0,focusable:!r,active:!1,children:C.jsxs("button",{type:"button",role:i===void 0?"menuitem":s?"menuitemcheckbox":"menuitemradio","aria-checked":i,className:`menu-item${o?" menu-item-danger":""}`,onClick:n,disabled:r,children:[i!==void 0&&C.jsx("span",{className:"menu-item-check","aria-hidden":"true",children:i&&C.jsx(Ze,{size:12})}),t&&C.jsx("span",{className:"menu-item-icon",children:t}),C.jsxs("span",{className:"menu-item-label",children:[e,c&&C.jsx("span",{className:"menu-item-note",children:c})]}),l!==void 0&&C.jsx("span",{className:"menu-item-trailing",children:l})]})}),Go=()=>C.jsx("div",{className:"menu-divider",role:"separator"}),Uo=({children:t})=>C.jsx(Ho,{asChild:!0,orientation:"vertical",loop:!0,children:C.jsx("div",{className:"menu",role:"menu",children:t})});export{Uo as M,Ko as P,Xo as a,Go as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,j as f,a3 as ze,v as Ze}from"./index-BOxe43p1.js";import{u as de,a as k,P,b as oe,c as qe,d as Z,e as _,f as Qe,g as Je,D as et,h as tt}from"./index-CfxsUslp.js";var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},nt="FocusScope",Se=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,d]=c.useState(null),l=de(o),h=de(a),v=c.useRef(null),p=k(t,u=>d(u)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(g.paused||!i)return;const C=b.target;i.contains(C)?v.current=C:D(v.current,{select:!0})},m=function(b){if(g.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||D(v.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&D(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const E=new MutationObserver(y);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),E.disconnect()}}},[r,i,g.paused]),c.useEffect(()=>{if(i){me.add(g);const u=document.activeElement;if(!i.contains(u)){const y=new CustomEvent(q,fe);i.addEventListener(q,l),i.dispatchEvent(y),y.defaultPrevented||(rt(ut(we(i)),{select:!0}),document.activeElement===u&&D(i))}return()=>{i.removeEventListener(q,l),setTimeout(()=>{const y=new CustomEvent(Q,fe);i.addEventListener(Q,h),i.dispatchEvent(y),y.defaultPrevented||D(u??document.body,{select:!0}),i.removeEventListener(Q,h),me.remove(g)},0)}}},[i,l,h,g]);const w=c.useCallback(u=>{if(!n&&!r||g.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(m&&y){const E=u.currentTarget,[b,C]=ot(E);b&&C?!u.shiftKey&&y===C?(u.preventDefault(),n&&D(b,{select:!0})):u.shiftKey&&y===b&&(u.preventDefault(),n&&D(C,{select:!0})):y===E&&u.preventDefault()}},[n,r,g.paused]);return f.jsx(P.div,{tabIndex:-1,...s,ref:p,onKeyDown:w})});Se.displayName=nt;function rt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(D(r,{select:t}),document.activeElement!==n)return}function ot(e){const t=we(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function we(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 ve(e,t){for(const n of e)if(!at(n,{upTo:t}))return n}function at(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 it(e){return e instanceof HTMLInputElement&&"select"in e}function D(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var me=ct();function ct(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var st="Portal",Ne=c.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=c.useState(!1);oe(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?ze.createPortal(f.jsx(P.div,{...r,ref:t}),s):null});Ne.displayName=st;function lt(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=dt(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=k(r.ref,ft(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};X.displayName="Presence";function dt(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,d]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=L(r.current);a.current=i==="mounted"?l:"none"},[i]),oe(()=>{const l=r.current,h=o.current;if(h!==e){const p=a.current,g=L(l);e?d("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(h&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),oe(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,v=g=>{const u=L(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},p=g=>{g.target===t&&(a.current=L(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function L(e){return(e==null?void 0:e.animationName)||"none"}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 J=0;function vt(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){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 R=function(){return R=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},R.apply(this,arguments)};function Re(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 mt(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 G="right-scroll-bar-position",H="width-before-scroll-bar",ht="with-scroll-bars-hidden",gt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pt(e,t){var n=c.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 yt=typeof window<"u"?c.useLayoutEffect:c.useEffect,pe=new WeakMap;function Et(e,t){var n=pt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return yt(function(){var r=pe.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||ee(i,null)}),a.forEach(function(i){o.has(i)||ee(i,s)})}pe.set(n,e)},[e]),n}function bt(e){return e}function Ct(e,t){t===void 0&&(t=bt);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 s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var d=function(){var h=s;s=[],h.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return o}function St(e){e===void 0&&(e={});var t=Ct(null);return t.options=R({async:!0,ssr:!1},e),t}var Ae=function(e){var t=e.sideCar,n=Re(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 c.createElement(r,R({},n))};Ae.isSideCarExport=!0;function wt(e,t){return e.useMedium(t),Ae}var xe=St(),te=function(){},Y=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,d=e.className,l=e.removeScrollBar,h=e.enabled,v=e.shards,p=e.sideCar,g=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,b=e.gapMode,C=Re(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,A=Et([n,t]),x=R(R({},C),o);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:xe,removeScrollBar:l,shards:v,noRelative:g,noIsolation:w,inert:u,setCallbacks:a,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(i),R(R({},x),{ref:A})):c.createElement(E,R({},x,{className:d,ref:A}),i))});Y.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y.classNames={fullWidth:H,zeroRight:G};var Nt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nt();return t&&e.setAttribute("nonce",t),e}function At(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rt())&&(At(t,n),xt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=Dt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Tt=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[ne(n),ne(r),ne(o)]},Mt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pt;var t=Tt(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])}},It=De(),F="data-scroll-locked",Ft=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as c,j as f,a3 as ze,v as Ze}from"./index-B0gQkEg0.js";import{u as de,a as k,P,b as oe,c as qe,d as Z,e as _,f as Qe,g as Je,D as et,h as tt}from"./index-72oF89LJ.js";var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},nt="FocusScope",Se=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,d]=c.useState(null),l=de(o),h=de(a),v=c.useRef(null),p=k(t,u=>d(u)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(g.paused||!i)return;const C=b.target;i.contains(C)?v.current=C:D(v.current,{select:!0})},m=function(b){if(g.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||D(v.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&D(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const E=new MutationObserver(y);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),E.disconnect()}}},[r,i,g.paused]),c.useEffect(()=>{if(i){me.add(g);const u=document.activeElement;if(!i.contains(u)){const y=new CustomEvent(q,fe);i.addEventListener(q,l),i.dispatchEvent(y),y.defaultPrevented||(rt(ut(we(i)),{select:!0}),document.activeElement===u&&D(i))}return()=>{i.removeEventListener(q,l),setTimeout(()=>{const y=new CustomEvent(Q,fe);i.addEventListener(Q,h),i.dispatchEvent(y),y.defaultPrevented||D(u??document.body,{select:!0}),i.removeEventListener(Q,h),me.remove(g)},0)}}},[i,l,h,g]);const w=c.useCallback(u=>{if(!n&&!r||g.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(m&&y){const E=u.currentTarget,[b,C]=ot(E);b&&C?!u.shiftKey&&y===C?(u.preventDefault(),n&&D(b,{select:!0})):u.shiftKey&&y===b&&(u.preventDefault(),n&&D(C,{select:!0})):y===E&&u.preventDefault()}},[n,r,g.paused]);return f.jsx(P.div,{tabIndex:-1,...s,ref:p,onKeyDown:w})});Se.displayName=nt;function rt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(D(r,{select:t}),document.activeElement!==n)return}function ot(e){const t=we(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function we(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 ve(e,t){for(const n of e)if(!at(n,{upTo:t}))return n}function at(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 it(e){return e instanceof HTMLInputElement&&"select"in e}function D(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var me=ct();function ct(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var st="Portal",Ne=c.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=c.useState(!1);oe(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?ze.createPortal(f.jsx(P.div,{...r,ref:t}),s):null});Ne.displayName=st;function lt(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=dt(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=k(r.ref,ft(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};X.displayName="Presence";function dt(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,d]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=L(r.current);a.current=i==="mounted"?l:"none"},[i]),oe(()=>{const l=r.current,h=o.current;if(h!==e){const p=a.current,g=L(l);e?d("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(h&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),oe(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,v=g=>{const u=L(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},p=g=>{g.target===t&&(a.current=L(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function L(e){return(e==null?void 0:e.animationName)||"none"}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 J=0;function vt(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){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 R=function(){return R=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},R.apply(this,arguments)};function Re(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 mt(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 G="right-scroll-bar-position",H="width-before-scroll-bar",ht="with-scroll-bars-hidden",gt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pt(e,t){var n=c.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 yt=typeof window<"u"?c.useLayoutEffect:c.useEffect,pe=new WeakMap;function Et(e,t){var n=pt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return yt(function(){var r=pe.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||ee(i,null)}),a.forEach(function(i){o.has(i)||ee(i,s)})}pe.set(n,e)},[e]),n}function bt(e){return e}function Ct(e,t){t===void 0&&(t=bt);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 s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var d=function(){var h=s;s=[],h.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return o}function St(e){e===void 0&&(e={});var t=Ct(null);return t.options=R({async:!0,ssr:!1},e),t}var Ae=function(e){var t=e.sideCar,n=Re(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 c.createElement(r,R({},n))};Ae.isSideCarExport=!0;function wt(e,t){return e.useMedium(t),Ae}var xe=St(),te=function(){},Y=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,d=e.className,l=e.removeScrollBar,h=e.enabled,v=e.shards,p=e.sideCar,g=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,b=e.gapMode,C=Re(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,A=Et([n,t]),x=R(R({},C),o);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:xe,removeScrollBar:l,shards:v,noRelative:g,noIsolation:w,inert:u,setCallbacks:a,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(i),R(R({},x),{ref:A})):c.createElement(E,R({},x,{className:d,ref:A}),i))});Y.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y.classNames={fullWidth:H,zeroRight:G};var Nt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nt();return t&&e.setAttribute("nonce",t),e}function At(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rt())&&(At(t,n),xt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=Dt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Tt=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[ne(n),ne(r),ne(o)]},Mt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pt;var t=Tt(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])}},It=De(),F="data-scroll-locked",Ft=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(ht,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(r,`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,i as J,u as Q,b as X,t as ee,j as e,e as B,A as te,$ as ne}from"./index-BOxe43p1.js";import{f as q,a as re,c as se,h as ae,i as Z,j as ie,k as oe,m as ce}from"./recordings-BWe1ydXm.js";import{P as le}from"./page-header-COQZxJfR.js";import{B as I}from"./button-Cg08-EMT.js";import{E as F}from"./EmptyState-DqWU2-vM.js";import{M as ue}from"./Modal-Bsvj1tm2.js";import{P as de,M as fe,a as me}from"./Menu-CtdCybzA.js";import{A as ge}from"./AnnotationOverlay-Btq3dZRI.js";import{t as O,v as pe,R as he,P as be,n as ye,c as U,o as ve,a as R,f as ke,p as xe,S as V,b as je,d as Me}from"./recordings-n-GTW3aT.js";import{A as we}from"./arrow-left-BWfCbeHP.js";import{T as Re}from"./trash-2-B701i8sy.js";import{P as Se,a as Ne}from"./play-DrN1Se_R.js";import{D as Ee}from"./download-B56lwxWP.js";import"./utils-CDN07tui.js";import"./index-CfxsUslp.js";import"./check-BMTaH72W.js";function Ce(n){const t=[{key:"zip",label:"All videos (zip)",url:re(n.groupId)}];return n.hasComposite&&t.push({key:"composite",label:"Side-by-side video",url:se(n.groupId)}),t.push({key:"bundle",label:"Proof bundle",url:ae(n.groupId)}),n.phones.filter(l=>l.status!=="FAILED"&&l.status!=="DISCARDED").forEach(l=>{t.push({key:`video-${l.recordingId}`,label:`${l.name}: video`,url:Z(n.groupId,l.recordingId,!0)}),l.annotationCount>0&&t.push({key:`annotated-${l.recordingId}`,label:`${l.name}: video with annotations`,url:ie(n.groupId,l.recordingId)})}),t}function Ie(n,t){return t?t.role==="ADMIN"||t.role==="SUPER_ADMIN"?!0:!!n.startedBy&&!!t.userId&&n.startedBy.id===t.userId:!1}function De(n){if(n instanceof q){if(n.code==="not_owner")return"Only the person who recorded it, or an admin, can delete it.";if(n.code==="recording_in_progress")return"It’s still recording. Stop it on Live devices first.";if(n.status===404)return"It was already deleted, or it’s on phones you can’t see."}return`Couldn’t delete the recording: ${n instanceof Error?n.message:String(n)}`}function Ae(n){const t=document.createElement("a");t.href=n,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t)}const Te={now:()=>performance.now(),schedule:n=>window.requestAnimationFrame(()=>n()),cancel:n=>window.cancelAnimationFrame(n)},Pe=100,_e=3,$e=.05;function W(n){return n.ended||Number.isFinite(n.duration)&&n.currentTime>=n.duration-$e}function Fe(n,t=Te){const l=c.useRef(new Map),v=c.useRef(new Map),u=c.useRef(new Map),d=c.useRef({baseMs:0,since:null,running:!1,waiting:!1}),p=c.useRef(null),S=c.useRef(-1/0),k=c.useRef(n);k.current=n;const[D,w]=c.useState({timeMs:0,playing:!1,waiting:!1}),x=()=>d.current.since===null?d.current.baseMs:d.current.baseMs+(t.now()-d.current.since),h=(s,a)=>{l.current.forEach((i,M)=>{var _;const m=v.current.get(M);if(!m||i.error)return;const T=O(s,m.offsetMs,m.durationMs);let C=T==="before"?0:T==="after"?m.durationMs:pe(s,m.offsetMs);Number.isFinite(i.duration)&&(C=Math.min(C,i.duration*1e3));const L=d.current.running?he:be;ye(i.currentTime*1e3,C,L)&&(i.currentTime=C/1e3),a&&T==="playing"?i.paused&&!W(i)&&((_=i.play())==null||_.catch(()=>{})):i.paused||i.pause()})},j=s=>Array.from(l.current.entries()).some(([a,i])=>{const M=v.current.get(a);return!!M&&!i.error&&!W(i)&&O(s,M.offsetMs,M.durationMs)==="playing"&&i.readyState<_e}),g=s=>{const a=t.now();!s&&a-S.current<Pe||(S.current=a,w({timeMs:x(),playing:d.current.running,waiting:d.current.waiting}))},b=()=>{p.current!==null&&t.cancel(p.current),p.current=null},A=()=>{p.current=null;const s=d.current;if(!s.running)return;const a=x();if(a>=k.current){Object.assign(s,{baseMs:k.current,since:null,running:!1,waiting:!1}),h(k.current,!1),g(!0);return}const i=j(a);i!==s.waiting?(s.baseMs=a,s.since=i?null:t.now(),s.waiting=i,h(a,!i),g(!0)):(h(a,!i),g(!1)),p.current=t.schedule(A)},N=()=>{const s=d.current;x()>=k.current?s.baseMs=0:s.baseMs=x(),Object.assign(s,{since:t.now(),running:!0,waiting:!1}),h(s.baseMs,!0),g(!0),b(),p.current=t.schedule(A)},y=()=>{const s=d.current;Object.assign(s,{baseMs:x(),since:null,running:!1,waiting:!1}),b(),h(s.baseMs,!1),g(!0)},f=s=>{const a=d.current,i=U(s,k.current);a.baseMs=i,a.since=a.running&&!a.waiting?t.now():null,h(i,a.running&&!a.waiting),g(!0)},P=c.useCallback((s,a)=>{v.current.set(s,a);let i=u.current.get(s);return i||(i=M=>{if(M){l.current.set(s,M);const m=d.current;h(x(),m.running&&!m.waiting)}else l.current.delete(s)},u.current.set(s,i)),i},[]);return c.useEffect(()=>b,[]),{...D,play:N,pause:y,toggle:()=>d.current.running?y():N(),seek:f,bind:P}}const Le=()=>{},Y="Stop the recording on Live devices first.",Be=1e3;function Oe(n){const t=n;return!t||!t.closest?!1:!!t.closest('input:not([type="range"]):not([type="checkbox"]), select, textarea, [contenteditable="true"], [role="dialog"], [role="menu"]')}function Ue({groupId:n,phone:t,timeMs:l,marks:v,showMarks:u,bind:d}){const[p,S]=c.useState(!1),[k,D]=c.useState(void 0),w=t.status==="FAILED"||t.status==="DISCARDED",x=O(l,t.offsetMs,t.durationMs),h=je(v,l).map(Me).filter(g=>g!==null);let j=null;return w?j=`Recording failed: ${t.failReason??"unknown reason"}`:p?j="Video no longer available":x==="before"&&t.offsetMs>=Be&&(j=`Starts at ${R(t.offsetMs)}`),e.jsxs("figure",{className:"rec-tile theme-dark","aria-label":t.name,children:[e.jsx("figcaption",{className:"rec-tile-name",title:t.name,children:t.name}),e.jsxs("div",{className:"rec-tile-screen",children:[!w&&e.jsx("video",{className:"rec-tile-video",muted:!0,playsInline:!0,preload:"auto",src:Z(n,t.recordingId),ref:d(t.recordingId,{offsetMs:t.offsetMs,durationMs:t.durationMs}),onError:()=>S(!0),onLoadedMetadata:g=>{const b=g.currentTarget;b.videoWidth>0&&b.videoHeight>0&&D(b.videoWidth/b.videoHeight)}}),!w&&u&&e.jsx(ge,{enabled:!1,shape:"RECT",color:"currentColor",onCommit:Le,committed:h,mediaAspect:k}),j&&e.jsx("div",{className:"rec-tile-note",children:j})]})]})}function ze({detail:n}){const[t,l]=c.useState(!1),v=c.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{ref:v,variant:"secondary","aria-haspopup":"menu","aria-expanded":t,onClick:()=>l(u=>!u),children:[e.jsx(Ee,{size:14,"aria-hidden":"true"}),"Download"]}),e.jsx(de,{open:t,onClose:()=>l(!1),anchorRef:v,children:e.jsx(fe,{children:Ce(n.summary).map(u=>e.jsx(me,{onClick:()=>{l(!1),Ae(u.url)},children:u.label},u.key))})})]})}function at(){var K;const{groupId:n=""}=J(),t=Q(),{me:l}=X(),{toast:v}=ee(),[u,d]=c.useState(null),[p,S]=c.useState(null),[k,D]=c.useState(0),[w,x]=c.useState(!0),[h,j]=c.useState(!1),[g,b]=c.useState(!1),[A,N]=c.useState(null);c.useEffect(()=>{let r=!0;return S(null),d(null),oe(n).then(o=>r&&d(ve(o))).catch(o=>{r&&S({missing:o instanceof q&&o.status===404,message:o instanceof Error?o.message:String(o)})}),()=>{r=!1}},[n,k]);const y=(u==null?void 0:u.summary.durationMs)??0,f=Fe(y),P=c.useRef(f);P.current=f;const s=c.useRef(!0);if(c.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]),c.useEffect(()=>{if(!u||u.summary.status==="recording")return;const r=o=>{var $,H;if(o.metaKey||o.ctrlKey||o.altKey||Oe(o.target)||o.key===" "&&((H=($=o.target)==null?void 0:$.closest)!=null&&H.call($,"button, a, label")))return;if(o.key===" "&&o.repeat){o.preventDefault();return}const E=P.current;o.key===" "?(o.preventDefault(),E.toggle()):o.key==="ArrowRight"?(o.preventDefault(),E.seek(U(E.timeMs+V,y))):o.key==="ArrowLeft"&&(o.preventDefault(),E.seek(U(E.timeMs-V,y)))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[u,y]),p)return p.missing?e.jsx(F,{title:"This recording isn't available",description:"It may have been deleted, or it's on phones you can't see.",action:e.jsx(B,{className:"rec-link",to:"/recordings",children:"Back to Recordings"})}):e.jsx(F,{title:"Couldn't load this recording",description:p.message,action:e.jsxs(I,{variant:"secondary",onClick:()=>D(r=>r+1),children:[e.jsx(te,{size:14,"aria-hidden":"true"}),"Retry"]})});if(!u)return e.jsx(F,{title:"Loading recording…"});const{summary:a,bookmarks:i,annotations:M}=u,m=a.status==="recording",T=a.phones.map(r=>r.name).join(", "),C=r=>{var o;return((o=a.phones.find(E=>E.recordingId===r))==null?void 0:o.name)??""},L=[T,a.durationMs===null?null:`Length ${R(a.durationMs)}`,`Recorded by ${((K=a.startedBy)==null?void 0:K.name)??"Unknown"}`].filter(Boolean).join(" · "),_=Ie(a,l),z=()=>{j(!1),N(null)},G=async()=>{b(!0),N(null);try{await ce(n)}catch(r){s.current&&(b(!1),N(De(r)));return}v("Recording deleted","success"),s.current&&t("/recordings")};return e.jsxs("div",{className:"rec-page",children:[e.jsx("nav",{className:"rec-backbar",children:e.jsxs(B,{className:"rec-link",to:"/recordings",children:[e.jsx(we,{size:14,"aria-hidden":"true"})," Recordings"]})}),e.jsx(le,{icon:ne,title:ke(a.startedAt),subtitle:L,action:e.jsxs(e.Fragment,{children:[!m&&a.status!=="failed"&&e.jsx(ze,{detail:u}),_&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:"danger",disabled:m,"aria-describedby":m?"rec-delete-reason":void 0,title:m?Y:void 0,onClick:()=>{N(null),j(!0)},children:[e.jsx(Re,{size:14,"aria-hidden":"true"}),"Delete"]}),m&&e.jsx("span",{id:"rec-delete-reason",className:"sr-only",children:Y})]})]})}),m?e.jsx(F,{title:"Still recording",description:"Stop it on Live devices to play it here.",action:e.jsx(B,{className:"rec-link",to:"/devices/live",children:"Open Live devices"})}):e.jsxs("div",{className:`rec-body${i.length>0?" rec-body--with-list":""}`,children:[e.jsxs("div",{className:"rec-player",children:[e.jsx("div",{className:"rec-grid",children:a.phones.map(r=>e.jsx(Ue,{groupId:n,phone:r,timeMs:f.timeMs,marks:M.filter(o=>o.recordingId===r.recordingId),showMarks:w,bind:f.bind},r.recordingId))}),e.jsxs("div",{className:"rec-transport",children:[e.jsx(I,{variant:"secondary",size:"icon","aria-label":f.playing?"Pause":"Play",onClick:f.toggle,children:f.playing?e.jsx(Se,{size:14,"aria-hidden":"true"}):e.jsx(Ne,{size:14,"aria-hidden":"true"})}),e.jsxs("span",{className:"rec-num rec-clock",children:[R(f.timeMs)," / ",R(y)]}),e.jsxs("div",{className:"rec-timeline",children:[e.jsx("input",{type:"range",className:"rec-range","aria-label":"Timeline","aria-valuetext":`${R(f.timeMs)} of ${R(y)}`,min:0,max:y,step:100,value:f.timeMs,onChange:r=>f.seek(Number(r.target.value))}),i.map(r=>e.jsx("button",{type:"button",className:"rec-mark",style:{left:`${xe(r.timecodeMs,y)}%`},title:r.label,"aria-label":`Bookmark: ${r.label}, ${R(r.timecodeMs)}`,onClick:()=>f.seek(r.timecodeMs)},r.id))]}),e.jsx("span",{role:"status",className:"rec-waiting",children:f.waiting?"Buffering…":""}),a.annotationCount>0&&e.jsxs("label",{className:"rec-toggle",children:[e.jsx("input",{type:"checkbox",checked:w,onChange:r=>x(r.target.checked)}),"Annotations"]})]})]}),i.length>0&&e.jsxs("section",{className:"rec-bookmarks","aria-labelledby":"rec-bookmarks-title",children:[e.jsx("h2",{id:"rec-bookmarks-title",className:"rec-bookmarks-title",children:"Bookmarks"}),e.jsx("ol",{className:"rec-bookmark-list",children:i.map(r=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"rec-bookmark",onClick:()=>f.seek(r.timecodeMs),children:[e.jsx("span",{className:"rec-bookmark-label",children:r.label}),e.jsxs("span",{className:"rec-num rec-bookmark-meta",children:[R(r.timecodeMs)," · ",C(r.recordingId)]})]})},r.id))})]})]}),e.jsxs(ue,{open:h,title:"Delete this recording?",onClose:()=>{g||z()},footer:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"secondary",onClick:z,disabled:g,children:"Cancel"}),e.jsx(I,{variant:"danger",onClick:G,disabled:g,children:"Delete"})]}),children:[e.jsx("p",{children:"Its videos, bookmarks and annotations are removed for everyone."}),A&&e.jsx("p",{role:"alert",className:"rec-error",children:A})]})]})}export{at as default};
|
|
1
|
+
import{r as c,i as J,u as Q,b as X,t as ee,j as e,e as B,A as te,$ as ne}from"./index-B0gQkEg0.js";import{f as q,a as re,c as se,h as ae,i as Z,j as ie,k as oe,m as ce}from"./recordings-BWe1ydXm.js";import{P as le}from"./page-header-D8KUX6Qg.js";import{B as I}from"./button-DDau4Axv.js";import{E as F}from"./EmptyState-7hETKEWb.js";import{M as ue}from"./Modal-C6WjZFeI.js";import{P as de,M as fe,a as me}from"./Menu-KrPnfdsf.js";import{A as ge}from"./AnnotationOverlay-2W4JvEyZ.js";import{t as O,v as pe,R as he,P as be,n as ye,c as U,o as ve,a as R,f as ke,p as xe,S as V,b as je,d as Me}from"./recordings-n-GTW3aT.js";import{A as we}from"./arrow-left-BtB0_Jg_.js";import{T as Re}from"./trash-2-CZ2ew6AZ.js";import{P as Se,a as Ne}from"./play-Cvc8xzic.js";import{D as Ee}from"./download-BroHxNOh.js";import"./utils-CDN07tui.js";import"./index-72oF89LJ.js";import"./check-K1ovTQam.js";function Ce(n){const t=[{key:"zip",label:"All videos (zip)",url:re(n.groupId)}];return n.hasComposite&&t.push({key:"composite",label:"Side-by-side video",url:se(n.groupId)}),t.push({key:"bundle",label:"Proof bundle",url:ae(n.groupId)}),n.phones.filter(l=>l.status!=="FAILED"&&l.status!=="DISCARDED").forEach(l=>{t.push({key:`video-${l.recordingId}`,label:`${l.name}: video`,url:Z(n.groupId,l.recordingId,!0)}),l.annotationCount>0&&t.push({key:`annotated-${l.recordingId}`,label:`${l.name}: video with annotations`,url:ie(n.groupId,l.recordingId)})}),t}function Ie(n,t){return t?t.role==="ADMIN"||t.role==="SUPER_ADMIN"?!0:!!n.startedBy&&!!t.userId&&n.startedBy.id===t.userId:!1}function De(n){if(n instanceof q){if(n.code==="not_owner")return"Only the person who recorded it, or an admin, can delete it.";if(n.code==="recording_in_progress")return"It’s still recording. Stop it on Live devices first.";if(n.status===404)return"It was already deleted, or it’s on phones you can’t see."}return`Couldn’t delete the recording: ${n instanceof Error?n.message:String(n)}`}function Ae(n){const t=document.createElement("a");t.href=n,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t)}const Te={now:()=>performance.now(),schedule:n=>window.requestAnimationFrame(()=>n()),cancel:n=>window.cancelAnimationFrame(n)},Pe=100,_e=3,$e=.05;function W(n){return n.ended||Number.isFinite(n.duration)&&n.currentTime>=n.duration-$e}function Fe(n,t=Te){const l=c.useRef(new Map),v=c.useRef(new Map),u=c.useRef(new Map),d=c.useRef({baseMs:0,since:null,running:!1,waiting:!1}),p=c.useRef(null),S=c.useRef(-1/0),k=c.useRef(n);k.current=n;const[D,w]=c.useState({timeMs:0,playing:!1,waiting:!1}),x=()=>d.current.since===null?d.current.baseMs:d.current.baseMs+(t.now()-d.current.since),h=(s,a)=>{l.current.forEach((i,M)=>{var _;const m=v.current.get(M);if(!m||i.error)return;const T=O(s,m.offsetMs,m.durationMs);let C=T==="before"?0:T==="after"?m.durationMs:pe(s,m.offsetMs);Number.isFinite(i.duration)&&(C=Math.min(C,i.duration*1e3));const L=d.current.running?he:be;ye(i.currentTime*1e3,C,L)&&(i.currentTime=C/1e3),a&&T==="playing"?i.paused&&!W(i)&&((_=i.play())==null||_.catch(()=>{})):i.paused||i.pause()})},j=s=>Array.from(l.current.entries()).some(([a,i])=>{const M=v.current.get(a);return!!M&&!i.error&&!W(i)&&O(s,M.offsetMs,M.durationMs)==="playing"&&i.readyState<_e}),g=s=>{const a=t.now();!s&&a-S.current<Pe||(S.current=a,w({timeMs:x(),playing:d.current.running,waiting:d.current.waiting}))},b=()=>{p.current!==null&&t.cancel(p.current),p.current=null},A=()=>{p.current=null;const s=d.current;if(!s.running)return;const a=x();if(a>=k.current){Object.assign(s,{baseMs:k.current,since:null,running:!1,waiting:!1}),h(k.current,!1),g(!0);return}const i=j(a);i!==s.waiting?(s.baseMs=a,s.since=i?null:t.now(),s.waiting=i,h(a,!i),g(!0)):(h(a,!i),g(!1)),p.current=t.schedule(A)},N=()=>{const s=d.current;x()>=k.current?s.baseMs=0:s.baseMs=x(),Object.assign(s,{since:t.now(),running:!0,waiting:!1}),h(s.baseMs,!0),g(!0),b(),p.current=t.schedule(A)},y=()=>{const s=d.current;Object.assign(s,{baseMs:x(),since:null,running:!1,waiting:!1}),b(),h(s.baseMs,!1),g(!0)},f=s=>{const a=d.current,i=U(s,k.current);a.baseMs=i,a.since=a.running&&!a.waiting?t.now():null,h(i,a.running&&!a.waiting),g(!0)},P=c.useCallback((s,a)=>{v.current.set(s,a);let i=u.current.get(s);return i||(i=M=>{if(M){l.current.set(s,M);const m=d.current;h(x(),m.running&&!m.waiting)}else l.current.delete(s)},u.current.set(s,i)),i},[]);return c.useEffect(()=>b,[]),{...D,play:N,pause:y,toggle:()=>d.current.running?y():N(),seek:f,bind:P}}const Le=()=>{},Y="Stop the recording on Live devices first.",Be=1e3;function Oe(n){const t=n;return!t||!t.closest?!1:!!t.closest('input:not([type="range"]):not([type="checkbox"]), select, textarea, [contenteditable="true"], [role="dialog"], [role="menu"]')}function Ue({groupId:n,phone:t,timeMs:l,marks:v,showMarks:u,bind:d}){const[p,S]=c.useState(!1),[k,D]=c.useState(void 0),w=t.status==="FAILED"||t.status==="DISCARDED",x=O(l,t.offsetMs,t.durationMs),h=je(v,l).map(Me).filter(g=>g!==null);let j=null;return w?j=`Recording failed: ${t.failReason??"unknown reason"}`:p?j="Video no longer available":x==="before"&&t.offsetMs>=Be&&(j=`Starts at ${R(t.offsetMs)}`),e.jsxs("figure",{className:"rec-tile theme-dark","aria-label":t.name,children:[e.jsx("figcaption",{className:"rec-tile-name",title:t.name,children:t.name}),e.jsxs("div",{className:"rec-tile-screen",children:[!w&&e.jsx("video",{className:"rec-tile-video",muted:!0,playsInline:!0,preload:"auto",src:Z(n,t.recordingId),ref:d(t.recordingId,{offsetMs:t.offsetMs,durationMs:t.durationMs}),onError:()=>S(!0),onLoadedMetadata:g=>{const b=g.currentTarget;b.videoWidth>0&&b.videoHeight>0&&D(b.videoWidth/b.videoHeight)}}),!w&&u&&e.jsx(ge,{enabled:!1,shape:"RECT",color:"currentColor",onCommit:Le,committed:h,mediaAspect:k}),j&&e.jsx("div",{className:"rec-tile-note",children:j})]})]})}function ze({detail:n}){const[t,l]=c.useState(!1),v=c.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{ref:v,variant:"secondary","aria-haspopup":"menu","aria-expanded":t,onClick:()=>l(u=>!u),children:[e.jsx(Ee,{size:14,"aria-hidden":"true"}),"Download"]}),e.jsx(de,{open:t,onClose:()=>l(!1),anchorRef:v,children:e.jsx(fe,{children:Ce(n.summary).map(u=>e.jsx(me,{onClick:()=>{l(!1),Ae(u.url)},children:u.label},u.key))})})]})}function at(){var K;const{groupId:n=""}=J(),t=Q(),{me:l}=X(),{toast:v}=ee(),[u,d]=c.useState(null),[p,S]=c.useState(null),[k,D]=c.useState(0),[w,x]=c.useState(!0),[h,j]=c.useState(!1),[g,b]=c.useState(!1),[A,N]=c.useState(null);c.useEffect(()=>{let r=!0;return S(null),d(null),oe(n).then(o=>r&&d(ve(o))).catch(o=>{r&&S({missing:o instanceof q&&o.status===404,message:o instanceof Error?o.message:String(o)})}),()=>{r=!1}},[n,k]);const y=(u==null?void 0:u.summary.durationMs)??0,f=Fe(y),P=c.useRef(f);P.current=f;const s=c.useRef(!0);if(c.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]),c.useEffect(()=>{if(!u||u.summary.status==="recording")return;const r=o=>{var $,H;if(o.metaKey||o.ctrlKey||o.altKey||Oe(o.target)||o.key===" "&&((H=($=o.target)==null?void 0:$.closest)!=null&&H.call($,"button, a, label")))return;if(o.key===" "&&o.repeat){o.preventDefault();return}const E=P.current;o.key===" "?(o.preventDefault(),E.toggle()):o.key==="ArrowRight"?(o.preventDefault(),E.seek(U(E.timeMs+V,y))):o.key==="ArrowLeft"&&(o.preventDefault(),E.seek(U(E.timeMs-V,y)))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[u,y]),p)return p.missing?e.jsx(F,{title:"This recording isn't available",description:"It may have been deleted, or it's on phones you can't see.",action:e.jsx(B,{className:"rec-link",to:"/recordings",children:"Back to Recordings"})}):e.jsx(F,{title:"Couldn't load this recording",description:p.message,action:e.jsxs(I,{variant:"secondary",onClick:()=>D(r=>r+1),children:[e.jsx(te,{size:14,"aria-hidden":"true"}),"Retry"]})});if(!u)return e.jsx(F,{title:"Loading recording…"});const{summary:a,bookmarks:i,annotations:M}=u,m=a.status==="recording",T=a.phones.map(r=>r.name).join(", "),C=r=>{var o;return((o=a.phones.find(E=>E.recordingId===r))==null?void 0:o.name)??""},L=[T,a.durationMs===null?null:`Length ${R(a.durationMs)}`,`Recorded by ${((K=a.startedBy)==null?void 0:K.name)??"Unknown"}`].filter(Boolean).join(" · "),_=Ie(a,l),z=()=>{j(!1),N(null)},G=async()=>{b(!0),N(null);try{await ce(n)}catch(r){s.current&&(b(!1),N(De(r)));return}v("Recording deleted","success"),s.current&&t("/recordings")};return e.jsxs("div",{className:"rec-page",children:[e.jsx("nav",{className:"rec-backbar",children:e.jsxs(B,{className:"rec-link",to:"/recordings",children:[e.jsx(we,{size:14,"aria-hidden":"true"})," Recordings"]})}),e.jsx(le,{icon:ne,title:ke(a.startedAt),subtitle:L,action:e.jsxs(e.Fragment,{children:[!m&&a.status!=="failed"&&e.jsx(ze,{detail:u}),_&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:"danger",disabled:m,"aria-describedby":m?"rec-delete-reason":void 0,title:m?Y:void 0,onClick:()=>{N(null),j(!0)},children:[e.jsx(Re,{size:14,"aria-hidden":"true"}),"Delete"]}),m&&e.jsx("span",{id:"rec-delete-reason",className:"sr-only",children:Y})]})]})}),m?e.jsx(F,{title:"Still recording",description:"Stop it on Live devices to play it here.",action:e.jsx(B,{className:"rec-link",to:"/devices/live",children:"Open Live devices"})}):e.jsxs("div",{className:`rec-body${i.length>0?" rec-body--with-list":""}`,children:[e.jsxs("div",{className:"rec-player",children:[e.jsx("div",{className:"rec-grid",children:a.phones.map(r=>e.jsx(Ue,{groupId:n,phone:r,timeMs:f.timeMs,marks:M.filter(o=>o.recordingId===r.recordingId),showMarks:w,bind:f.bind},r.recordingId))}),e.jsxs("div",{className:"rec-transport",children:[e.jsx(I,{variant:"secondary",size:"icon","aria-label":f.playing?"Pause":"Play",onClick:f.toggle,children:f.playing?e.jsx(Se,{size:14,"aria-hidden":"true"}):e.jsx(Ne,{size:14,"aria-hidden":"true"})}),e.jsxs("span",{className:"rec-num rec-clock",children:[R(f.timeMs)," / ",R(y)]}),e.jsxs("div",{className:"rec-timeline",children:[e.jsx("input",{type:"range",className:"rec-range","aria-label":"Timeline","aria-valuetext":`${R(f.timeMs)} of ${R(y)}`,min:0,max:y,step:100,value:f.timeMs,onChange:r=>f.seek(Number(r.target.value))}),i.map(r=>e.jsx("button",{type:"button",className:"rec-mark",style:{left:`${xe(r.timecodeMs,y)}%`},title:r.label,"aria-label":`Bookmark: ${r.label}, ${R(r.timecodeMs)}`,onClick:()=>f.seek(r.timecodeMs)},r.id))]}),e.jsx("span",{role:"status",className:"rec-waiting",children:f.waiting?"Buffering…":""}),a.annotationCount>0&&e.jsxs("label",{className:"rec-toggle",children:[e.jsx("input",{type:"checkbox",checked:w,onChange:r=>x(r.target.checked)}),"Annotations"]})]})]}),i.length>0&&e.jsxs("section",{className:"rec-bookmarks","aria-labelledby":"rec-bookmarks-title",children:[e.jsx("h2",{id:"rec-bookmarks-title",className:"rec-bookmarks-title",children:"Bookmarks"}),e.jsx("ol",{className:"rec-bookmark-list",children:i.map(r=>e.jsx("li",{children:e.jsxs("button",{type:"button",className:"rec-bookmark",onClick:()=>f.seek(r.timecodeMs),children:[e.jsx("span",{className:"rec-bookmark-label",children:r.label}),e.jsxs("span",{className:"rec-num rec-bookmark-meta",children:[R(r.timecodeMs)," · ",C(r.recordingId)]})]})},r.id))})]})]}),e.jsxs(ue,{open:h,title:"Delete this recording?",onClose:()=>{g||z()},footer:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"secondary",onClick:z,disabled:g,children:"Cancel"}),e.jsx(I,{variant:"danger",onClick:G,disabled:g,children:"Delete"})]}),children:[e.jsx("p",{children:"Its videos, bookmarks and annotations are removed for everyone."}),A&&e.jsx("p",{role:"alert",className:"rec-error",children:A})]})]})}export{at as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as V,H as Y,r as l,j as n,$ as z,A as G,e as q}from"./index-
|
|
1
|
+
import{u as V,H as Y,r as l,j as n,$ as z,A as G,e as q}from"./index-B0gQkEg0.js";import{P as Q}from"./page-header-D8KUX6Qg.js";import{T as Z,a as J,b as T,c as h,d as X,e as m}from"./Table-DwIgERRt.js";import{B as v}from"./button-DDau4Axv.js";import{E as y}from"./EmptyState-7hETKEWb.js";import{I as ee}from"./input-DIc4MSC7.js";import{F as f}from"./FilterMenu-Yvf6RGMd.js";import{l as A}from"./recordings-BWe1ydXm.js";import{f as ne,a as te}from"./recordings-n-GTW3aT.js";import"./utils-CDN07tui.js";import"./Menu-KrPnfdsf.js";import"./index-72oF89LJ.js";import"./check-K1ovTQam.js";import"./plus-C9Zj84UF.js";const re={phone:"",by:"",when:"any",q:""},oe=["any","24h","7d","30d"],R=864e5,se={"24h":R,"7d":7*R,"30d":30*R},ae={any:"Any time","24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days"};function ce(t){const r=t.get("when");return{phone:t.get("phone")??"",by:t.get("by")??"",when:r&&oe.includes(r)?r:"any",q:t.get("q")??""}}function F(t){const r=new URLSearchParams;return t.phone&&r.set("phone",t.phone),t.by&&r.set("by",t.by),t.when!=="any"&&r.set("when",t.when),t.q.trim()&&r.set("q",t.q),r}function ie(t){return!!(t.phone||t.by||t.when!=="any"||t.q.trim())}function P(t,r){return{udid:t.phone||void 0,startedBy:t.by||void 0,since:t.when==="any"?void 0:new Date(r-se[t.when]).toISOString(),q:t.q.trim()||void 0}}const B=50,le=250;function de(t){const r=t.phones.map(g=>g.name);return{text:r.length>2?`${r.slice(0,2).join(", ")} +${r.length-2}`:r.join(", "),title:r.join(`
|
|
2
2
|
`)}}const ue=t=>t.status==="recording"?"/devices/live":`/recordings/${encodeURIComponent(t.groupId)}`;function Ne(){const t=V(),[r,g]=Y(),a=ce(r),x=F(a).toString(),[s,S]=l.useState(null),[I,D]=l.useState(null),[j,C]=l.useState([]),[N,w]=l.useState(null),[H,k]=l.useState(!1),[M,O]=l.useState(0),u=l.useRef(0),d=l.useRef(!0),p=e=>g(F(e),{replace:!0});l.useEffect(()=>{d.current=!0;const e=++u.current,c=window.setTimeout(()=>{A({...P(a,Date.now()),limit:B}).then(i=>{!d.current||e!==u.current||(S(i),C(i.recordings),w(null),D(x))}).catch(i=>{!d.current||e!==u.current||w(i instanceof Error?i.message:String(i))})},le);return()=>{window.clearTimeout(c),d.current=!1}},[x,M]);const b=I===x?(s==null?void 0:s.nextCursor)??null:null,_=async()=>{if(!b)return;const e=u.current;k(!0);try{const c=await A({...P(a,Date.now()),limit:B,cursor:b});if(!d.current||e!==u.current)return;S(c),C(i=>i.concat(c.recordings))}catch(c){if(!d.current||e!==u.current)return;w(c instanceof Error?c.message:String(c))}finally{d.current&&k(!1)}},o=s==null?void 0:s.facets,W=[{value:"",label:"Any phone",count:(o==null?void 0:o.when.any)??0},...((o==null?void 0:o.phones)??[]).map(e=>({value:e.udid,label:e.name,count:e.count}))],$=[{value:"",label:"Anyone",count:(o==null?void 0:o.when.any)??0},...((o==null?void 0:o.people)??[]).map(e=>({value:e.id,label:e.name,count:e.count})),...o&&o.unknownCount>0?[{value:"unknown",label:"Unknown",count:o.unknownCount}]:[]],K=["any","24h","7d","30d"].map(e=>({value:e,label:ae[e],count:(o==null?void 0:o.when[e])??0})),E=(s==null?void 0:s.total)??0;return n.jsxs("div",{className:"rec-page",children:[n.jsx(Q,{icon:z,title:"Recordings",subtitle:s?`${E} recording${E===1?"":"s"}`:void 0}),n.jsxs("div",{className:"rec-toolbar",children:[n.jsx(ee,{type:"text",className:"rec-search","aria-label":"Search recordings",placeholder:"Search phones and bookmarks",value:a.q,onChange:e=>p({...a,q:e.target.value})}),n.jsx(f,{name:"Phone",value:a.phone,anyValue:"",options:W,onChange:e=>p({...a,phone:e})}),n.jsx(f,{name:"Recorded by",value:a.by,anyValue:"",options:$,onChange:e=>p({...a,by:e})}),n.jsx(f,{name:"When",value:a.when,anyValue:"any",options:K,onChange:e=>p({...a,when:e})})]}),N?n.jsx(y,{title:"Couldn't load recordings",description:N,action:n.jsxs(v,{variant:"secondary",onClick:()=>O(e=>e+1),children:[n.jsx(G,{size:14,"aria-hidden":"true"}),"Retry"]})}):s?j.length===0?ie(a)?n.jsx(y,{title:"No recordings match",action:n.jsx(v,{variant:"secondary",onClick:()=>p(re),children:"Clear filters"})}):n.jsx(y,{title:"No recordings yet",description:"Record phones from Live devices.",action:n.jsx(q,{className:"rec-link",to:"/devices/live",children:"Open Live devices"})}):n.jsxs(n.Fragment,{children:[n.jsxs(Z,{className:"rec-table",children:[n.jsxs("caption",{className:"sr-only",children:["Recordings, ",j.length," shown"]}),n.jsx(J,{children:n.jsxs(T,{children:[n.jsx(h,{scope:"col",children:"When"}),n.jsx(h,{scope:"col",children:"Phones"}),n.jsx(h,{scope:"col",children:"Length"}),n.jsx(h,{scope:"col",children:"Recorded by"}),n.jsx(h,{scope:"col",children:"Bookmarks"}),n.jsx(h,{scope:"col",children:"Status"})]})}),n.jsx(X,{children:j.map(e=>{var L;const c=de(e),i=ue(e);return n.jsxs(T,{className:"rec-row",onClick:U=>{U.target.closest("a")||t(i)},children:[n.jsx(m,{children:n.jsx(q,{to:i,className:"rec-link",children:ne(e.startedAt)})}),n.jsx(m,{title:c.title,children:c.text}),n.jsx(m,{className:"rec-num",children:e.durationMs===null?"—":te(e.durationMs)}),n.jsx(m,{children:((L=e.startedBy)==null?void 0:L.name)??"Unknown"}),n.jsx(m,{className:"rec-num",children:e.bookmarkCount}),n.jsx(m,{children:e.status==="recording"?"Recording…":e.status==="failed"?"Failed":""})]},e.groupId)})})]}),b&&n.jsx("div",{className:"rec-more",children:n.jsx(v,{variant:"secondary",onClick:_,disabled:H,children:"Load more"})})]}):n.jsx(y,{title:"Loading recordings…"}),s&&n.jsxs("p",{className:"rec-footnote",children:["Recordings are kept for ",s.retention.days," days, up to the newest"," ",s.retention.maxCount,"."]})]})}export{Ne as default,de as phoneNames};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-B0gQkEg0.js";const s=({kind:n,size:a=6,className:l})=>e.jsx("span",{className:`status-dot status-dot-${n}${l?" "+l:""}`,style:{width:a,height:a},"aria-hidden":!0});function d({segments:n,value:a,onChange:l,size:o="md",label:i}){return e.jsx("div",{className:`seg seg-${o}`,role:"tablist","aria-label":i,children:n.map(t=>e.jsxs("button",{role:"tab","aria-selected":t.value===a,"aria-label":t.title&&typeof t.label=="string"?t.label:void 0,"aria-keyshortcuts":t.keyShortcuts,title:t.title,disabled:t.disabled,className:`seg-btn${t.value===a?" seg-btn-active":""}`,onClick:()=>{t.disabled||l(t.value)},type:"button",children:[t.tone&&e.jsx(s,{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{s as S,d as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as n,j as s,A as h}from"./index-
|
|
1
|
+
import{c as n,j as s,A as h}from"./index-B0gQkEg0.js";import{B as r}from"./button-DDau4Axv.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-B0gQkEg0.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,t as z,r,X as h,j as e,S as M,A,W as O,Y as B}from"./index-
|
|
1
|
+
import{c as p,t as z,r,X as h,j as e,S as M,A,W as O,Y as B}from"./index-B0gQkEg0.js";/* empty css */import{S as k,A as L}from"./SettingCard-CPm3w9l2.js";import{P as U}from"./page-header-D8KUX6Qg.js";import{L as _}from"./lock-pVLvnN30.js";import{C as w}from"./circle-check-CBv88cH7.js";import{A as $}from"./activity-DrLbHifn.js";import"./button-DDau4Axv.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{t as le,r as a,j as e,A as $,Z as g,y as oe}from"./index-BOxe43p1.js";/* empty css */import{a as L}from"./time-D-gjmE1o.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-zNTX92Pn.js";import{F as m}from"./FieldGroup-CveQ3xrA.js";import{P as O}from"./page-header-COQZxJfR.js";import{M as B}from"./Modal-Bsvj1tm2.js";import{B as u}from"./button-Cg08-EMT.js";import{I as H}from"./input-CZHFjbSg.js";import{S as M}from"./select-Bpyn7rWO.js";import{P as v}from"./plus-5aq-9uRx.js";import{T as pe}from"./trash-2-B701i8sy.js";import{C as he}from"./check-BMTaH72W.js";import{C as xe}from"./copy-Be7LNMXV.js";import"./index-CfxsUslp.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 Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,k]=a.useState(!0),[G,N]=a.useState(!1),[Z,d]=a.useState(!1),[r,y]=a.useState(null),[C,T]=a.useState(null),[S,_]=a.useState(!1),[p,I]=a.useState(""),[j,A]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,F]=a.useState(""),[h,D]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{k(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){N(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),N(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{k(!1)}};a.useEffect(()=>{f()},[]);const V=()=>{I(""),A({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),F(""),D("30d")},ee=async()=>{const s=U.filter(t=>j[t]);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 t=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(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),V(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{T(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{T(null)}},te=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 ae=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:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). 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:ae}),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:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),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:Z,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=>I(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 sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),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:t=>A({...j,[s]:t.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:"Team",description:e.jsxs(e.Fragment,{children:["The key is yours, so like you it can use every team's devices, whichever team you pick. The team is recorded on the leases it takes, and limits the key only if you are made a member. To keep a test session to one team, set"," ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>F(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team"}),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=>D(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&&te(r.raw),disabled:!r,children:[S?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),S?"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{Ee as ApiKeys};
|
|
1
|
+
import{t as le,r as a,j as e,A as $,Z as g,y as oe}from"./index-B0gQkEg0.js";/* empty css */import{a as L}from"./time-D-gjmE1o.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-DwIgERRt.js";import{F as m}from"./FieldGroup-GOgssFEP.js";import{P as O}from"./page-header-D8KUX6Qg.js";import{M as B}from"./Modal-C6WjZFeI.js";import{B as u}from"./button-DDau4Axv.js";import{I as H}from"./input-DIc4MSC7.js";import{S as M}from"./select-BWpnhWXj.js";import{P as v}from"./plus-C9Zj84UF.js";import{T as pe}from"./trash-2-CZ2ew6AZ.js";import{C as he}from"./check-K1ovTQam.js";import{C as xe}from"./copy-t0QB14JI.js";import"./index-72oF89LJ.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 Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,k]=a.useState(!0),[G,N]=a.useState(!1),[Z,d]=a.useState(!1),[r,y]=a.useState(null),[C,T]=a.useState(null),[S,_]=a.useState(!1),[p,I]=a.useState(""),[j,A]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,F]=a.useState(""),[h,D]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{k(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){N(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),N(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{k(!1)}};a.useEffect(()=>{f()},[]);const V=()=>{I(""),A({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),F(""),D("30d")},ee=async()=>{const s=U.filter(t=>j[t]);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 t=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(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),V(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{T(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{T(null)}},te=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 ae=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:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). 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:ae}),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:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),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:Z,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=>I(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 sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),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:t=>A({...j,[s]:t.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:"Team",description:e.jsxs(e.Fragment,{children:["The key is yours, so like you it can use every team's devices, whichever team you pick. The team is recorded on the leases it takes, and limits the key only if you are made a member. To keep a test session to one team, set"," ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>F(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team"}),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=>D(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&&te(r.raw),disabled:!r,children:[S?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),S?"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{Ee as ApiKeys};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as k,j as e,r as i,A as K,t as ve,b as je,X as p,O as fe,q as V,z as ye,v as ge}from"./index-
|
|
1
|
+
import{c as k,j as e,r as i,A as K,t as ve,b as je,X as p,O as fe,q as V,z as ye,v as ge}from"./index-B0gQkEg0.js";import{f as Ne}from"./time-D-gjmE1o.js";import{c as be,B as x}from"./button-DDau4Axv.js";import{c as ke}from"./utils-CDN07tui.js";import{P as we}from"./page-header-D8KUX6Qg.js";import{S as Z}from"./select-BWpnhWXj.js";import{M as J}from"./Modal-C6WjZFeI.js";import{F as Q}from"./FieldGroup-GOgssFEP.js";import{U as ee,T as q}from"./upload-Dv99y_le.js";import{C as Ce}from"./check-K1ovTQam.js";import{C as Ae}from"./copy-t0QB14JI.js";import{Z as Se}from"./zap-ClcHFxfo.js";import{D as ze}from"./download-BroHxNOh.js";import{T as Me}from"./trash-2-CZ2ew6AZ.js";import"./index-72oF89LJ.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-B0gQkEg0.js";import{N as l}from"./network-BSfA8ZxG.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","2.
|
|
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","2.16.0"," · Self-hosted device lab"]}),e.jsx("a",{href:"/xenon/api-docs",target:"_blank",rel:"noreferrer",className:"text-[var(--text-muted)] underline-offset-4 hover:text-[var(--text)] hover:underline",children:"API docs"})]})]})]}),e.jsx("main",{className:"flex items-center justify-center px-6 py-10",children:e.jsx("div",{className:"w-full max-w-[400px] rounded-xl border border-[var(--border)] bg-[var(--surface)] px-8 py-9 shadow-[var(--shadow-lg)]",children:t})})]})}export{b as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ee,r as h,p as te,X,j as e,z as V,R as _,f as se,T as ae,q as re,u as ne,i as le,t as oe,M as ie}from"./index-
|
|
1
|
+
import{c as ee,r as h,p as te,X,j as e,z as V,R as _,f as se,T as ae,q as re,u as ne,i as le,t as oe,M as ie}from"./index-B0gQkEg0.js";import{s as ce,b as L,P as de,T as B,i as xe,f as q,a as ue,c as me,d as pe,p as he,e as fe,r as ve,C as be,g as ge,h as je,j as A,k as Ne,l as W,S as we,m as ye,n as Se,u as Ce,o as $e}from"./use-builds-data-DrYC8JCF.js";import{I as J}from"./input-DIc4MSC7.js";import{L as ke,a as Me}from"./list-checks-B06IJJad.js";import{B as O}from"./button-DDau4Axv.js";import{D as Ee}from"./download-BroHxNOh.js";import{s as Te}from"./labels-C21SA4JG.js";import{C as Re}from"./circle-x-Bmltailn.js";import{C as Be}from"./circle-check-CBv88cH7.js";import{C as Le}from"./chevron-right-Biq00pMt.js";import{T as Ie}from"./tablet-BBcoqBmL.js";import{M as _e}from"./monitor-BtrN5IkI.js";import{S}from"./stat-tile-Duex-GZD.js";import{P as De}from"./page-header-D8KUX6Qg.js";import{S as Ae}from"./select-BWpnhWXj.js";import{E as F}from"./EmptyState-7hETKEWb.js";import"./time-D-gjmE1o.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{r as x,j as z}from"./index-
|
|
1
|
+
import{r as x,j as z}from"./index-B0gQkEg0.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};
|