@tapflowio/relay 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/RelayServer.d.ts +50 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +359 -84
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/SessionManager.d.ts +43 -6
  6. package/dist/SessionManager.d.ts.map +1 -1
  7. package/dist/SessionManager.js +94 -8
  8. package/dist/SessionManager.js.map +1 -1
  9. package/dist/types.d.ts +5 -10
  10. package/dist/types.d.ts.map +1 -1
  11. package/package.json +5 -3
  12. package/public/assets/{AppCenter-BRmG2FEm.js → AppCenter-B3FO67aw.js} +1 -1
  13. package/public/assets/AppCenter-B3FO67aw.js.br +0 -0
  14. package/public/assets/{Default-DTr0wqds.js → Default-BlNUv5dw.js} +1 -1
  15. package/public/assets/Default-BlNUv5dw.js.br +0 -0
  16. package/public/assets/{Invite-DKsNh2GB.js → Invite-CKYFmy7S.js} +1 -1
  17. package/public/assets/Invite-CKYFmy7S.js.br +0 -0
  18. package/public/assets/{MacResources-CLDdcibL.js → MacResources-BK4VQnFc.js} +1 -1
  19. package/public/assets/MacResources-BK4VQnFc.js.br +0 -0
  20. package/public/assets/{NotFound-BtKq2uv6.js → NotFound-BMmi1paB.js} +1 -1
  21. package/public/assets/NotFound-BMmi1paB.js.br +0 -0
  22. package/public/assets/QASession-CVTlqW3d.js +125 -0
  23. package/public/assets/QASession-CVTlqW3d.js.br +0 -0
  24. package/public/assets/{ResetPassword-gp6hVQrf.js → ResetPassword-VPPBWzSI.js} +1 -1
  25. package/public/assets/ResetPassword-VPPBWzSI.js.br +0 -0
  26. package/public/assets/{Setup-DiG4Nbs7.js → Setup-CRdnCl41.js} +1 -1
  27. package/public/assets/Setup-CRdnCl41.js.br +0 -0
  28. package/public/assets/{Team-D1iwg2vL.js → Team-CBsjuUwh.js} +1 -1
  29. package/public/assets/Team-CBsjuUwh.js.br +0 -0
  30. package/public/assets/{Tokens-DGtE4Xcy.js → Tokens-CU9HB9WD.js} +1 -1
  31. package/public/assets/Tokens-CU9HB9WD.js.br +0 -0
  32. package/public/assets/alert-dialog-DWqGDQTB.js +1 -0
  33. package/public/assets/alert-dialog-DWqGDQTB.js.br +0 -0
  34. package/public/assets/{badge-CavXTq2x.js → badge-OToVq1dK.js} +1 -1
  35. package/public/assets/badge-OToVq1dK.js.br +0 -0
  36. package/public/assets/{build-format-BZV6gt41.js → build-format-B78hbKY9.js} +1 -1
  37. package/public/assets/build-format-B78hbKY9.js.br +3 -0
  38. package/public/assets/dialog-BxC9v2BL.js +11 -0
  39. package/public/assets/dialog-BxC9v2BL.js.br +0 -0
  40. package/public/assets/index-DXjMx9hQ.js +274 -0
  41. package/public/assets/index-DXjMx9hQ.js.br +0 -0
  42. package/public/assets/index-uGJGo6ac.css +1 -0
  43. package/public/assets/index-uGJGo6ac.css.br +0 -0
  44. package/public/assets/{pencil-BGrOEXS6.js → pencil-Cq64I9LV.js} +1 -1
  45. package/public/assets/pencil-Cq64I9LV.js.br +0 -0
  46. package/public/assets/{table-CqOA0Bb1.js → table-CbATN5Pi.js} +1 -1
  47. package/public/assets/table-CbATN5Pi.js.br +0 -0
  48. package/public/assets/tabs-BVumgDA4.js +1 -0
  49. package/public/assets/tabs-BVumgDA4.js.br +0 -0
  50. package/public/assets/{trash-2-CwlFrbEF.js → trash-2-CszwJHEh.js} +1 -1
  51. package/public/assets/trash-2-CszwJHEh.js.br +0 -0
  52. package/public/index.html +2 -2
  53. package/public/index.html.br +0 -0
  54. package/public/assets/AppCenter-BRmG2FEm.js.br +0 -0
  55. package/public/assets/Default-DTr0wqds.js.br +0 -0
  56. package/public/assets/Invite-DKsNh2GB.js.br +0 -0
  57. package/public/assets/MacResources-CLDdcibL.js.br +0 -0
  58. package/public/assets/NotFound-BtKq2uv6.js.br +0 -0
  59. package/public/assets/QASession-B_5aJ67l.js +0 -130
  60. package/public/assets/QASession-B_5aJ67l.js.br +0 -0
  61. package/public/assets/ResetPassword-gp6hVQrf.js.br +0 -0
  62. package/public/assets/Setup-DiG4Nbs7.js.br +0 -0
  63. package/public/assets/Team-D1iwg2vL.js.br +0 -0
  64. package/public/assets/Tokens-DGtE4Xcy.js.br +0 -0
  65. package/public/assets/alert-dialog-CXwkFlF3.js +0 -1
  66. package/public/assets/alert-dialog-CXwkFlF3.js.br +0 -0
  67. package/public/assets/badge-CavXTq2x.js.br +0 -0
  68. package/public/assets/build-format-BZV6gt41.js.br +0 -0
  69. package/public/assets/dialog-JbKwqqS0.js +0 -11
  70. package/public/assets/dialog-JbKwqqS0.js.br +0 -0
  71. package/public/assets/index-CBnxiD7-.js +0 -274
  72. package/public/assets/index-CBnxiD7-.js.br +0 -0
  73. package/public/assets/index-Ctx3_cYz.css +0 -1
  74. package/public/assets/index-Ctx3_cYz.css.br +0 -0
  75. package/public/assets/pencil-BGrOEXS6.js.br +0 -0
  76. package/public/assets/table-CqOA0Bb1.js.br +0 -0
  77. package/public/assets/tabs-BVBbhCFG.js +0 -1
  78. package/public/assets/tabs-BVBbhCFG.js.br +0 -0
  79. package/public/assets/trash-2-CwlFrbEF.js.br +0 -0
@@ -0,0 +1 @@
1
+ @font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-standard-normal-BwkfbSeq.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-ext-standard-normal-DpK-iCPk.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:JetBrains Mono;font-style:normal;font-display:swap;font-weight:100 800;src:url(/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 98%;--foreground: 0 0% 9%;--card: 0 0% 100%;--card-foreground: 0 0% 9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 9%;--primary: 0 0% 9%;--primary-foreground: 0 0% 100%;--secondary: 0 0% 96%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96%;--muted-foreground: 0 0% 53%;--accent: 0 0% 96%;--accent-foreground: 0 0% 9%;--destructive: 0 100% 47%;--destructive-foreground: 0 0% 100%;--border: 0 0% 92%;--input: 0 0% 92%;--ring: 0 0% 9%;--radius: .5rem;--avatar-1-bg: 353 90% 82%;--avatar-1-fg: 353 80% 28%;--avatar-2-bg: 25 100% 76%;--avatar-2-fg: 25 90% 25%;--avatar-3-bg: 48 100% 72%;--avatar-3-fg: 31 85% 25%;--avatar-4-bg: 151 70% 70%;--avatar-4-fg: 151 80% 18%;--avatar-5-bg: 216 90% 78%;--avatar-5-fg: 216 85% 25%;--avatar-6-bg: 278 75% 84%;--avatar-6-fg: 278 75% 28%;--sidebar-background: 0 0% 98%;--sidebar-foreground: 0 0% 30%;--sidebar-primary: 0 0% 9%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 0 0% 96%;--sidebar-accent-foreground: 0 0% 9%;--sidebar-border: 0 0% 92%;--sidebar-ring: 211 100% 48%;--chart-1: 216 85% 55%;--chart-2: 262 65% 58%;--chart-3: 30 80% 55%;--chart-4: 151 65% 45%;--chart-5: 340 75% 55%}.dark{--background: 0 0% 9%;--foreground: 0 0% 98%;--card: 0 0% 11%;--card-foreground: 0 0% 98%;--popover: 0 0% 11%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 0 0% 9%;--secondary: 0 0% 15%;--secondary-foreground: 0 0% 98%;--muted: 0 0% 15%;--muted-foreground: 0 0% 65%;--accent: 0 0% 15%;--accent-foreground: 0 0% 98%;--destructive: 0 70% 62%;--destructive-foreground: 0 0% 98%;--border: 0 0% 18%;--input: 0 0% 18%;--ring: 0 0% 98%;--avatar-1-bg: 353 40% 32%;--avatar-1-fg: 353 60% 78%;--avatar-2-bg: 25 42% 32%;--avatar-2-fg: 25 65% 78%;--avatar-3-bg: 48 42% 32%;--avatar-3-fg: 48 65% 78%;--avatar-4-bg: 151 36% 28%;--avatar-4-fg: 151 50% 72%;--avatar-5-bg: 216 42% 32%;--avatar-5-fg: 216 60% 78%;--avatar-6-bg: 278 38% 32%;--avatar-6-fg: 278 55% 78%;--sidebar-background: 0 0% 7%;--sidebar-foreground: 0 0% 80%;--sidebar-primary: 0 0% 98%;--sidebar-primary-foreground: 0 0% 9%;--sidebar-accent: 0 0% 13%;--sidebar-accent-foreground: 0 0% 98%;--sidebar-border: 0 0% 18%;--sidebar-ring: 211 100% 48%;--chart-1: 216 80% 65%;--chart-2: 262 60% 68%;--chart-3: 30 75% 65%;--chart-4: 151 60% 55%;--chart-5: 340 70% 65%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-feature-settings:"ss01","ss02";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button:not([aria-haspopup]):not(:disabled),[role=button]:not([aria-haspopup]):not(:disabled){transition-property:color,background-color,border-color,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.12s}button:active:not([aria-haspopup]):not(:disabled),[role=button]:active:not([aria-haspopup]):not(:disabled){transform:translateY(1px)}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50,.z-\[50\]{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-1{margin-left:-.25rem}.-mr-4{margin-right:-1rem}.-mt-1{margin-top:-.25rem}.mb-1{margin-bottom:.25rem}.ml-0\.5{margin-left:.125rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[220px\]{height:220px}.h-\[32px\]{height:32px}.h-\[52px\]{height:52px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-48{max-height:12rem}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[var\(--radix-dropdown-menu-content-available-height\)\]{max-height:var(--radix-dropdown-menu-content-available-height)}.min-h-0{min-height:0px}.min-h-16{min-height:4rem}.min-h-\[100px\]{min-height:100px}.min-h-\[80px\]{min-height:80px}.min-h-full{min-height:100%}.min-h-svh{min-height:100svh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-\[300px\]{width:300px}.w-\[500px\]{width:500px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-6{min-width:1.5rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[500px\]{max-width:500px}.max-w-\[900px\]{max-width:900px}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\[--radix-dropdown-menu-content-transform-origin\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[12px\]{gap:12px}.gap-\[4px\]{gap:4px}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:hsl(var(--border))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-\[18px\]{border-radius:18px!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-pill{border-radius:100px}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-border{border-color:hsl(var(--border))}.border-input{border-color:hsl(var(--input))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/90{background-color:hsl(var(--background) / .9)}.bg-black\/80{background-color:#000c}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-foreground\/85{background-color:hsl(var(--foreground) / .85)}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/40{background-color:hsl(var(--muted-foreground) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-400{--tw-bg-opacity: 1;background-color:rgb(167 139 250 / var(--tw-bg-opacity, 1))}.bg-zinc-100{--tw-bg-opacity: 1;background-color:rgb(244 244 245 / var(--tw-bg-opacity, 1))}.bg-zinc-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.fill-muted-foreground{fill:hsl(var(--muted-foreground))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-\[10px\]{padding:10px}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[7px\]{padding-left:7px;padding-right:7px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-\[1px\]{padding-bottom:1px}.pl-1{padding-left:.25rem}.pl-8{padding-left:2rem}.pl-\[4px\]{padding-left:4px}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:Inter,ui-sans-serif,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-display-md{letter-spacing:-.96px}.tracking-display-sm{letter-spacing:-.6px}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-background{color:hsl(var(--background))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/75{color:hsl(var(--foreground) / .75)}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-sky-700{--tw-text-opacity: 1;color:rgb(3 105 161 / var(--tw-text-opacity, 1))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity, 1))}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card-1{--tw-shadow: inset 0 0 0 1px rgba(0,0,0,.08);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card-2{--tw-shadow: 0px 1px 1px rgba(0,0,0,.02), 0px 2px 2px rgba(0,0,0,.04), inset 0 0 0 1px rgba(0,0,0,.08);--tw-shadow-colored: 0px 1px 1px var(--tw-shadow-color), 0px 2px 2px var(--tw-shadow-color), inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card-3{--tw-shadow: 0px 2px 2px rgba(0,0,0,.04), 0px 8px 8px -8px rgba(0,0,0,.04), inset 0 0 0 1px rgba(0,0,0,.08);--tw-shadow-colored: 0px 2px 2px var(--tw-shadow-color), 0px 8px 8px -8px var(--tw-shadow-color), inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card-4{--tw-shadow: 0px 2px 2px rgba(0,0,0,.04), 0px 8px 16px -4px rgba(0,0,0,.04), inset 0 0 0 1px rgba(0,0,0,.08);--tw-shadow-colored: 0px 2px 2px var(--tw-shadow-color), 0px 8px 16px -4px var(--tw-shadow-color), inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pt-0:first-child{padding-top:0}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}.focus-within\:ring-2:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-ring:focus-within{--tw-ring-color: hsl(var(--ring))}.focus-within\:ring-offset-2:focus-within{--tw-ring-offset-width: 2px}.hover\:border-primary:hover{border-color:hsl(var(--primary))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-destructive\/20:hover{background-color:hsl(var(--destructive) / .2)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:\!opacity-100:hover{opacity:1!important}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-50{opacity:.5}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:justify-center{justify-content:center}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-emerald-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(2 44 34 / var(--tw-bg-opacity, 1))}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-red-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(69 10 10 / var(--tw-bg-opacity, 1))}.dark\:bg-sky-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 47 73 / var(--tw-bg-opacity, 1))}.dark\:bg-zinc-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-emerald-300:is(.dark *){--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-sky-300:is(.dark *){--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.dark\:text-zinc-400:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}@media(min-width:640px){.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:max-w-\[440px\]{max-width:440px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2\.5{gap:.625rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media(min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:1536px){.\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-3\.5>svg{height:.875rem}.\[\&\>svg\]\:w-3\.5>svg{width:.875rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:.75rem;height:.75rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:hsl(var(--background) / .2)}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:hsl(var(--background))}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:hsl(var(--background) / .1)}
@@ -1,4 +1,4 @@
1
- import{W as a}from"./index-CBnxiD7-.js";/**
1
+ import{W as a}from"./index-DXjMx9hQ.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a6 as o,a3 as t,J as l}from"./index-CBnxiD7-.js";const r=o.forwardRef(({className:a,...e},s)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:s,className:l("w-full caption-bottom text-sm",a),...e})}));r.displayName="Table";const d=o.forwardRef(({className:a,...e},s)=>t.jsx("thead",{ref:s,className:l("[&_tr]:border-b",a),...e}));d.displayName="TableHeader";const m=o.forwardRef(({className:a,...e},s)=>t.jsx("tbody",{ref:s,className:l("[&_tr:last-child]:border-0",a),...e}));m.displayName="TableBody";const b=o.forwardRef(({className:a,...e},s)=>t.jsx("tfoot",{ref:s,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...e}));b.displayName="TableFooter";const c=o.forwardRef(({className:a,...e},s)=>t.jsx("tr",{ref:s,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...e}));c.displayName="TableRow";const f=o.forwardRef(({className:a,...e},s)=>t.jsx("th",{ref:s,className:l("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...e}));f.displayName="TableHead";const i=o.forwardRef(({className:a,...e},s)=>t.jsx("td",{ref:s,className:l("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...e}));i.displayName="TableCell";const n=o.forwardRef(({className:a,...e},s)=>t.jsx("caption",{ref:s,className:l("mt-4 text-sm text-muted-foreground",a),...e}));n.displayName="TableCaption";export{r as T,m as a,i as b,f as c,d,c as e};
1
+ import{a6 as o,a3 as t,J as l}from"./index-DXjMx9hQ.js";const r=o.forwardRef(({className:a,...e},s)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:s,className:l("w-full caption-bottom text-sm",a),...e})}));r.displayName="Table";const d=o.forwardRef(({className:a,...e},s)=>t.jsx("thead",{ref:s,className:l("[&_tr]:border-b",a),...e}));d.displayName="TableHeader";const m=o.forwardRef(({className:a,...e},s)=>t.jsx("tbody",{ref:s,className:l("[&_tr:last-child]:border-0",a),...e}));m.displayName="TableBody";const b=o.forwardRef(({className:a,...e},s)=>t.jsx("tfoot",{ref:s,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...e}));b.displayName="TableFooter";const c=o.forwardRef(({className:a,...e},s)=>t.jsx("tr",{ref:s,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...e}));c.displayName="TableRow";const f=o.forwardRef(({className:a,...e},s)=>t.jsx("th",{ref:s,className:l("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...e}));f.displayName="TableHead";const i=o.forwardRef(({className:a,...e},s)=>t.jsx("td",{ref:s,className:l("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...e}));i.displayName="TableCell";const n=o.forwardRef(({className:a,...e},s)=>t.jsx("caption",{ref:s,className:l("mt-4 text-sm text-muted-foreground",a),...e}));n.displayName="TableCaption";export{r as T,m as a,i as b,f as c,d,c as e};
@@ -0,0 +1 @@
1
+ import{a6 as o,a3 as g,u as S,t as p,q as j,K as m,s as A,Z as N,O as P,af as k,ae as L,ai as $,J as x}from"./index-DXjMx9hQ.js";const M=location.protocol==="https:"?"wss:":"ws:",D=`${M}//${location.host}`,O=2e3;function ee(t,e){const a=o.useRef(null),[f,n]=o.useState(!1),r=o.useRef(t),u=o.useRef(e);return o.useLayoutEffect(()=>{r.current=t,u.current=e},[t,e]),o.useEffect(()=>{let d=!1;const b=()=>{if(d)return;const l=new WebSocket(D);l.binaryType="arraybuffer",a.current=l,l.onopen=()=>n(!0),l.onclose=()=>{n(!1),d||setTimeout(b,O)},l.onmessage=c=>{var s;if(c.data instanceof ArrayBuffer){(s=u.current)==null||s.call(u,c.data);return}try{r.current(JSON.parse(c.data))}catch{}}};return b(),()=>{var l;d=!0,(l=a.current)==null||l.close()}},[]),{send:o.useCallback(d=>{var b;((b=a.current)==null?void 0:b.readyState)===WebSocket.OPEN&&a.current.send(JSON.stringify(d))},[]),connected:f}}var V=Object.defineProperty,T=(t,e)=>V(t,"name",{value:e,configurable:!0}),y="Tabs",[F,te]=P(y,[N]),w=N(),[G,C]=F(y),K=o.forwardRef(T(function(e,a){const{__scopeTabs:f,value:n,onValueChange:r,defaultValue:u,orientation:i="horizontal",dir:d,activationMode:b="automatic",...l}=e,c=k(d),[s,v]=L({prop:n,onChange:r,defaultProp:u??"",caller:y});return g.jsx(G,{scope:f,baseId:$(),value:s,onValueChange:v,orientation:i,dir:c,activationMode:b,children:g.jsx(p.div,{dir:c,"data-orientation":i,...l,ref:a})})},"Tabs")),J="TabsList",q=o.forwardRef(T(function(e,a){const{__scopeTabs:f,loop:n=!0,...r}=e,u=C(J,f),i=w(f);return g.jsx(S,{asChild:!0,...i,orientation:u.orientation,dir:u.dir,loop:n,children:g.jsx(p.div,{role:"tablist","aria-orientation":u.orientation,...r,ref:a})})},"TabsList")),W="TabsTrigger",Y=o.forwardRef(T(function(e,a){const{__scopeTabs:f,value:n,disabled:r=!1,...u}=e,i=C(W,f),d=w(f),b=R(i.baseId,n),l=h(i.baseId,n),c=n===i.value;return g.jsx(j,{asChild:!0,...d,focusable:!r,active:c,children:g.jsx(p.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:b,...u,ref:a,onMouseDown:m(e.onMouseDown,s=>{!r&&s.button===0&&s.ctrlKey===!1?i.onValueChange(n):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{r||s.target!==s.currentTarget||[" ","Enter"].includes(s.key)&&i.onValueChange(n)}),onFocus:m(e.onFocus,()=>{const s=i.activationMode!=="manual";!c&&!r&&s&&i.onValueChange(n)})})})},"TabsTrigger")),z="TabsContent",H=o.forwardRef(T(function(e,a){const{__scopeTabs:f,value:n,forceMount:r,children:u,...i}=e,d=C(z,f),b=R(d.baseId,n),l=h(d.baseId,n),c=n===d.value,s=o.useRef(c);return o.useEffect(()=>{const v=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(v)},[]),g.jsx(A,{present:r||c,children:({present:v})=>g.jsx(p.div,{"data-state":c?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":b,hidden:!v,id:l,tabIndex:0,...i,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:v&&u})})},"TabsContent"));function R(t,e){return`${t}-trigger-${e}`}T(R,"makeTriggerId");function h(t,e){return`${t}-content-${e}`}T(h,"makeContentId");var U=K,_=q,E=Y,I=H;const ae=U,Z=o.forwardRef(({className:t,...e},a)=>g.jsx(_,{ref:a,className:x("inline-flex h-9 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));Z.displayName=_.displayName;const B=o.forwardRef(({className:t,...e},a)=>g.jsx(E,{ref:a,className:x("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));B.displayName=E.displayName;const Q=o.forwardRef(({className:t,...e},a)=>g.jsx(I,{ref:a,className:x("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Q.displayName=I.displayName;export{ae as T,Q as a,Z as b,B as c,ee as u};
@@ -1,4 +1,4 @@
1
- import{W as a}from"./index-CBnxiD7-.js";/**
1
+ import{W as a}from"./index-DXjMx9hQ.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/public/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
7
7
  <title>tapflow</title>
8
- <script type="module" crossorigin src="/assets/index-CBnxiD7-.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-Ctx3_cYz.css">
8
+ <script type="module" crossorigin src="/assets/index-DXjMx9hQ.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-uGJGo6ac.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
Binary file
Binary file
@@ -1,130 +0,0 @@
1
- import{W as te,a6 as o,al as un,a3 as n,J as Z,y as Pt,T as Ce,z as ke,B as ae,x as Ee,S as dn,a8 as tt,r as Jn,s as Ct,K as Le,ad as Oe,t as ze,O as fn,ac as et,aj as Zn,af as Qn,U as er,w as tr,f as nr,am as rr,ae as sr,ak as or,ab as ar,L as ir}from"./index-CBnxiD7-.js";import{f as cr,a as lr,P as hn,c as Gt,S as ur,b as dr}from"./build-format-BZV6gt41.js";import{u as pn,T as fr,b as hr,c as qt,a as Jt}from"./tabs-BVBbhCFG.js";import{D as mn,a as gn,d as pr,e as xn,b as mr,c as gr,k as xr,S as br,i as yr,j as vr,g as wr,h as Zt}from"./dialog-JbKwqqS0.js";import{B as Sr}from"./badge-CavXTq2x.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Rr=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jr=te("arrow-left",Rr);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Cr=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kr=te("arrow-up",Cr);/**
12
- * @license lucide-react v0.577.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Er=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Tr=te("camera",Er);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const _r=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ar=te("download",_r);/**
22
- * @license lucide-react v0.577.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Pr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],Nr=te("film",Pr);/**
27
- * @license lucide-react v0.577.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const Dr=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],bn=te("house",Dr);/**
32
- * @license lucide-react v0.577.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const Lr=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Mr=te("image-plus",Lr);/**
37
- * @license lucide-react v0.577.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const Ir=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ur=te("info",Ir);/**
42
- * @license lucide-react v0.577.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const Hr=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Fr=te("keyboard",Hr);/**
47
- * @license lucide-react v0.577.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const Br=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],yn=te("link-2",Br);/**
52
- * @license lucide-react v0.577.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const $r=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rt=te("loader-circle",$r);/**
57
- * @license lucide-react v0.577.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const Or=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],zr=te("message-square",Or);/**
62
- * @license lucide-react v0.577.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const Wr=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Vr=te("power",Wr);/**
67
- * @license lucide-react v0.577.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Kr=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Xr=te("rotate-cw",Kr);/**
72
- * @license lucide-react v0.577.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const Yr=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Gr=te("scan-line",Yr);/**
77
- * @license lucide-react v0.577.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const qr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Jr=te("square",qr);/**
82
- * @license lucide-react v0.577.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const Zr=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Qr=te("video",Zr);/**
87
- * @license lucide-react v0.577.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const es=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],ts=te("volume-2",es);/**
92
- * @license lucide-react v0.577.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const ns=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],rs=te("volume-1",ns);function ss(t){const[e,r]=o.useState(null);return o.useEffect(()=>{t&&cr(t).then(r)},[t]),{build:e}}function os(t){const[e,r]=o.useState([]),[s,i]=o.useState(null),[a,c]=o.useState(null),[f,u]=o.useState(""),[p,m]=o.useState(!1),[g,d]=o.useState(""),x=o.useCallback(E=>{E.type==="agents:listed"&&r(E.sessions),E.type==="session:joined"&&(m(!1),d("Connected")),E.type==="error"&&(m(!1),d(`Error: ${E.message}`))},[]),{send:y,connected:R}=pn(x);o.useEffect(()=>{if(!R)return;y({type:"agents:list"});const E=setInterval(()=>y({type:"agents:list"}),5e3);return()=>clearInterval(E)},[R,y]);const C=o.useRef({sessionId:a,deviceId:f});o.useEffect(()=>{C.current={sessionId:a,deviceId:f}},[a,f]),o.useEffect(()=>()=>{const{sessionId:E,deviceId:M}=C.current;E&&M&&y({type:"device:shutdown",sessionId:E,payload:{deviceId:M}})},[y]);const A=e.filter(E=>E.devices.some(M=>M.platform===t)),j=o.useCallback(E=>{u(E.id),m(!0),d("Booting…"),c(E.sessionId)},[]),P=o.useCallback(()=>u(""),[]),_=o.useCallback(()=>{const{sessionId:E,deviceId:M}=C.current;E&&M&&y({type:"device:shutdown",sessionId:E,payload:{deviceId:M}}),c(null),m(!1),d("")},[y]),L=o.useCallback(()=>{const{sessionId:E,deviceId:M}=C.current;E&&M&&y({type:"device:shutdown",sessionId:E,payload:{deviceId:M}}),c(null),i(null),m(!1),d("")},[y]);return{sessions:e,selectedAgent:s,setSelectedAgent:i,activeSessionId:a,deviceId:f,booting:p,status:g,send:y,connected:R,agentGroups:A,startDevice:j,resetDevice:P,handleBack:_,handleBackToMacs:L}}function as(t,e){const[r,s]=o.useState(""),[i,a]=o.useState(""),[c,f]=o.useState("app-only"),u=(t==null?void 0:t.devices.filter(g=>g.platform===e))??[],p=[...new Set(u.map(g=>g.osVersion).filter(Boolean))].sort((g,d)=>{const x=C=>C.replace(/^[^\d]*/,"").split(".").map(Number),[y,R]=[x(g),x(d)];for(let C=0;C<Math.max(y.length,R.length);C++){const A=(R[C]??0)-(y[C]??0);if(A!==0)return A}return 0}),m=(r?u.filter(g=>g.osVersion===r):u).filter(g=>!i||g.name.toLowerCase().includes(i.toLowerCase()));return{filteredDevices:u,osVersions:p,osVersion:r,setOsVersion:s,deviceSearch:i,setDeviceSearch:a,versionedDevices:m,resetMode:c,setResetMode:f}}function is(){const[t]=un(),e=t.get("perf")==="1",[r,s]=o.useState(e);return o.useEffect(()=>{if(!e){s(!1);return}s(!0);const i=a=>{a.ctrlKey&&a.shiftKey&&a.key==="P"&&s(c=>!c)};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e]),{perfMode:e,visible:r}}const cs=["video/mp4;codecs=avc1","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function vn({sessionId:t,buildId:e,onRecordingUploaded:r}){const[s,i]=o.useState("idle"),a=o.useRef(null),c=o.useRef(r);o.useEffect(()=>{c.current=r},[r]);const f=o.useRef(!1),u=o.useRef(null),p=o.useRef([]),m=o.useRef(""),g=o.useRef(0),d=o.useRef(null),x=o.useCallback(()=>{var C;f.current&&((C=d.current)==null||C.call(d),g.current=requestAnimationFrame(x))},[]),y=o.useCallback(C=>{const A=a.current;if(!A)return;const j=A.getContext("2d");j&&(j.fillStyle="#000",j.fillRect(0,0,A.width,A.height));const P=cs.find(L=>MediaRecorder.isTypeSupported(L))??"";if(!P)return;m.current=P,p.current=[];const _=new MediaRecorder(A.captureStream(30),{mimeType:P});_.ondataavailable=L=>{L.data.size>0&&p.current.push(L.data)},u.current=_,_.start(1e3),d.current=C,f.current=!0,g.current=requestAnimationFrame(x),i("recording")},[x]),R=o.useCallback(async()=>{var L;i("uploading"),f.current=!1,cancelAnimationFrame(g.current);const C=u.current;if(!C){i("idle");return}await new Promise(E=>{const M=setTimeout(E,5e3);C.onstop=()=>{clearTimeout(M),E()};try{C.stop()}catch{clearTimeout(M),E()}}),u.current=null;const A=m.current,j=A.includes("mp4")?".mp4":".webm",P=new Blob(p.current,{type:A});p.current=[];const _=new FormData;_.append("file",P,`tapflow-${Date.now()}${j}`);try{const E=new URLSearchParams({sessionId:t});e&&E.set("buildId",String(e));const M=await fetch(`/api/v1/recordings/upload?${E}`,{method:"POST",credentials:"include",body:_}),G=await M.json();if(M.ok&&G.url){const Q=document.createElement("a");Q.href=G.url,Q.download="",Q.click(),(L=c.current)==null||L.call(c),i("done"),setTimeout(()=>i("idle"),2e3)}else i("idle")}catch{i("idle")}},[t,e]);return o.useEffect(()=>{if(s!=="recording")return;const C=()=>{document.visibilityState==="hidden"&&R()};return document.addEventListener("visibilitychange",C),()=>{var A;document.removeEventListener("visibilitychange",C),f.current&&(f.current=!1,cancelAnimationFrame(g.current),(A=u.current)==null||A.stop(),u.current=null)}},[s,R]),{recordState:s,recordCanvasRef:a,startClientRecording:y,stopClientRecording:R}}function wn(){const t=o.useRef(0),[e,r]=o.useState(0);return o.useEffect(()=>{const s=setInterval(()=>{r(t.current),t.current=0},1e3);return()=>clearInterval(s)},[]),{fps:e,frameCount:t}}function Qe({className:t,...e}){return n.jsx("kbd",{"data-slot":"kbd",className:Z("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t),...e})}function Nt({className:t,...e}){return n.jsx("kbd",{"data-slot":"kbd-group",className:Z("inline-flex items-center gap-1",t),...e})}function lt({label:t,keys:e}){return n.jsxs("span",{className:"flex items-center gap-3",children:[t,n.jsx(Nt,{children:e.map(r=>n.jsx(Qe,{children:r},r))})]})}function Sn({joined:t,onScreenshot:e,onRecordToggle:r,recordState:s,onRotate:i,onDeepLink:a,platformSlot:c,launchSlot:f}){return t?n.jsx(Pt,{delayDuration:400,children:n.jsxs("div",{className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 backdrop-blur-sm px-1.5 py-2.5 shrink-0 mt-3",children:[f,c,n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:a,children:n.jsx(yn,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:n.jsx(lt,{label:"Deeplink",keys:["⌘","K"]})})]}),n.jsx("div",{className:"w-4 h-px bg-border my-1"}),n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e,children:n.jsx(Tr,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:n.jsx(lt,{label:"Screenshot",keys:["⌘","S"]})})]}),n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:Z("h-8 w-8",s==="recording"&&"text-red-500 hover:text-red-500"),disabled:s==="uploading"||s==="done",onClick:r,children:s==="uploading"?n.jsx(Rt,{className:"h-4 w-4 animate-spin"}):s==="recording"?n.jsx(Jr,{className:"h-4 w-4 fill-current"}):n.jsx(Qr,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:s==="idle"?n.jsx(lt,{label:"Start recording",keys:["⌘","⇧","Y"]}):s==="recording"?n.jsx(lt,{label:"Stop recording",keys:["⌘","⇧","Y"]}):"Processing…"})]}),n.jsx("div",{className:"w-4 h-px bg-border my-1"}),n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:i,children:n.jsx(Xr,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:n.jsx(lt,{label:"Rotate",keys:["⌘","⇧","O"]})})]})]})}):null}class Dt{constructor(e){this.bytes=e,this.bitPos=0}get position(){return this.bitPos}bit(){const e=this.bitPos>>3,r=7-(this.bitPos&7);return this.bitPos++,e>=this.bytes.length?0:this.bytes[e]>>r&1}bits(e){let r=0;for(let s=0;s<e;s++)r=r<<1|this.bit();return r>>>0}flag(){return this.bit()===1}ue(){let e=0;for(;this.bit()===0&&e<32;)e++;return e===0?0:(1<<e)-1+this.bits(e)}se(){const e=this.ue();return e&1?Math.ceil(e/2):-Math.ceil(e/2)}}class ls{constructor(){this.bitsArr=[]}bit(e){this.bitsArr.push(e&1)}ue(e){const r=e+1,s=Math.floor(Math.log2(r));for(let i=0;i<s;i++)this.bit(0);for(let i=s;i>=0;i--)this.bit(r>>i&1)}toBytes(){const e=[];for(let r=0;r<this.bitsArr.length;r+=8){let s=0;for(let i=0;i<8;i++)s=s<<1|(this.bitsArr[r+i]??0);e.push(s)}return new Uint8Array(e)}}function Rn(t){const e=[];let r=0;for(let s=1;s<t.length;s++){const i=t[s];if(r>=2&&i===3){r=0;continue}e.push(i),r=i===0?r+1:0}return new Uint8Array(e)}function us(t){const e=[];let r=0;for(const s of t)r>=2&&s<=3&&(e.push(3),r=0),e.push(s),r=s===0?r+1:0;return new Uint8Array(e)}const ds=new Set([100,110,122,244,44,83,86,118,128,138,139,134,135]);function Qt(t){const e=t.ue()+1;t.bits(4),t.bits(4);for(let r=0;r<e;r++)t.ue(),t.ue(),t.flag();t.bits(5),t.bits(5),t.bits(5),t.bits(5)}function jn(t){const e=t.bits(8);t.bits(8);const r=t.bits(8);if(t.ue(),ds.has(e)){const g=t.ue();if(g===3&&t.flag(),t.ue(),t.ue(),t.flag(),t.flag()){const d=g!==3?8:12;for(let x=0;x<d;x++)if(t.flag()){const y=x<6?16:64;let R=8,C=8;for(let A=0;A<y;A++)C!==0&&(C=(R+t.se()+256)%256),R=C===0?R:C}}}t.ue();const s=t.ue();if(s===0)t.ue();else if(s===1){t.flag(),t.se(),t.se();const g=t.ue();for(let d=0;d<g;d++)t.se()}const i=t.ue();t.flag(),t.ue(),t.ue(),t.flag()||t.flag(),t.flag(),t.flag()&&(t.ue(),t.ue(),t.ue(),t.ue());const a={profileIdc:e,levelIdc:r,numRefFrames:i,bitstreamRestriction:!1,maxNumReorderFrames:null,maxDecFrameBuffering:null};if(!t.flag())return{...a,vuiPresent:!1,restrictionFlagPos:-1};t.flag()&&t.bits(8)===255&&(t.bits(16),t.bits(16)),t.flag()&&t.flag(),t.flag()&&(t.bits(3),t.flag(),t.flag()&&(t.bits(8),t.bits(8),t.bits(8))),t.flag()&&(t.ue(),t.ue()),t.flag()&&(t.bits(32),t.bits(32),t.flag());const f=t.flag();f&&Qt(t);const u=t.flag();u&&Qt(t),(f||u)&&t.flag(),t.flag();const p=t.position;return t.flag()?(t.flag(),t.ue(),t.ue(),t.ue(),t.ue(),{...a,vuiPresent:!0,bitstreamRestriction:!0,maxNumReorderFrames:t.ue(),maxDecFrameBuffering:t.ue(),restrictionFlagPos:p}):{...a,vuiPresent:!0,restrictionFlagPos:p}}function fs(t){const e=jn(new Dt(Rn(t)));return{profileIdc:e.profileIdc,levelIdc:e.levelIdc,vuiPresent:e.vuiPresent,bitstreamRestriction:e.bitstreamRestriction,maxNumReorderFrames:e.maxNumReorderFrames,maxDecFrameBuffering:e.maxDecFrameBuffering}}function hs(t){const e=Rn(t),r=jn(new Dt(e));if(!r.vuiPresent||r.restrictionFlagPos<0||r.bitstreamRestriction)return null;const s=new ls,i=new Dt(e);for(let a=0;a<r.restrictionFlagPos;a++)s.bit(i.bit());return s.bit(1),s.bit(1),s.ue(0),s.ue(0),s.ue(0),s.ue(0),s.ue(0),s.ue(r.numRefFrames),s.bit(1),Uint8Array.from([t[0],...us(s.toBytes())])}function ps(t){const e=[],r=t.length;let s=-1,i=0;for(;i+2<r;){const a=i+3<r&&t[i]===0&&t[i+1]===0&&t[i+2]===0&&t[i+3]===1,c=t[i]===0&&t[i+1]===0&&t[i+2]===1;a||c?(s>=0&&e.push(t.subarray(s,i)),i+=a?4:3,s=i):i++}return s>=0&&e.push(t.subarray(s,r)),e}class ms{constructor(e){this.onFrame=e,this.decoder=null,this.sps=null,this.pps=null,this.frameCount=0,this.submitAt=new Map,this.spsLogged=!1}setDecodeSampler(e){this.decodeSampler=e}decode(e){const r=[];let s=!1;for(const p of ps(new Uint8Array(e))){const m=p[0]&31;if(m===7){const g=!this.sps||p.length!==this.sps.length||p.some((d,x)=>d!==this.sps[x]);this.sps=p,g&&this.decoder&&(this.decoder.close(),this.decoder=null)}else m===8?this.pps=p:m>=1&&m<=5&&(m===5&&(s=!0),r.push(p))}if(s&&this.sps&&this.pps&&!this.decoder&&this.initDecoder(this.sps,this.pps),!this.decoder||r.length===0)return;let i=0;for(const p of r)i+=4+p.length;const a=new Uint8Array(i),c=new DataView(a.buffer);let f=0;for(const p of r)c.setUint32(f,p.length,!1),f+=4,a.set(p,f),f+=p.length;const u=Math.round(this.frameCount++*(1e6/30));if(this.decodeSampler&&(this.submitAt.set(u,performance.now()),this.submitAt.size>120)){const p=this.submitAt.keys().next().value;p!==void 0&&this.submitAt.delete(p)}try{this.decoder.decode(new EncodedVideoChunk({type:s?"key":"delta",timestamp:u,data:a}))}catch{}}sampleDecode(e){var s;if(!this.decodeSampler)return;const r=this.submitAt.get(e.timestamp);r!==void 0&&(this.submitAt.delete(e.timestamp),this.decodeSampler({decodeMs:performance.now()-r,queueSize:((s=this.decoder)==null?void 0:s.decodeQueueSize)??0}))}close(){var e;(e=this.decoder)==null||e.close(),this.decoder=null}logSpsVui(e){if(!(this.spsLogged||!this.decodeSampler)){this.spsLogged=!0;try{console.log("[sps-vui]",JSON.stringify(fs(e)))}catch(r){console.warn("[sps-vui] parse failed",r)}}}initDecoder(e,r){this.logSpsVui(e);const s=hs(e)??e,i=s[0]===0?s.subarray(4):s,a=`avc1.${i[1].toString(16).padStart(2,"0")}${i[2].toString(16).padStart(2,"0")}${i[3].toString(16).padStart(2,"0")}`,c=this.buildAVCC(s,r);this.decoder=new VideoDecoder({output:f=>{this.sampleDecode(f),this.onFrame(f)},error:f=>console.error("[WebCodecsCore]",f)}),this.decoder.configure({codec:a,description:c,optimizeForLatency:!0})}buildAVCC(e,r){const s=e[0]===0?e.subarray(4):e,i=r[0]===0?r.subarray(4):r,a=new Uint8Array(8+s.length+1+2+i.length);let c=0;return a[c++]=1,a[c++]=s[1],a[c++]=s[2],a[c++]=s[3],a[c++]=255,a[c++]=225,a[c++]=s.length>>8&255,a[c++]=s.length&255,a.set(s,c),c+=s.length,a[c++]=1,a[c++]=i.length>>8&255,a[c++]=i.length&255,a.set(i,c),a}}const gs=`#version 300 es
97
- in vec2 a_pos;
98
- out vec2 v_uv;
99
- void main() {
100
- v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);
101
- gl_Position = vec4(a_pos, 0.0, 1.0);
102
- }`,xs=`#version 300 es
103
- precision mediump float;
104
- in vec2 v_uv;
105
- uniform sampler2D u_tex;
106
- out vec4 out_color;
107
- void main() {
108
- out_color = texture(u_tex, v_uv);
109
- }`;function bs(t){const e=t.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const r=(m,g)=>{const d=e.createShader(m);return e.shaderSource(d,g),e.compileShader(d),d},s=e.createProgram(),i=r(e.VERTEX_SHADER,gs),a=r(e.FRAGMENT_SHADER,xs);e.attachShader(s,i),e.attachShader(s,a),e.linkProgram(s),e.deleteShader(i),e.deleteShader(a),e.useProgram(s);const c=e.createVertexArray();e.bindVertexArray(c);const f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);const u=e.getAttribLocation(s,"a_pos");e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.bindVertexArray(null);const p=e.createTexture();return e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,p),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.uniform1i(e.getUniformLocation(s,"u_tex"),0),{gl:e,program:s,tex:p,vao:c}}class ys{constructor(e){this.canvas=e,this.state=null}init(){return this.state=bs(this.canvas),this.state!==null}drawFrame(e){const r=this.state;if(!r)return e.close(),null;const s=e.displayWidth,i=e.displayHeight;try{return(this.canvas.width!==s||this.canvas.height!==i)&&(this.canvas.width=s,this.canvas.height=i,r.gl.viewport(0,0,s,i)),r.gl.activeTexture(r.gl.TEXTURE0),r.gl.bindTexture(r.gl.TEXTURE_2D,r.tex),r.gl.texImage2D(r.gl.TEXTURE_2D,0,r.gl.RGBA,r.gl.RGBA,r.gl.UNSIGNED_BYTE,e),r.gl.bindVertexArray(r.vao),r.gl.drawArrays(r.gl.TRIANGLES,0,6),r.gl.bindVertexArray(null),r.gl.bindTexture(r.gl.TEXTURE_2D,null),{width:s,height:i}}finally{e.close()}}dispose(){const e=this.state;e&&(e.gl.deleteTexture(e.tex),e.gl.deleteVertexArray(e.vao),e.gl.deleteProgram(e.program),this.state=null)}}function vs(t){const e=new ys(t);return e.init(),e}class ws{constructor(e=vs){this._size=null,this.canvas=document.createElement("canvas"),this.renderer=e(this.canvas),this.core=new ms(r=>this.render(r))}get surface(){return this.canvas}get size(){return this._size}onResize(e){this.resizeCb=e}onDecodedFrame(e){this.decodedCb=e,this.core.setDecodeSampler(r=>{this.lastSample=r})}decode(e){this.core.decode(e)}close(){this.core.close(),this.renderer.dispose()}render(e){var s,i;const r=this.renderer.drawFrame(e);r&&((s=this.decodedCb)==null||s.call(this,performance.now(),this.lastSample),this.lastSample=void 0,(!this._size||this._size.width!==r.width||this._size.height!==r.height)&&(this._size=r,(i=this.resizeCb)==null||i.call(this,r)))}}const Ss=`#version 300 es
110
- in vec2 a_pos;
111
- out vec2 v_uv;
112
- void main() {
113
- v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);
114
- gl_Position = vec4(a_pos, 0.0, 1.0);
115
- }`,Rs=`#version 300 es
116
- precision mediump float;
117
- in vec2 v_uv;
118
- uniform sampler2D u_texY;
119
- uniform sampler2D u_texU;
120
- uniform sampler2D u_texV;
121
- out vec4 out_color;
122
- void main() {
123
- float Y = (texture(u_texY, v_uv).r - 0.0627451) * 1.1643836; // (y-16/255)*255/219
124
- float U = (texture(u_texU, v_uv).r - 0.5019608) * 1.1383929; // (u-128/255)*255/224
125
- float V = (texture(u_texV, v_uv).r - 0.5019608) * 1.1383929;
126
- float r = Y + 1.5748 * V;
127
- float g = Y - 0.1873 * U - 0.4681 * V;
128
- float b = Y + 1.8556 * U;
129
- out_color = vec4(r, g, b, 1.0);
130
- }`;function Tt(t,e,r,s){const i=t.createTexture();return t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.uniform1i(t.getUniformLocation(s,r),e),i}function js(t){const e=t.getContext("webgl2",{alpha:!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0});if(!e)return null;const r=(d,x)=>{const y=e.createShader(d);return e.shaderSource(y,x),e.compileShader(y),y},s=e.createProgram(),i=r(e.VERTEX_SHADER,Ss),a=r(e.FRAGMENT_SHADER,Rs);e.attachShader(s,i),e.attachShader(s,a),e.linkProgram(s),e.deleteShader(i),e.deleteShader(a),e.useProgram(s);const c=e.createVertexArray();e.bindVertexArray(c);const f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);const u=e.getAttribLocation(s,"a_pos");e.enableVertexAttribArray(u),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.bindVertexArray(null),e.pixelStorei(e.UNPACK_ALIGNMENT,1);const p=Tt(e,0,"u_texY",s),m=Tt(e,1,"u_texU",s),g=Tt(e,2,"u_texV",s);return{gl:e,program:s,texY:p,texU:m,texV:g,vao:c}}class Cs{constructor(e){this.canvas=e,this.state=null}init(){return this.state=js(this.canvas),this.state!==null}drawI420(e,r,s){const i=this.state;if(!i)return null;const{gl:a}=i,c=r+1>>1,f=s+1>>1,u=r*s,p=c*f,m=e.subarray(0,u),g=e.subarray(u,u+p),d=e.subarray(u+p,u+2*p);(this.canvas.width!==r||this.canvas.height!==s)&&(this.canvas.width=r,this.canvas.height=s,a.viewport(0,0,r,s));const x=(y,R,C,A,j)=>{a.activeTexture(a.TEXTURE0+y),a.bindTexture(a.TEXTURE_2D,R),a.texImage2D(a.TEXTURE_2D,0,a.R8,C,A,0,a.RED,a.UNSIGNED_BYTE,j)};return x(0,i.texY,r,s,m),x(1,i.texU,c,f,g),x(2,i.texV,c,f,d),a.bindVertexArray(i.vao),a.drawArrays(a.TRIANGLES,0,6),a.bindVertexArray(null),{width:r,height:s}}dispose(){const e=this.state;e&&(e.gl.deleteTexture(e.texY),e.gl.deleteTexture(e.texU),e.gl.deleteTexture(e.texV),e.gl.deleteVertexArray(e.vao),e.gl.deleteProgram(e.program),this.state=null)}}const ks=0;function Es(t){const e=new Cs(t);return e.init(),e}function Ts(){return new Worker(new URL("/assets/tinyh264.worker-DiJ50Hai.js",import.meta.url),{type:"module"})}class _s{constructor(e=Es,r=Ts){this.ready=!1,this.pending=[],this._size=null,this.canvas=document.createElement("canvas"),this.renderer=e(this.canvas),this.worker=r(),this.worker.onmessage=s=>this.onMessage(s.data)}get surface(){return this.canvas}get size(){return this._size}onResize(e){this.resizeCb=e}onDecodedFrame(e){this.decodedCb=e}decode(e){if(!this.ready){this.pending.push(e);return}this.post(e)}close(){this.worker.terminate(),this.renderer.dispose()}post(e){this.worker.postMessage({type:"decode",data:e,offset:0,length:e.byteLength,renderStateId:ks},[e])}onMessage(e){var s,i;if(e.type==="decoderReady"){this.ready=!0;for(const a of this.pending)this.post(a);this.pending.length=0;return}const r=this.renderer.drawI420(new Uint8Array(e.data),e.width,e.height);r&&((s=this.decodedCb)==null||s.call(this,performance.now()),(!this._size||this._size.width!==r.width||this._size.height!==r.height)&&(this._size=r,(i=this.resizeCb)==null||i.call(this,r)))}}function Ut(){const t=typeof window<"u";let e=!1;try{e=!!document.createElement("canvas").getContext("webgl2")}catch{e=!1}return{secureContext:t&&window.isSecureContext===!0,webCodecs:t&&"VideoDecoder"in window,webgl2:e,wasm:typeof WebAssembly<"u"&&typeof Worker<"u"}}function As(t=Ut()){return t.secureContext&&t.webCodecs&&t.webgl2?new ws:t.wasm&&t.webgl2?new _s:null}function Ps(t=Ut()){return t.secureContext&&t.webCodecs&&t.webgl2||t.wasm&&t.webgl2}function Ns(t=Ut()){return t.secureContext&&t.webCodecs&&t.webgl2?"high":t.wasm&&t.webgl2?"standard":"unsupported"}const en="tapflow.perfModeNoticeDismissed",Ds="https://www.tapflow.dev/reference/configuration#https-secure-context";function Ls(t,e){return t==="standard"&&!e}function Ms({open:t,onOpenChange:e}){return n.jsx(mn,{open:t,onOpenChange:e,children:n.jsxs(gn,{className:"sm:max-w-[440px]",children:[n.jsxs(pr,{children:[n.jsx(xn,{children:"Streaming in Standard mode"}),n.jsxs(mr,{className:"space-y-3 pt-1",children:[n.jsx("span",{className:"block",children:"This screen is running in Standard mode. For a faster, smoother picture, switch to Smooth."}),n.jsx("span",{className:"block",children:"Smooth needs the relay served over HTTPS. If you didn't set up tapflow, ask whoever did."})]})]}),n.jsxs(gr,{children:[n.jsx(ae,{variant:"outline",onClick:()=>window.open(Ds,"_blank","noopener,noreferrer"),children:"How to enable"}),n.jsx(ae,{onClick:()=>e(!1),children:"Got it"})]})]})})}const Is={high:"Smooth",standard:"Standard",unsupported:null};function Us(t){const{connected:e,joined:r,bootError:s,deviceReady:i,installing:a,installError:c}=t;return e?r?s?`Boot failed: ${s.length>40?s.slice(0,40)+"…":s}`:i?a?"Installing app…":c?`Install failed: ${c}`:null:"Starting device…":"Joining session…":"Connecting…"}function Ht(t){const{joined:e,fps:r,keyboardActive:s}=t,i=Us(t),a=r>15,c=a?"#10b981":"#94a3b8",f=a?"Active":"Idle",u=o.useMemo(()=>Ns(),[]),p=Is[u],[m,g]=o.useState(!1);o.useEffect(()=>{let x=!1;try{x=localStorage.getItem(en)==="1"}catch{}Ls(u,x)&&g(!0)},[u]);const d=x=>{if(g(x),!x)try{localStorage.setItem(en,"1")}catch{}};return n.jsxs("div",{className:"w-[300px] shrink-0 mt-3 rounded-xl border bg-background px-4 py-4 flex flex-col gap-3",children:[n.jsxs("div",{className:Z("flex items-center",s?"text-emerald-500":"text-muted-foreground"),style:{gap:6},children:[n.jsx(Gr,{className:"h-3.5 w-3.5 shrink-0"}),n.jsx("span",{className:"text-[12px] font-medium",children:"Focus"})]}),e&&n.jsxs("div",{className:"flex items-center gap-[12px]",children:[n.jsxs("div",{className:"flex items-center gap-[4px]",children:[n.jsx("span",{className:"h-2 w-2 rounded-full shrink-0 mr-1",style:{background:c}}),n.jsx("span",{className:"text-[12px] font-mono text-foreground/75",children:r}),n.jsx("span",{className:"text-[12px] text-muted-foreground",children:"fps"}),n.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"·"}),n.jsx("span",{className:Z("text-[11px]",a?"text-emerald-500":"text-muted-foreground/60"),children:f})]}),p&&n.jsxs(n.Fragment,{children:[n.jsx(dn,{orientation:"vertical",className:"h-3"}),u==="standard"?n.jsx("button",{type:"button",onClick:()=>g(!0),className:"text-[11px] text-foreground/70 hover:text-foreground underline-offset-2 hover:underline",children:p}):n.jsx("span",{className:"text-[11px] text-muted-foreground",children:p})]})]}),i&&n.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-all",children:i}),n.jsx(Ms,{open:m,onOpenChange:d})]})}function Cn({open:t,onOpenChange:e,sessionId:r,send:s}){const[i,a]=o.useState(""),c=o.useRef(null);o.useEffect(()=>{t?setTimeout(()=>{var u;return(u=c.current)==null?void 0:u.focus()},0):a("")},[t]);const f=()=>{i.trim()&&(s({type:"open-url",sessionId:r,payload:{url:i.trim()}}),e(!1))};return n.jsx(mn,{open:t,onOpenChange:e,children:n.jsxs(gn,{className:"w-[500px] max-w-[500px] h-[52px] !rounded-[18px] p-[10px] border border-border bg-background shadow-lg overflow-hidden [&>button]:hidden","aria-describedby":void 0,children:[n.jsx(xn,{className:"sr-only",children:"Open Deeplink"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex-1 h-[32px] flex items-center gap-2 pl-[4px] pb-[1px]",children:[n.jsx(lr,{className:"h-4 w-4 text-muted-foreground shrink-0"}),n.jsx("input",{ref:c,className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground min-w-0",placeholder:"myapp://home...",value:i,onChange:u=>a(u.target.value),onKeyDown:u=>{u.key==="Enter"&&f()}})]}),n.jsx(ae,{size:"sm",disabled:!i.trim(),onClick:f,className:"shrink-0 rounded-xl h-8 px-4",children:"Open"})]})]})})}function Hs(t,e,r,s,i,a){const{x:c,y:f,width:u,height:p}=i;let m,g;if(a){const d=(t.x-e.left)/e.width;m=(1-(t.y-e.top)/e.height)*r,g=d*s}else m=(t.x-e.left)*(r/e.width),g=(t.y-e.top)*(s/e.height);return m<c||m>c+u||g<f||g>f+p?null:{x:(m-c)/u,y:(g-f)/p}}function Fs(t,e,r){const s=(t.x-e.left)/e.width,i=(t.y-e.top)/e.height;return s<0||s>1||i<0||i>1?null:r?{x:i,y:1-s}:{x:s,y:i}}function kn(t){return{f0:{x:1-t.x,y:1-t.y},f1:t}}function Bs(t,e){return t>0?Math.min(1,e/t):1}const Lt=22,tn=[84,70,70,69],$s=1,Os=0,jt=1,En=2,zs=1,Ws=2,Vs=4;function Ks(t){if(t.byteLength<Lt)return null;const e=new DataView(t);for(let i=0;i<tn.length;i++)if(e.getUint8(i)!==tn[i])return null;if(e.getUint8(4)!==$s)return null;const r=e.getUint8(5),s=r&Vs?En:r&zs?jt:Os;return{capturedAt:Number(e.getBigUint64(6)),relayedAt:Number(e.getBigUint64(14)),codec:s,keyframe:s===jt&&(r&Ws)!==0}}function Tn(t){const{binaryFrameHandlerRef:e,perfHookRef:r,frameCount:s}=t,i=o.useRef(t);i.current=t,o.useEffect(()=>{let a=null,c=!1,f=!1,u;const p=()=>{if(a)return a;if(c)return null;const m=As();return m?(a=m,m.onResize(g=>i.current.onResize(g)),u=i.current.onDecoderReady(m),m):(c=!0,i.current.onUnsupported(),console.warn("[decoder] none available — set up HTTPS or use a supported browser"),null)};return e.current=(m,g)=>{const d=i.current.onJpegFrame;if(d&&(g==null?void 0:g.codec)!==jt){d(m,g);return}const x=p();if(x){if(!f){if(!(g!=null&&g.keyframe))return;f=!0}x.decode(m),s.current+=1}},()=>{e.current=void 0,typeof u=="function"&&u(),a==null||a.close(),a==null||a.surface.remove(),a=null}},[e,r,s])}const Xs=3e3+5*300,Ys=Xs+500,bt=8;function Gs(){var t;return window.isSecureContext&&typeof ClipboardItem<"u"&&!!((t=navigator.clipboard)!=null&&t.write)}class yt extends Error{}function qs(t){const e=t.then(r=>new Blob([r],{type:"text/plain"}));return navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}function Js(){const t=new Uint8Array(16);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function Ft(t){return!(t.metaKey||t.ctrlKey)||t.altKey?!1:t.code==="KeyV"?!0:!t.shiftKey&&(t.code==="KeyC"||t.code==="KeyX")}const Zs=1024*1024,Qs=t=>new TextEncoder().encode(t).length,eo=t=>{var e;return!!((e=t.payload)!=null&&e.unsupported)},to=t=>{const e=t.payload;return(e==null?void 0:e.sentinelParked)===!1||(e==null?void 0:e.unsupported)===!0};function no(){const t=window.getSelection();return!!t&&!t.isCollapsed&&t.toString().length>0}function nn(){const t=document.activeElement;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function _n({sessionId:t,send:e,active:r,supported:s,handlerRef:i,sendChord:a,onError:c}){const f=o.useRef(new Map),u=o.useRef(null),p=o.useRef(c);o.useLayoutEffect(()=>{p.current=c});const m=o.useCallback(d=>{var x;u.current!==d&&(u.current=d,(x=p.current)==null||x.call(p,d))},[]);o.useEffect(()=>(i.current=d=>{if(!d.requestId)return;const x=f.current.get(d.requestId);x&&(f.current.delete(d.requestId),x(d))},()=>{i.current=void 0}),[i]);const g=o.useCallback((d,x)=>{const y=Js();return new Promise(R=>{const C=setTimeout(()=>{f.current.delete(y),R(null)},Ys);f.current.set(y,A=>{clearTimeout(C),R(A)}),e({type:d,sessionId:t,requestId:y,payload:x})})},[e,t]);o.useEffect(()=>{if(!r||!s)return;const d=async y=>{if(y.code==="KeyV"||!Ft(y))return;const R=y.code==="KeyX";if(nn()||no()||(y.preventDefault(),y.repeat))return;if(!Gs()){a(R?"KeyX":"KeyC",bt),m("Copied on the device. Serving the dashboard over HTTPS also brings it to your clipboard.");return}let C,A;const j=new Promise((E,M)=>{C=E,A=M});j.catch(()=>{});const P=qs(j).catch(E=>{E instanceof yt||m(E instanceof Error&&E.name==="NotAllowedError"?"Your browser blocked the clipboard write":"Could not write to your clipboard")}),_=await g("clipboard:read",{press:R?"cut":"copy"});if(!_){A(new yt("timeout")),m("The device is taking too long — try again");return}if(_.type==="clipboard:error"){A(new yt(_.message??"read failed")),m(_.message??"Clipboard read failed"),to(_)&&a(R?"KeyX":"KeyC",bt);return}const{text:L}=_.payload??{};if(u.current=null,!L){A(new yt("empty"));return}C(L),await P},x=y=>{var C;if(nn())return;const R=((C=y.clipboardData)==null?void 0:C.getData("text"))??"";if(y.preventDefault(),!R){a("KeyV",bt);return}if(Qs(R)>Zs){m("That text is too large to send to the device");return}g("clipboard:write",{text:R,pasteAfter:!0}).then(A=>{if((A==null?void 0:A.type)==="clipboard:write-done"){u.current=null;return}if(!A){m("The device is taking too long — try again");return}m(A.message??"Clipboard write failed"),eo(A)&&a("KeyV",bt)})};return document.addEventListener("keydown",d),document.addEventListener("paste",x),()=>{document.removeEventListener("keydown",d),document.removeEventListener("paste",x)}},[r,s,g,a,m])}const Ae=13,Je=8,rn=16,ro=.02,so=100;function oo({sessionId:t,buildId:e,send:r,connected:s,joined:i,deviceReady:a,installing:c,installed:f,installError:u,bootError:p,launching:m,setLaunching:g,chrome:d,binaryFrameHandlerRef:x,clipboardHandlerRef:y,clipboardSupported:R,onRecordingUploaded:C,swKeyboardVisible:A,swKeyboardPending:j,onKbdToggle:P,perfHookRef:_}){const L=o.useRef(null),E=o.useRef(null),M=o.useRef(null),{fps:G,frameCount:Q}=wn(),$=o.useRef(0),{recordState:W,recordCanvasRef:Y,startClientRecording:Re,stopClientRecording:ce}=vn({sessionId:t,buildId:e,onRecordingUploaded:C}),le=o.useRef(0),[he,xe]=o.useState(!1),[F,X]=o.useState(!1),[z,pe]=o.useState(!1),[se,oe]=o.useState(!1),[Ie,q]=o.useState(null),[Te,H]=o.useState(null),[V,ne]=o.useState(!1),[ee,re]=o.useState(null),be=o.useRef(ee);o.useEffect(()=>{be.current=ee},[ee]);const ue=o.useRef(null),me=o.useRef(null),de=o.useRef(!1),fe=o.useRef(!1),ye=o.useRef(0),ie=o.useRef(null),ve=o.useRef(null),_e=o.useRef("idle"),Pe=o.useRef(null),We=o.useRef(null),Ue=o.useRef(null);o.useEffect(()=>{Ue.current=d},[d]),o.useEffect(()=>{const l=new Image;l.onload=()=>{We.current=l},l.src=`data:image/png;base64,${d.framePng}`},[d.framePng]),Tn({binaryFrameHandlerRef:x,perfHookRef:_,frameCount:Q,onUnsupported:()=>{},onResize:l=>{const b=L.current;if(b&&(b.width!==l.width||b.height!==l.height)&&(b.width=l.width,b.height=l.height,!Ue.current)){const h=Y.current;h&&(h.width=l.width,h.height=l.height)}X(!0)},onDecoderReady:l=>{var w;const b=l.surface,h=L.current;b.style.position="absolute",h&&(b.style.left=h.style.left,b.style.top=h.style.top,b.style.width=h.style.width,b.style.height=h.style.height,b.style.borderRadius=h.style.borderRadius),b.style.objectFit="fill",b.style.zIndex="3",b.style.pointerEvents="none",(w=E.current)==null||w.appendChild(b);let k=null;const T=()=>{const D=L.current,I=D==null?void 0:D.getContext("2d");if(D&&I&&l.size)try{I.drawImage(l.surface,0,0,D.width,D.height)}catch{}k=requestAnimationFrame(T)};return k=requestAnimationFrame(T),()=>{k!==null&&cancelAnimationFrame(k)}},onJpegFrame:l=>{const b=performance.now();$.current&&b-$.current,$.current=b;const h=le.current;createImageBitmap(new Blob([l],{type:"image/jpeg"})).then(k=>{if(performance.now()-b,le.current!==h){k.close();return}const T=L.current,w=T==null?void 0:T.getContext("2d");if(!T||!w){k.close();return}if((T.width!==k.width||T.height!==k.height)&&(T.width=k.width,T.height=k.height,!Ue.current)){const I=Y.current;I&&(I.width=k.width,I.height=k.height)}const D=performance.now();w.drawImage(k,0,0),performance.now()-D,k.close(),X(!0),Q.current+=1}).catch(()=>{})}}),o.useEffect(()=>{const l=Y.current,b=E.current;l&&b&&(l.width=b.clientWidth,l.height=b.clientHeight)},[d]);const at=o.useCallback(()=>{const l=Y.current,b=L.current;if(!l||!b)return;const h=l.getContext("2d");if(!h)return;const k=Ue.current;if(h.clearRect(0,0,l.width,l.height),k){We.current&&h.drawImage(We.current,0,0,l.width,l.height);const D=Math.round(k.screenCornerRadius/2*(l.height/(k.compositeHeight/2)));h.save(),h.beginPath(),D>0?h.roundRect(b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight,D):h.rect(b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight),h.clip(),h.drawImage(b,b.offsetLeft,b.offsetTop,b.clientWidth,b.clientHeight),h.restore()}else h.drawImage(b,0,0,l.width,l.height);const T=be.current;if(T)for(const D of[T.f0,T.f1]){const I=k?b.offsetLeft+D.x*b.clientWidth:D.x*l.width,K=k?b.offsetTop+D.y*b.clientHeight:D.y*l.height;de.current?(h.beginPath(),h.arc(I,K,Je,0,Math.PI*2),h.fillStyle="rgba(255,255,255,0.92)",h.fill(),h.strokeStyle="rgba(0,0,0,0.2)",h.lineWidth=1,h.stroke()):(h.beginPath(),h.arc(I,K,Ae,0,Math.PI*2),h.strokeStyle="rgba(0,0,0,0.3)",h.lineWidth=3,h.stroke(),h.beginPath(),h.arc(I,K,Ae,0,Math.PI*2),h.strokeStyle="rgba(255,255,255,0.65)",h.lineWidth=1.5,h.stroke())}const w=ve.current;if(w){const D=_e.current,I=Pe.current;if(h.save(),D==="down")h.beginPath(),h.arc(w.x,w.y,Je,0,Math.PI*2),h.fillStyle="rgba(255,255,255,0.92)",h.fill(),h.strokeStyle="rgba(0,0,0,0.2)",h.lineWidth=1,h.stroke();else if(D==="release"&&I){const K=Math.min((performance.now()-I.startTime)/350,1);h.beginPath(),h.arc(w.x,w.y,Je+26*K,0,Math.PI*2),h.strokeStyle=`rgba(255,255,255,${(1-K)*.55})`,h.lineWidth=1.5,h.stroke(),K>=1&&(_e.current="idle",Pe.current=null)}else h.beginPath(),h.arc(w.x,w.y,Ae,0,Math.PI*2),h.strokeStyle="rgba(0,0,0,0.3)",h.lineWidth=3,h.stroke(),h.beginPath(),h.arc(w.x,w.y,Ae,0,Math.PI*2),h.strokeStyle="rgba(255,255,255,0.65)",h.lineWidth=1.5,h.stroke();h.restore()}},[]),it=o.useCallback(()=>{const l=L.current;if(!l)return;const b=document.createElement("canvas"),h=b.getContext("2d");h&&(b.width=l.width,b.height=l.height,h.drawImage(l,0,0),b.toBlob(k=>{if(!k)return;const T=URL.createObjectURL(k),w=document.createElement("a");w.href=T,w.download=`tapflow-${Date.now()}.png`,w.click(),URL.revokeObjectURL(T)},"image/png"))},[]),Ve=o.useCallback(()=>{if(W==="idle"){const l=Y.current;if(!l)return;const b=E.current;if(b&&b.clientWidth>0)l.width=b.clientWidth,l.height=b.clientHeight;else{const h=L.current;if(h&&h.width>0)l.width=h.width,l.height=h.height;else return}Re(at)}else W==="recording"&&ce()},[W,Re,ce,at]),je=o.useCallback(()=>{r({type:"input:rotate",sessionId:t}),pe(l=>!l)},[r,t]),He=o.useRef(z);o.useEffect(()=>{He.current=z},[z]),o.useEffect(()=>()=>{He.current&&r({type:"input:rotate",sessionId:t})},[]);const kt=o.useCallback((l,b)=>{r({type:"input:key",sessionId:t,payload:{code:l,modifiers:b}})},[r,t]);_n({sessionId:t,send:r,active:se,supported:R,handlerRef:y,sendChord:kt,onError:l=>tt.error(l)}),o.useEffect(()=>{const l=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),b=w=>{if(w.code==="AltLeft"||w.code==="AltRight"){fe.current=!0;return}if(w.metaKey){const I=document.activeElement;if(!I||I.tagName!=="INPUT"&&I.tagName!=="TEXTAREA"){if(!w.shiftKey&&w.code==="KeyK"){w.preventDefault(),xe(!0);return}if(!w.shiftKey&&w.code==="KeyS"){w.preventDefault(),it();return}if(w.shiftKey&&w.code==="KeyY"){w.preventDefault(),Ve();return}if(w.shiftKey&&w.code==="KeyO"){w.preventDefault(),je();return}if(w.shiftKey&&w.code==="KeyU"){w.preventDefault(),r({type:"input:button",sessionId:t,payload:{name:"home"}});return}if(w.shiftKey&&w.code==="KeyK"){w.preventDefault(),j||P();return}}}if(!se||l.has(w.code)||R&&Ft(w))return;w.preventDefault();const D=(w.shiftKey?2:0)|(w.ctrlKey?1:0)|(w.metaKey?8:0);r({type:"input:key",sessionId:t,payload:{code:w.code,modifiers:D}})},h=()=>{de.current&&(de.current=!1,ne(!1),r({type:"input:pinch:end",sessionId:t})),fe.current=!1,re(null)},k=w=>{(w.code==="AltLeft"||w.code==="AltRight")&&h()},T=()=>{fe.current&&h()};return window.addEventListener("keydown",b),window.addEventListener("keyup",k),window.addEventListener("blur",T),()=>{window.removeEventListener("keydown",b),window.removeEventListener("keyup",k),window.removeEventListener("blur",T)}},[se,R,r,t,it,Ve,je,P,j]),o.useEffect(()=>{if(!se)return;const l=b=>{const h=E.current??L.current;h&&!h.contains(b.target)&&oe(!1)};return document.addEventListener("pointerdown",l),()=>document.removeEventListener("pointerdown",l)},[se]);const Ne=o.useCallback(l=>{const b=(z?M.current:null)??E.current;if(!b)return null;const h=b.getBoundingClientRect(),k=d.compositeWidth/2,T=d.compositeHeight/2,w=d.screenRect.x/2,D=d.screenRect.y/2,I=d.screenRect.width/2,K=d.screenRect.height/2;return Hs({x:l.clientX,y:l.clientY},h,k,T,{x:w,y:D,width:I,height:K},z)},[d,z]),Ke=o.useCallback(l=>{const b=Ne(l);return b?kn(b):null},[Ne]),rt=o.useCallback(l=>{const b=z?M.current:E.current;if(!b)return null;const h=b.getBoundingClientRect();let k,T;if(z){const D=h.height-(l.clientY-h.top),I=l.clientX-h.left;k=D*(d.compositeWidth/h.height),T=I*(d.compositeHeight/h.width)}else k=(l.clientX-h.left)*(d.compositeWidth/h.width),T=(l.clientY-h.top)*(d.compositeHeight/h.height);const w=d.screenRect;if(k>=w.x&&k<=w.x+w.width&&T>=w.y&&T<=w.y+w.height)return null;for(const D of d.buttons){const I=k-D.normalOffset.x,K=T-D.normalOffset.y;if(I*I+K*K<so**2)return D.name}return null},[d,z]),Xe=o.useCallback(l=>{const b=L.current,h=Y.current;return b&&b.clientWidth>0?{x:b.offsetLeft+l.x*b.clientWidth,y:b.offsetTop+l.y*b.clientHeight}:{x:l.x*((h==null?void 0:h.width)??1),y:l.y*((h==null?void 0:h.height)??1)}},[]),we=o.useCallback(l=>{if(oe(!0),fe.current){const w=Ke(l);if(!w)return;de.current=!0,ne(!0),l.target.setPointerCapture(l.pointerId),re(w),r({type:"input:pinch:start",sessionId:t,payload:w});return}const b=rt(l);if(b){ue.current=b,q(b),l.target.setPointerCapture(l.pointerId),r({type:"input:button",sessionId:t,payload:{name:b,phase:"down"}});return}const h=Ne(l);if(!h)return;me.current=h,l.target.setPointerCapture(l.pointerId),ve.current=Xe(h),_e.current="down",Pe.current=null;const k=l.currentTarget.getBoundingClientRect(),T=ie.current;T&&(T.style.display="block",T.style.left=`${l.clientX-k.left}px`,T.style.top=`${l.clientY-k.top}px`,T.style.width=`${Je*2}px`,T.style.height=`${Je*2}px`,T.style.background="rgba(255,255,255,0.92)",T.style.border="1.5px solid rgba(0,0,0,0.2)",T.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),r({type:"input:touch:start",sessionId:t,payload:h})},[rt,Ne,Ke,Xe,r,t]),mt=o.useCallback(l=>{if(l.buttons===0){if(H(rt(l)),fe.current){re(Ke(l)),ve.current=null;const D=ie.current;D&&(D.style.display="none")}else{re(null);const D=Ne(l);ve.current=D?Xe(D):null,_e.current!=="down"&&(_e.current="idle");const I=ie.current;if(I)if(D){const K=l.currentTarget.getBoundingClientRect();I.style.display="block",I.style.left=`${l.clientX-K.left}px`,I.style.top=`${l.clientY-K.top}px`,I.style.width=`${Ae*2}px`,I.style.height=`${Ae*2}px`,I.style.background="transparent",I.style.border="1.5px solid rgba(255,255,255,0.6)",I.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"}else I.style.display="none"}return}if(de.current){const D=Ke(l);if(!D)return;const I=performance.now();if(I-ye.current<rn)return;ye.current=I,re(D),r({type:"input:pinch:move",sessionId:t,payload:D});return}if(ue.current||!me.current)return;const b=Ne(l);if(!b)return;const h=b.x-me.current.x,k=b.y-me.current.y;if(Math.sqrt(h*h+k*k)<ro)return;const T=performance.now();if(T-ye.current<rn)return;ye.current=T,ve.current=Xe(b);const w=ie.current;if(w&&w.style.display!=="none"){const D=l.currentTarget.getBoundingClientRect();w.style.left=`${l.clientX-D.left}px`,w.style.top=`${l.clientY-D.top}px`}r({type:"input:touch:move",sessionId:t,payload:b})},[rt,Ne,Ke,Xe,r,t]),Fe=o.useCallback(()=>{if(de.current){de.current=!1,ne(!1),re(null),r({type:"input:pinch:end",sessionId:t});return}if(me.current=null,ue.current){r({type:"input:button",sessionId:t,payload:{name:ue.current,phase:"up"}}),ue.current=null,setTimeout(()=>q(null),100);return}_e.current="release",Pe.current={startTime:performance.now()};const l=ie.current;l&&(l.style.width=`${Ae*2}px`,l.style.height=`${Ae*2}px`,l.style.background="transparent",l.style.border="1.5px solid rgba(255,255,255,0.6)",l.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t})},[r,t]),Ye=o.useCallback(()=>{if(de.current){de.current=!1,ne(!1),re(null),r({type:"input:pinch:end",sessionId:t});return}if(me.current=null,ue.current){r({type:"input:button",sessionId:t,payload:{name:ue.current,phase:"up"}}),ue.current=null,q(null);return}_e.current="release",Pe.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t})},[r,t]),Et=o.useCallback(()=>{H(null),re(null),ve.current=null;const l=ie.current;l&&(l.style.display="none")},[]),Be=d.compositeWidth/2,gt=d.compositeHeight/2,st=Bs(gt,750),Ge=Math.round(Be*st),qe=Math.round(gt*st),ot=d.screenRect.x/d.compositeWidth*100,v=d.screenRect.y/d.compositeHeight*100,N=d.screenRect.width/d.compositeWidth*100,O=d.screenRect.height/d.compositeHeight*100,S=Math.round(d.screenCornerRadius/2*st),J=n.jsxs(n.Fragment,{children:[n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r({type:"input:button",sessionId:t,payload:{name:"home"}}),children:n.jsx(bn,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:n.jsxs("span",{className:"flex items-center gap-3",children:["Home ",n.jsxs(Nt,{children:[n.jsx(Qe,{children:"⌘"}),n.jsx(Qe,{children:"⇧"}),n.jsx(Qe,{children:"U"})]})]})})]}),n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:j,onClick:P,"data-active":A,children:j?n.jsx(Rt,{className:"h-4 w-4 animate-spin"}):n.jsx(Fr,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:n.jsxs("span",{className:"flex items-center gap-3",children:["Software keyboard ",n.jsxs(Nt,{children:[n.jsx(Qe,{children:"⌘"}),n.jsx(Qe,{children:"⇧"}),n.jsx(Qe,{children:"K"})]})]})})]})]}),U=f&&e?n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:m,onClick:()=>{g(!0),r({type:"app:launch",sessionId:t,buildId:e})},children:m?n.jsx(Rt,{className:"h-4 w-4 animate-spin"}):n.jsx(hn,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:m?"Launching…":"Launch app"})]}):null;return n.jsxs("div",{className:"flex items-start justify-center gap-16",children:[n.jsx("canvas",{ref:Y,style:{display:"none"}}),n.jsx(Cn,{open:he,onOpenChange:xe,sessionId:t,send:r}),n.jsx(Sn,{joined:i,onDeepLink:()=>xe(!0),onScreenshot:it,onRecordToggle:Ve,recordState:W,onRotate:je,platformSlot:J,launchSlot:U}),n.jsxs("div",{className:"flex items-start gap-8",children:[n.jsxs("div",{ref:M,style:{width:z?qe:Ge,height:z?Ge:qe,position:"relative",flexShrink:0},children:[n.jsxs("div",{ref:E,className:`relative ${Te?"cursor-pointer":"cursor-default"}`,style:{width:Ge,height:qe,...z?{position:"absolute",top:(Ge-qe)/2,left:(qe-Ge)/2,transform:"rotate(-90deg)",transformOrigin:"center center"}:{}},onPointerDown:we,onPointerMove:mt,onPointerUp:Fe,onPointerCancel:Ye,onPointerLeave:Et,children:[n.jsx("img",{src:`data:image/png;base64,${d.framePng}`,style:{position:"absolute",top:0,left:0,zIndex:2,width:"100%",height:"100%",display:"block",pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),n.jsx("canvas",{ref:L,style:{position:"absolute",zIndex:3,left:`${ot}%`,top:`${v}%`,width:`${N}%`,height:`${O}%`,borderRadius:S>0?`${S}px`:void 0,backgroundColor:"#010101",cursor:"none",visibility:F?"visible":"hidden"}}),!F&&n.jsx("div",{className:"absolute animate-pulse bg-zinc-700",style:{zIndex:3,left:`${ot}%`,top:`${v}%`,width:`${N}%`,height:`${O}%`,borderRadius:S>0?`${S}px`:void 0}}),ee&&(()=>{const l=ot/100,b=v/100,h=N/100,k=O/100,T=(w,D)=>({left:`${(l+w*h)*100}%`,top:`${(b+D*k)*100}%`});return n.jsx(n.Fragment,{children:[ee.f0,ee.f1].map((w,D)=>n.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",...V?{width:Je*2,height:Je*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:Ae*2,height:Ae*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"},...T(w.x,w.y)}},D))})})(),i&&G===0&&n.jsx("div",{style:{position:"absolute",zIndex:8,left:`${ot}%`,top:`${v}%`,width:`${N}%`,height:`${O}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:n.jsx("span",{style:{color:"white",fontSize:"0.875rem"},children:"Waiting for first frame..."})}),d.buttons.map(l=>{const b=Ie===l.name,h=Te===l.name,k=l.anchor==="bottom",T=l.anchor==="top",w=k?(l.normalOffset.y-l.buttonH/2)/d.compositeHeight*100:T?l.rolloverOffset.y/d.compositeHeight*100:(l.normalOffset.y-l.buttonH/2)/d.compositeHeight*100,D=l.buttonH/d.compositeHeight*100,I=l.buttonW/d.compositeWidth*100,K=l.buttonW/2,ge=(l.rolloverOffset.x-K)/d.compositeWidth*100,De=(2*l.rolloverOffset.x-l.normalOffset.x-K)/d.compositeWidth*100,xt=l.rolloverOffset.x/d.compositeWidth*100,ct=k?(l.normalOffset.y-l.buttonH/2)/d.compositeHeight*100:T?l.rolloverOffset.y/d.compositeHeight*100:(l.normalOffset.y-l.buttonH/2)/d.compositeHeight*100,Yt=T?(2*l.rolloverOffset.y-l.normalOffset.y)/d.compositeHeight*100:0,qn=l.onTop?4:1;return n.jsxs(o.Fragment,{children:[l.buttonPng&&n.jsx("img",{src:`data:image/png;base64,${l.buttonPng}`,style:{position:"absolute",zIndex:qn,top:`${T&&h?Yt:w}%`,left:`${T?ge:h?De:ge}%`,width:`${I}%`,height:`${D}%`,transition:T?"top 0.15s ease":"left 0.15s ease",pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),b&&l.pressedPng&&l.pressedRect&&n.jsx("img",{src:`data:image/png;base64,${l.pressedPng}`,style:{position:"absolute",zIndex:l.onTop?3:1,left:`${T?ge:h?De:ge}%`,top:`${T&&h?Yt:w}%`,width:`${l.pressedRect.width/d.compositeWidth*100}%`,height:`${l.pressedRect.height/d.compositeHeight*100}%`,pointerEvents:"none",userSelect:"none"},draggable:!1,alt:""}),h&&n.jsx("div",{className:"bg-foreground/85 text-background text-[11px] px-[7px] py-1.5 rounded-lg whitespace-nowrap pointer-events-none",style:{position:"absolute",zIndex:5,left:`${xt}%`,top:`${ct}%`,transform:"translate(-50%, calc(-100% - 8px))"},children:l.accessibilityTitle})]},l.name)})]}),n.jsx("div",{ref:ie,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}})]}),n.jsx(Ht,{joined:i,fps:G,connected:s,deviceReady:a,bootError:p,installing:c,installError:u,keyboardActive:se})]})]})}const Ze=13,ut=8,sn=16,ao=.02,_t=720;function io({sessionId:t,buildId:e,send:r,connected:s,joined:i,deviceReady:a,installing:c,installed:f,installError:u,bootError:p,launching:m,setLaunching:g,androidButtons:d,binaryFrameHandlerRef:x,clipboardHandlerRef:y,clipboardSupported:R,onRecordingUploaded:C,screenWidth:A,screenHeight:j,cornerRadius:P,perfHookRef:_}){const L=o.useRef(null),E=o.useRef(null),M=o.useRef(null),{fps:G,frameCount:Q}=wn(),{recordState:$,recordCanvasRef:W,startClientRecording:Y,stopClientRecording:Re}=vn({sessionId:t,buildId:e,onRecordingUploaded:C}),[ce,le]=o.useState(!1),[he,xe]=o.useState(!1),[F,X]=o.useState(!1),z=o.useRef(null),[pe,se]=o.useState(null),[oe,Ie]=o.useState(!1),[q,Te]=o.useState(!1),[H,V]=o.useState(!1),[ne,ee]=o.useState(null),re=o.useRef(ne);o.useEffect(()=>{re.current=ne},[ne]);const be=o.useRef(!1),ue=o.useRef(!1),me=o.useRef(null),de=o.useRef(0),fe=o.useRef(null),ye=o.useRef(null),ie=o.useRef("idle"),ve=o.useRef(null);Tn({binaryFrameHandlerRef:x,perfHookRef:_,frameCount:Q,onUnsupported:()=>X(!0),onResize:v=>{xe(!0);const N=z.current;(!N||N.width!==v.width||N.height!==v.height)&&(z.current=v,se(v))},onDecoderReady:v=>{var O;M.current=v;const N=v.surface;N.style.display="block",N.style.width="100%",N.style.height="100%",N.style.objectFit="fill",(O=L.current)==null||O.appendChild(N)}});const _e=o.useCallback(()=>{var I;const v=W.current,N=(I=M.current)==null?void 0:I.surface,O=z.current;if(!v||!N||!O)return;const S=v.getContext("2d");if(!S)return;const J=O.width,U=O.height,l=v.width>v.height!=J>U;S.save(),l&&(S.translate(v.width,0),S.rotate(Math.PI/2)),S.drawImage(N,0,0,J,U);const b=Math.max(J,U),h=b>_t?b/_t:1,k=Ze*h,T=ut*h,w=re.current;if(w)for(const K of[w.f0,w.f1]){const ge=K.x*J,De=K.y*U;be.current?(S.beginPath(),S.arc(ge,De,T,0,Math.PI*2),S.fillStyle="rgba(255,255,255,0.92)",S.fill(),S.strokeStyle="rgba(0,0,0,0.2)",S.lineWidth=h,S.stroke()):(S.beginPath(),S.arc(ge,De,k,0,Math.PI*2),S.strokeStyle="rgba(0,0,0,0.3)",S.lineWidth=3*h,S.stroke(),S.beginPath(),S.arc(ge,De,k,0,Math.PI*2),S.strokeStyle="rgba(255,255,255,0.65)",S.lineWidth=1.5*h,S.stroke())}const D=ye.current;if(D){const K=D.x*J,ge=D.y*U,De=ie.current,xt=ve.current;if(De==="down")S.beginPath(),S.arc(K,ge,T,0,Math.PI*2),S.fillStyle="rgba(255,255,255,0.92)",S.fill(),S.strokeStyle="rgba(0,0,0,0.2)",S.lineWidth=h,S.stroke();else if(De==="release"&&xt){const ct=Math.min((performance.now()-xt.startTime)/350,1);S.beginPath(),S.arc(K,ge,T+26*h*ct,0,Math.PI*2),S.strokeStyle=`rgba(255,255,255,${(1-ct)*.55})`,S.lineWidth=1.5*h,S.stroke(),ct>=1&&(ie.current="idle",ve.current=null)}else S.beginPath(),S.arc(K,ge,k,0,Math.PI*2),S.strokeStyle="rgba(0,0,0,0.3)",S.lineWidth=3*h,S.stroke(),S.beginPath(),S.arc(K,ge,k,0,Math.PI*2),S.strokeStyle="rgba(255,255,255,0.65)",S.lineWidth=1.5*h,S.stroke()}S.restore()},[]),Pe=o.useCallback(()=>{var J;const v=(J=M.current)==null?void 0:J.surface,N=z.current;if(!v||!N)return;const O=document.createElement("canvas"),S=O.getContext("2d");S&&(O.width=N.width,O.height=N.height,S.drawImage(v,0,0,N.width,N.height),O.toBlob(U=>{if(!U)return;const l=URL.createObjectURL(U),b=document.createElement("a");b.href=l,b.download=`tapflow-${Date.now()}.png`,b.click(),URL.revokeObjectURL(l)},"image/png"))},[]),We=o.useCallback(()=>{if($==="idle"){const v=W.current;if(!v)return;const N=z.current;if(!N)return;const O=Ve.current;v.width=O?N.height:N.width,v.height=O?N.width:N.height,Y(_e)}else $==="recording"&&Re()},[$,Y,Re,_e]),Ue=o.useCallback(()=>{r({type:"input:rotate",sessionId:t}),Ie(v=>!v)},[r,t]),at=o.useRef(oe);o.useEffect(()=>{at.current=oe},[oe]),o.useEffect(()=>()=>{at.current&&r({type:"input:rotate",sessionId:t})},[]);const it=o.useCallback((v,N)=>{r({type:"input:key",sessionId:t,payload:{code:v,modifiers:N}})},[r,t]);_n({sessionId:t,send:r,active:q,supported:R,handlerRef:y,sendChord:it,onError:v=>tt.error(v)}),o.useEffect(()=>{const v=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),N=U=>{if(U.code==="AltLeft"||U.code==="AltRight"){ue.current=!0;return}if(U.metaKey){const b=document.activeElement;if(!b||b.tagName!=="INPUT"&&b.tagName!=="TEXTAREA"){if(!U.shiftKey&&U.code==="KeyK"){U.preventDefault(),le(!0);return}if(!U.shiftKey&&U.code==="KeyS"){U.preventDefault(),Pe();return}if(U.shiftKey&&U.code==="KeyY"){U.preventDefault(),We();return}if(U.shiftKey&&U.code==="KeyO"){U.preventDefault(),Ue();return}}}if(!q||v.has(U.code)||R&&Ft(U))return;U.preventDefault();const l=(U.shiftKey?2:0)|(U.ctrlKey?1:0)|(U.metaKey?8:0);r({type:"input:key",sessionId:t,payload:{code:U.code,modifiers:l}})},O=()=>{be.current&&(be.current=!1,V(!1),r({type:"input:pinch:end",sessionId:t})),ue.current=!1,ee(null)},S=U=>{(U.code==="AltLeft"||U.code==="AltRight")&&O()},J=()=>{ue.current&&O()};return window.addEventListener("keydown",N),window.addEventListener("keyup",S),window.addEventListener("blur",J),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",S),window.removeEventListener("blur",J)}},[q,R,r,t,Pe,We,Ue]),o.useEffect(()=>{if(!q)return;const v=N=>{const O=E.current??L.current;O&&!O.contains(N.target)&&Te(!1)};return document.addEventListener("pointerdown",v),()=>document.removeEventListener("pointerdown",v)},[q]);const Ve=o.useRef(!1),je=o.useCallback(v=>{const N=L.current;if(!N)return null;const O=N.getBoundingClientRect();return Fs({x:v.clientX,y:v.clientY},O,Ve.current)},[]),He=o.useCallback(v=>{const N=je(v);return N?kn(N):null},[je]),kt=o.useCallback(v=>{if(ue.current){const J=He(v);if(!J)return;be.current=!0,V(!0),v.target.setPointerCapture(v.pointerId);const U=fe.current;U&&(U.style.display="none"),ee(J),r({type:"input:pinch:start",sessionId:t,payload:J});return}const N=je(v);if(!N)return;Te(!0),me.current=N,v.target.setPointerCapture(v.pointerId);const O=v.currentTarget.getBoundingClientRect();ye.current=N,ie.current="down",ve.current=null;const S=fe.current;S&&(S.style.display="block",S.style.left=`${v.clientX-O.left}px`,S.style.top=`${v.clientY-O.top}px`,S.style.width=`${ut*2}px`,S.style.height=`${ut*2}px`,S.style.background="rgba(255,255,255,0.92)",S.style.border="1.5px solid rgba(0,0,0,0.2)",S.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),r({type:"input:touch:start",sessionId:t,payload:N})},[je,He,r,t]),Ne=o.useCallback(v=>{if(v.buttons===0){if(ue.current){ee(He(v)),ye.current=null;const T=fe.current;T&&(T.style.display="none");return}const b=je(v),h=v.currentTarget.getBoundingClientRect(),k=fe.current;b?(ye.current=b,ie.current!=="down"&&(ie.current="idle"),k&&(k.style.display="block",k.style.left=`${v.clientX-h.left}px`,k.style.top=`${v.clientY-h.top}px`,k.style.width=`${Ze*2}px`,k.style.height=`${Ze*2}px`,k.style.background="transparent",k.style.border="1.5px solid rgba(255,255,255,0.6)",k.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)")):(ye.current=null,k&&(k.style.display="none"));return}if(be.current){const b=He(v);if(!b)return;const h=performance.now();if(h-de.current<sn)return;de.current=h,ee(b),r({type:"input:pinch:move",sessionId:t,payload:b});return}if(!me.current)return;const N=je(v);if(!N)return;const O=N.x-me.current.x,S=N.y-me.current.y;if(Math.sqrt(O*O+S*S)<ao)return;const J=performance.now();if(J-de.current<sn)return;de.current=J;const U=v.currentTarget.getBoundingClientRect();ye.current=N;const l=fe.current;l&&l.style.display!=="none"&&(l.style.left=`${v.clientX-U.left}px`,l.style.top=`${v.clientY-U.top}px`),r({type:"input:touch:move",sessionId:t,payload:N})},[je,He,r,t]),Ke=o.useCallback(()=>{if(be.current){be.current=!1,V(!1),ee(null),r({type:"input:pinch:end",sessionId:t});return}me.current=null,ie.current="release",ve.current={startTime:performance.now()};const v=fe.current;v&&(v.style.width=`${Ze*2}px`,v.style.height=`${Ze*2}px`,v.style.background="transparent",v.style.border="1.5px solid rgba(255,255,255,0.6)",v.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),r({type:"input:touch:end",sessionId:t})},[r,t]),rt=o.useCallback(()=>{if(be.current){be.current=!1,V(!1),ee(null),r({type:"input:pinch:end",sessionId:t});return}me.current=null,ie.current="release",ve.current={startTime:performance.now()},r({type:"input:touch:end",sessionId:t})},[r,t]),Xe=o.useCallback(()=>{ee(null),ye.current=null;const v=fe.current;v&&(v.style.display="none")},[]),we=pe??(A&&j?{width:A,height:j}:null),mt=we?Math.min(1,_t/Math.max(we.width,we.height)):.3,Fe=we?Math.round(we.width*mt):324,Ye=we?Math.round(we.height*mt):720,Et=we?we.width>we.height:!1,Be=oe&&!Et;o.useLayoutEffect(()=>{Ve.current=Be},[Be]);const gt=Be?Ye:Fe,Xt=Be?Fe:Ye,st=P!=null?Math.round(P*Fe):22,Ge=Be?{position:"absolute",width:Fe,height:Ye,top:(Fe-Ye)/2,left:(Ye-Fe)/2,transform:"rotate(90deg)",transformOrigin:"center center",visibility:he?"visible":"hidden",cursor:"none"}:{visibility:he?"visible":"hidden",cursor:"none"},qe=n.jsx(n.Fragment,{children:d==null?void 0:d.map(v=>n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r({type:"input:button",sessionId:t,payload:{name:v.name}}),children:v.name==="back"?n.jsx(jr,{className:"h-4 w-4"}):v.name==="recent_apps"?n.jsx(Jn,{className:"h-4 w-4"}):v.name==="volume_up"?n.jsx(ts,{className:"h-4 w-4"}):v.name==="volume_down"?n.jsx(rs,{className:"h-4 w-4"}):v.name==="power"?n.jsx(Vr,{className:"h-4 w-4"}):n.jsx(bn,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:v.accessibilityTitle})]},v.name))}),ot=f&&e?n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:m||c,onClick:()=>{g(!0),r({type:"app:launch",sessionId:t,buildId:e})},children:m?n.jsx(Rt,{className:"h-4 w-4 animate-spin"}):n.jsx(hn,{className:"h-4 w-4"})})}),n.jsx(Ee,{side:"left",children:m?"Launching…":c?"Installing…":"Launch app"})]}):null;return n.jsxs("div",{className:"flex items-start justify-center gap-16",children:[n.jsx("canvas",{ref:W,style:{display:"none"}}),n.jsx(Cn,{open:ce,onOpenChange:le,sessionId:t,send:r}),n.jsx(Sn,{joined:i,onDeepLink:()=>le(!0),onScreenshot:Pe,onRecordToggle:We,recordState:$,onRotate:Ue,platformSlot:qe,launchSlot:ot}),n.jsxs("div",{className:"flex items-start gap-8",children:[n.jsx("div",{style:{background:"#1c1c1e",borderRadius:`${st+12}px`,padding:"12px",flexShrink:0,boxShadow:"0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06)"},children:n.jsx("div",{ref:E,className:"relative",style:{width:gt,height:Xt,backgroundColor:"#010101",borderRadius:`${st}px`,overflow:"hidden"},children:F?n.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-4 text-center",children:n.jsxs("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.875rem"},children:["이 환경에서는 스트리밍을 표시할 수 없습니다.",n.jsx("br",{}),"Chrome/Edge 또는 HTTPS 환경에서 다시 시도해 주세요."]})}):n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:L,className:Be?void 0:"block w-full h-full",style:Ge,onPointerDown:kt,onPointerMove:Ne,onPointerUp:Ke,onPointerCancel:rt,onPointerLeave:Xe}),!he&&n.jsx("div",{className:"absolute inset-0 animate-pulse bg-zinc-700"}),!he&&a&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"0.875rem"},children:"Waiting for stream…"})}),n.jsx("div",{ref:fe,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}}),ne&&n.jsx(n.Fragment,{children:[ne.f0,ne.f1].map((v,N)=>n.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",left:`${v.x*100}%`,top:`${v.y*100}%`,...H?{width:ut*2,height:ut*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:Ze*2,height:Ze*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"}}},N))})]})})}),n.jsx(Ht,{joined:i,fps:G,connected:s,deviceReady:a,bootError:p,installing:c,installError:u,keyboardActive:q})]})]})}function co(t,e){const r=new DataView(t),s=Math.floor(t.byteLength/2),i=Math.floor(s/e),a=[];for(let c=0;c<e;c++)a.push(new Float32Array(i));for(let c=0;c<i;c++)for(let f=0;f<e;f++){const u=r.getInt16((c*e+f)*2,!0);a[f][c]=u/32768}return a}const lo=44100,At=2,on=.06,uo=.3;function fo(){const t=o.useRef(null),e=o.useRef(0),r=o.useCallback(()=>{if(t.current)return t.current;const i=window.AudioContext??window.webkitAudioContext;return i?(t.current=new i,t.current):null},[]),s=o.useCallback(i=>{var d;const a=r();if(!a)return;a.state==="suspended"&&a.resume();const c=co(i,At),f=((d=c[0])==null?void 0:d.length)??0;if(f===0)return;const u=a.createBuffer(At,f,lo);for(let x=0;x<At;x++)u.getChannelData(x).set(c[x]);const p=a.createBufferSource();p.buffer=u,p.connect(a.destination);const m=a.currentTime;let g=e.current;(g<m+.005||g>m+uo+on)&&(g=m+on),p.start(g),e.current=g+u.duration},[r]);return o.useEffect(()=>()=>{var i;(i=t.current)==null||i.close(),t.current=null},[]),{pushFrame:s}}function ho({sessionId:t,deviceId:e,buildId:r,resetMode:s,onRecordingUploaded:i}){const a=o.useRef(()=>{});is();const c=o.useRef(null),f=o.useRef(null),u=o.useRef([]);o.useRef({onFrameBegin:()=>{var H;return(H=c.current)==null?void 0:H.onFrameBegin()},onFrameEnd:H=>{var ee,re;const V=u.current.shift()??null,ne=V?{...H,capturedAt:V.capturedAt,relayedAt:V.relayedAt}:H;(ee=c.current)==null||ee.onFrameEnd(ne),(re=f.current)==null||re.call(f,ne)}});const[p,m]=o.useState(!1),[g,d]=o.useState(!1),[x,y]=o.useState(null),[R,C]=o.useState(!1),[A,j]=o.useState(!1),[P,_]=o.useState(null),[L,E]=o.useState(null),[M,G]=o.useState(!1),[Q,$]=o.useState([]),[W,Y]=o.useState(!1),[Re,ce]=o.useState(!1),le=o.useRef(void 0),he=o.useRef(void 0),{pushFrame:xe}=fo(),F=o.useCallback(H=>{var V;if(H.type==="session:joined"&&(m(!0),$(H.capabilities??[]),a.current({type:"device:boot",sessionId:t,payload:{deviceId:e,resetMode:s,acceptH264:Ps(),secureContext:window.isSecureContext}})),H.type==="device:boot-error"&&E(H.message),H.type==="device:booting"&&(d(!1),C(!1),j(!1),_(null),E(null),y(null)),H.type==="device:ready"&&(d(!0),r&&(C(!0),a.current({type:"app:install",sessionId:t,buildId:r}))),H.type==="app:install-done"&&(C(!1),j(!0)),H.type==="app:install-error"&&(C(!1),_(H.message)),H.type==="app:launch-done"&&G(!1),H.type==="app:launch-error"&&G(!1),H.type==="session:chrome"&&y(H.payload),H.type==="keyboard:toggled"){const{visible:ne}=H.payload;Y(ne),ce(!1)}(H.type==="clipboard:data"||H.type==="clipboard:write-done"||H.type==="clipboard:error")&&((V=he.current)==null||V.call(he,H)),H.type==="open-url:done"&&tt.success("Deeplink opened"),H.type==="open-url:error"&&tt.error(H.message),H.type==="error"&&H.message==="Agent resources exhausted"&&tt.error("Could not start session — this Mac is currently overloaded.",{description:"Go back and select a different Mac."})},[t,e,r]),X=o.useCallback(H=>{var re;const V=Ks(H);if(V&&V.codec===En){xe(H.slice(Lt));return}V&&V.codec===jt||u.current.push(V);const ne=V?H.slice(Lt):H,ee=V?{codec:V.codec,keyframe:V.keyframe,capturedAt:V.capturedAt,relayedAt:V.relayedAt}:void 0;(re=le.current)==null||re.call(le,ne,ee)},[xe]),{send:z,connected:pe}=pn(F,X);o.useLayoutEffect(()=>{a.current=z}),o.useEffect(()=>{pe&&z({type:"session:start",sessionId:t})},[pe,z,t]);const se=x!==null&&"framePng"in x?x:null,oe=x!==null&&!("framePng"in x)?x:null,Ie=()=>{ce(!0),z({type:"input:keyboard:toggle",sessionId:t})},q={sessionId:t,buildId:r,send:z,connected:pe,joined:p,deviceReady:g,installing:R,installed:A,installError:P,bootError:L,launching:M,setLaunching:G,binaryFrameHandlerRef:le,clipboardHandlerRef:he,clipboardSupported:Q.includes("clipboard"),onRecordingUploaded:i,swKeyboardVisible:W,swKeyboardPending:Re,onKbdToggle:Ie};if(!se&&!oe)return n.jsxs("div",{className:"flex items-start justify-center gap-16",children:[n.jsx("div",{className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 px-1.5 py-2.5 shrink-0 mt-3 opacity-40",children:Array.from({length:5}).map((H,V)=>n.jsx("div",{className:"h-8 w-8 rounded-md bg-muted animate-pulse"},V))}),n.jsxs("div",{className:"flex items-start gap-8",children:[n.jsx("div",{style:{background:"#1c1c1e",borderRadius:"34px",padding:"12px",flexShrink:0},children:n.jsx("div",{className:"animate-pulse bg-zinc-700",style:{width:324,height:720,borderRadius:"22px"}})}),n.jsx(Ht,{joined:p,fps:0,connected:pe,deviceReady:g,bootError:L,installing:R,installError:P,keyboardActive:!1})]})]});const Te=void 0;return n.jsxs(n.Fragment,{children:[se&&n.jsx(oo,{...q,chrome:se,perfHookRef:Te}),oe&&n.jsx(io,{...q,androidButtons:oe.buttons,screenWidth:oe.screenWidth,screenHeight:oe.screenHeight,cornerRadius:oe.cornerRadius,perfHookRef:Te}),!1]})}const An=o.forwardRef(({className:t,...e},r)=>n.jsx("textarea",{className:Z("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...e}));An.displayName="Textarea";var po=Object.defineProperty,B=(t,e)=>po(t,"name",{value:e,configurable:!0});function Pn(t,e){return o.useReducer((r,s)=>e[r][s]??r,t)}B(Pn,"useStateMachine");var Nn="ScrollArea",[Dn]=fn(Nn),[mo,Se]=Dn(Nn),go=o.forwardRef(B(function(e,r){const{__scopeScrollArea:s,type:i="hover",dir:a,scrollHideDelay:c=600,...f}=e,[u,p]=o.useState(null),[m,g]=o.useState(null),[d,x]=o.useState(null),[y,R]=o.useState(null),[C,A]=o.useState(null),[j,P]=o.useState(0),[_,L]=o.useState(0),[E,M]=o.useState(!1),[G,Q]=o.useState(!1),$=Oe(r,p),W=Qn(a);return n.jsx(mo,{scope:s,type:i,dir:W,scrollHideDelay:c,scrollArea:u,viewport:m,onViewportChange:g,content:d,onContentChange:x,scrollbarX:y,onScrollbarXChange:R,scrollbarXEnabled:E,onScrollbarXEnabledChange:M,scrollbarY:C,onScrollbarYChange:A,scrollbarYEnabled:G,onScrollbarYEnabledChange:Q,onCornerWidthChange:P,onCornerHeightChange:L,children:n.jsx(ze.div,{dir:W,...f,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})},"ScrollArea")),xo="ScrollAreaViewport",bo=o.forwardRef(B(function(e,r){const{__scopeScrollArea:s,children:i,nonce:a,...c}=e,f=Se(xo,s),u=o.useRef(null),p=Oe(r,u,f.onViewportChange);return n.jsxs(n.Fragment,{children:[n.jsx(yo,{nonce:a}),n.jsx(ze.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...e.style},children:n.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})},"ScrollAreaViewport")),yo=o.memo(B(function({nonce:e}){return n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(t,e)=>t.nonce===e.nonce),Me="ScrollAreaScrollbar",Ln=o.forwardRef(B(function(e,r){const{forceMount:s,...i}=e,a=Se(Me,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:f}=a,u=e.orientation==="horizontal";return o.useEffect(()=>(u?c(!0):f(!0),()=>{u?c(!1):f(!1)}),[u,c,f]),a.type==="hover"?n.jsx(vo,{...i,ref:r,forceMount:s}):a.type==="scroll"?n.jsx(wo,{...i,ref:r,forceMount:s}):a.type==="auto"?n.jsx(Mn,{...i,ref:r,forceMount:s}):a.type==="always"?n.jsx(Bt,{...i,ref:r,"data-state":"visible"}):null},"ScrollAreaScrollbar")),vo=o.forwardRef(B(function(e,r){const{forceMount:s,...i}=e,a=Se(Me,e.__scopeScrollArea),[c,f]=o.useState(!1);return o.useEffect(()=>{const u=a.scrollArea;let p=0;if(u){const m=B(()=>{window.clearTimeout(p),f(!0)},"handlePointerEnter"),g=B(()=>{p=window.setTimeout(()=>f(!1),a.scrollHideDelay)},"handlePointerLeave");return u.addEventListener("pointerenter",m),u.addEventListener("pointerleave",g),()=>{window.clearTimeout(p),u.removeEventListener("pointerenter",m),u.removeEventListener("pointerleave",g)}}},[a.scrollArea,a.scrollHideDelay]),n.jsx(Ct,{present:s||c,children:n.jsx(Mn,{"data-state":c?"visible":"hidden",...i,ref:r})})},"ScrollAreaScrollbarHover")),wo=o.forwardRef(B(function(e,r){const{forceMount:s,...i}=e,a=Se(Me,e.__scopeScrollArea),c=e.orientation==="horizontal",f=pt(()=>p("SCROLL_END"),100),[u,p]=Pn("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return o.useEffect(()=>{if(u==="idle"){const m=window.setTimeout(()=>p("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(m)}},[u,a.scrollHideDelay,p]),o.useEffect(()=>{const m=a.viewport,g=c?"scrollLeft":"scrollTop";if(m){let d=m[g];const x=B(()=>{const y=m[g];d!==y&&(p("SCROLL"),f()),d=y},"handleScroll");return m.addEventListener("scroll",x),()=>m.removeEventListener("scroll",x)}},[a.viewport,c,p,f]),n.jsx(Ct,{present:s||u!=="hidden",children:n.jsx(Bt,{"data-state":u==="hidden"?"hidden":"visible",...i,ref:r,onPointerEnter:Le(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:Le(e.onPointerLeave,()=>p("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Mn=o.forwardRef(B(function(e,r){const s=Se(Me,e.__scopeScrollArea),{forceMount:i,...a}=e,[c,f]=o.useState(!1),u=e.orientation==="horizontal",p=pt(()=>{if(s.viewport){const m=s.viewport.offsetWidth<s.viewport.scrollWidth,g=s.viewport.offsetHeight<s.viewport.scrollHeight;f(u?m:g)}},10);return nt(s.viewport,p),nt(s.content,p),n.jsx(Ct,{present:i||c,children:n.jsx(Bt,{"data-state":c?"visible":"hidden",...a,ref:r})})},"ScrollAreaScrollbarAuto")),Bt=o.forwardRef(B(function(e,r){const{orientation:s="vertical",...i}=e,a=Se(Me,e.__scopeScrollArea),c=o.useRef(null),f=o.useRef(0),[u,p]=o.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=$t(u.viewport,u.content),g={...i,sizes:u,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:B(x=>c.current=x,"onThumbChange"),onThumbPointerUp:B(()=>f.current=0,"onThumbPointerUp"),onThumbPointerDown:B(x=>f.current=x,"onThumbPointerDown")};function d(x,y){return Fn(x,f.current,u,y)}return B(d,"getScrollPosition"),s==="horizontal"?n.jsx(So,{...g,ref:r,onThumbPositionChange:()=>{if(a.viewport&&c.current){const x=a.viewport.scrollLeft,y=It(x,u,a.dir);c.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollLeft=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollLeft=d(x,a.dir))}}):s==="vertical"?n.jsx(Ro,{...g,ref:r,onThumbPositionChange:()=>{if(a.viewport&&c.current){const x=a.viewport.scrollTop,y=It(x,u);c.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollTop=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollTop=d(x))}}):null},"ScrollAreaScrollbarVisible")),So=o.forwardRef(B(function(e,r){const{sizes:s,onSizesChange:i,...a}=e,c=Se(Me,e.__scopeScrollArea),[f,u]=o.useState(),p=o.useRef(null),m=Oe(r,p,c.onScrollbarXChange);return o.useEffect(()=>{p.current&&u(getComputedStyle(p.current))},[p]),n.jsx(Un,{"data-orientation":"horizontal",...a,ref:m,sizes:s,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ht(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(c.viewport){const x=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(x),zt(x,d)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&f&&i({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:ft(f.paddingLeft),paddingEnd:ft(f.paddingRight)}})}})},"ScrollAreaScrollbarX")),Ro=o.forwardRef(B(function(e,r){const{sizes:s,onSizesChange:i,...a}=e,c=Se(Me,e.__scopeScrollArea),[f,u]=o.useState(),p=o.useRef(null),m=Oe(r,p,c.onScrollbarYChange);return o.useEffect(()=>{p.current&&u(getComputedStyle(p.current))},[p]),n.jsx(Un,{"data-orientation":"vertical",...a,ref:m,sizes:s,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ht(s)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(c.viewport){const x=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(x),zt(x,d)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&f&&i({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:ft(f.paddingTop),paddingEnd:ft(f.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[jo,In]=Dn(Me),Un=o.forwardRef(B(function(e,r){const{__scopeScrollArea:s,sizes:i,hasThumb:a,onThumbChange:c,onThumbPointerUp:f,onThumbPointerDown:u,onThumbPositionChange:p,onDragScroll:m,onWheelScroll:g,onResize:d,...x}=e,y=Se(Me,s),[R,C]=o.useState(null),A=Oe(r,C),j=o.useRef(null),P=o.useRef(""),_=y.viewport,L=i.content-i.viewport,E=et(g),M=et(p),G=pt(d,10);function Q($){if(j.current){const W=$.clientX-j.current.left,Y=$.clientY-j.current.top;m({x:W,y:Y})}}return B(Q,"handleDragScroll"),o.useEffect(()=>{const $=B(W=>{const Y=W.target;(R==null?void 0:R.contains(Y))&&E(W,L)},"handleWheel");return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[_,R,L,E]),o.useEffect(M,[i,M]),nt(R,G),nt(y.content,G),n.jsx(jo,{scope:s,scrollbar:R,hasThumb:a,onThumbChange:et(c),onThumbPointerUp:et(f),onThumbPositionChange:M,onThumbPointerDown:et(u),children:n.jsx(ze.div,{...x,ref:A,style:{position:"absolute",...x.style},onPointerDown:Le(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),j.current=R.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),Q($))}),onPointerMove:Le(e.onPointerMove,Q),onPointerUp:Le(e.onPointerUp,$=>{const W=$.target;W.hasPointerCapture($.pointerId)&&W.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=P.current,y.viewport&&(y.viewport.style.scrollBehavior=""),j.current=null})})})},"ScrollAreaScrollbarImpl")),Mt="ScrollAreaThumb",Co=o.forwardRef(B(function(e,r){const{forceMount:s,...i}=e,a=In(Mt,e.__scopeScrollArea);return n.jsx(Ct,{present:s||a.hasThumb,children:n.jsx(ko,{ref:r,...i})})},"ScrollAreaThumb")),ko=o.forwardRef(B(function(e,r){const{__scopeScrollArea:s,style:i,...a}=e,c=Se(Mt,s),f=In(Mt,s),{onThumbPositionChange:u}=f,p=Oe(r,f.onThumbChange),m=o.useRef(void 0),g=pt(()=>{m.current&&(m.current(),m.current=void 0)},100);return o.useEffect(()=>{const d=c.viewport;if(d){const x=B(()=>{if(g(),!m.current){const y=_o(d,u);m.current=y,u()}},"handleScroll");return u(),d.addEventListener("scroll",x),()=>d.removeEventListener("scroll",x)}},[c.viewport,g,u]),n.jsx(ze.div,{"data-state":f.hasThumb?"visible":"hidden",...a,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Le(e.onPointerDownCapture,d=>{const y=d.target.getBoundingClientRect(),R=d.clientX-y.left,C=d.clientY-y.top;f.onThumbPointerDown({x:R,y:C})}),onPointerUp:Le(e.onPointerUp,f.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Hn="ScrollAreaCorner",Eo=o.forwardRef(B(function(e,r){const s=Se(Hn,e.__scopeScrollArea),i=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&i?n.jsx(To,{...e,ref:r}):null},"ScrollAreaCorner")),To=o.forwardRef(B(function(e,r){const{__scopeScrollArea:s,...i}=e,a=Se(Hn,s),[c,f]=o.useState(0),[u,p]=o.useState(0),m=!!(c&&u),{onCornerWidthChange:g,onCornerHeightChange:d}=a;return nt(a.scrollbarX,()=>{var y;const x=((y=a.scrollbarX)==null?void 0:y.offsetHeight)||0;a.onCornerHeightChange(x),p(x)}),nt(a.scrollbarY,()=>{var y;const x=((y=a.scrollbarY)==null?void 0:y.offsetWidth)||0;a.onCornerWidthChange(x),f(x)}),o.useEffect(()=>()=>{g(0),d(0)},[g,d]),m?n.jsx(ze.div,{...i,ref:r,style:{width:c,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function ft(t){return t?parseInt(t,10):0}B(ft,"toInt");function $t(t,e){const r=t/e;return isNaN(r)?0:r}B($t,"getThumbRatio");function ht(t){const e=$t(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=(t.scrollbar.size-r)*e;return Math.max(s,18)}B(ht,"getThumbSize");function Fn(t,e,r,s="ltr"){const i=ht(r),a=i/2,c=e||a,f=i-c,u=r.scrollbar.paddingStart+c,p=r.scrollbar.size-r.scrollbar.paddingEnd-f,m=r.content-r.viewport,g=s==="ltr"?[0,m]:[m*-1,0];return Ot([u,p],g)(t)}B(Fn,"getScrollPositionFromPointer");function It(t,e,r="ltr"){const s=ht(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-i,c=e.content-e.viewport,f=a-s,u=r==="ltr"?[0,c]:[c*-1,0],p=xr(t,u);return Ot([0,c],[0,f])(p)}B(It,"getThumbOffsetFromScroll");function Ot(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const s=(e[1]-e[0])/(t[1]-t[0]);return e[0]+s*(r-t[0])}}B(Ot,"linearScale");function zt(t,e){return t>0&&t<e}B(zt,"isScrollingWithinScrollbarBounds");var _o=B((t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},s=0;return B((function i(){const a={left:t.scrollLeft,top:t.scrollTop},c=r.left!==a.left,f=r.top!==a.top;(c||f)&&e(),r=a,s=window.requestAnimationFrame(i)}),"loop")(),()=>window.cancelAnimationFrame(s)},"addUnlinkedScrollListener");function pt(t,e){const r=et(t),s=o.useRef(0);return o.useEffect(()=>()=>window.clearTimeout(s.current),[]),o.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(r,e)},[r,e])}B(pt,"useDebounceCallback");function nt(t,e){const r=et(e);Zn(()=>{let s=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(r)});return i.observe(t),()=>{window.cancelAnimationFrame(s),i.unobserve(t)}}},[t,r])}B(nt,"useResizeObserver");var Bn=go,Ao=bo,Po=Eo;const $n=o.forwardRef(({className:t,children:e,...r},s)=>n.jsxs(Bn,{ref:s,className:Z("relative overflow-hidden",t),...r,children:[n.jsx(Ao,{className:"h-full w-full rounded-[inherit]",children:e}),n.jsx(On,{}),n.jsx(Po,{})]}));$n.displayName=Bn.displayName;const On=o.forwardRef(({className:t,orientation:e="vertical",...r},s)=>n.jsx(Ln,{ref:s,orientation:e,className:Z("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:n.jsx(Co,{className:"relative flex-1 rounded-full bg-border"})}));On.displayName=Ln.displayName;function zn(t){return/[Zz]|[+-]\d{2}/.test(t)?new Date(t):new Date(t.replace(" ","T")+"Z")}function No(t){const e=new Map;for(const i of t){const a=zn(i.created_at).toDateString();e.has(a)||e.set(a,[]),e.get(a).push(i)}const r=new Date().toDateString(),s=new Date(Date.now()-864e5).toDateString();return Array.from(e.entries()).map(([i,a])=>{let c;if(i===r)c="Today";else if(i===s)c="Yesterday";else{const f=new Date(i);c=f.toLocaleDateString(void 0,{month:"short",day:"numeric",...f.getFullYear()!==new Date().getFullYear()?{year:"numeric"}:{}})}return{label:c,items:a}})}function Do(t){return zn(t).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}const Lo=5*1024*1024,Mo=["image/png","image/jpeg","image/webp"];function Io({buildId:t}){const[e,r]=o.useState([]),[s,i]=o.useState(""),[a,c]=o.useState(null),[f,u]=o.useState(!1),[p,m]=o.useState(""),g=o.useRef(null),d=o.useRef({});function x(){fetch(`/api/v1/comments?build_id=${t}`,{credentials:"include"}).then(j=>j.ok?j.json():[]).then(r)}o.useEffect(()=>{x()},[t]),o.useEffect(()=>{const j=window.location.hash;if(!j.startsWith("#comment-"))return;const P=Number(j.replace("#comment-","")),_=d.current[P];if(!_)return;_.scrollIntoView({behavior:"smooth"});const L=document.documentElement.classList.contains("dark");_.style.backgroundColor=L?"rgb(0 112 243 / 0.18)":"#d3e5ff",setTimeout(()=>{_.style.backgroundColor=""},2e3)},[e]);function y(j){const P=`${location.origin}${location.pathname}${location.search}#comment-${j}`;navigator.clipboard.writeText(P).then(()=>tt.success("Link copied")).catch(()=>tt.error("Could not copy link"))}function R(j){if(m(""),!Mo.includes(j.type)){m("Only png, jpg, webp allowed");return}if(j.size>Lo){m("Max 5MB");return}c(j)}async function C(j){if(j.preventDefault(),!s.trim()&&!a)return;u(!0);const P=new FormData;P.append("build_id",String(t)),P.append("body",s),a&&P.append("attachment",a),(await fetch("/api/v1/comments",{method:"POST",credentials:"include",body:P})).ok&&(i(""),c(null),x()),u(!1)}const A=No(e);return n.jsxs("div",{className:"flex h-full flex-col gap-3 px-1",children:[n.jsx($n,{className:"flex-1 rounded-md border",children:n.jsx("div",{className:"p-3",children:e.length===0?n.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No comments yet."}):n.jsx("div",{className:"flex flex-col",children:A.map(({label:j,items:P})=>n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"h-px flex-1 bg-border"}),n.jsx("span",{className:"text-[11px] font-medium text-muted-foreground px-1 select-none",children:j}),n.jsx("div",{className:"h-px flex-1 bg-border"})]}),n.jsx("div",{className:"flex flex-col gap-4",children:P.map(_=>n.jsxs("div",{id:`comment-${_.id}`,ref:L=>{d.current[_.id]=L},className:"group flex gap-2.5 rounded-md px-2 py-1.5 transition-all",children:[n.jsx("div",{className:"mt-0.5 shrink-0",children:n.jsx(er,{name:_.author,avatarUrl:_.authorAvatarUrl,size:28})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm font-semibold leading-none",children:_.author}),n.jsx("span",{className:"text-[11px] text-muted-foreground leading-none",children:Do(_.created_at)}),n.jsx(ae,{variant:"ghost",size:"icon",className:"h-4 w-4 ml-0.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity",onClick:()=>y(_.id),children:n.jsx(yn,{className:"h-3 w-3"})})]}),n.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap mt-1",children:_.body}),_.attachments.map(L=>n.jsx("a",{href:L.file_path,target:"_blank",rel:"noreferrer",className:"mt-1.5 block",children:n.jsx("img",{src:L.file_path,alt:"attachment",className:"max-h-48 rounded border object-contain"})},L.id))]})]},_.id))})]},j))})})}),n.jsx("div",{className:"pb-1",children:n.jsx("form",{onSubmit:C,children:n.jsxs("div",{className:"rounded-xl border border-input bg-background ring-offset-background transition-shadow focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[n.jsx(An,{placeholder:"Leave a comment…",value:s,onChange:j=>i(j.target.value),className:"min-h-16 resize-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm"}),(a||p)&&n.jsxs("div",{className:"px-3 -mt-1 pb-1",children:[a&&n.jsx("p",{className:"text-xs text-muted-foreground",children:a.name}),p&&n.jsx("p",{className:"text-xs text-destructive",children:p})]}),n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>{var j;return(j=g.current)==null?void 0:j.click()},children:n.jsx(Mr,{className:"h-4 w-4"})}),n.jsx("input",{ref:g,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:j=>{var _;const P=(_=j.target.files)==null?void 0:_[0];P&&R(P)}}),n.jsx("div",{className:"flex-1"}),n.jsx(ae,{type:"submit",size:"icon",className:"h-7 w-7 rounded-full",disabled:f||!s.trim()&&!a,children:n.jsx(kr,{className:"h-3.5 w-3.5"})})]})]})})})]})}function Uo(t){return t<1024*1024?`${(t/1024).toFixed(0)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function Ho(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fo(t){const e=new Date(t).getTime()-Date.now();if(e<=0)return{label:"Expired",urgent:!0};const r=Math.floor(e/36e5);return r<1?{label:"< 1 hour left",urgent:!0}:r<24?{label:`Expires in ${r}h`,urgent:r<6}:{label:`Expires in ${Math.floor(r/24)}d`,urgent:!1}}function Bo({buildId:t,refreshKey:e}){const[r,s]=o.useState([]),[i,a]=o.useState(!0),[c,f]=o.useState(!1);return o.useEffect(()=>{a(!0),f(!1);const u=setTimeout(()=>f(!0),250);return fetch(`/api/v1/recordings?buildId=${t}`,{credentials:"include"}).then(p=>p.ok?p.json():[]).then(p=>s(p)).catch(()=>s([])).finally(()=>{clearTimeout(u),a(!1)}),()=>clearTimeout(u)},[t,e]),i?c?n.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading recordings…"}):null:r.length===0?n.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No recordings yet."}):n.jsx("div",{className:"flex flex-col gap-2",children:r.map(u=>{const p=Fo(u.expiresAt);return n.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[n.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[n.jsx("span",{className:"text-xs font-medium truncate",children:Ho(u.createdAt)}),n.jsxs("span",{className:`text-xs ${p.urgent?"text-destructive":"text-muted-foreground"}`,children:[p.label," · ",Uo(u.fileSize)]})]}),n.jsx(ae,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 ml-2",title:"Download",onClick:()=>{const m=document.createElement("a");m.href=u.url,m.download="",m.click()},children:n.jsx(Ar,{className:"h-3.5 w-3.5"})})]},u.id)})})}function $o({buildId:t,recordingsRefreshKey:e=0}){return n.jsxs(fr,{defaultValue:"comments",className:"flex h-full flex-col",children:[n.jsx("div",{className:"shrink-0 px-1",children:n.jsxs(hr,{className:"w-full",children:[n.jsxs(qt,{value:"comments",className:"flex-1 gap-1.5",children:[n.jsx(zr,{className:"h-3.5 w-3.5"}),"Comments"]}),n.jsxs(qt,{value:"recordings",className:"flex-1 gap-1.5",children:[n.jsx(Nr,{className:"h-3.5 w-3.5"}),"Recordings"]})]})}),n.jsx(Jt,{value:"comments",className:"mt-3 min-h-0 flex-1 overflow-hidden",children:n.jsx(Io,{buildId:t})}),n.jsx(Jt,{value:"recordings",className:"mt-3 min-h-0 flex-1 overflow-y-auto",children:n.jsx(Bo,{buildId:t,refreshKey:e})})]})}const Wn=o.forwardRef(({...t},e)=>n.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));Wn.displayName="Breadcrumb";const Vn=o.forwardRef(({className:t,...e},r)=>n.jsx("ol",{ref:r,className:Z("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));Vn.displayName="BreadcrumbList";const dt=o.forwardRef(({className:t,...e},r)=>n.jsx("li",{ref:r,className:Z("inline-flex items-center gap-1.5",t),...e}));dt.displayName="BreadcrumbItem";const vt=o.forwardRef(({asChild:t,className:e,...r},s)=>{const i=t?tr:"a";return n.jsx(i,{ref:s,className:Z("transition-colors hover:text-foreground cursor-pointer",e),...r})});vt.displayName="BreadcrumbLink";const wt=o.forwardRef(({className:t,...e},r)=>n.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:Z("font-medium text-foreground",t),...e}));wt.displayName="BreadcrumbPage";const St=({children:t,className:e,...r})=>n.jsx("li",{role:"presentation","aria-hidden":"true",className:Z("[&>svg]:h-3.5 [&>svg]:w-3.5",e),...r,children:t??n.jsx(nr,{})});St.displayName="BreadcrumbSeparator";var Oo=Object.defineProperty,$e=(t,e)=>Oo(t,"name",{value:e,configurable:!0}),Wt="Switch",[zo]=fn(Wt),[Wo,Vt]=zo(Wt);function Kn(t){const{__scopeSwitch:e,checked:r,children:s,defaultChecked:i,disabled:a,form:c,name:f,onCheckedChange:u,required:p,value:m="on",internal_do_not_use_render:g}=t,[d,x]=sr({prop:r,defaultProp:i??!1,onChange:u,caller:Wt}),[y,R]=o.useState(null),[C,A]=o.useState(null),j=o.useRef(!1),[P,_]=o.useReducer(M=>M+1,0),L=y?!!c||!!y.closest("form"):!0,E={checked:d,setChecked:x,disabled:a,control:y,setControl:R,name:f,form:c,value:m,hasConsumerStoppedPropagationRef:j,userInteractionCount:P,onUserInteraction:_,required:p,defaultChecked:i,isFormControl:L,bubbleInput:C,setBubbleInput:A};return n.jsx(Wo,{scope:e,...E,children:Yn(g)?g(E):s})}$e(Kn,"SwitchProvider");var Vo="SwitchTrigger",Ko=o.forwardRef($e(function({__scopeSwitch:e,onClick:r,...s},i){const{control:a,form:c,value:f,disabled:u,checked:p,required:m,setControl:g,setChecked:d,hasConsumerStoppedPropagationRef:x,onUserInteraction:y,isFormControl:R,bubbleInput:C}=Vt(Vo,e),A=Oe(i,g),j=o.useRef(p);return o.useEffect(()=>{const P=c?a==null?void 0:a.ownerDocument.getElementById(c):a==null?void 0:a.form;if(P instanceof HTMLFormElement){const _=$e(()=>d(j.current),"reset");return P.addEventListener("reset",_),()=>P.removeEventListener("reset",_)}},[a,c,d]),n.jsx(ze.button,{type:"button",role:"switch","aria-checked":p,"aria-required":m,"data-state":Kt(p),"data-disabled":u?"":void 0,disabled:u,value:f,...s,ref:A,onClick:Le(r,P=>{y(),d(_=>!_),C&&R&&(x.current=P.isPropagationStopped(),x.current||P.stopPropagation())})})},"SwitchTrigger")),Xn=o.forwardRef($e(function(e,r){const{__scopeSwitch:s,name:i,checked:a,defaultChecked:c,required:f,disabled:u,value:p,onCheckedChange:m,form:g,...d}=e;return n.jsx(Kn,{__scopeSwitch:s,checked:a,defaultChecked:c,disabled:u,required:f,onCheckedChange:m,name:i,form:g,value:p,internal_do_not_use_render:({isFormControl:x})=>n.jsxs(n.Fragment,{children:[n.jsx(Ko,{...d,ref:r,__scopeSwitch:s}),x&&n.jsx(qo,{__scopeSwitch:s})]})})},"Switch")),Xo="SwitchThumb",Yo=o.forwardRef($e(function(e,r){const{__scopeSwitch:s,...i}=e,a=Vt(Xo,s);return n.jsx(ze.span,{"data-state":Kt(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:r})},"SwitchThumb")),Go="SwitchBubbleInput",qo=o.forwardRef($e(function({__scopeSwitch:e,onClick:r,...s},i){const{control:a,hasConsumerStoppedPropagationRef:c,userInteractionCount:f,checked:u,defaultChecked:p,required:m,disabled:g,name:d,value:x,form:y,bubbleInput:R,setBubbleInput:C}=Vt(Go,e),A=Oe(i,C),j=rr(a),P=o.useRef(!1),_=o.useRef(u),L=o.useRef(f);o.useEffect(()=>{const M=R;if(!M)return;const G=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(G,"checked").set,W=f!==L.current;L.current=f;const Y=_.current!==u;_.current=u;const Re=!(W&&c.current);if(Y&&$){P.current=!W;const ce=new Event("click",{bubbles:Re});$.call(M,u),M.dispatchEvent(ce),P.current=!1}},[R,u,c,f]);const E=o.useRef(u);return n.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??E.current,required:m,disabled:g,name:d,value:x,form:y,...s,tabIndex:-1,ref:A,onClick:Le(r,M=>{P.current&&M.stopPropagation()}),style:{...s.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Yn(t){return typeof t=="function"}$e(Yn,"isFunction");function Kt(t){return t?"checked":"unchecked"}$e(Kt,"getState");const Gn=o.forwardRef(({className:t,...e},r)=>n.jsx(Xn,{className:Z("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:r,children:n.jsx(Yo,{className:Z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Gn.displayName=Xn.displayName;const an=70,cn=80;function Jo(t,e){if(!t||e)return"unknown";const r=t.memUsedMB/t.memTotalMB*100;return t.cpuPercent>cn||r>cn?"overloaded":t.cpuPercent>=an||r>=an?"warning":"healthy"}function sa(){const[t]=un(),e=or(),r=t.get("id"),{build:s}=ss(r),[i,a]=o.useState(0),c=(s==null?void 0:s.platform)??"ios",{sessions:f,selectedAgent:u,setSelectedAgent:p,activeSessionId:m,deviceId:g,booting:d,status:x,connected:y,agentGroups:R,startDevice:C,resetDevice:A,handleBack:j,handleBackToMacs:P}=os(c),_=R.find(F=>F.agentName===u),{osVersions:L,osVersion:E,setOsVersion:M,deviceSearch:G,setDeviceSearch:Q,versionedDevices:$,resetMode:W,setResetMode:Y}=as(_,c),ce=f.flatMap(F=>F.devices).find(F=>F.id===g),le=ce?`${ce.name}${ce.osVersion?` · ${ce.osVersion}`:""}`:"",he=o.useCallback(()=>a(F=>F+1),[]),{setNode:xe}=ar();return o.useEffect(()=>{if(s)return xe(n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wn,{children:n.jsxs(Vn,{children:[n.jsx(dt,{children:n.jsx(vt,{asChild:!0,children:n.jsx("button",{onClick:()=>e(`/app-center?appId=${s.app_id}`),children:s.name})})}),n.jsx(St,{}),n.jsx(dt,{children:u?n.jsx(vt,{asChild:!0,children:n.jsx("button",{onClick:P,children:Gt(s)})}):n.jsx(wt,{children:Gt(s)})}),u&&n.jsxs(n.Fragment,{children:[n.jsx(St,{}),n.jsx(dt,{children:m?n.jsx(vt,{asChild:!0,children:n.jsx("button",{onClick:j,children:u})}):n.jsx(wt,{children:u})})]}),m&&n.jsxs(n.Fragment,{children:[n.jsx(St,{}),n.jsx(dt,{children:n.jsx(wt,{children:le})})]})]})}),!u&&s.status_label&&n.jsx(Sr,{tone:ur[s.status_label],children:s.status_label})]})),()=>xe(null)},[s,u,m,le,e,j,P,xe]),n.jsxs("div",{className:"flex h-full min-h-0 gap-6 p-6",children:[n.jsx("div",{className:"flex flex-col gap-3 flex-1 min-w-0 min-h-0",children:n.jsx("div",{className:"flex-1 min-h-0 overflow-auto -ml-1 pl-1 -mr-4 pr-4",children:m?n.jsx("div",{className:"min-h-full flex items-center justify-center py-6 px-8 min-w-max",children:n.jsx(ho,{sessionId:m,deviceId:g,buildId:s==null?void 0:s.id,resetMode:W,onRecordingUploaded:he})}):u?n.jsxs("div",{className:"flex flex-col gap-5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:P,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"← All Macs"}),n.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select device"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dr,{placeholder:"Search device…",value:G,onChange:Q}),L.length>0&&n.jsxs(br,{value:E||"__all__",onValueChange:F=>{M(F==="__all__"?"":F),A()},children:[n.jsx(yr,{className:"h-8 w-36 shrink-0",children:n.jsx(vr,{})}),n.jsxs(wr,{children:[n.jsx(Zt,{value:"__all__",children:"Any version"}),L.map(F=>n.jsx(Zt,{value:F,children:F},F))]})]}),n.jsx(Pt,{children:n.jsxs(Ce,{children:[n.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[n.jsx(ke,{asChild:!0,children:n.jsxs(ir,{htmlFor:"reset-mode",className:"flex items-center gap-1 text-sm cursor-pointer whitespace-nowrap",children:[n.jsx(Ur,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Full reset"]})}),n.jsx(Gn,{id:"reset-mode",checked:W==="full-erase",onCheckedChange:F=>Y(F?"full-erase":"app-only")})]}),n.jsx(Ee,{children:W==="full-erase"?"Erase all data before booting":"Keep existing data"})]})})]}),$.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:y?"No devices available for this OS.":"Connecting to relay…"}):n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:$.map(F=>{const X=F.status==="booted",z=F.busy,pe=z?"In use":X?"Booted":"Available",se=z?"bg-amber-400":X?"bg-emerald-400":"bg-muted-foreground/40";return n.jsxs("button",{disabled:z||d||!y,onClick:()=>C(F),className:Z("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px]","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[n.jsx("span",{className:"text-sm font-medium leading-tight",children:F.name}),F.osVersion&&n.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:F.osVersion}),n.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{className:Z("inline-block h-1.5 w-1.5 rounded-full",se)}),pe]})]},F.id)})}),x&&n.jsx("p",{className:"text-sm text-muted-foreground",children:x})]}):n.jsxs("div",{className:"flex flex-col gap-5",children:[n.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select Mac"}),R.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:y?`No agents available for ${c}.`:"Connecting to relay…"}):n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:R.map(F=>{const X=F.resources,z=X?Date.now()-X.reportedAt>3e4:!1,pe=F.devices.filter(Te=>Te.platform===c).length,se=(X==null?void 0:X.cpuPercent)??0,oe=X?X.memUsedMB/X.memTotalMB*100:0,Ie=Jo(X,z),q=Ie==="overloaded";return n.jsx(Pt,{children:n.jsxs(Ce,{children:[n.jsx(ke,{asChild:!0,children:n.jsx("span",{tabIndex:q?0:void 0,className:q?"cursor-not-allowed":void 0,children:n.jsxs("button",{disabled:q,"aria-disabled":q,onClick:()=>p(F.agentName??null),className:Z("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px] w-full",q?"pointer-events-none":"hover:bg-accent"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx(Zo,{health:Ie}),n.jsx("span",{className:"text-sm font-medium leading-tight truncate",children:F.agentName??"Unknown"})]}),z&&n.jsx("span",{className:"shrink-0 text-[10px] font-medium text-amber-500",children:"Stale"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsxs("span",{children:[pe," device",pe!==1?"s":""]}),X&&n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"·"}),n.jsxs("span",{children:[X.slotsAvailable,"/",X.slotsTotal," slots"]})]})]}),X&&!z&&n.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[n.jsx(ln,{label:"CPU",percent:se,colorClass:"bg-blue-400"}),n.jsx(ln,{label:"RAM",percent:oe,colorClass:"bg-violet-400"})]})]})})}),q&&n.jsx(Ee,{children:"This Mac is currently overloaded. Try again later."})]})},F.agentName)})})]})})}),r&&n.jsxs(n.Fragment,{children:[n.jsx(dn,{orientation:"vertical",className:"h-auto"}),n.jsx("div",{className:"w-80 shrink-0 h-full",children:n.jsx($o,{buildId:Number(r),recordingsRefreshKey:i})})]})]})}function Zo({health:t}){const e={unknown:"bg-muted-foreground/40",healthy:"bg-emerald-400",warning:"bg-amber-400",overloaded:"bg-red-500"}[t];return n.jsx("span",{"data-testid":"resource-health-dot",className:Z("inline-block h-2 w-2 shrink-0 rounded-full",e)})}function ln({label:t,percent:e,colorClass:r}){return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[n.jsx("span",{children:t}),n.jsxs("span",{children:[e.toFixed(0),"%"]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:Z("h-full rounded-full transition-all",r),style:{width:`${Math.min(100,e)}%`}})})]})}export{sa as QASession};