@xenon-device-management/xenon 1.22.0 → 1.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/lib/package.json +1 -1
  2. package/lib/public/assets/{ApiKeyGate-B_1qvA7M.js → ApiKeyGate-Snh2iZH5.js} +1 -1
  3. package/lib/public/assets/{BugReportButton-0m4q010L.js → BugReportButton-Sk0KGufH.js} +1 -1
  4. package/lib/public/assets/DeviceMosaicView-O292tZkA.js +2 -0
  5. package/lib/public/assets/{EmptyState-CTmGgoSm.js → EmptyState-CQun3BJE.js} +1 -1
  6. package/lib/public/assets/{FieldGroup-oWAJBBAu.js → FieldGroup-DmYZP2j7.js} +1 -1
  7. package/lib/public/assets/{Modal-LXKxgyV7.js → Modal-C5W8lMJ6.js} +1 -1
  8. package/lib/public/assets/{SegmentedControl-BSWMM3qE.js → SegmentedControl-BIzlKyUd.js} +1 -1
  9. package/lib/public/assets/{SettingCard-CeHOIGW9.js → SettingCard-DAFqQw7S.js} +1 -1
  10. package/lib/public/assets/{Table-EHWJCCzN.js → Table-DRkkM4OR.js} +1 -1
  11. package/lib/public/assets/{activity-CHfTPuBn.js → activity-B6x69oOy.js} +1 -1
  12. package/lib/public/assets/{ai-settings-B_dT4ctk.js → ai-settings-CSZQis7F.js} +1 -1
  13. package/lib/public/assets/{api-keys-BIKaKigW.js → api-keys-4ddjSngL.js} +1 -1
  14. package/lib/public/assets/{apps-Dp4crlsn.js → apps-CePIfnu9.js} +1 -1
  15. package/lib/public/assets/{arrow-left-QDqb-yc1.js → arrow-left-CaOe18yC.js} +1 -1
  16. package/lib/public/assets/{arrow-right-D_onnhWU.js → arrow-right-FEQsqDvH.js} +1 -1
  17. package/lib/public/assets/{arrow-up-right-DOwr8XxB.js → arrow-up-right-Dnszb73S.js} +1 -1
  18. package/lib/public/assets/{auth-shell-NbHUThYR.js → auth-shell-Vq1rYIVD.js} +2 -2
  19. package/lib/public/assets/{builds-page-CQseApdL.js → builds-page-FfsUegKZ.js} +1 -1
  20. package/lib/public/assets/{button-Do8mBvkU.js → button-DrqhMLZ0.js} +1 -1
  21. package/lib/public/assets/{calendar-DrH0mjSD.js → calendar-BuRuUa7q.js} +1 -1
  22. package/lib/public/assets/{check-C8Un1cwf.js → check-DYccNk73.js} +1 -1
  23. package/lib/public/assets/{chevron-right-DHjIgZvn.js → chevron-right-C6ny35i3.js} +1 -1
  24. package/lib/public/assets/{circle-check-Dkg-Ka4_.js → circle-check-Cokzy9a2.js} +1 -1
  25. package/lib/public/assets/{circle-x-BPKWtaZx.js → circle-x-BhUzyxKR.js} +1 -1
  26. package/lib/public/assets/{clock-CQLUBaRx.js → clock-BCG0drfS.js} +1 -1
  27. package/lib/public/assets/{copy-CWx0Ec1c.js → copy-BKOm9hko.js} +1 -1
  28. package/lib/public/assets/{device-explorer-BjrTj6Sm.js → device-explorer-CIjs3BXP.js} +1 -1
  29. package/lib/public/assets/{download-DJ_pjhGv.js → download-R2k7Nd4P.js} +1 -1
  30. package/lib/public/assets/{forgot-password-MmPdS0S2.js → forgot-password-CiZcr-gB.js} +1 -1
  31. package/lib/public/assets/{funnel-DR8YKoFW.js → funnel-SD4F5IdR.js} +1 -1
  32. package/lib/public/assets/{index-DbzQAv86.js → index-BHDlQcd6.js} +2 -2
  33. package/lib/public/assets/{input-CKKtQEU5.js → input-Ilib6feD.js} +1 -1
  34. package/lib/public/assets/{layers-DprXM0fz.js → layers-CLuKN5Oy.js} +1 -1
  35. package/lib/public/assets/{lock-BXGh7bJZ.js → lock-s9ZhGDFF.js} +1 -1
  36. package/lib/public/assets/{login-DOYeWP9H.js → login-EkaxK7K5.js} +1 -1
  37. package/lib/public/assets/{maintenance-settings-w8U3BRZk.js → maintenance-settings-yYhZaU7n.js} +1 -1
  38. package/lib/public/assets/{mouse-pointer-2-BD4cWXDU.js → mouse-pointer-2-C6yy1DTx.js} +1 -1
  39. package/lib/public/assets/{network-C5bJeATc.js → network-B8fPwmW9.js} +1 -1
  40. package/lib/public/assets/{overview-DzAXi4vj.js → overview-DrTe5eJi.js} +1 -1
  41. package/lib/public/assets/{page-header-CqaoOYPH.js → page-header-DhD-Kua9.js} +1 -1
  42. package/lib/public/assets/{plus-CJfVcjJv.js → plus-B75ovH3O.js} +1 -1
  43. package/lib/public/assets/{profile-page-Mk1yk1c4.js → profile-page-C2p5rB3x.js} +1 -1
  44. package/lib/public/assets/{reset-password-D1gtSgzr.js → reset-password-tCemYrqV.js} +1 -1
  45. package/lib/public/assets/{runbook-page-B7EjVqsY.js → runbook-page-Dq3wdSII.js} +1 -1
  46. package/lib/public/assets/{select-DVYczzD1.js → select-Cfv-njLE.js} +1 -1
  47. package/lib/public/assets/{selector-detail-page-C6b-Z-ep.js → selector-detail-page-8xf4CxH5.js} +1 -1
  48. package/lib/public/assets/{selector-health-DhzDZLlF.js → selector-health-BP45B44s.js} +1 -1
  49. package/lib/public/assets/{selector-health-page-w5zIE-r8.js → selector-health-page-D-8SdN_l.js} +1 -1
  50. package/lib/public/assets/{session-detail-page-CiPVLY-1.js → session-detail-page-Dm4tnoTT.js} +1 -1
  51. package/lib/public/assets/{settings-Bm-LdOxO.js → settings-ChfaAd8F.js} +1 -1
  52. package/lib/public/assets/{status-pill-outline-BgQ_Ur6B.js → status-pill-outline-CLa0C1Sg.js} +1 -1
  53. package/lib/public/assets/{tablet-1GdHxaSx.js → tablet-0sIFwy2Z.js} +1 -1
  54. package/lib/public/assets/{teams-D8rZexDl.js → teams-BFhWbK5i.js} +1 -1
  55. package/lib/public/assets/{trash-2-DJgpvIoq.js → trash-2-BcQxmJP-.js} +1 -1
  56. package/lib/public/assets/{upload-BJ0V1QbY.js → upload-BucqEWub.js} +1 -1
  57. package/lib/public/assets/{use-password-reset-mode-BVFQr1mo.js → use-password-reset-mode-XoxXVCzm.js} +1 -1
  58. package/lib/public/assets/{users-Bxnci4rK.js → users-B7uveXL_.js} +1 -1
  59. package/lib/public/assets/{users-DUb_rmxk.js → users-DyB6E3FF.js} +1 -1
  60. package/lib/public/assets/{webhook-settings-DL54Ijod.js → webhook-settings-qoHAETzC.js} +1 -1
  61. package/lib/public/assets/{zap-BLSqrVs9.js → zap-CqGOjAjn.js} +1 -1
  62. package/lib/public/index.html +1 -1
  63. package/lib/src/app/routers/control.js +18 -15
  64. package/lib/src/app/routers/recordings.js +5 -3
  65. package/lib/src/services/VideoPipelineService.js +44 -14
  66. package/lib/src/services/fillMissingScreenSize.js +50 -0
  67. package/lib/src/services/recording/RecordingOrchestrator.js +103 -2
  68. package/lib/src/services/recording/activeRecordings.js +8 -2
  69. package/lib/src/services/recording/annotation-render.js +189 -47
  70. package/lib/src/services/recording/probeDuration.js +21 -0
  71. package/lib/src/services/recording/proof-bundle.js +38 -15
  72. package/lib/src/services/recording/recordingTiming.js +86 -0
  73. package/lib/test/unit/active-recordings.spec.js +8 -0
  74. package/lib/test/unit/annotation-render.spec.js +226 -0
  75. package/lib/test/unit/composite-geometry.spec.js +80 -0
  76. package/lib/test/unit/fill-missing-screen-size.spec.js +65 -0
  77. package/lib/test/unit/proof-bundle.spec.js +65 -0
  78. package/lib/test/unit/recording-orchestrator.spec.js +95 -0
  79. package/lib/test/unit/recording-timing.spec.js +88 -0
  80. package/lib/tsconfig.tsbuildinfo +1 -1
  81. package/package.json +1 -1
  82. package/lib/public/assets/DeviceMosaicView-D4uKl1Gv.js +0 -2
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-DzAXi4vj.js","assets/labels-C21SA4JG.js","assets/funnel-DR8YKoFW.js","assets/arrow-right-D_onnhWU.js","assets/tablet-1GdHxaSx.js","assets/activity-CHfTPuBn.js","assets/page-header-CqaoOYPH.js","assets/page-header-TkpFo69t.css","assets/device-explorer-BjrTj6Sm.js","assets/button-Do8mBvkU.js","assets/utils-CDN07tui.js","assets/button-BcBq3nMd.css","assets/select-DVYczzD1.js","assets/select-_gbV-uJG.css","assets/BugReportButton-0m4q010L.js","assets/BugReportButton-DFLx1uf_.css","assets/Modal-LXKxgyV7.js","assets/Modal-CkhpaXeX.css","assets/FieldGroup-oWAJBBAu.js","assets/FieldGroup-trY-2qmW.css","assets/clock-CQLUBaRx.js","assets/plus-CJfVcjJv.js","assets/copy-CWx0Ec1c.js","assets/upload-BJ0V1QbY.js","assets/time-B8FIgwPE.js","assets/mouse-pointer-2-BD4cWXDU.js","assets/layers-DprXM0fz.js","assets/zap-BLSqrVs9.js","assets/check-C8Un1cwf.js","assets/chevron-right-DHjIgZvn.js","assets/keycodes-bIEJfQzr.js","assets/download-DJ_pjhGv.js","assets/trash-2-DJgpvIoq.js","assets/lock-BXGh7bJZ.js","assets/SegmentedControl-BSWMM3qE.js","assets/device-explorer-CCbOXiB6.css","assets/builds-page-CQseApdL.js","assets/status-pill-outline-BgQ_Ur6B.js","assets/circle-x-BPKWtaZx.js","assets/circle-check-Dkg-Ka4_.js","assets/input-CKKtQEU5.js","assets/input-B5edaXfx.css","assets/session-detail-page-CiPVLY-1.js","assets/arrow-left-QDqb-yc1.js","assets/arrow-up-right-DOwr8XxB.js","assets/EmptyState-CTmGgoSm.js","assets/EmptyState-BSDHFxd1.css","assets/Table-EHWJCCzN.js","assets/Table-BIjXN_-_.css","assets/network-C5bJeATc.js","assets/session-detail-page-Bzzc3bMl.css","assets/runbook-page-B7EjVqsY.js","assets/runbook-page-BFqSC-Ta.css","assets/apps-Dp4crlsn.js","assets/apps-DJMD5JOy.css","assets/webhook-settings-DL54Ijod.js","assets/webhook-settings-CAfLaykw.css","assets/settings-Dep_3kbA.css","assets/settings-Bm-LdOxO.js","assets/SettingCard-CeHOIGW9.js","assets/SettingCard-CiKM8yKg.css","assets/calendar-DrH0mjSD.js","assets/ai-settings-B_dT4ctk.js","assets/maintenance-settings-w8U3BRZk.js","assets/api-keys-BIKaKigW.js","assets/teams-D8rZexDl.js","assets/users-DUb_rmxk.js","assets/selector-health-page-w5zIE-r8.js","assets/selector-health-DhzDZLlF.js","assets/selector-health-BlICzZlk.css","assets/selector-detail-page-C6b-Z-ep.js","assets/DeviceMosaicView-D4uKl1Gv.js","assets/profile-page-Mk1yk1c4.js","assets/users-Bxnci4rK.js","assets/login-DOYeWP9H.js","assets/use-password-reset-mode-BVFQr1mo.js","assets/auth-shell-NbHUThYR.js","assets/forgot-password-MmPdS0S2.js","assets/reset-password-D1gtSgzr.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-DrTe5eJi.js","assets/labels-C21SA4JG.js","assets/funnel-SD4F5IdR.js","assets/arrow-right-FEQsqDvH.js","assets/tablet-0sIFwy2Z.js","assets/activity-B6x69oOy.js","assets/page-header-DhD-Kua9.js","assets/page-header-TkpFo69t.css","assets/device-explorer-CIjs3BXP.js","assets/button-DrqhMLZ0.js","assets/utils-CDN07tui.js","assets/button-BcBq3nMd.css","assets/select-Cfv-njLE.js","assets/select-_gbV-uJG.css","assets/BugReportButton-Sk0KGufH.js","assets/BugReportButton-DFLx1uf_.css","assets/Modal-C5W8lMJ6.js","assets/Modal-CkhpaXeX.css","assets/FieldGroup-DmYZP2j7.js","assets/FieldGroup-trY-2qmW.css","assets/clock-BCG0drfS.js","assets/plus-B75ovH3O.js","assets/copy-BKOm9hko.js","assets/upload-BucqEWub.js","assets/time-B8FIgwPE.js","assets/mouse-pointer-2-C6yy1DTx.js","assets/layers-CLuKN5Oy.js","assets/zap-CqGOjAjn.js","assets/check-DYccNk73.js","assets/chevron-right-C6ny35i3.js","assets/keycodes-bIEJfQzr.js","assets/download-R2k7Nd4P.js","assets/trash-2-BcQxmJP-.js","assets/lock-s9ZhGDFF.js","assets/SegmentedControl-BIzlKyUd.js","assets/device-explorer-CCbOXiB6.css","assets/builds-page-FfsUegKZ.js","assets/status-pill-outline-CLa0C1Sg.js","assets/circle-x-BhUzyxKR.js","assets/circle-check-Cokzy9a2.js","assets/input-Ilib6feD.js","assets/input-B5edaXfx.css","assets/session-detail-page-Dm4tnoTT.js","assets/arrow-left-CaOe18yC.js","assets/arrow-up-right-Dnszb73S.js","assets/EmptyState-CQun3BJE.js","assets/EmptyState-BSDHFxd1.css","assets/Table-DRkkM4OR.js","assets/Table-BIjXN_-_.css","assets/network-B8fPwmW9.js","assets/session-detail-page-Bzzc3bMl.css","assets/runbook-page-Dq3wdSII.js","assets/runbook-page-BFqSC-Ta.css","assets/apps-CePIfnu9.js","assets/apps-DJMD5JOy.css","assets/webhook-settings-qoHAETzC.js","assets/webhook-settings-CAfLaykw.css","assets/settings-Dep_3kbA.css","assets/settings-ChfaAd8F.js","assets/SettingCard-DAFqQw7S.js","assets/SettingCard-CiKM8yKg.css","assets/calendar-BuRuUa7q.js","assets/ai-settings-CSZQis7F.js","assets/maintenance-settings-yYhZaU7n.js","assets/api-keys-4ddjSngL.js","assets/teams-BFhWbK5i.js","assets/users-DyB6E3FF.js","assets/selector-health-page-D-8SdN_l.js","assets/selector-health-BP45B44s.js","assets/selector-health-BlICzZlk.css","assets/selector-detail-page-8xf4CxH5.js","assets/DeviceMosaicView-O292tZkA.js","assets/profile-page-C2p5rB3x.js","assets/users-B7uveXL_.js","assets/login-EkaxK7K5.js","assets/use-password-reset-mode-XoxXVCzm.js","assets/auth-shell-Vq1rYIVD.js","assets/forgot-password-CiZcr-gB.js","assets/reset-password-tCemYrqV.js"])))=>i.map(i=>d[i]);
2
2
  function Kf(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gu={exports:{}},mr={};/*
3
3
  object-assign
4
4
  (c) Sindre Sorhus
@@ -211,4 +211,4 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const sy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ly=F("x",sy),$i={"X-Appium-Is-Sensitive":"true"},yt="/xenon/api/auth";class eu extends Error{constructor(t,n,r=null){super(t),this.status=n,this.retryAfterSec=r,this.name="LoginError"}}async function dv(e,t){let n;try{n=await fetch(`${yt}/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({email:e,password:t})})}catch(r){throw new eu(r.message||"Network error",0)}if(!n.ok){const r=await n.json().catch(()=>({})),i=Number(n.headers.get("Retry-After"));throw new eu(r.error||`Login failed (${n.status})`,n.status,Number.isFinite(i)&&i>0?i:null)}}async function pv(){try{const e=await fetch(`${yt}/options`,{credentials:"include"});return e.ok?{passwordReset:(await e.json()).passwordReset==="email"?"email":"admin"}:{passwordReset:"admin"}}catch{return{passwordReset:"admin"}}}async function ay(){await fetch(`${yt}/logout`,{method:"POST",credentials:"include"})}async function uy(){const e=await fetch(`${yt}/me`,{credentials:"include"});if(e.status===401)return null;if(!e.ok)throw new Error(`Failed to fetch /me (${e.status})`);return e.json()}async function hv(e,t){const n=await fetch(`${yt}/change-password`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({oldPassword:e,newPassword:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Change password failed (${n.status})`)}}async function mv(e){const t=await fetch(`${yt}/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok&&t.status!==204)throw t.status===429?new Error("Too many attempts — try again later."):new Error(`Request failed (${t.status})`)}async function yv(e){return(await fetch(`${yt}/reset-password/check`,{method:"POST",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({token:e})})).ok}async function gv(e,t){const n=await fetch(`${yt}/reset-password`,{method:"POST",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({token:e,newPassword:t})});if(!n.ok&&n.status!==204){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Reset failed (${n.status})`)}}const vl="xenon.hadSession";function cy(){try{localStorage.setItem(vl,"1")}catch{}}function fy(){try{localStorage.removeItem(vl)}catch{}}function dy(){try{return localStorage.getItem(vl)==="1"}catch{return!1}}const Tf=g.createContext(null);function py({children:e}){const[t,n]=g.useState(!0),[r,i]=g.useState(null);async function o(){try{const l=await uy();l&&cy(),i(l)}finally{n(!1)}}async function s(){fy(),await ay(),i(null),window.location.href="/xenon/login"}return g.useEffect(()=>{o()},[]),p.jsx(Tf.Provider,{value:{loading:t,me:r,refresh:o,signOut:s},children:e})}function wl(){const e=g.useContext(Tf);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const De=Object.create(null);De.open="0";De.close="1";De.ping="2";De.pong="3";De.message="4";De.upgrade="5";De.noop="6";const Qr=Object.create(null);Object.keys(De).forEach(e=>{Qr[De[e]]=e});const fs={type:"error",data:"parser error"},Rf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Pf=typeof ArrayBuffer=="function",Nf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,kl=({type:e,data:t},n,r)=>Rf&&t instanceof Blob?n?r(t):tu(t,r):Pf&&(t instanceof ArrayBuffer||Nf(t))?n?r(t):tu(new Blob([t]),r):r(De[e]+(t||"")),tu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function nu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let yo;function hy(e,t){if(Rf&&e.data instanceof Blob)return e.data.arrayBuffer().then(nu).then(t);if(Pf&&(e.data instanceof ArrayBuffer||Nf(e.data)))return t(nu(e.data));kl(e,!1,n=>{yo||(yo=new TextEncoder),t(yo.encode(n))})}const ru="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Un=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ru.length;e++)Un[ru.charCodeAt(e)]=e;const my=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),m=new Uint8Array(u);for(r=0;r<n;r+=4)o=Un[e.charCodeAt(r)],s=Un[e.charCodeAt(r+1)],l=Un[e.charCodeAt(r+2)],a=Un[e.charCodeAt(r+3)],m[i++]=o<<2|s>>4,m[i++]=(s&15)<<4|l>>2,m[i++]=(l&3)<<6|a&63;return u},yy=typeof ArrayBuffer=="function",xl=(e,t)=>{if(typeof e!="string")return{type:"message",data:Of(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:gy(e.substring(1),t)}:Qr[n]?e.length>1?{type:Qr[n],data:e.substring(1)}:{type:Qr[n]}:fs},gy=(e,t)=>{if(yy){const n=my(e);return Of(n,t)}else return{base64:!0,data:e}},Of=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Lf="",vy=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{kl(o,!1,l=>{r[s]=l,++i===n&&t(r.join(Lf))})})},wy=(e,t)=>{const n=e.split(Lf),r=[];for(let i=0;i<n.length;i++){const o=xl(n[i],t);if(r.push(o),o.type==="error")break}return r};function ky(){return new TransformStream({transform(e,t){hy(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let go;function Dr(e){return e.reduce((t,n)=>t+n.length,0)}function Mr(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xy(e,t){go||(go=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Dr(n)<1)break;const a=Mr(n,1);o=(a[0]&128)===128,i=a[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Dr(n)<2)break;const a=Mr(n,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),r=3}else if(r===2){if(Dr(n)<8)break;const a=Mr(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),m=u.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(fs);break}i=m*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Dr(n)<i)break;const a=Mr(n,i);l.enqueue(xl(o?a:go.decode(a),t)),r=0}if(i===0||i>e){l.enqueue(fs);break}}}})}const jf=4;function G(e){if(e)return Ey(e)}function Ey(e){for(var t in G.prototype)e[t]=G.prototype[t];return e}G.prototype.on=G.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};G.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};G.prototype.off=G.prototype.removeListener=G.prototype.removeAllListeners=G.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};G.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};G.prototype.emitReserved=G.prototype.emit;G.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};G.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ui=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_y="arraybuffer";function Af(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Sy=ve.setTimeout,Cy=ve.clearTimeout;function Bi(e,t){t.useNativeTimers?(e.setTimeoutFn=Sy.bind(ve),e.clearTimeoutFn=Cy.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const Ty=1.33;function Ry(e){return typeof e=="string"?Py(e):Math.ceil((e.byteLength||e.size)*Ty)}function Py(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function If(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ny(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Oy(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Ly extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class El extends G{constructor(t){super(),this.writable=!1,Bi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ly(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=xl(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Ny(t);return n.length?"?"+n:""}}class jy extends El{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wy(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,vy(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=If()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Df=!1;try{Df=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ay=Df;function Iy(){}class Dy extends jy{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ie extends G{constructor(t,n,r){super(),this.createRequest=t,Bi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Af(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ie.requestsCount++,Ie.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Iy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ie.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ie.requestsCount=0;Ie.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",iu);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,iu,!1)}}function iu(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}const My=function(){const e=Mf({xdomain:!1});return e&&e.responseType!==null}();class $y extends Dy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=My&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ie(Mf,this.uri(),t)}}function Mf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ay))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Uy extends El{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=$f?{}:Af(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;kl(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&Ui(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=If()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const vo=ve.WebSocket||ve.MozWebSocket;class By extends Uy{createSocket(t,n,r){return $f?new vo(t,n,r):n?new vo(t,n):new vo(t)}doWrite(t,n){this.ws.send(n)}}class zy extends El{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=ky();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:l,value:a})=>{l||(this.onPacket(a),o())}).catch(l=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Ui(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Fy={websocket:By,webtransport:zy,polling:$y},by=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ds(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=by.exec(e||""),o={},s=14;for(;s--;)o[Vy[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=qy(o,o.path),o.queryKey=Wy(o,o.query),o}function qy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Wy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const ps=typeof addEventListener=="function"&&typeof removeEventListener=="function",Gr=[];ps&&addEventListener("offline",()=>{Gr.forEach(e=>e())},!1);class lt extends G{constructor(t,n){if(super(),this.binaryType=_y,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ds(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ds(n.host).host);Bi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Oy(this.opts.query)),ps&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Gr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=jf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&lt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",lt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Ry(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ui(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(lt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ps&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Gr.indexOf(this._offlineEventListener);r!==-1&&Gr.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}lt.protocol=jf;class Hy extends lt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;lt.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",v=>{if(!r)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;lt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const s=v=>{const h=new Error("probe error: "+v);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function a(){s("socket closed")}function u(v){n&&v.name!==n.name&&o()}const m=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",l),this.off("close",a),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",l),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Ky=class extends Hy{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Fy[i]).filter(i=>!!i)),super(t,r)}};function Qy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ds(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const Gy=typeof ArrayBuffer=="function",Yy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Uf=Object.prototype.toString,Xy=typeof Blob=="function"||typeof Blob<"u"&&Uf.call(Blob)==="[object BlobConstructor]",Jy=typeof File=="function"||typeof File<"u"&&Uf.call(File)==="[object FileConstructor]";function _l(e){return Gy&&(e instanceof ArrayBuffer||Yy(e))||Xy&&e instanceof Blob||Jy&&e instanceof File}function Yr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yr(e[n]))return!0;return!1}if(_l(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yr(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yr(e[n]))return!0;return!1}function Zy(e){const t=[],n=e.data,r=e;return r.data=hs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function hs(e,t){if(!e)return e;if(_l(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=hs(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=hs(e[r],t));return n}return e}function eg(e,t){return e.data=ms(e.data,t),delete e.attachments,e}function ms(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ms(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ms(e[n],t));return e}const tg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var D;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(D||(D={}));class ng{constructor(t){this.replacer=t}encode(t){return(t.type===D.EVENT||t.type===D.ACK)&&Yr(t)?this.encodeAsBinary({type:t.type===D.EVENT?D.BINARY_EVENT:D.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===D.BINARY_EVENT||t.type===D.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Zy(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Sl extends G{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===D.BINARY_EVENT;r||n.type===D.BINARY_ACK?(n.type=r?D.EVENT:D.ACK,this.reconstructor=new rg(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_l(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(D[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===D.BINARY_EVENT||r.type===D.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Sl.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case D.CONNECT:return ou(n);case D.DISCONNECT:return n===void 0;case D.CONNECT_ERROR:return typeof n=="string"||ou(n);case D.EVENT:case D.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tg.indexOf(n[0])===-1);case D.ACK:case D.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rg{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eg(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ou(e){return Object.prototype.toString.call(e)==="[object Object]"}const ig=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Sl,Encoder:ng,get PacketType(){return D}},Symbol.toStringTag,{value:"Module"}));function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const og=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Bf extends G{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Re(t,"open",this.onopen.bind(this)),Re(t,"packet",this.onpacket.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(og.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:D.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,v=n.pop();this._registerAckCallback(m,v),s.id=m}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),s=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,l)=>s?i(s):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:D.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case D.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case D.EVENT:case D.BINARY_EVENT:this.onevent(t);break;case D.ACK:case D.BINARY_ACK:this.onack(t);break;case D.DISCONNECT:this.ondisconnect();break;case D.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:D.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:D.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function yn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}yn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};yn.prototype.reset=function(){this.attempts=0};yn.prototype.setMin=function(e){this.ms=e};yn.prototype.setMax=function(e){this.max=e};yn.prototype.setJitter=function(e){this.jitter=e};class ys extends G{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Bi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||ig;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ky(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Re(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=Re(n,"error",o);if(this._timeout!==!1){const l=this._timeout,a=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Re(t,"ping",this.onping.bind(this)),Re(t,"data",this.ondata.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this)),Re(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ui(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Bf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ln={};function Xr(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Qy(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=Ln[i]&&o in Ln[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let a;return l?a=new ys(r,t):(Ln[i]||(Ln[i]=new ys(r,t)),a=Ln[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Xr,{Manager:ys,Socket:Bf,io:Xr,connect:Xr});let wo=null;const Bn=new Map;function sg(e,t){const n=Bn.get(e);n&&Array.from(n).forEach(r=>r(t))}function lg(){if(wo)return wo;const e=Xr(window.location.origin,{path:"/socket.io",reconnection:!0,withCredentials:!0});return e.on("connect",()=>{console.log("[Socket] Connected to Hub"),e.emit("register_dashboard")}),e.on("disconnect",()=>{console.log("[Socket] Disconnected from Hub")}),e.onAny((t,n)=>sg(t,n)),wo=e,e}function ag(e,t){let n=Bn.get(e);return n||(n=new Set,Bn.set(e,n)),n.add(t),()=>{const r=Bn.get(e);r&&(r.delete(t),r.size===0&&Bn.delete(e))}}const ug=()=>{const[e]=g.useState(lg),[t,n]=g.useState(e.connected);g.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1);return e.on("connect",i),e.on("disconnect",o),n(e.connected),()=>{e.off("connect",i),e.off("disconnect",o)}},[e]);const r=g.useCallback((i,o)=>ag(i,o),[]);return{socket:e,isConnected:t,on:r}},cg=6e4;function fg(e,t,n,r=!0){if(e)return{tone:"live",label:"Live",title:"Connected to the Xenon server. Updates stream in as they happen."};const i=t??n;if(n-i<cg)return r?{tone:"reconnecting",label:"Reconnecting…",title:"Lost the connection to the Xenon server. Retrying automatically."}:{tone:"reconnecting",label:"Connecting…",title:"Connecting to the Xenon server."};const o=new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return{tone:"down",label:`Disconnected · since ${o}`,title:`No connection to the Xenon server since ${o}. What's on screen may be out of date.`}}function dg(){const{isConnected:e}=ug(),[t,n]=g.useState(null),[r,i]=g.useState(()=>Date.now()),[o,s]=g.useState(e);return g.useEffect(()=>{n(e?null:Date.now()),e&&s(!0)},[e]),g.useEffect(()=>{if(e)return;const l=window.setInterval(()=>i(Date.now()),5e3);return()=>window.clearInterval(l)},[e]),fg(e,t,r,o)}const zf="xenon.theme",su="dark",Ff="(prefers-color-scheme: light)";function pg(){try{const e=localStorage.getItem(zf);return e==="light"||e==="system"||e==="dark"?e:su}catch{return su}}function bf(e,t){return e==="system"?t?"light":"dark":e}function hg(){return typeof window.matchMedia=="function"&&window.matchMedia(Ff).matches}function Vf(e){document.documentElement.setAttribute("data-theme",e)}function mg(e){try{localStorage.setItem(zf,e)}catch{}Vf(bf(e,hg()))}function yg(){const[e,t]=g.useState(pg);return g.useEffect(()=>{var o;if(e!=="system"||typeof window.matchMedia!="function")return;const r=window.matchMedia(Ff),i=()=>Vf(bf("system",r.matches));return(o=r.addEventListener)==null||o.call(r,"change",i),()=>{var s;return(s=r.removeEventListener)==null?void 0:s.call(r,"change",i)}},[e]),[e,r=>{mg(r),t(r)}]}function gg({className:e,alt:t="Xenon"}){const n="/xenon/";return p.jsxs(p.Fragment,{children:[p.jsx("img",{src:`${n}logo.svg`,alt:t,className:`logo-for-dark ${e??""}`}),p.jsx("img",{src:`${n}logo-light.svg`,alt:t,className:`logo-for-light ${e??""}`})]})}const vg=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],wg=()=>{const e=mn(),{me:t,signOut:n}=wl(),r=dg(),[i,o]=yg(),[s,l]=g.useState(!1),a=g.useRef(null),u=((t==null?void 0:t.name)??"A").split(" ").map(h=>h[0]).slice(0,2).join("").toUpperCase(),m=(t==null?void 0:t.role)==="SUPER_ADMIN"?"Super admin":(t==null?void 0:t.role)==="ADMIN"?"Admin":"Member";g.useEffect(()=>{const h=E=>{a.current&&!a.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const v=()=>window.dispatchEvent(new CustomEvent("xenon.open-command-palette"));return p.jsx("header",{className:"fixed top-0 left-14 right-0 z-20 h-14 border-b border-[var(--border)] bg-[var(--bg)]/80 backdrop-blur-md",children:p.jsxs("div",{className:"flex items-center h-full px-4 gap-4",children:[p.jsx("button",{type:"button",onClick:()=>e("/overview"),className:"flex items-center gap-3 min-w-0 cursor-pointer","aria-label":"Xenon home",children:p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(gg,{alt:"Xenon Logo",className:"h-8 w-auto object-contain"})})}),p.jsx("div",{className:"flex-1 max-w-xl mx-auto",children:p.jsxs("button",{type:"button",onClick:v,className:"relative w-full h-9 flex items-center text-left","aria-label":"Open command palette",children:[p.jsx("div",{className:"w-full h-9 pl-9 pr-14 rounded-md bg-[var(--surface)] border border-[var(--border)] text-sm text-[var(--text-dim)] hover:border-[var(--border-strong)] hover:text-[var(--text)] transition-colors flex items-center",children:"Search devices, sessions, settings…"}),p.jsx(Cf,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--text-dim)]"}),p.jsx("kbd",{className:"absolute right-3 top-1/2 -translate-y-1/2 font-mono text-[10px] text-[var(--text-dim)] border border-[var(--border)] rounded px-1.5 py-0.5",children:"⌘K"})]})}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{role:"status",title:r.title,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border ${r.tone==="live"?"bg-[var(--color-success)]/10 border-[var(--color-success)]/20 text-[var(--color-success)]":r.tone==="reconnecting"?"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-[var(--amber)]":"bg-[var(--red)]/10 border-[var(--red)]/25 text-[var(--red)]"}`,children:[p.jsx("span",{className:`h-1.5 w-1.5 rounded-full bg-current ${r.tone==="live"?"pulse-dot":""}`,"aria-hidden":"true"}),p.jsx("span",{className:"text-[11px] font-medium",children:r.label})]}),p.jsxs("div",{className:"relative",ref:a,children:[p.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 pl-1.5 pr-2.5 rounded-md border border-[var(--border)] hover:border-[var(--border-strong)] hover:bg-[var(--surface)] transition-colors",onClick:()=>l(h=>!h),"aria-haspopup":"true","aria-expanded":s,children:[p.jsx("span",{className:"h-6 w-6 rounded-full bg-[var(--color-accent)]/15 text-[var(--color-accent)] text-[11px] font-semibold flex items-center justify-center",children:u}),p.jsxs("span",{className:"flex flex-col items-start leading-tight",children:[p.jsx("span",{className:"text-xs text-[var(--text)]",children:(t==null?void 0:t.name)??"Account"}),p.jsx("span",{className:"text-[10px] text-[var(--text-dim)]",children:m})]}),p.jsx(_m,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"})]}),s&&p.jsxs("div",{className:"absolute top-full right-0 mt-2 w-64 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden",children:[p.jsxs("div",{className:"px-3 py-2",children:[p.jsx("div",{className:"text-[11px] text-[var(--text-dim)] mb-1",children:"System"}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--text)]",children:[p.jsx("span",{className:"text-[var(--text-muted)]",children:"Version"}),p.jsxs("span",{className:"font-mono text-[var(--text-muted)]",children:["v","1.22.0"]})]})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("div",{className:"px-3 py-2 flex items-center justify-between gap-2",children:[p.jsx("span",{id:"theme-label",className:"text-xs text-[var(--text-muted)]",children:"Theme"}),p.jsx("div",{className:"seg seg-sm",role:"radiogroup","aria-labelledby":"theme-label",children:vg.map(h=>p.jsx("button",{type:"button",role:"radio","aria-checked":i===h.value,className:`seg-btn${i===h.value?" seg-btn-active":""}`,onClick:()=>o(h.value),children:h.label},h.value))})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("button",{type:"button",onClick:()=>{l(!1),e("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--bg)] text-left",children:[p.jsx(ry,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"}),"Profile"]}),t!=null&&t.authDisabled?p.jsx("p",{className:"px-3 py-2 text-xs text-[var(--text-muted)]",children:"Sign-in is off on this server."}):p.jsxs("button",{type:"button",onClick:()=>{l(!1),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--red)] hover:bg-[var(--bg)] text-left",children:[p.jsx(Bm,{className:"h-3.5 w-3.5"}),"Logout"]})]})]})]})]})})};class kg extends g.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReset=()=>{this.setState({hasError:!1}),window.location.reload()}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?this.props.fallback||p.jsxs("div",{className:"error-boundary-container",style:{padding:"4rem 2rem",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"1.5rem",color:"var(--text)",background:"var(--bg-main)",minHeight:"100vh"},children:[p.jsx("div",{style:{color:"var(--accent-red)"},children:p.jsx(Xm,{size:64})}),p.jsx("h2",{style:{fontSize:"2rem",fontWeight:700,margin:0},children:"Component exception detected"}),p.jsx("p",{style:{color:"var(--text-muted)",maxWidth:"500px",lineHeight:1.6},children:"An unexpected error occurred while rendering this section. Xenon's isolation engine has contained the fault to prevent a total system crash."}),this.state.error&&p.jsx("pre",{style:{background:"rgb(var(--rgb-black) / 0.3)",padding:"1rem",borderRadius:"8px",fontSize:"0.8rem",color:"var(--accent-red)",maxWidth:"80%",overflowX:"auto"},children:this.state.error.message}),p.jsxs("button",{onClick:this.handleReset,style:{background:"var(--color-accent)",color:"var(--secondary)",border:"none",padding:"0.75rem 2rem",borderRadius:"8px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",transition:"all 0.2s"},onMouseOver:t=>t.currentTarget.style.transform="translateY(-2px)",onMouseOut:t=>t.currentTarget.style.transform="translateY(0)",children:[p.jsx(Sf,{size:18}),"Reload application"]})]}):this.props.children}}const xg=g.lazy(()=>Q(()=>import("./overview-DzAXi4vj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),lu=g.lazy(()=>Q(()=>import("./device-explorer-BjrTj6Sm.js"),__vite__mapDeps([8,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,5,1,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),au=g.lazy(()=>Q(()=>import("./builds-page-CQseApdL.js"),__vite__mapDeps([36,37,24,5,38,39,40,10,41,12,13,20,9,11,31,1,29,4,6,7]))),Eg=g.lazy(()=>Q(()=>import("./session-detail-page-CiPVLY-1.js"),__vite__mapDeps([42,37,24,14,15,43,29,22,44,45,46,47,48,16,17,31,49,1,50]))),_g=g.lazy(()=>Q(()=>import("./runbook-page-B7EjVqsY.js"),__vite__mapDeps([51,43,52]))),Sg=g.lazy(()=>Q(()=>import("./apps-Dp4crlsn.js"),__vite__mapDeps([53,24,9,10,11,6,7,12,13,23,28,22,27,31,32,54]))),Cg=g.lazy(()=>Q(()=>import("./webhook-settings-DL54Ijod.js"),__vite__mapDeps([55,18,19,6,7,32,21,38,39,27,5,56,57])).then(e=>({default:e.WebhookSettings}))),Tg=g.lazy(()=>Q(()=>import("./settings-Bm-LdOxO.js"),__vite__mapDeps([58,59,9,10,11,60,16,17,6,7,39,20,25,28,5,61,44,57])).then(e=>({default:e.Settings}))),Rg=g.lazy(()=>Q(()=>import("./ai-settings-B_dT4ctk.js"),__vite__mapDeps([62,59,9,10,11,60,6,7,33,39,5,57])).then(e=>({default:e.AISettings}))),Pg=g.lazy(()=>Q(()=>import("./maintenance-settings-w8U3BRZk.js"),__vite__mapDeps([63,59,9,10,11,60,6,7,32,28,61,57])).then(e=>({default:e.MaintenanceSettings}))),Ng=g.lazy(()=>Q(()=>import("./api-keys-BIKaKigW.js"),__vite__mapDeps([64,24,47,48,18,19,6,7,16,17,9,10,11,40,41,12,13,21,32,28,22,57])).then(e=>({default:e.ApiKeys}))),Og=g.lazy(()=>Q(()=>import("./teams-D8rZexDl.js"),__vite__mapDeps([65,24,47,48,18,19,6,7,16,17,9,10,11,40,41,12,13,66,21,43,32,57])).then(e=>({default:e.Teams}))),Lg=g.lazy(()=>Q(()=>import("./selector-health-page-w5zIE-r8.js"),__vite__mapDeps([67,27,68,69,39,16,17,28,22,24,45,46,6,7,34,1,2,29,44]))),jg=g.lazy(()=>Q(()=>import("./selector-detail-page-C6b-Z-ep.js"),__vite__mapDeps([70,24,6,7,68,69,26,39,27,28,22]))),Ag=g.lazy(()=>Q(()=>import("./DeviceMosaicView-D4uKl1Gv.js"),__vite__mapDeps([71,1,30,6,7]))),Ig=g.lazy(()=>Q(()=>import("./profile-page-Mk1yk1c4.js"),__vite__mapDeps([72,6,7,24,12,10,13,22,32]))),Dg=g.lazy(()=>Q(()=>import("./users-Bxnci4rK.js"),__vite__mapDeps([73,66,24,6,7,9,10,11,40,41,12,13,21,32]))),Mg=()=>p.jsxs("div",{className:"flex items-center justify-center gap-2 h-full text-xs text-[var(--text-dim)]",children:[p.jsx(Sf,{className:"animate-spin",size:14}),p.jsx("span",{children:"Hydrating view…"})]}),$g=()=>p.jsx(kg,{children:p.jsx(g.Suspense,{fallback:p.jsx(Mg,{}),children:p.jsxs(Ef,{children:[p.jsx($,{path:"/",element:p.jsx(qt,{to:"/overview",replace:!0})}),p.jsx($,{path:"/overview",element:p.jsx(xg,{})}),p.jsx($,{path:"/devices",element:p.jsx(lu,{})}),p.jsx($,{path:"/devices/:udid/control/:tab?",element:p.jsx(lu,{})}),p.jsx($,{path:"/apps",element:p.jsx(Sg,{})}),p.jsx($,{path:"/sessions",element:p.jsx(qt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/sessions/*",element:p.jsx(qt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/builds",element:p.jsx(au,{})}),p.jsx($,{path:"/builds/:buildId",element:p.jsx(au,{})}),p.jsx($,{path:"/builds/:buildId/sessions/:sessionId",element:p.jsx(Eg,{})}),p.jsx($,{path:"/notifications",element:p.jsx(Cg,{})}),p.jsx($,{path:"/settings",element:p.jsx(Tg,{})}),p.jsx($,{path:"/ai-settings",element:p.jsx(Rg,{})}),p.jsx($,{path:"/maintenance",element:p.jsx(Pg,{})}),p.jsx($,{path:"/api-keys",element:p.jsx(Ng,{})}),p.jsx($,{path:"/teams",element:p.jsx(Og,{})}),p.jsx($,{path:"/users",element:p.jsx(Dg,{})}),p.jsx($,{path:"/selector-health",element:p.jsx(Lg,{})}),p.jsx($,{path:"/selector-health/detail",element:p.jsx(jg,{})}),p.jsx($,{path:"/devices/live",element:p.jsx(Ag,{})}),p.jsx($,{path:"/runbooks/:category",element:p.jsx(_g,{})}),p.jsx($,{path:"/profile",element:p.jsx(Ig,{})}),p.jsx($,{path:"*",element:p.jsx(qt,{to:"/overview",replace:!0})})]})})});let hr=null;function uu(e){hr=e}const Ug=new Set(["device_held_by_another_user","device_in_use_by_session"]);function Bg(e){return!e||typeof e!="object"?!1:Ug.has(e.error??"")}const zg=5e3,cu=new Map;function Fg(e){if(!hr)return;const t=Date.now(),n=cu.get(e)??0;t-n<zg||(cu.set(e,t),hr(e,"error"))}class qf extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}}async function ko(e,t){if(e.status===403){const n=await e.clone().json().catch(()=>({})),r=n&&(n.error||n.message)||"You do not have permission for this action.";hr&&hr(r,"error")}if(e.status===409){const n=await e.clone().json().catch(()=>({}));Bg(n)&&Fg(n.message||"This device is in use by another user.")}if(e.status===204||e.status===205)return null;if(t&&(e.status<200||e.status>=300)){const n=await e.json().catch(()=>null),r=n&&typeof n=="object"&&(n.error||n.message)||`Request failed (${e.status})`;throw new qf(String(r),e.status,n)}return e.json()}class bg{makeGETRequest(t){return fetch(this.formatUrl(t)).then(n=>ko(n,!1))}makePOSTRequest(t,n,r,i={},o={}){return fetch(this.formatUrl(t),{method:"POST",body:JSON.stringify(r||{}),headers:{"Content-Type":"application/json"},...i}).then(s=>ko(s,!o.resolveErrors))}makeDELETERequest(t,n={}){return fetch(this.formatUrl(t),{method:"DELETE"}).then(r=>ko(r,!n.resolveErrors))}formatUrl(t){return`/xenon/api${t}`}}const R=new bg;function wv(e){return e instanceof qf?`The server rejected the change: ${e.message}`:"Couldn't reach the Xenon server. Check your connection and try again."}const Wf=g.createContext(void 0),kv=()=>{const e=g.useContext(Wf);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},Vg=({children:e})=>{const[t,n]=g.useState([]),r=g.useCallback(o=>{n(s=>s.filter(l=>l.id!==o))},[]),i=g.useCallback((o,s="info",l=4e3)=>{const a=Math.random().toString(36).substring(2,9);return n(u=>[...u,{id:a,message:o,type:s,duration:l}]),s!=="loading"&&l>0&&setTimeout(()=>{r(a)},l),a},[r]);return g.useEffect(()=>(uu((o,s="info")=>i(o,s)),()=>uu(null)),[i]),p.jsxs(Wf.Provider,{value:{toast:i,removeToast:r},children:[e,p.jsx("div",{className:"toast-container","aria-live":"polite","aria-atomic":"true",role:"status",children:t.map(o=>p.jsxs("div",{className:`toast-item toast-${o.type} animate-slide-in`,children:[p.jsxs("div",{className:"toast-icon",children:[o.type==="success"&&p.jsx(Rm,{size:18}),o.type==="error"&&p.jsx(Cm,{size:18}),o.type==="info"&&p.jsx(Lm,{size:18}),o.type==="loading"&&p.jsx($m,{size:18,className:"animate-spin"})]}),p.jsx("div",{className:"toast-message",children:o.message}),p.jsx("button",{className:"toast-close",onClick:()=>r(o.id),"aria-label":`Close ${o.type} notification`,children:p.jsx(ly,{size:14})})]},o.id))})]})},qg=[{id:"overview",label:"Overview",icon:Dm,path:"/overview"},{id:"devices",label:"Devices",icon:Gm,path:"/devices"},{id:"live-devices",label:"Live devices",icon:Zm,path:"/devices/live"},{id:"apps",label:"Apps",icon:mm,path:"/apps"},{id:"sessions",label:"Sessions",icon:Fm,path:"/builds"},{id:"selector-health",label:"Selector health",icon:Nm,path:"/selector-health"},{id:"notifications",label:"Notifications",icon:gm,path:"/notifications"},{id:"settings",label:"Settings",icon:Wm,path:"/settings",minRole:"ADMIN"},{id:"ai",label:"AI engine",icon:xm,path:"/ai-settings",minRole:"ADMIN"},{id:"maintenance",label:"Maintenance",icon:Km,path:"/maintenance",minRole:"ADMIN"},{id:"teams",label:"Teams",icon:oy,path:"/teams",minRole:"ADMIN"},{id:"users",label:"Users",icon:ty,path:"/users",minRole:"ADMIN"},{id:"apikeys",label:"API keys",icon:Am,path:"/api-keys",minRole:"ADMIN"}],fu={SUPER_ADMIN:3,ADMIN:2,MEMBER:1};function Wg(e,t){return t?(e?fu[e]??0:0)>=fu[t]:!0}const Hg=()=>{const e=mn(),t=We(),{me:n}=wl(),r=qg.filter(l=>Wg(n==null?void 0:n.role,l.minRole)),i=t.pathname.replace(/\/$/,"")||"/",o=r.filter(l=>i===l.path||i.startsWith(l.path+"/")).sort((l,a)=>a.path.length-l.path.length)[0],s=l=>(o==null?void 0:o.path)===l;return p.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 w-14 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col items-center py-3",children:[p.jsx("nav",{className:"flex-1 flex flex-col gap-1 w-full items-center",children:r.map(l=>{const a=l.icon,u=s(l.path);return p.jsxs("button",{type:"button",onClick:()=>e(l.path),className:`group relative w-full flex justify-center py-2.5 mx-1 rounded-md transition-colors ${u?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,"aria-label":l.label,"aria-current":u?"page":void 0,children:[p.jsx("span",{className:`absolute left-0 top-1 bottom-1 w-[3px] rounded-r transition-all ${u?"bg-[var(--color-accent)]":"bg-transparent"}`}),p.jsx(a,{className:`h-[18px] w-[18px] transition-colors ${u?"text-[var(--color-accent)]":"text-[var(--text-dim)] group-hover:text-[var(--text)]"}`,strokeWidth:u?2.25:2}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:l.label})]},l.id)})}),p.jsxs("button",{type:"button",className:"group relative w-full flex justify-center py-2.5 mt-2","aria-label":"API docs",onClick:()=>window.open(window.location.origin+"/xenon/api-docs","_blank"),children:[p.jsx(wm,{className:"h-[18px] w-[18px] text-[var(--text-dim)] group-hover:text-[var(--text)] transition-colors"}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:"API docs"})]})]})};class jn{static getDevices(){return R.makeGETRequest(`/device?t=${Date.now()}`)}static getPendingSessionsCount(){return R.makeGETRequest("/queue/length")}static getPendingSessions(){return R.makeGETRequest("/queue")}static getQueueSummary(){return R.makeGETRequest("/queue/summary")}static getQueueStatus(t){return R.makeGETRequest(`/queue/status/${t}`)}static getBuilds(){return R.makeGETRequest("/build")}static getSessions(t={}){let r=`/session?t=${Date.now()}`;return t.buildId&&(r+=`&buildId=${encodeURIComponent(t.buildId)}`),t.query&&(r+=`&query=${encodeURIComponent(t.query)}`),t.status&&(r+=`&status=${encodeURIComponent(t.status)}`),t.platform&&(r+=`&platform=${encodeURIComponent(t.platform)}`),R.makeGETRequest(r)}static getSession(t){return R.makeGETRequest(`/session/${t}`)}static getSessionLogs(t){return R.makeGETRequest(`/session/${t}/session_log`)}static getDeviceLogs(t){return R.makeGETRequest(`/session/${t}/logs/device`)}static getDebugLogs(t){return R.makeGETRequest(`/session/${t}/logs/debug`)}static getProfilingData(t){return R.makeGETRequest(`/session/${t}/profiling`)}static omniScan(t){return R.makeGETRequest(`/session/${t}/xenon/omni-scan`)}static omniScanControl(t){return R.makeGETRequest(`/control/${t}/omni-scan`)}static testAiLocator(t,n,r){return R.makePOSTRequest(`/session/${t}/xenon/test-locator`,{},{strategy:n,selector:r})}static getDisplayState(t){return R.makeGETRequest(`/control/${t}/display`)}static getAppiumSession(t){return R.makeGETRequest(`/control/${t}/appium-session`)}static async verifyLocator(t,n,r){const i=t.startsWith("/")?t:`/${t}`,s=await(await fetch(`${i}/session/${n}/xenon/verify-locator`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).json().catch(()=>({}));return(s==null?void 0:s.value)??s}static testAiLocatorControl(t,n,r){return R.makePOSTRequest(`/control/${t}/test-locator`,{},{strategy:n,selector:r})}static blockDevice(t,n){return R.makePOSTRequest("/block",{},{udid:t,host:n})}static unblockDevice(t,n){return R.makePOSTRequest("/unblock",{},{udid:t,host:n})}static updateDeviceTags(t,n,r){return R.makePOSTRequest("/device/tags",{},{udid:t,host:n,tags:r})}static async listTeams(){const t=await fetch("/xenon/api/teams",{credentials:"include"});if(!t.ok)throw new Error(`listTeams failed (${t.status})`);return(await t.json()).map(r=>({id:r.id,name:r.name}))}static async setDeviceTeam(t,n){const r=await fetch(`/xenon/api/grid/device/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok&&r.status!==204){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setDeviceTeam failed (${r.status})`)}}static getSessionLiveVideoUrl(t){return R.formatUrl(`/session/${t}/live_video`)}static getReservations(){return R.makeGETRequest("/reservation")}static reserveDevice(t,n,r,i,o){return R.makePOSTRequest("/reservation",{},{udid:t,host:n,reservedBy:r,duration:i,reason:o},{},{resolveErrors:!0})}static releaseReservation(t,n){return R.makeDELETERequest(`/reservation/${t}/${encodeURIComponent(n)}`)}static extendReservation(t,n,r){return R.makePOSTRequest(`/reservation/${t}/${encodeURIComponent(n)}/extend`,{},{duration:r})}static getAssetUrl(t){return t?`/xenon/assets/${t.replace(/^\//,"")}`:""}static tap(t,n,r){return R.makePOSTRequest(`/control/${t}/tap`,{},{x:n,y:r})}static swipe(t,n,r,i,o){return R.makePOSTRequest(`/control/${t}/swipe`,{},{x:n,y:r,endX:i,endY:o})}static typeText(t,n){return R.makePOSTRequest(`/control/${t}/text`,{},{text:n})}static pressKey(t,n){return R.makePOSTRequest(`/control/${t}/keyevent`,{},{keyCode:n})}static getClipboard(t){return R.makeGETRequest(`/control/${t}/clipboard`)}static setClipboard(t,n){return R.makePOSTRequest(`/control/${t}/clipboard`,{},{content:n})}static getScreenshot(t){return R.makeGETRequest(`/control/${t}/screenshot`)}static touchAndHold(t,n,r,i){return R.makePOSTRequest(`/control/${t}/touchAndHold`,{},{x:n,y:r,duration:i})}static lock(t){return R.makePOSTRequest(`/control/${t}/lock`,{},{})}static unlock(t){return R.makePOSTRequest(`/control/${t}/unlock`,{},{})}static installApp(t,n){return R.makePOSTRequest(`/control/${t}/install`,{},{appPath:n})}static startStream(t){return R.makePOSTRequest(`/control/${t}/stream/start`,{},{},{},{resolveErrors:!0})}static stopStream(t){return R.makePOSTRequest(`/control/${t}/stream/stop`,{},{},{keepalive:!0})}static uninstallApp(t,n){return R.makePOSTRequest(`/control/${t}/uninstall`,{},{bundleId:n})}static uploadAndInstallApp(t,n){const r=new FormData;return r.append("app",n),fetch(`/xenon/api/control/${t}/upload-install`,{method:"POST",body:r}).then(i=>i.json())}static listApps(t){return R.makeGETRequest(`/control/${t}/apps`)}static getLogs(t){return R.makeGETRequest(`/control/${t}/logs`)}static getApps(){return R.makeGETRequest("/apps")}static uploadApp(t){const n=new FormData;return n.append("app",t),fetch("/xenon/api/apps/upload",{method:"POST",body:n}).then(r=>r.json())}static deleteApp(t){return R.makeDELETERequest(`/apps/${t}`)}static installRepositoryApp(t,n){return R.makePOSTRequest(`/control/${t}/install-repository-app`,{},{appId:n},{},{resolveErrors:!0})}static executeShell(t,n){return R.makePOSTRequest(`/control/${t}/shell`,{},{command:n},{},{resolveErrors:!0})}static getInspectorSnapshot(t){return R.makeGETRequest(`/control/${t}/inspector/snapshot`)}static getWebhookConfigs(){return R.makeGETRequest("/webhook")}static addWebhookConfig(t,n,r,i){return R.makePOSTRequest("/webhook",{},{url:t,events:n,type:r,payloadTemplate:i})}static deleteWebhookConfig(t){return R.makeDELETERequest(`/webhook/${t}`)}static testWebhook(t,n){return R.makePOSTRequest("/webhook/test",{},{url:t,type:n})}static getGlobalConfig(){return R.makeGETRequest("/config")}static updateGlobalConfig(t){return R.makePOSTRequest("/config",{},t)}static testAIConfig(t){return R.makePOSTRequest("/config/test-ai",{},t,{},{resolveErrors:!0})}static resetMetrics(){return R.makePOSTRequest("/config/reset-metrics",{},{})}static getRecentHealingEvents(t=50){return R.makeGETRequest(`/healing/events?limit=${t}&t=${Date.now()}`)}static getHealingSummary(t=30){return R.makeGETRequest(`/healing/summary?windowDays=${t}&t=${Date.now()}`)}static getHealingHotspots(t={}){const{windowDays:n=30,limit:r=20,tier:i,platform:o,status:s="active"}=t;let l=`/healing/hotspots?windowDays=${n}&limit=${r}&status=${s}&t=${Date.now()}`;return i&&(l+=`&tier=${encodeURIComponent(i)}`),o&&(l+=`&platform=${encodeURIComponent(o)}`),R.makeGETRequest(l)}static getMutedSelectors(t={}){const{limit:n=50,offset:r=0}=t;return R.makeGETRequest(`/healing/state/muted?limit=${n}&offset=${r}&t=${Date.now()}`)}static getSelectorState(t,n){return R.makeGETRequest(`/healing/state/${encodeURIComponent(t)}/${encodeURIComponent(n)}?t=${Date.now()}`)}static async postSelectorStateAction(t){const n=await fetch("/xenon/api/healing/selector/state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({})),i=new Error(r.error??`Selector state action failed (${n.status})`);throw i.status=n.status,i.currentStatus=r.currentStatus??null,i}return n.json()}static getHealingSelectorDetail(t,n=30){return R.makeGETRequest(`/healing/selector?value=${encodeURIComponent(t)}&windowDays=${n}&t=${Date.now()}`)}static sendHealingDigest(t={}){return R.makePOSTRequest("/healing/digest/send",{},t)}static async exportBuild(t,n,r){const i=await fetch(`/xenon/api/build/${encodeURIComponent(t)}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:n,...r?{sessionIds:r}:{}})});if(!i.ok){const u=await i.text().catch(()=>i.statusText);throw new Error(`Export failed (${i.status}): ${u||i.statusText}`)}const o=i.headers.get("Content-Disposition")||"",s=/filename="?([^";]+)"?/.exec(o),l=s?s[1]:`build-${t}-sessions.${n}`;return{blob:await i.blob(),filename:l}}}function Kg(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function Qg(){const[e,t]=g.useState(!1);return g.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&!Kg(i.target)&&(i.preventDefault(),t(o=>!o)),i.key==="Escape"&&t(!1)},r=()=>t(!0);return window.addEventListener("keydown",n),window.addEventListener("xenon.open-command-palette",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("xenon.open-command-palette",r)}},[]),{open:e,setOpen:t}}function du(e,t){if(!e)return 0;const n=e.toLowerCase(),r=t.toLowerCase();if(r===n)return 1e4;if(r.startsWith(n))return 5e3-(r.length-n.length);let i=0,o=0,s=0;for(let l=0;l<n.length;l++){const a=n[l],u=r.indexOf(a,i);if(u===-1)return 0;u===i?(s+=1,o+=20+s*5):(s=0,o+=10-Math.min(u-i,10)),i=u+1}return Math.max(o,1)}const pu=[{id:"nav:overview",kind:"nav",label:"Overview",path:"/overview"},{id:"nav:devices",kind:"nav",label:"Devices",path:"/devices"},{id:"nav:live",kind:"nav",label:"Live devices",path:"/devices/live"},{id:"nav:builds",kind:"nav",label:"Sessions",path:"/builds"},{id:"nav:apps",kind:"nav",label:"Apps",path:"/apps"},{id:"nav:selector-health",kind:"nav",label:"Selector health",path:"/selector-health"},{id:"nav:notifications",kind:"nav",label:"Notifications",path:"/notifications"},{id:"nav:settings",kind:"nav",label:"Settings",path:"/settings"},{id:"nav:ai-settings",kind:"nav",label:"AI engine",path:"/ai-settings"},{id:"nav:maintenance",kind:"nav",label:"Maintenance",path:"/maintenance"},{id:"nav:teams",kind:"nav",label:"Teams",path:"/teams"},{id:"nav:api-keys",kind:"nav",label:"API keys",path:"/api-keys"},{id:"nav:users",kind:"nav",label:"Users",path:"/users"},{id:"nav:profile",kind:"nav",label:"Profile",path:"/profile"}];class Gg{constructor(){this.devices=[],this.builds=[],this.sessions=[],this.teams=[],this.keys=[],this.apps=[]}setDevices(t){this.devices=t.map(n=>({id:`device:${n.udid}`,kind:"device",label:n.name||n.udid,sub:n.udid,path:`/devices/${n.udid}/control`}))}setBuilds(t){this.builds=t.map(n=>({id:`build:${n.id}`,kind:"build",label:n.name||n.id,sub:typeof n.sessionCount=="number"?`${n.sessionCount} session${n.sessionCount===1?"":"s"}${n.failedCount?` · ${n.failedCount} failed`:""}`:n.id,path:`/builds/${encodeURIComponent(n.id)}`}))}setSessions(t){this.sessions=t.map(n=>({id:`session:${n.id}`,kind:"session",label:n.name||n.id,sub:n.id,path:`/builds?session=${encodeURIComponent(n.id)}`}))}setTeams(t){this.teams=t.map(n=>({id:`team:${n.id}`,kind:"team",label:n.name||n.id,sub:n.id,path:`/teams?team=${encodeURIComponent(n.id)}`}))}setKeys(t){this.keys=t.map(n=>({id:`key:${n.id}`,kind:"key",label:n.name||n.id,sub:n.id,path:`/api-keys?key=${encodeURIComponent(n.id)}`}))}setApps(t){this.apps=t.map(n=>({id:`app:${n.id}`,kind:"app",label:n.name||n.id,sub:n.id,path:`/apps?app=${encodeURIComponent(n.id)}`}))}search(t,n=8){return t.trim()?[...pu,...this.devices,...this.builds,...this.sessions,...this.teams,...this.keys,...this.apps].map(i=>{const o=du(t,i.label),s=i.sub?du(t,i.sub):0;return{it:i,score:Math.max(o,s)}}).filter(i=>i.score>0).sort((i,o)=>o.score-i.score).slice(0,n).map(i=>i.it):pu.slice(0,n)}}const Yg={nav:"Navigation",device:"Devices",build:"Builds",session:"Running sessions",team:"Teams",key:"API keys",app:"Apps"},Xg=["nav","device","build","session","team","key","app"],Jg=()=>{const{open:e,setOpen:t}=Qg(),[n,r]=g.useState(""),[i,o]=g.useState(0),s=mn(),l=g.useRef(new Gg),a=g.useRef(null);g.useEffect(()=>{if(!e)return;Promise.all([jn.getDevices().catch(()=>[]),jn.getSessions().catch(()=>[]),jn.getApps().catch(()=>[]),jn.listTeams().catch(()=>[]),jn.getBuilds().catch(()=>[])]).then(([k,c,f,d,y])=>{Array.isArray(k)&&l.current.setDevices(k),Array.isArray(y)&&l.current.setBuilds(y),Array.isArray(c)&&l.current.setSessions(c),Array.isArray(f)&&l.current.setApps(f),Array.isArray(d)&&l.current.setTeams(d)});const x=setTimeout(()=>{var k;return(k=a.current)==null?void 0:k.focus()},0);return()=>clearTimeout(x)},[e]),g.useEffect(()=>{e||(r(""),o(0))},[e]);const u=g.useMemo(()=>l.current.search(n,8),[n,e]),m=g.useMemo(()=>{const x=new Map;return u.forEach(k=>{const c=x.get(k.kind)||[];c.push(k),x.set(k.kind,c)}),x},[u]),v=g.useCallback(x=>{s(x.path),t(!1)},[s,t]),h=x=>{x.key==="ArrowDown"?(x.preventDefault(),o(k=>Math.min(k+1,Math.max(u.length-1,0)))):x.key==="ArrowUp"?(x.preventDefault(),o(k=>Math.max(k-1,0))):x.key==="Enter"&&(x.preventDefault(),u[i]&&v(u[i]))};if(!e)return null;let E=-1;return p.jsx("div",{className:"cp-overlay",onClick:()=>t(!1),children:p.jsxs("div",{className:"cp",role:"dialog","aria-modal":!0,"aria-label":"Command palette",onClick:x=>x.stopPropagation(),children:[p.jsxs("div",{className:"cp-input-row",children:[p.jsx(Cf,{size:14}),p.jsx("input",{ref:a,className:"cp-input",placeholder:"Search devices, sessions, settings…",value:n,onChange:x=>{r(x.target.value),o(0)},onKeyDown:h}),p.jsx("span",{className:"cp-esc",children:"ESC"})]}),p.jsxs("div",{className:"cp-results",children:[u.length===0&&p.jsx("div",{className:"cp-empty",children:"No results."}),Xg.filter(x=>m.has(x)).map(x=>p.jsxs("div",{className:"cp-group",children:[p.jsx("div",{className:"cp-group-head",children:Yg[x]}),m.get(x).map(k=>{E+=1;const c=E===i;return p.jsxs("button",{type:"button",className:`cp-item${c?" cp-item-active":""}`,onMouseEnter:()=>{o(E)},onClick:()=>v(k),children:[p.jsx("span",{className:"cp-item-label",children:k.label}),k.sub&&p.jsx("span",{className:"cp-item-sub",children:k.sub})]},k.id)})]},x))]})]})})};function Zg({children:e}){const{loading:t,me:n}=wl(),r=We();if(t)return p.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading…"});if(!n){const i=encodeURIComponent(r.pathname+r.search),o=dy()?"&reason=expired":"";return p.jsx(qt,{to:`/login?next=${i}${o}`,replace:!0})}return p.jsx(p.Fragment,{children:e})}const hu="Xenon",ev={"/overview":"Overview","/devices":"Devices","/devices/live":"Live devices","/apps":"Apps","/builds":"Sessions","/selector-health":"Selector health","/selector-health/detail":"Selector health","/notifications":"Notifications","/settings":"Settings","/ai-settings":"AI engine","/maintenance":"Maintenance","/teams":"Teams","/users":"Users","/api-keys":"API keys","/profile":"Profile","/login":"Sign in","/forgot-password":"Forgot password","/reset-password":"Reset password"};function tv(e){const t=e.replace(/\/+$/,"")||"/";let n=ev[t];if(!n){let r;(r=t.match(/^\/devices\/([^/]+)\/control/))?n=`${decodeURIComponent(r[1])} · Device`:/^\/builds\/[^/]+\/sessions\//.test(t)?n="Session":/^\/builds\/[^/]+$/.test(t)?n="Sessions":(r=t.match(/^\/runbooks\/([^/]+)/))?n=`Runbook · ${decodeURIComponent(r[1])}`:t.startsWith("/reset-password/")&&(n="Reset password")}return n?`${n} · ${hu}`:hu}function nv(){const{pathname:e}=We();return g.useEffect(()=>{document.title=tv(e)},[e]),null}const rv=g.lazy(()=>Q(()=>import("./login-DOYeWP9H.js"),__vite__mapDeps([74,10,75,76,49,33,20,3]))),iv=g.lazy(()=>Q(()=>import("./forgot-password-MmPdS0S2.js"),__vite__mapDeps([77,75,76,49]))),mu=g.lazy(()=>Q(()=>import("./reset-password-D1gtSgzr.js"),__vite__mapDeps([78,76,49]))),ov=g.lazy(()=>Q(()=>import("./ApiKeyGate-B_1qvA7M.js"),[]).then(e=>({default:e.ApiKeyGate})));function sv(){return p.jsx(Vg,{children:p.jsxs("div",{className:"min-h-screen w-full bg-[var(--bg)] text-[var(--text)]",children:[p.jsx(Hg,{}),p.jsx(wg,{}),p.jsx("main",{className:"pl-14 pt-14 h-screen overflow-y-auto",children:p.jsx($g,{})}),p.jsx(Jg,{})]})})}function lv(){return p.jsxs(om,{basename:"/xenon",children:[p.jsx(nv,{}),p.jsx(py,{children:p.jsx(g.Suspense,{fallback:p.jsx("div",{style:{padding:40},children:"Loading…"}),children:p.jsxs(Ef,{children:[p.jsx($,{path:"/login",element:p.jsx(rv,{})}),p.jsx($,{path:"/forgot-password",element:p.jsx(iv,{})}),p.jsx($,{path:"/reset-password",element:p.jsx(mu,{})}),p.jsx($,{path:"/reset-password/:token",element:p.jsx(mu,{})}),p.jsx($,{path:"/api-key-gate",element:p.jsx(ov,{children:p.jsx(qt,{to:"/overview",replace:!0})})}),p.jsx($,{path:"*",element:p.jsx(Zg,{children:p.jsx(sv,{})})})]})})})]})}df.render(p.jsx(g.StrictMode,{children:p.jsx(lv,{})}),document.getElementById("root"));export{Xm as A,_m as B,Cm as C,Sf as D,yu as E,wm as F,mm as G,gm as H,Lm as I,Nm as J,Wm as K,eu as L,Fm as M,qt as N,xm as O,wv as P,Am as Q,id as R,Km as S,Zm as T,ry as U,oy as V,fv as W,jn as X,Bg as Y,hv as Z,ty as _,We as a,wl as b,F as c,fy as d,cv as e,$m as f,mv as g,pv as h,uv as i,p as j,yv as k,dv as l,gv as m,gg as n,$i as o,ug as p,Gm as q,g as r,Dm as s,df as t,mn as u,av as v,rd as w,kv as x,ly as y,Cf as z};
214
+ */const sy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ly=F("x",sy),$i={"X-Appium-Is-Sensitive":"true"},yt="/xenon/api/auth";class eu extends Error{constructor(t,n,r=null){super(t),this.status=n,this.retryAfterSec=r,this.name="LoginError"}}async function dv(e,t){let n;try{n=await fetch(`${yt}/login`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({email:e,password:t})})}catch(r){throw new eu(r.message||"Network error",0)}if(!n.ok){const r=await n.json().catch(()=>({})),i=Number(n.headers.get("Retry-After"));throw new eu(r.error||`Login failed (${n.status})`,n.status,Number.isFinite(i)&&i>0?i:null)}}async function pv(){try{const e=await fetch(`${yt}/options`,{credentials:"include"});return e.ok?{passwordReset:(await e.json()).passwordReset==="email"?"email":"admin"}:{passwordReset:"admin"}}catch{return{passwordReset:"admin"}}}async function ay(){await fetch(`${yt}/logout`,{method:"POST",credentials:"include"})}async function uy(){const e=await fetch(`${yt}/me`,{credentials:"include"});if(e.status===401)return null;if(!e.ok)throw new Error(`Failed to fetch /me (${e.status})`);return e.json()}async function hv(e,t){const n=await fetch(`${yt}/change-password`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({oldPassword:e,newPassword:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Change password failed (${n.status})`)}}async function mv(e){const t=await fetch(`${yt}/forgot-password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok&&t.status!==204)throw t.status===429?new Error("Too many attempts — try again later."):new Error(`Request failed (${t.status})`)}async function yv(e){return(await fetch(`${yt}/reset-password/check`,{method:"POST",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({token:e})})).ok}async function gv(e,t){const n=await fetch(`${yt}/reset-password`,{method:"POST",headers:{"Content-Type":"application/json",...$i},body:JSON.stringify({token:e,newPassword:t})});if(!n.ok&&n.status!==204){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Reset failed (${n.status})`)}}const vl="xenon.hadSession";function cy(){try{localStorage.setItem(vl,"1")}catch{}}function fy(){try{localStorage.removeItem(vl)}catch{}}function dy(){try{return localStorage.getItem(vl)==="1"}catch{return!1}}const Tf=g.createContext(null);function py({children:e}){const[t,n]=g.useState(!0),[r,i]=g.useState(null);async function o(){try{const l=await uy();l&&cy(),i(l)}finally{n(!1)}}async function s(){fy(),await ay(),i(null),window.location.href="/xenon/login"}return g.useEffect(()=>{o()},[]),p.jsx(Tf.Provider,{value:{loading:t,me:r,refresh:o,signOut:s},children:e})}function wl(){const e=g.useContext(Tf);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const De=Object.create(null);De.open="0";De.close="1";De.ping="2";De.pong="3";De.message="4";De.upgrade="5";De.noop="6";const Qr=Object.create(null);Object.keys(De).forEach(e=>{Qr[De[e]]=e});const fs={type:"error",data:"parser error"},Rf=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Pf=typeof ArrayBuffer=="function",Nf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,kl=({type:e,data:t},n,r)=>Rf&&t instanceof Blob?n?r(t):tu(t,r):Pf&&(t instanceof ArrayBuffer||Nf(t))?n?r(t):tu(new Blob([t]),r):r(De[e]+(t||"")),tu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function nu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let yo;function hy(e,t){if(Rf&&e.data instanceof Blob)return e.data.arrayBuffer().then(nu).then(t);if(Pf&&(e.data instanceof ArrayBuffer||Nf(e.data)))return t(nu(e.data));kl(e,!1,n=>{yo||(yo=new TextEncoder),t(yo.encode(n))})}const ru="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Un=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ru.length;e++)Un[ru.charCodeAt(e)]=e;const my=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,l,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),m=new Uint8Array(u);for(r=0;r<n;r+=4)o=Un[e.charCodeAt(r)],s=Un[e.charCodeAt(r+1)],l=Un[e.charCodeAt(r+2)],a=Un[e.charCodeAt(r+3)],m[i++]=o<<2|s>>4,m[i++]=(s&15)<<4|l>>2,m[i++]=(l&3)<<6|a&63;return u},yy=typeof ArrayBuffer=="function",xl=(e,t)=>{if(typeof e!="string")return{type:"message",data:Of(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:gy(e.substring(1),t)}:Qr[n]?e.length>1?{type:Qr[n],data:e.substring(1)}:{type:Qr[n]}:fs},gy=(e,t)=>{if(yy){const n=my(e);return Of(n,t)}else return{base64:!0,data:e}},Of=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Lf="",vy=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{kl(o,!1,l=>{r[s]=l,++i===n&&t(r.join(Lf))})})},wy=(e,t)=>{const n=e.split(Lf),r=[];for(let i=0;i<n.length;i++){const o=xl(n[i],t);if(r.push(o),o.type==="error")break}return r};function ky(){return new TransformStream({transform(e,t){hy(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let go;function Dr(e){return e.reduce((t,n)=>t+n.length,0)}function Mr(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xy(e,t){go||(go=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Dr(n)<1)break;const a=Mr(n,1);o=(a[0]&128)===128,i=a[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Dr(n)<2)break;const a=Mr(n,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),r=3}else if(r===2){if(Dr(n)<8)break;const a=Mr(n,8),u=new DataView(a.buffer,a.byteOffset,a.length),m=u.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(fs);break}i=m*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Dr(n)<i)break;const a=Mr(n,i);l.enqueue(xl(o?a:go.decode(a),t)),r=0}if(i===0||i>e){l.enqueue(fs);break}}}})}const jf=4;function G(e){if(e)return Ey(e)}function Ey(e){for(var t in G.prototype)e[t]=G.prototype[t];return e}G.prototype.on=G.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};G.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};G.prototype.off=G.prototype.removeListener=G.prototype.removeAllListeners=G.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};G.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};G.prototype.emitReserved=G.prototype.emit;G.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};G.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ui=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ve=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_y="arraybuffer";function Af(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Sy=ve.setTimeout,Cy=ve.clearTimeout;function Bi(e,t){t.useNativeTimers?(e.setTimeoutFn=Sy.bind(ve),e.clearTimeoutFn=Cy.bind(ve)):(e.setTimeoutFn=ve.setTimeout.bind(ve),e.clearTimeoutFn=ve.clearTimeout.bind(ve))}const Ty=1.33;function Ry(e){return typeof e=="string"?Py(e):Math.ceil((e.byteLength||e.size)*Ty)}function Py(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function If(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ny(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Oy(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Ly extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class El extends G{constructor(t){super(),this.writable=!1,Bi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ly(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=xl(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Ny(t);return n.length?"?"+n:""}}class jy extends El{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wy(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,vy(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=If()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Df=!1;try{Df=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ay=Df;function Iy(){}class Dy extends jy{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ie extends G{constructor(t,n,r){super(),this.createRequest=t,Bi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Af(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ie.requestsCount++,Ie.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Iy,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ie.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ie.requestsCount=0;Ie.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",iu);else if(typeof addEventListener=="function"){const e="onpagehide"in ve?"pagehide":"unload";addEventListener(e,iu,!1)}}function iu(){for(let e in Ie.requests)Ie.requests.hasOwnProperty(e)&&Ie.requests[e].abort()}const My=function(){const e=Mf({xdomain:!1});return e&&e.responseType!==null}();class $y extends Dy{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=My&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ie(Mf,this.uri(),t)}}function Mf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ay))return new XMLHttpRequest}catch{}if(!t)try{return new ve[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $f=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Uy extends El{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=$f?{}:Af(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;kl(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&Ui(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=If()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const vo=ve.WebSocket||ve.MozWebSocket;class By extends Uy{createSocket(t,n,r){return $f?new vo(t,n,r):n?new vo(t,n):new vo(t)}doWrite(t,n){this.ws.send(n)}}class zy extends El{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xy(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=ky();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:l,value:a})=>{l||(this.onPacket(a),o())}).catch(l=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Ui(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Fy={websocket:By,webtransport:zy,polling:$y},by=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ds(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=by.exec(e||""),o={},s=14;for(;s--;)o[Vy[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=qy(o,o.path),o.queryKey=Wy(o,o.query),o}function qy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Wy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const ps=typeof addEventListener=="function"&&typeof removeEventListener=="function",Gr=[];ps&&addEventListener("offline",()=>{Gr.forEach(e=>e())},!1);class lt extends G{constructor(t,n){if(super(),this.binaryType=_y,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ds(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ds(n.host).host);Bi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Oy(this.opts.query)),ps&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Gr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=jf,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&lt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",lt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Ry(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ui(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(lt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ps&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Gr.indexOf(this._offlineEventListener);r!==-1&&Gr.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}lt.protocol=jf;class Hy extends lt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;lt.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",v=>{if(!r)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;lt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,m(),n.close(),n=null)}const s=v=>{const h=new Error("probe error: "+v);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function a(){s("socket closed")}function u(v){n&&v.name!==n.name&&o()}const m=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",l),this.off("close",a),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",l),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Ky=class extends Hy{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Fy[i]).filter(i=>!!i)),super(t,r)}};function Qy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ds(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const Gy=typeof ArrayBuffer=="function",Yy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Uf=Object.prototype.toString,Xy=typeof Blob=="function"||typeof Blob<"u"&&Uf.call(Blob)==="[object BlobConstructor]",Jy=typeof File=="function"||typeof File<"u"&&Uf.call(File)==="[object FileConstructor]";function _l(e){return Gy&&(e instanceof ArrayBuffer||Yy(e))||Xy&&e instanceof Blob||Jy&&e instanceof File}function Yr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yr(e[n]))return!0;return!1}if(_l(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yr(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yr(e[n]))return!0;return!1}function Zy(e){const t=[],n=e.data,r=e;return r.data=hs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function hs(e,t){if(!e)return e;if(_l(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=hs(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=hs(e[r],t));return n}return e}function eg(e,t){return e.data=ms(e.data,t),delete e.attachments,e}function ms(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ms(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ms(e[n],t));return e}const tg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var D;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(D||(D={}));class ng{constructor(t){this.replacer=t}encode(t){return(t.type===D.EVENT||t.type===D.ACK)&&Yr(t)?this.encodeAsBinary({type:t.type===D.EVENT?D.BINARY_EVENT:D.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===D.BINARY_EVENT||t.type===D.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Zy(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Sl extends G{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===D.BINARY_EVENT;r||n.type===D.BINARY_ACK?(n.type=r?D.EVENT:D.ACK,this.reconstructor=new rg(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_l(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(D[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===D.BINARY_EVENT||r.type===D.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Sl.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case D.CONNECT:return ou(n);case D.DISCONNECT:return n===void 0;case D.CONNECT_ERROR:return typeof n=="string"||ou(n);case D.EVENT:case D.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tg.indexOf(n[0])===-1);case D.ACK:case D.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rg{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eg(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ou(e){return Object.prototype.toString.call(e)==="[object Object]"}const ig=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Sl,Encoder:ng,get PacketType(){return D}},Symbol.toStringTag,{value:"Module"}));function Re(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const og=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Bf extends G{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Re(t,"open",this.onopen.bind(this)),Re(t,"packet",this.onpacket.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(og.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:D.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,v=n.pop();this._registerAckCallback(m,v),s.id=m}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),s=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,l)=>s?i(s):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:D.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case D.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case D.EVENT:case D.BINARY_EVENT:this.onevent(t);break;case D.ACK:case D.BINARY_ACK:this.onack(t);break;case D.DISCONNECT:this.ondisconnect();break;case D.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:D.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:D.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function yn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}yn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};yn.prototype.reset=function(){this.attempts=0};yn.prototype.setMin=function(e){this.ms=e};yn.prototype.setMax=function(e){this.max=e};yn.prototype.setJitter=function(e){this.jitter=e};class ys extends G{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Bi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||ig;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ky(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Re(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=Re(n,"error",o);if(this._timeout!==!1){const l=this._timeout,a=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Re(t,"ping",this.onping.bind(this)),Re(t,"data",this.ondata.bind(this)),Re(t,"error",this.onerror.bind(this)),Re(t,"close",this.onclose.bind(this)),Re(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ui(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Bf(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ln={};function Xr(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Qy(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=Ln[i]&&o in Ln[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let a;return l?a=new ys(r,t):(Ln[i]||(Ln[i]=new ys(r,t)),a=Ln[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Xr,{Manager:ys,Socket:Bf,io:Xr,connect:Xr});let wo=null;const Bn=new Map;function sg(e,t){const n=Bn.get(e);n&&Array.from(n).forEach(r=>r(t))}function lg(){if(wo)return wo;const e=Xr(window.location.origin,{path:"/socket.io",reconnection:!0,withCredentials:!0});return e.on("connect",()=>{console.log("[Socket] Connected to Hub"),e.emit("register_dashboard")}),e.on("disconnect",()=>{console.log("[Socket] Disconnected from Hub")}),e.onAny((t,n)=>sg(t,n)),wo=e,e}function ag(e,t){let n=Bn.get(e);return n||(n=new Set,Bn.set(e,n)),n.add(t),()=>{const r=Bn.get(e);r&&(r.delete(t),r.size===0&&Bn.delete(e))}}const ug=()=>{const[e]=g.useState(lg),[t,n]=g.useState(e.connected);g.useEffect(()=>{const i=()=>n(!0),o=()=>n(!1);return e.on("connect",i),e.on("disconnect",o),n(e.connected),()=>{e.off("connect",i),e.off("disconnect",o)}},[e]);const r=g.useCallback((i,o)=>ag(i,o),[]);return{socket:e,isConnected:t,on:r}},cg=6e4;function fg(e,t,n,r=!0){if(e)return{tone:"live",label:"Live",title:"Connected to the Xenon server. Updates stream in as they happen."};const i=t??n;if(n-i<cg)return r?{tone:"reconnecting",label:"Reconnecting…",title:"Lost the connection to the Xenon server. Retrying automatically."}:{tone:"reconnecting",label:"Connecting…",title:"Connecting to the Xenon server."};const o=new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return{tone:"down",label:`Disconnected · since ${o}`,title:`No connection to the Xenon server since ${o}. What's on screen may be out of date.`}}function dg(){const{isConnected:e}=ug(),[t,n]=g.useState(null),[r,i]=g.useState(()=>Date.now()),[o,s]=g.useState(e);return g.useEffect(()=>{n(e?null:Date.now()),e&&s(!0)},[e]),g.useEffect(()=>{if(e)return;const l=window.setInterval(()=>i(Date.now()),5e3);return()=>window.clearInterval(l)},[e]),fg(e,t,r,o)}const zf="xenon.theme",su="dark",Ff="(prefers-color-scheme: light)";function pg(){try{const e=localStorage.getItem(zf);return e==="light"||e==="system"||e==="dark"?e:su}catch{return su}}function bf(e,t){return e==="system"?t?"light":"dark":e}function hg(){return typeof window.matchMedia=="function"&&window.matchMedia(Ff).matches}function Vf(e){document.documentElement.setAttribute("data-theme",e)}function mg(e){try{localStorage.setItem(zf,e)}catch{}Vf(bf(e,hg()))}function yg(){const[e,t]=g.useState(pg);return g.useEffect(()=>{var o;if(e!=="system"||typeof window.matchMedia!="function")return;const r=window.matchMedia(Ff),i=()=>Vf(bf("system",r.matches));return(o=r.addEventListener)==null||o.call(r,"change",i),()=>{var s;return(s=r.removeEventListener)==null?void 0:s.call(r,"change",i)}},[e]),[e,r=>{mg(r),t(r)}]}function gg({className:e,alt:t="Xenon"}){const n="/xenon/";return p.jsxs(p.Fragment,{children:[p.jsx("img",{src:`${n}logo.svg`,alt:t,className:`logo-for-dark ${e??""}`}),p.jsx("img",{src:`${n}logo-light.svg`,alt:t,className:`logo-for-light ${e??""}`})]})}const vg=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],wg=()=>{const e=mn(),{me:t,signOut:n}=wl(),r=dg(),[i,o]=yg(),[s,l]=g.useState(!1),a=g.useRef(null),u=((t==null?void 0:t.name)??"A").split(" ").map(h=>h[0]).slice(0,2).join("").toUpperCase(),m=(t==null?void 0:t.role)==="SUPER_ADMIN"?"Super admin":(t==null?void 0:t.role)==="ADMIN"?"Admin":"Member";g.useEffect(()=>{const h=E=>{a.current&&!a.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const v=()=>window.dispatchEvent(new CustomEvent("xenon.open-command-palette"));return p.jsx("header",{className:"fixed top-0 left-14 right-0 z-20 h-14 border-b border-[var(--border)] bg-[var(--bg)]/80 backdrop-blur-md",children:p.jsxs("div",{className:"flex items-center h-full px-4 gap-4",children:[p.jsx("button",{type:"button",onClick:()=>e("/overview"),className:"flex items-center gap-3 min-w-0 cursor-pointer","aria-label":"Xenon home",children:p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(gg,{alt:"Xenon Logo",className:"h-8 w-auto object-contain"})})}),p.jsx("div",{className:"flex-1 max-w-xl mx-auto",children:p.jsxs("button",{type:"button",onClick:v,className:"relative w-full h-9 flex items-center text-left","aria-label":"Open command palette",children:[p.jsx("div",{className:"w-full h-9 pl-9 pr-14 rounded-md bg-[var(--surface)] border border-[var(--border)] text-sm text-[var(--text-dim)] hover:border-[var(--border-strong)] hover:text-[var(--text)] transition-colors flex items-center",children:"Search devices, sessions, settings…"}),p.jsx(Cf,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--text-dim)]"}),p.jsx("kbd",{className:"absolute right-3 top-1/2 -translate-y-1/2 font-mono text-[10px] text-[var(--text-dim)] border border-[var(--border)] rounded px-1.5 py-0.5",children:"⌘K"})]})}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{role:"status",title:r.title,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border ${r.tone==="live"?"bg-[var(--color-success)]/10 border-[var(--color-success)]/20 text-[var(--color-success)]":r.tone==="reconnecting"?"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-[var(--amber)]":"bg-[var(--red)]/10 border-[var(--red)]/25 text-[var(--red)]"}`,children:[p.jsx("span",{className:`h-1.5 w-1.5 rounded-full bg-current ${r.tone==="live"?"pulse-dot":""}`,"aria-hidden":"true"}),p.jsx("span",{className:"text-[11px] font-medium",children:r.label})]}),p.jsxs("div",{className:"relative",ref:a,children:[p.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 pl-1.5 pr-2.5 rounded-md border border-[var(--border)] hover:border-[var(--border-strong)] hover:bg-[var(--surface)] transition-colors",onClick:()=>l(h=>!h),"aria-haspopup":"true","aria-expanded":s,children:[p.jsx("span",{className:"h-6 w-6 rounded-full bg-[var(--color-accent)]/15 text-[var(--color-accent)] text-[11px] font-semibold flex items-center justify-center",children:u}),p.jsxs("span",{className:"flex flex-col items-start leading-tight",children:[p.jsx("span",{className:"text-xs text-[var(--text)]",children:(t==null?void 0:t.name)??"Account"}),p.jsx("span",{className:"text-[10px] text-[var(--text-dim)]",children:m})]}),p.jsx(_m,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"})]}),s&&p.jsxs("div",{className:"absolute top-full right-0 mt-2 w-64 rounded-md border border-[var(--border)] bg-[var(--surface)] shadow-lg overflow-hidden",children:[p.jsxs("div",{className:"px-3 py-2",children:[p.jsx("div",{className:"text-[11px] text-[var(--text-dim)] mb-1",children:"System"}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-[var(--text)]",children:[p.jsx("span",{className:"text-[var(--text-muted)]",children:"Version"}),p.jsxs("span",{className:"font-mono text-[var(--text-muted)]",children:["v","1.22.2"]})]})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("div",{className:"px-3 py-2 flex items-center justify-between gap-2",children:[p.jsx("span",{id:"theme-label",className:"text-xs text-[var(--text-muted)]",children:"Theme"}),p.jsx("div",{className:"seg seg-sm",role:"radiogroup","aria-labelledby":"theme-label",children:vg.map(h=>p.jsx("button",{type:"button",role:"radio","aria-checked":i===h.value,className:`seg-btn${i===h.value?" seg-btn-active":""}`,onClick:()=>o(h.value),children:h.label},h.value))})]}),p.jsx("div",{className:"h-px bg-[var(--border)]"}),p.jsxs("button",{type:"button",onClick:()=>{l(!1),e("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--text)] hover:bg-[var(--bg)] text-left",children:[p.jsx(ry,{className:"h-3.5 w-3.5 text-[var(--text-dim)]"}),"Profile"]}),t!=null&&t.authDisabled?p.jsx("p",{className:"px-3 py-2 text-xs text-[var(--text-muted)]",children:"Sign-in is off on this server."}):p.jsxs("button",{type:"button",onClick:()=>{l(!1),n()},className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--red)] hover:bg-[var(--bg)] text-left",children:[p.jsx(Bm,{className:"h-3.5 w-3.5"}),"Logout"]})]})]})]})]})})};class kg extends g.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReset=()=>{this.setState({hasError:!1}),window.location.reload()}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?this.props.fallback||p.jsxs("div",{className:"error-boundary-container",style:{padding:"4rem 2rem",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"1.5rem",color:"var(--text)",background:"var(--bg-main)",minHeight:"100vh"},children:[p.jsx("div",{style:{color:"var(--accent-red)"},children:p.jsx(Xm,{size:64})}),p.jsx("h2",{style:{fontSize:"2rem",fontWeight:700,margin:0},children:"Component exception detected"}),p.jsx("p",{style:{color:"var(--text-muted)",maxWidth:"500px",lineHeight:1.6},children:"An unexpected error occurred while rendering this section. Xenon's isolation engine has contained the fault to prevent a total system crash."}),this.state.error&&p.jsx("pre",{style:{background:"rgb(var(--rgb-black) / 0.3)",padding:"1rem",borderRadius:"8px",fontSize:"0.8rem",color:"var(--accent-red)",maxWidth:"80%",overflowX:"auto"},children:this.state.error.message}),p.jsxs("button",{onClick:this.handleReset,style:{background:"var(--color-accent)",color:"var(--secondary)",border:"none",padding:"0.75rem 2rem",borderRadius:"8px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",transition:"all 0.2s"},onMouseOver:t=>t.currentTarget.style.transform="translateY(-2px)",onMouseOut:t=>t.currentTarget.style.transform="translateY(0)",children:[p.jsx(Sf,{size:18}),"Reload application"]})]}):this.props.children}}const xg=g.lazy(()=>Q(()=>import("./overview-DrTe5eJi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),lu=g.lazy(()=>Q(()=>import("./device-explorer-CIjs3BXP.js"),__vite__mapDeps([8,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,5,1,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))),au=g.lazy(()=>Q(()=>import("./builds-page-FfsUegKZ.js"),__vite__mapDeps([36,37,24,5,38,39,40,10,41,12,13,20,9,11,31,1,29,4,6,7]))),Eg=g.lazy(()=>Q(()=>import("./session-detail-page-Dm4tnoTT.js"),__vite__mapDeps([42,37,24,14,15,43,29,22,44,45,46,47,48,16,17,31,49,1,50]))),_g=g.lazy(()=>Q(()=>import("./runbook-page-Dq3wdSII.js"),__vite__mapDeps([51,43,52]))),Sg=g.lazy(()=>Q(()=>import("./apps-CePIfnu9.js"),__vite__mapDeps([53,24,9,10,11,6,7,12,13,23,28,22,27,31,32,54]))),Cg=g.lazy(()=>Q(()=>import("./webhook-settings-qoHAETzC.js"),__vite__mapDeps([55,18,19,6,7,32,21,38,39,27,5,56,57])).then(e=>({default:e.WebhookSettings}))),Tg=g.lazy(()=>Q(()=>import("./settings-ChfaAd8F.js"),__vite__mapDeps([58,59,9,10,11,60,16,17,6,7,39,20,25,28,5,61,44,57])).then(e=>({default:e.Settings}))),Rg=g.lazy(()=>Q(()=>import("./ai-settings-CSZQis7F.js"),__vite__mapDeps([62,59,9,10,11,60,6,7,33,39,5,57])).then(e=>({default:e.AISettings}))),Pg=g.lazy(()=>Q(()=>import("./maintenance-settings-yYhZaU7n.js"),__vite__mapDeps([63,59,9,10,11,60,6,7,32,28,61,57])).then(e=>({default:e.MaintenanceSettings}))),Ng=g.lazy(()=>Q(()=>import("./api-keys-4ddjSngL.js"),__vite__mapDeps([64,24,47,48,18,19,6,7,16,17,9,10,11,40,41,12,13,21,32,28,22,57])).then(e=>({default:e.ApiKeys}))),Og=g.lazy(()=>Q(()=>import("./teams-BFhWbK5i.js"),__vite__mapDeps([65,24,47,48,18,19,6,7,16,17,9,10,11,40,41,12,13,66,21,43,32,57])).then(e=>({default:e.Teams}))),Lg=g.lazy(()=>Q(()=>import("./selector-health-page-D-8SdN_l.js"),__vite__mapDeps([67,27,68,69,39,16,17,28,22,24,45,46,6,7,34,1,2,29,44]))),jg=g.lazy(()=>Q(()=>import("./selector-detail-page-8xf4CxH5.js"),__vite__mapDeps([70,24,6,7,68,69,26,39,27,28,22]))),Ag=g.lazy(()=>Q(()=>import("./DeviceMosaicView-O292tZkA.js"),__vite__mapDeps([71,1,30,6,7]))),Ig=g.lazy(()=>Q(()=>import("./profile-page-C2p5rB3x.js"),__vite__mapDeps([72,6,7,24,12,10,13,22,32]))),Dg=g.lazy(()=>Q(()=>import("./users-B7uveXL_.js"),__vite__mapDeps([73,66,24,6,7,9,10,11,40,41,12,13,21,32]))),Mg=()=>p.jsxs("div",{className:"flex items-center justify-center gap-2 h-full text-xs text-[var(--text-dim)]",children:[p.jsx(Sf,{className:"animate-spin",size:14}),p.jsx("span",{children:"Hydrating view…"})]}),$g=()=>p.jsx(kg,{children:p.jsx(g.Suspense,{fallback:p.jsx(Mg,{}),children:p.jsxs(Ef,{children:[p.jsx($,{path:"/",element:p.jsx(qt,{to:"/overview",replace:!0})}),p.jsx($,{path:"/overview",element:p.jsx(xg,{})}),p.jsx($,{path:"/devices",element:p.jsx(lu,{})}),p.jsx($,{path:"/devices/:udid/control/:tab?",element:p.jsx(lu,{})}),p.jsx($,{path:"/apps",element:p.jsx(Sg,{})}),p.jsx($,{path:"/sessions",element:p.jsx(qt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/sessions/*",element:p.jsx(qt,{to:"/builds",replace:!0})}),p.jsx($,{path:"/builds",element:p.jsx(au,{})}),p.jsx($,{path:"/builds/:buildId",element:p.jsx(au,{})}),p.jsx($,{path:"/builds/:buildId/sessions/:sessionId",element:p.jsx(Eg,{})}),p.jsx($,{path:"/notifications",element:p.jsx(Cg,{})}),p.jsx($,{path:"/settings",element:p.jsx(Tg,{})}),p.jsx($,{path:"/ai-settings",element:p.jsx(Rg,{})}),p.jsx($,{path:"/maintenance",element:p.jsx(Pg,{})}),p.jsx($,{path:"/api-keys",element:p.jsx(Ng,{})}),p.jsx($,{path:"/teams",element:p.jsx(Og,{})}),p.jsx($,{path:"/users",element:p.jsx(Dg,{})}),p.jsx($,{path:"/selector-health",element:p.jsx(Lg,{})}),p.jsx($,{path:"/selector-health/detail",element:p.jsx(jg,{})}),p.jsx($,{path:"/devices/live",element:p.jsx(Ag,{})}),p.jsx($,{path:"/runbooks/:category",element:p.jsx(_g,{})}),p.jsx($,{path:"/profile",element:p.jsx(Ig,{})}),p.jsx($,{path:"*",element:p.jsx(qt,{to:"/overview",replace:!0})})]})})});let hr=null;function uu(e){hr=e}const Ug=new Set(["device_held_by_another_user","device_in_use_by_session"]);function Bg(e){return!e||typeof e!="object"?!1:Ug.has(e.error??"")}const zg=5e3,cu=new Map;function Fg(e){if(!hr)return;const t=Date.now(),n=cu.get(e)??0;t-n<zg||(cu.set(e,t),hr(e,"error"))}class qf extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}}async function ko(e,t){if(e.status===403){const n=await e.clone().json().catch(()=>({})),r=n&&(n.error||n.message)||"You do not have permission for this action.";hr&&hr(r,"error")}if(e.status===409){const n=await e.clone().json().catch(()=>({}));Bg(n)&&Fg(n.message||"This device is in use by another user.")}if(e.status===204||e.status===205)return null;if(t&&(e.status<200||e.status>=300)){const n=await e.json().catch(()=>null),r=n&&typeof n=="object"&&(n.error||n.message)||`Request failed (${e.status})`;throw new qf(String(r),e.status,n)}return e.json()}class bg{makeGETRequest(t){return fetch(this.formatUrl(t)).then(n=>ko(n,!1))}makePOSTRequest(t,n,r,i={},o={}){return fetch(this.formatUrl(t),{method:"POST",body:JSON.stringify(r||{}),headers:{"Content-Type":"application/json"},...i}).then(s=>ko(s,!o.resolveErrors))}makeDELETERequest(t,n={}){return fetch(this.formatUrl(t),{method:"DELETE"}).then(r=>ko(r,!n.resolveErrors))}formatUrl(t){return`/xenon/api${t}`}}const R=new bg;function wv(e){return e instanceof qf?`The server rejected the change: ${e.message}`:"Couldn't reach the Xenon server. Check your connection and try again."}const Wf=g.createContext(void 0),kv=()=>{const e=g.useContext(Wf);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},Vg=({children:e})=>{const[t,n]=g.useState([]),r=g.useCallback(o=>{n(s=>s.filter(l=>l.id!==o))},[]),i=g.useCallback((o,s="info",l=4e3)=>{const a=Math.random().toString(36).substring(2,9);return n(u=>[...u,{id:a,message:o,type:s,duration:l}]),s!=="loading"&&l>0&&setTimeout(()=>{r(a)},l),a},[r]);return g.useEffect(()=>(uu((o,s="info")=>i(o,s)),()=>uu(null)),[i]),p.jsxs(Wf.Provider,{value:{toast:i,removeToast:r},children:[e,p.jsx("div",{className:"toast-container","aria-live":"polite","aria-atomic":"true",role:"status",children:t.map(o=>p.jsxs("div",{className:`toast-item toast-${o.type} animate-slide-in`,children:[p.jsxs("div",{className:"toast-icon",children:[o.type==="success"&&p.jsx(Rm,{size:18}),o.type==="error"&&p.jsx(Cm,{size:18}),o.type==="info"&&p.jsx(Lm,{size:18}),o.type==="loading"&&p.jsx($m,{size:18,className:"animate-spin"})]}),p.jsx("div",{className:"toast-message",children:o.message}),p.jsx("button",{className:"toast-close",onClick:()=>r(o.id),"aria-label":`Close ${o.type} notification`,children:p.jsx(ly,{size:14})})]},o.id))})]})},qg=[{id:"overview",label:"Overview",icon:Dm,path:"/overview"},{id:"devices",label:"Devices",icon:Gm,path:"/devices"},{id:"live-devices",label:"Live devices",icon:Zm,path:"/devices/live"},{id:"apps",label:"Apps",icon:mm,path:"/apps"},{id:"sessions",label:"Sessions",icon:Fm,path:"/builds"},{id:"selector-health",label:"Selector health",icon:Nm,path:"/selector-health"},{id:"notifications",label:"Notifications",icon:gm,path:"/notifications"},{id:"settings",label:"Settings",icon:Wm,path:"/settings",minRole:"ADMIN"},{id:"ai",label:"AI engine",icon:xm,path:"/ai-settings",minRole:"ADMIN"},{id:"maintenance",label:"Maintenance",icon:Km,path:"/maintenance",minRole:"ADMIN"},{id:"teams",label:"Teams",icon:oy,path:"/teams",minRole:"ADMIN"},{id:"users",label:"Users",icon:ty,path:"/users",minRole:"ADMIN"},{id:"apikeys",label:"API keys",icon:Am,path:"/api-keys",minRole:"ADMIN"}],fu={SUPER_ADMIN:3,ADMIN:2,MEMBER:1};function Wg(e,t){return t?(e?fu[e]??0:0)>=fu[t]:!0}const Hg=()=>{const e=mn(),t=We(),{me:n}=wl(),r=qg.filter(l=>Wg(n==null?void 0:n.role,l.minRole)),i=t.pathname.replace(/\/$/,"")||"/",o=r.filter(l=>i===l.path||i.startsWith(l.path+"/")).sort((l,a)=>a.path.length-l.path.length)[0],s=l=>(o==null?void 0:o.path)===l;return p.jsxs("aside",{className:"fixed inset-y-0 left-0 z-30 w-14 border-r border-[var(--border)] bg-[var(--surface)] flex flex-col items-center py-3",children:[p.jsx("nav",{className:"flex-1 flex flex-col gap-1 w-full items-center",children:r.map(l=>{const a=l.icon,u=s(l.path);return p.jsxs("button",{type:"button",onClick:()=>e(l.path),className:`group relative w-full flex justify-center py-2.5 mx-1 rounded-md transition-colors ${u?"bg-[var(--surface-2)]":"hover:bg-[var(--surface-2)]/60"}`,"aria-label":l.label,"aria-current":u?"page":void 0,children:[p.jsx("span",{className:`absolute left-0 top-1 bottom-1 w-[3px] rounded-r transition-all ${u?"bg-[var(--color-accent)]":"bg-transparent"}`}),p.jsx(a,{className:`h-[18px] w-[18px] transition-colors ${u?"text-[var(--color-accent)]":"text-[var(--text-dim)] group-hover:text-[var(--text)]"}`,strokeWidth:u?2.25:2}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:l.label})]},l.id)})}),p.jsxs("button",{type:"button",className:"group relative w-full flex justify-center py-2.5 mt-2","aria-label":"API docs",onClick:()=>window.open(window.location.origin+"/xenon/api-docs","_blank"),children:[p.jsx(wm,{className:"h-[18px] w-[18px] text-[var(--text-dim)] group-hover:text-[var(--text)] transition-colors"}),p.jsx("span",{className:"pointer-events-none absolute left-full ml-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-md bg-[var(--surface-2)] border border-[var(--border-strong)] px-2 py-1 text-xs text-[var(--text)] opacity-0 group-hover:opacity-100 transition-opacity z-50 shadow-lg",children:"API docs"})]})]})};class jn{static getDevices(){return R.makeGETRequest(`/device?t=${Date.now()}`)}static getPendingSessionsCount(){return R.makeGETRequest("/queue/length")}static getPendingSessions(){return R.makeGETRequest("/queue")}static getQueueSummary(){return R.makeGETRequest("/queue/summary")}static getQueueStatus(t){return R.makeGETRequest(`/queue/status/${t}`)}static getBuilds(){return R.makeGETRequest("/build")}static getSessions(t={}){let r=`/session?t=${Date.now()}`;return t.buildId&&(r+=`&buildId=${encodeURIComponent(t.buildId)}`),t.query&&(r+=`&query=${encodeURIComponent(t.query)}`),t.status&&(r+=`&status=${encodeURIComponent(t.status)}`),t.platform&&(r+=`&platform=${encodeURIComponent(t.platform)}`),R.makeGETRequest(r)}static getSession(t){return R.makeGETRequest(`/session/${t}`)}static getSessionLogs(t){return R.makeGETRequest(`/session/${t}/session_log`)}static getDeviceLogs(t){return R.makeGETRequest(`/session/${t}/logs/device`)}static getDebugLogs(t){return R.makeGETRequest(`/session/${t}/logs/debug`)}static getProfilingData(t){return R.makeGETRequest(`/session/${t}/profiling`)}static omniScan(t){return R.makeGETRequest(`/session/${t}/xenon/omni-scan`)}static omniScanControl(t){return R.makeGETRequest(`/control/${t}/omni-scan`)}static testAiLocator(t,n,r){return R.makePOSTRequest(`/session/${t}/xenon/test-locator`,{},{strategy:n,selector:r})}static getDisplayState(t){return R.makeGETRequest(`/control/${t}/display`)}static getAppiumSession(t){return R.makeGETRequest(`/control/${t}/appium-session`)}static async verifyLocator(t,n,r){const i=t.startsWith("/")?t:`/${t}`,s=await(await fetch(`${i}/session/${n}/xenon/verify-locator`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).json().catch(()=>({}));return(s==null?void 0:s.value)??s}static testAiLocatorControl(t,n,r){return R.makePOSTRequest(`/control/${t}/test-locator`,{},{strategy:n,selector:r})}static blockDevice(t,n){return R.makePOSTRequest("/block",{},{udid:t,host:n})}static unblockDevice(t,n){return R.makePOSTRequest("/unblock",{},{udid:t,host:n})}static updateDeviceTags(t,n,r){return R.makePOSTRequest("/device/tags",{},{udid:t,host:n,tags:r})}static async listTeams(){const t=await fetch("/xenon/api/teams",{credentials:"include"});if(!t.ok)throw new Error(`listTeams failed (${t.status})`);return(await t.json()).map(r=>({id:r.id,name:r.name}))}static async setDeviceTeam(t,n){const r=await fetch(`/xenon/api/grid/device/${encodeURIComponent(t)}/team`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:n})});if(!r.ok&&r.status!==204){const i=await r.json().catch(()=>({}));throw new Error(i.error||`setDeviceTeam failed (${r.status})`)}}static getSessionLiveVideoUrl(t){return R.formatUrl(`/session/${t}/live_video`)}static getReservations(){return R.makeGETRequest("/reservation")}static reserveDevice(t,n,r,i,o){return R.makePOSTRequest("/reservation",{},{udid:t,host:n,reservedBy:r,duration:i,reason:o},{},{resolveErrors:!0})}static releaseReservation(t,n){return R.makeDELETERequest(`/reservation/${t}/${encodeURIComponent(n)}`)}static extendReservation(t,n,r){return R.makePOSTRequest(`/reservation/${t}/${encodeURIComponent(n)}/extend`,{},{duration:r})}static getAssetUrl(t){return t?`/xenon/assets/${t.replace(/^\//,"")}`:""}static tap(t,n,r){return R.makePOSTRequest(`/control/${t}/tap`,{},{x:n,y:r})}static swipe(t,n,r,i,o){return R.makePOSTRequest(`/control/${t}/swipe`,{},{x:n,y:r,endX:i,endY:o})}static typeText(t,n){return R.makePOSTRequest(`/control/${t}/text`,{},{text:n})}static pressKey(t,n){return R.makePOSTRequest(`/control/${t}/keyevent`,{},{keyCode:n})}static getClipboard(t){return R.makeGETRequest(`/control/${t}/clipboard`)}static setClipboard(t,n){return R.makePOSTRequest(`/control/${t}/clipboard`,{},{content:n})}static getScreenshot(t){return R.makeGETRequest(`/control/${t}/screenshot`)}static touchAndHold(t,n,r,i){return R.makePOSTRequest(`/control/${t}/touchAndHold`,{},{x:n,y:r,duration:i})}static lock(t){return R.makePOSTRequest(`/control/${t}/lock`,{},{})}static unlock(t){return R.makePOSTRequest(`/control/${t}/unlock`,{},{})}static installApp(t,n){return R.makePOSTRequest(`/control/${t}/install`,{},{appPath:n})}static startStream(t){return R.makePOSTRequest(`/control/${t}/stream/start`,{},{},{},{resolveErrors:!0})}static stopStream(t){return R.makePOSTRequest(`/control/${t}/stream/stop`,{},{},{keepalive:!0})}static uninstallApp(t,n){return R.makePOSTRequest(`/control/${t}/uninstall`,{},{bundleId:n})}static uploadAndInstallApp(t,n){const r=new FormData;return r.append("app",n),fetch(`/xenon/api/control/${t}/upload-install`,{method:"POST",body:r}).then(i=>i.json())}static listApps(t){return R.makeGETRequest(`/control/${t}/apps`)}static getLogs(t){return R.makeGETRequest(`/control/${t}/logs`)}static getApps(){return R.makeGETRequest("/apps")}static uploadApp(t){const n=new FormData;return n.append("app",t),fetch("/xenon/api/apps/upload",{method:"POST",body:n}).then(r=>r.json())}static deleteApp(t){return R.makeDELETERequest(`/apps/${t}`)}static installRepositoryApp(t,n){return R.makePOSTRequest(`/control/${t}/install-repository-app`,{},{appId:n},{},{resolveErrors:!0})}static executeShell(t,n){return R.makePOSTRequest(`/control/${t}/shell`,{},{command:n},{},{resolveErrors:!0})}static getInspectorSnapshot(t){return R.makeGETRequest(`/control/${t}/inspector/snapshot`)}static getWebhookConfigs(){return R.makeGETRequest("/webhook")}static addWebhookConfig(t,n,r,i){return R.makePOSTRequest("/webhook",{},{url:t,events:n,type:r,payloadTemplate:i})}static deleteWebhookConfig(t){return R.makeDELETERequest(`/webhook/${t}`)}static testWebhook(t,n){return R.makePOSTRequest("/webhook/test",{},{url:t,type:n})}static getGlobalConfig(){return R.makeGETRequest("/config")}static updateGlobalConfig(t){return R.makePOSTRequest("/config",{},t)}static testAIConfig(t){return R.makePOSTRequest("/config/test-ai",{},t,{},{resolveErrors:!0})}static resetMetrics(){return R.makePOSTRequest("/config/reset-metrics",{},{})}static getRecentHealingEvents(t=50){return R.makeGETRequest(`/healing/events?limit=${t}&t=${Date.now()}`)}static getHealingSummary(t=30){return R.makeGETRequest(`/healing/summary?windowDays=${t}&t=${Date.now()}`)}static getHealingHotspots(t={}){const{windowDays:n=30,limit:r=20,tier:i,platform:o,status:s="active"}=t;let l=`/healing/hotspots?windowDays=${n}&limit=${r}&status=${s}&t=${Date.now()}`;return i&&(l+=`&tier=${encodeURIComponent(i)}`),o&&(l+=`&platform=${encodeURIComponent(o)}`),R.makeGETRequest(l)}static getMutedSelectors(t={}){const{limit:n=50,offset:r=0}=t;return R.makeGETRequest(`/healing/state/muted?limit=${n}&offset=${r}&t=${Date.now()}`)}static getSelectorState(t,n){return R.makeGETRequest(`/healing/state/${encodeURIComponent(t)}/${encodeURIComponent(n)}?t=${Date.now()}`)}static async postSelectorStateAction(t){const n=await fetch("/xenon/api/healing/selector/state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({})),i=new Error(r.error??`Selector state action failed (${n.status})`);throw i.status=n.status,i.currentStatus=r.currentStatus??null,i}return n.json()}static getHealingSelectorDetail(t,n=30){return R.makeGETRequest(`/healing/selector?value=${encodeURIComponent(t)}&windowDays=${n}&t=${Date.now()}`)}static sendHealingDigest(t={}){return R.makePOSTRequest("/healing/digest/send",{},t)}static async exportBuild(t,n,r){const i=await fetch(`/xenon/api/build/${encodeURIComponent(t)}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:n,...r?{sessionIds:r}:{}})});if(!i.ok){const u=await i.text().catch(()=>i.statusText);throw new Error(`Export failed (${i.status}): ${u||i.statusText}`)}const o=i.headers.get("Content-Disposition")||"",s=/filename="?([^";]+)"?/.exec(o),l=s?s[1]:`build-${t}-sessions.${n}`;return{blob:await i.blob(),filename:l}}}function Kg(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"}function Qg(){const[e,t]=g.useState(!1);return g.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&!Kg(i.target)&&(i.preventDefault(),t(o=>!o)),i.key==="Escape"&&t(!1)},r=()=>t(!0);return window.addEventListener("keydown",n),window.addEventListener("xenon.open-command-palette",r),()=>{window.removeEventListener("keydown",n),window.removeEventListener("xenon.open-command-palette",r)}},[]),{open:e,setOpen:t}}function du(e,t){if(!e)return 0;const n=e.toLowerCase(),r=t.toLowerCase();if(r===n)return 1e4;if(r.startsWith(n))return 5e3-(r.length-n.length);let i=0,o=0,s=0;for(let l=0;l<n.length;l++){const a=n[l],u=r.indexOf(a,i);if(u===-1)return 0;u===i?(s+=1,o+=20+s*5):(s=0,o+=10-Math.min(u-i,10)),i=u+1}return Math.max(o,1)}const pu=[{id:"nav:overview",kind:"nav",label:"Overview",path:"/overview"},{id:"nav:devices",kind:"nav",label:"Devices",path:"/devices"},{id:"nav:live",kind:"nav",label:"Live devices",path:"/devices/live"},{id:"nav:builds",kind:"nav",label:"Sessions",path:"/builds"},{id:"nav:apps",kind:"nav",label:"Apps",path:"/apps"},{id:"nav:selector-health",kind:"nav",label:"Selector health",path:"/selector-health"},{id:"nav:notifications",kind:"nav",label:"Notifications",path:"/notifications"},{id:"nav:settings",kind:"nav",label:"Settings",path:"/settings"},{id:"nav:ai-settings",kind:"nav",label:"AI engine",path:"/ai-settings"},{id:"nav:maintenance",kind:"nav",label:"Maintenance",path:"/maintenance"},{id:"nav:teams",kind:"nav",label:"Teams",path:"/teams"},{id:"nav:api-keys",kind:"nav",label:"API keys",path:"/api-keys"},{id:"nav:users",kind:"nav",label:"Users",path:"/users"},{id:"nav:profile",kind:"nav",label:"Profile",path:"/profile"}];class Gg{constructor(){this.devices=[],this.builds=[],this.sessions=[],this.teams=[],this.keys=[],this.apps=[]}setDevices(t){this.devices=t.map(n=>({id:`device:${n.udid}`,kind:"device",label:n.name||n.udid,sub:n.udid,path:`/devices/${n.udid}/control`}))}setBuilds(t){this.builds=t.map(n=>({id:`build:${n.id}`,kind:"build",label:n.name||n.id,sub:typeof n.sessionCount=="number"?`${n.sessionCount} session${n.sessionCount===1?"":"s"}${n.failedCount?` · ${n.failedCount} failed`:""}`:n.id,path:`/builds/${encodeURIComponent(n.id)}`}))}setSessions(t){this.sessions=t.map(n=>({id:`session:${n.id}`,kind:"session",label:n.name||n.id,sub:n.id,path:`/builds?session=${encodeURIComponent(n.id)}`}))}setTeams(t){this.teams=t.map(n=>({id:`team:${n.id}`,kind:"team",label:n.name||n.id,sub:n.id,path:`/teams?team=${encodeURIComponent(n.id)}`}))}setKeys(t){this.keys=t.map(n=>({id:`key:${n.id}`,kind:"key",label:n.name||n.id,sub:n.id,path:`/api-keys?key=${encodeURIComponent(n.id)}`}))}setApps(t){this.apps=t.map(n=>({id:`app:${n.id}`,kind:"app",label:n.name||n.id,sub:n.id,path:`/apps?app=${encodeURIComponent(n.id)}`}))}search(t,n=8){return t.trim()?[...pu,...this.devices,...this.builds,...this.sessions,...this.teams,...this.keys,...this.apps].map(i=>{const o=du(t,i.label),s=i.sub?du(t,i.sub):0;return{it:i,score:Math.max(o,s)}}).filter(i=>i.score>0).sort((i,o)=>o.score-i.score).slice(0,n).map(i=>i.it):pu.slice(0,n)}}const Yg={nav:"Navigation",device:"Devices",build:"Builds",session:"Running sessions",team:"Teams",key:"API keys",app:"Apps"},Xg=["nav","device","build","session","team","key","app"],Jg=()=>{const{open:e,setOpen:t}=Qg(),[n,r]=g.useState(""),[i,o]=g.useState(0),s=mn(),l=g.useRef(new Gg),a=g.useRef(null);g.useEffect(()=>{if(!e)return;Promise.all([jn.getDevices().catch(()=>[]),jn.getSessions().catch(()=>[]),jn.getApps().catch(()=>[]),jn.listTeams().catch(()=>[]),jn.getBuilds().catch(()=>[])]).then(([k,c,f,d,y])=>{Array.isArray(k)&&l.current.setDevices(k),Array.isArray(y)&&l.current.setBuilds(y),Array.isArray(c)&&l.current.setSessions(c),Array.isArray(f)&&l.current.setApps(f),Array.isArray(d)&&l.current.setTeams(d)});const x=setTimeout(()=>{var k;return(k=a.current)==null?void 0:k.focus()},0);return()=>clearTimeout(x)},[e]),g.useEffect(()=>{e||(r(""),o(0))},[e]);const u=g.useMemo(()=>l.current.search(n,8),[n,e]),m=g.useMemo(()=>{const x=new Map;return u.forEach(k=>{const c=x.get(k.kind)||[];c.push(k),x.set(k.kind,c)}),x},[u]),v=g.useCallback(x=>{s(x.path),t(!1)},[s,t]),h=x=>{x.key==="ArrowDown"?(x.preventDefault(),o(k=>Math.min(k+1,Math.max(u.length-1,0)))):x.key==="ArrowUp"?(x.preventDefault(),o(k=>Math.max(k-1,0))):x.key==="Enter"&&(x.preventDefault(),u[i]&&v(u[i]))};if(!e)return null;let E=-1;return p.jsx("div",{className:"cp-overlay",onClick:()=>t(!1),children:p.jsxs("div",{className:"cp",role:"dialog","aria-modal":!0,"aria-label":"Command palette",onClick:x=>x.stopPropagation(),children:[p.jsxs("div",{className:"cp-input-row",children:[p.jsx(Cf,{size:14}),p.jsx("input",{ref:a,className:"cp-input",placeholder:"Search devices, sessions, settings…",value:n,onChange:x=>{r(x.target.value),o(0)},onKeyDown:h}),p.jsx("span",{className:"cp-esc",children:"ESC"})]}),p.jsxs("div",{className:"cp-results",children:[u.length===0&&p.jsx("div",{className:"cp-empty",children:"No results."}),Xg.filter(x=>m.has(x)).map(x=>p.jsxs("div",{className:"cp-group",children:[p.jsx("div",{className:"cp-group-head",children:Yg[x]}),m.get(x).map(k=>{E+=1;const c=E===i;return p.jsxs("button",{type:"button",className:`cp-item${c?" cp-item-active":""}`,onMouseEnter:()=>{o(E)},onClick:()=>v(k),children:[p.jsx("span",{className:"cp-item-label",children:k.label}),k.sub&&p.jsx("span",{className:"cp-item-sub",children:k.sub})]},k.id)})]},x))]})]})})};function Zg({children:e}){const{loading:t,me:n}=wl(),r=We();if(t)return p.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"Loading…"});if(!n){const i=encodeURIComponent(r.pathname+r.search),o=dy()?"&reason=expired":"";return p.jsx(qt,{to:`/login?next=${i}${o}`,replace:!0})}return p.jsx(p.Fragment,{children:e})}const hu="Xenon",ev={"/overview":"Overview","/devices":"Devices","/devices/live":"Live devices","/apps":"Apps","/builds":"Sessions","/selector-health":"Selector health","/selector-health/detail":"Selector health","/notifications":"Notifications","/settings":"Settings","/ai-settings":"AI engine","/maintenance":"Maintenance","/teams":"Teams","/users":"Users","/api-keys":"API keys","/profile":"Profile","/login":"Sign in","/forgot-password":"Forgot password","/reset-password":"Reset password"};function tv(e){const t=e.replace(/\/+$/,"")||"/";let n=ev[t];if(!n){let r;(r=t.match(/^\/devices\/([^/]+)\/control/))?n=`${decodeURIComponent(r[1])} · Device`:/^\/builds\/[^/]+\/sessions\//.test(t)?n="Session":/^\/builds\/[^/]+$/.test(t)?n="Sessions":(r=t.match(/^\/runbooks\/([^/]+)/))?n=`Runbook · ${decodeURIComponent(r[1])}`:t.startsWith("/reset-password/")&&(n="Reset password")}return n?`${n} · ${hu}`:hu}function nv(){const{pathname:e}=We();return g.useEffect(()=>{document.title=tv(e)},[e]),null}const rv=g.lazy(()=>Q(()=>import("./login-EkaxK7K5.js"),__vite__mapDeps([74,10,75,76,49,33,20,3]))),iv=g.lazy(()=>Q(()=>import("./forgot-password-CiZcr-gB.js"),__vite__mapDeps([77,75,76,49]))),mu=g.lazy(()=>Q(()=>import("./reset-password-tCemYrqV.js"),__vite__mapDeps([78,76,49]))),ov=g.lazy(()=>Q(()=>import("./ApiKeyGate-Snh2iZH5.js"),[]).then(e=>({default:e.ApiKeyGate})));function sv(){return p.jsx(Vg,{children:p.jsxs("div",{className:"min-h-screen w-full bg-[var(--bg)] text-[var(--text)]",children:[p.jsx(Hg,{}),p.jsx(wg,{}),p.jsx("main",{className:"pl-14 pt-14 h-screen overflow-y-auto",children:p.jsx($g,{})}),p.jsx(Jg,{})]})})}function lv(){return p.jsxs(om,{basename:"/xenon",children:[p.jsx(nv,{}),p.jsx(py,{children:p.jsx(g.Suspense,{fallback:p.jsx("div",{style:{padding:40},children:"Loading…"}),children:p.jsxs(Ef,{children:[p.jsx($,{path:"/login",element:p.jsx(rv,{})}),p.jsx($,{path:"/forgot-password",element:p.jsx(iv,{})}),p.jsx($,{path:"/reset-password",element:p.jsx(mu,{})}),p.jsx($,{path:"/reset-password/:token",element:p.jsx(mu,{})}),p.jsx($,{path:"/api-key-gate",element:p.jsx(ov,{children:p.jsx(qt,{to:"/overview",replace:!0})})}),p.jsx($,{path:"*",element:p.jsx(Zg,{children:p.jsx(sv,{})})})]})})})]})}df.render(p.jsx(g.StrictMode,{children:p.jsx(lv,{})}),document.getElementById("root"));export{Xm as A,_m as B,Cm as C,Sf as D,yu as E,wm as F,mm as G,gm as H,Lm as I,Nm as J,Wm as K,eu as L,Fm as M,qt as N,xm as O,wv as P,Am as Q,id as R,Km as S,Zm as T,ry as U,oy as V,fv as W,jn as X,Bg as Y,hv as Z,ty as _,We as a,wl as b,F as c,fy as d,cv as e,$m as f,mv as g,pv as h,uv as i,p as j,yv as k,dv as l,gv as m,gg as n,$i as o,ug as p,Gm as q,g as r,Dm as s,df as t,mn as u,av as v,rd as w,kv as x,ly as y,Cf as z};
@@ -1 +1 @@
1
- import{r as p,j as o}from"./index-DbzQAv86.js";import{c as e}from"./utils-CDN07tui.js";const n=p.forwardRef(({className:r,type:s,...t},a)=>o.jsx("input",{type:s,className:e("input-base",r),ref:a,...t}));n.displayName="Input";export{n as I};
1
+ import{r as p,j as o}from"./index-BHDlQcd6.js";import{c as e}from"./utils-CDN07tui.js";const n=p.forwardRef(({className:r,type:s,...t},a)=>o.jsx("input",{type:s,className:e("input-base",r),ref:a,...t}));n.displayName="Input";export{n as I};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DbzQAv86.js";/**
1
+ import{c as a}from"./index-BHDlQcd6.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DbzQAv86.js";/**
1
+ import{c}from"./index-BHDlQcd6.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as g,L as X,u as z,a as H,b as K,r as a,d as O,j as e,N as B,I as W,e as Y,C as _,f as G,l as J}from"./index-DbzQAv86.js";import{c as Q}from"./utils-CDN07tui.js";import{u as V}from"./use-password-reset-mode-BVFQr1mo.js";import{A as Z}from"./auth-shell-NbHUThYR.js";import{L as ee}from"./lock-BXGh7bJZ.js";import{C as te}from"./clock-CQLUBaRx.js";import{A as se}from"./arrow-right-D_onnhWU.js";import"./network-C5bJeATc.js";/**
1
+ import{c as g,L as X,u as z,a as H,b as K,r as a,d as O,j as e,N as B,I as W,e as Y,C as _,f as G,l as J}from"./index-BHDlQcd6.js";import{c as Q}from"./utils-CDN07tui.js";import{u as V}from"./use-password-reset-mode-XoxXVCzm.js";import{A as Z}from"./auth-shell-Vq1rYIVD.js";import{L as ee}from"./lock-s9ZhGDFF.js";import{C as te}from"./clock-BCG0drfS.js";import{A as se}from"./arrow-right-FEQsqDvH.js";import"./network-B8fPwmW9.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as N,x as M,r as d,X as C,j as e,D,S as y,I as w,P as A}from"./index-DbzQAv86.js";/* empty css */import{S as o,A as k}from"./SettingCard-CeHOIGW9.js";import{P as B}from"./page-header-CqaoOYPH.js";import{T as z}from"./trash-2-DJgpvIoq.js";import{C as E}from"./check-C8Un1cwf.js";import{C as R}from"./calendar-DrH0mjSD.js";import"./button-Do8mBvkU.js";import"./utils-CDN07tui.js";/**
1
+ import{c as N,x as M,r as d,X as C,j as e,D,S as y,I as w,P as A}from"./index-BHDlQcd6.js";/* empty css */import{S as o,A as k}from"./SettingCard-DAFqQw7S.js";import{P as B}from"./page-header-DhD-Kua9.js";import{T as z}from"./trash-2-BcQxmJP-.js";import{C as E}from"./check-DYccNk73.js";import{C as R}from"./calendar-BuRuUa7q.js";import"./button-DrqhMLZ0.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,4 +1,4 @@
1
- import{c as e}from"./index-DbzQAv86.js";/**
1
+ import{c as e}from"./index-BHDlQcd6.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DbzQAv86.js";/**
1
+ import{c as e}from"./index-BHDlQcd6.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.