expo-device-hub 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -188,12 +188,12 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
188
188
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.installOnUIRuntime=function(t){const o=globalThis?.expo?.installOnUIRuntime;if(!o)throw Error("Native method to install Expo Modules on the worklets UI runtime wasn't found in `expo-modules-core`.");o(t)}},142,[]);
189
189
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useEvent=function(u,s,c=null){const[o,f]=(0,t.useState)(c);return n(u,s,t=>f(t)),o},e.useEventListener=n;var t=r(d[0]);function n(n,u,s){const c=(0,t.useRef)(s);c.current=s,(0,t.useEffect)(()=>{const t=n.addListener(u,(...t)=>c.current(...t));return()=>t.remove()},[n,u,c])}},143,[38]);
190
190
  __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]);function l(){return(0,n.jsx)(u.default,{dom:{scrollEnabled:!1}})}},144,[145,151]);
191
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}}),r(d[0]),r(d[1]);var t=r(d[2]),o=r(d[3]),s=r(d[4]),n=r(d[5]),l=r(d[6]),c=r(d[7]),u=r(d[8]),f=r(d[9]),b=r(d[10]);function v(t,o){const s=new Set(t.map(t=>t.id));return[...t,...o.filter(t=>!s.has(t.id))]}const x=767,p=1167;function h(h){const S=(0,l.useColorScheme)(),j=(0,c.useDevices)(),y=(0,c.useRecentDevices)(),w=(0,f.useNewDeviceOptions)(),[k,C]=(0,t.useState)(''),[D,I]=(0,t.useState)([]),E=(0,u.useIsNarrow)(x),O=(0,u.useIsNarrow)(p),[z,T]=(0,t.useState)(!0),[L,N]=(0,t.useState)(!0),_=(0,t.useMemo)(()=>v(j.simulators,D.filter(t=>'ios'===t.platform)),[j.simulators,D]),A=(0,t.useMemo)(()=>v(j.emulators,D.filter(t=>'android'===t.platform)),[j.emulators,D]);async function F(t){if(I(o=>o.some(o=>o.id===t.id)?o:[...o,t]),C(t.id),'android'===t.platform&&!t.booted){const o=await(0,n.bootDevice)(t);o?(I(s=>[...s.filter(s=>s.id!==t.id&&s.id!==o),Object.assign({},t,{id:o,booted:!0})]),C(o)):(I(o=>o.filter(o=>o.id!==t.id)),C(''))}}async function M(t){await(0,n.shutdownDevice)(t),I(o=>o.filter(o=>o.id!==t.id)),C('')}async function P(t){await(0,n.removeDevice)(t),I(o=>o.filter(o=>o.id!==t.id)),C('')}(0,t.useEffect)(()=>{T(!E)},[E]),(0,t.useEffect)(()=>{N(!O)},[O]),(0,t.useEffect)(()=>{const t=document.documentElement;return t.classList.toggle('dark-theme','dark'===S),()=>t.classList.remove('dark-theme')},[S]),(0,t.useEffect)(()=>{const t=[..._,...A];t.some(t=>t.id===k)||C(t[0]?.id??'')},[_,A,k]);const R=[..._,...A],W=R.find(t=>t.id===k)??R[0],q=(0,o.useActiveDeviceClient)(W?{platform:W.platform,device:W.id}:null);return(0,b.jsxs)("div",{className:'dark'===S?'dark-theme':void 0,style:{display:'flex',position:'relative',flex:1,width:'100%',minWidth:0,height:'100vh',boxSizing:'border-box',backgroundColor:s.bg.subtle,color:s.text.default,fontFamily:'var(--expo-font-sans)',overflow:'hidden'},children:[z&&!E&&(0,b.jsx)(s.Sidebar,{simulators:_,emulators:A,recentSimulators:y.simulators,recentEmulators:y.emulators,simulatorOptions:w.ios,emulatorOptions:w.android,selectedId:k,onSelect:C,onAddDevice:F,onToggle:()=>T(!1)}),W?(0,b.jsx)(s.StreamPanel,{device:W,client:q,DeviceScreen:o.DeviceScreen,displayScreen:o.displayScreen,onShutdown:()=>M(W),onRemove:()=>P(W)}):(0,b.jsx)(s.EmptyState,{}),L&&!O&&(0,b.jsx)(s.LogSidebar,{client:q,onToggle:()=>N(!1)}),z&&E&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:()=>T(!1),style:{position:'absolute',inset:0,backgroundColor:'rgba(0, 0, 0, 0.35)',zIndex:10}}),(0,b.jsx)("div",{style:{position:'absolute',top:0,left:0,zIndex:11,backgroundColor:s.bg.subtle,boxShadow:s.shadow.lg},children:(0,b.jsx)(s.Sidebar,{simulators:_,emulators:A,recentSimulators:y.simulators,recentEmulators:y.emulators,simulatorOptions:w.ios,emulatorOptions:w.android,selectedId:k,onSelect:C,onAddDevice:F,onToggle:()=>T(!1)})})]}),L&&O&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:()=>N(!1),style:{position:'absolute',inset:0,backgroundColor:'rgba(0, 0, 0, 0.35)',zIndex:10}}),(0,b.jsx)("div",{style:{position:'absolute',top:0,right:0,zIndex:11,backgroundColor:s.bg.subtle,boxShadow:s.shadow.lg},children:(0,b.jsx)(s.LogSidebar,{client:q,onToggle:()=>N(!1)})})]}),!z&&(0,b.jsx)("div",{style:{position:'absolute',top:24,left:24,zIndex:12},children:(0,b.jsx)(s.SidebarToggle,{floating:!0,onClick:()=>T(!0)})}),!L&&(0,b.jsx)("div",{style:{position:'absolute',top:24,right:24,zIndex:12},children:(0,b.jsx)(s.SidebarToggle,{floating:!0,side:"right",onClick:()=>N(!0)})})]})}},145,[146,147,38,148,161,257,258,259,260,261,151]);
191
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}}),r(d[0]),r(d[1]);var o=r(d[2]),t=r(d[3]),s=r(d[4]),n=r(d[5]),l=r(d[6]),c=r(d[7]),u=r(d[8]),f=r(d[9]),b=r(d[10]);function v(o,t){const s=new Set(o.map(o=>o.id));return[...o,...t.filter(o=>!s.has(o.id))]}const x=767,p=1167;function h(h){const S=(0,l.useColorScheme)(),j=(0,c.useDevices)(),y=(0,c.useRecentDevices)(),w=(0,f.useNewDeviceOptions)(),[k,C]=(0,o.useState)(''),[D,I]=(0,o.useState)([]),E=(0,u.useIsNarrow)(x),O=(0,u.useIsNarrow)(p),[z,N]=(0,o.useState)(!0),[T,L]=(0,o.useState)(!0),[M,_]=(0,o.useState)(null),A=(0,o.useMemo)(()=>v(j.simulators,D.filter(o=>'ios'===o.platform)),[j.simulators,D]),F=(0,o.useMemo)(()=>v(j.emulators,D.filter(o=>'android'===o.platform)),[j.emulators,D]);async function P(o){if(I(t=>t.some(t=>t.id===o.id)?t:[...t,o]),C(o.id),'android'===o.platform&&!o.booted){const{serial:t,error:s}=await(0,n.bootDevice)(o);t?(I(s=>[...s.filter(s=>s.id!==o.id&&s.id!==t),Object.assign({},o,{id:t,booted:!0})]),C(t)):(I(t=>t.filter(t=>t.id!==o.id)),C(''),_({deviceName:o.name,message:s??'Unknown error'}))}}async function R(o){await(0,n.shutdownDevice)(o),I(t=>t.filter(t=>t.id!==o.id)),C('')}async function B(o){await(0,n.removeDevice)(o),I(t=>t.filter(t=>t.id!==o.id)),C('')}(0,o.useEffect)(()=>{N(!E)},[E]),(0,o.useEffect)(()=>{L(!O)},[O]),(0,o.useEffect)(()=>{const o=document.documentElement;return o.classList.toggle('dark-theme','dark'===S),()=>o.classList.remove('dark-theme')},[S]),(0,o.useEffect)(()=>{const o=[...A,...F];o.some(o=>o.id===k)||C(o[0]?.id??'')},[A,F,k]);const U=[...A,...F],W=U.find(o=>o.id===k)??U[0],q=(0,t.useActiveDeviceClient)(W?{platform:W.platform,device:W.id}:null);return(0,b.jsxs)("div",{className:'dark'===S?'dark-theme':void 0,style:{display:'flex',position:'relative',flex:1,width:'100%',minWidth:0,height:'100vh',boxSizing:'border-box',backgroundColor:s.bg.subtle,color:s.text.default,fontFamily:'var(--expo-font-sans)',overflow:'hidden'},children:[z&&!E&&(0,b.jsx)(s.Sidebar,{simulators:A,emulators:F,recentSimulators:y.simulators,recentEmulators:y.emulators,simulatorOptions:w.ios,emulatorOptions:w.android,selectedId:k,onSelect:C,onAddDevice:P,onToggle:()=>N(!1)}),W?(0,b.jsx)(s.StreamPanel,{device:W,client:q,DeviceScreen:t.DeviceScreen,displayScreen:t.displayScreen,onShutdown:()=>R(W),onRemove:()=>B(W)}):(0,b.jsx)(s.EmptyState,{}),T&&!O&&(0,b.jsx)(s.LogSidebar,{client:q,onToggle:()=>L(!1)}),z&&E&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:()=>N(!1),style:{position:'absolute',inset:0,backgroundColor:'rgba(0, 0, 0, 0.35)',zIndex:10}}),(0,b.jsx)("div",{style:{position:'absolute',top:0,left:0,zIndex:11,backgroundColor:s.bg.subtle,boxShadow:s.shadow.lg},children:(0,b.jsx)(s.Sidebar,{simulators:A,emulators:F,recentSimulators:y.simulators,recentEmulators:y.emulators,simulatorOptions:w.ios,emulatorOptions:w.android,selectedId:k,onSelect:C,onAddDevice:P,onToggle:()=>N(!1)})})]}),T&&O&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:()=>L(!1),style:{position:'absolute',inset:0,backgroundColor:'rgba(0, 0, 0, 0.35)',zIndex:10}}),(0,b.jsx)("div",{style:{position:'absolute',top:0,right:0,zIndex:11,backgroundColor:s.bg.subtle,boxShadow:s.shadow.lg},children:(0,b.jsx)(s.LogSidebar,{client:q,onToggle:()=>L(!1)})})]}),!z&&(0,b.jsx)("div",{style:{position:'absolute',top:24,left:24,zIndex:12},children:(0,b.jsx)(s.SidebarToggle,{floating:!0,onClick:()=>N(!0)})}),!T&&(0,b.jsx)("div",{style:{position:'absolute',top:24,right:24,zIndex:12},children:(0,b.jsx)(s.SidebarToggle,{floating:!0,side:"right",onClick:()=>L(!0)})}),(0,b.jsx)(s.BootErrorModal,{open:null!==M,onClose:()=>_(null),deviceName:M?.deviceName??'',message:M?.message??''})]})}},145,[146,147,38,148,161,257,258,259,260,261,151]);
192
192
  __d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, dependencyMap) {},146,[]);
193
193
  __d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, dependencyMap) {},147,[]);
194
194
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DeviceScreen",{enumerable:!0,get:function(){return n.DeviceScreen}}),Object.defineProperty(e,"displayScreen",{enumerable:!0,get:function(){return u.displayScreen}}),Object.defineProperty(e,"streamGeometry",{enumerable:!0,get:function(){return u.streamGeometry}}),Object.defineProperty(e,"useIosDeviceClient",{enumerable:!0,get:function(){return c.useIosDeviceClient}}),Object.defineProperty(e,"useAndroidDeviceClient",{enumerable:!0,get:function(){return o.useAndroidDeviceClient}}),Object.defineProperty(e,"useActiveDeviceClient",{enumerable:!0,get:function(){return f.useActiveDeviceClient}}),Object.defineProperty(e,"DEFAULT_ENDPOINTS",{enumerable:!0,get:function(){return b.DEFAULT_ENDPOINTS}}),Object.defineProperty(e,"SERVE_SIM_PLUGIN_PATH",{enumerable:!0,get:function(){return b.SERVE_SIM_PLUGIN_PATH}}),Object.defineProperty(e,"SERVE_EMU_PLUGIN_PATH",{enumerable:!0,get:function(){return b.SERVE_EMU_PLUGIN_PATH}}),Object.defineProperty(e,"endpointFor",{enumerable:!0,get:function(){return b.endpointFor}}),Object.defineProperty(e,"startIosHelper",{enumerable:!0,get:function(){return b.startIosHelper}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]),u=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]),b=r(d[6])},148,[149,150,153,154,156,160,155]);
195
195
  __d(function(g,r,i,a,m,e,d){},149,[]);
196
- __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceScreen=function({client:u,borderRadius:a,squircle:l}){const{videoKind:p,attachVideo:h,sendTouch:f,sendMultiTouch:b,screen:v,status:x,error:y}=u,w=!!b,j=(0,n.useRef)(null),[R,C]=(0,n.useState)(null);(0,n.useEffect)(()=>{const t=j.current;if(!t||'undefined'==typeof ResizeObserver)return;const n=new ResizeObserver(t=>{const n=t[0]?.contentRect;n&&C({w:n.width,h:n.height})});return n.observe(t),()=>n.disconnect()},[]);const I=(0,n.useRef)(new Map),E=(0,n.useRef)('none'),O=(0,n.useRef)(null),D=(0,n.useRef)(!1),k=(0,n.useRef)({x:0,y:0}),[M,S]=(0,n.useState)(null),F=(0,n.useRef)({}),P=(0,n.useRef)(0),A=()=>{P.current=0;const t=F.current;F.current={},t.single&&f(Object.assign({phase:'move'},t.single)),t.multi&&(b?.(t.multi),S({a:t.multi.a,b:t.multi.b}))},z=()=>{P.current||(P.current=requestAnimationFrame(A))},T=(t,n)=>{const r=j.current?.getBoundingClientRect();return r&&0!==r.width&&0!==r.height?{x:o((t-r.left)/r.width),y:o((n-r.top)/r.height)}:null},_=t=>D.current?{x:o(t.x+k.current.x),y:o(t.y+k.current.y)}:{x:1-t.x,y:1-t.y},q=(t,n)=>{P.current&&(cancelAnimationFrame(P.current),P.current=0),F.current={},b?.({phase:'end',a:t,b:n}),S(null)},K=t=>{const n=I.current.get(t.pointerId);if(!n)return;t.preventDefault();const r=T(t.clientX,t.clientY)??n;try{j.current?.releasePointerCapture(t.pointerId)}catch{}if('alt'===E.current)return q(r,_(r)),E.current='none',void I.current.clear();if('two'===E.current){const[t,n]=[...I.current.values()];return q(t??r,n??r),E.current='none',void I.current.clear()}'single'===E.current&&t.pointerId===O.current&&(P.current&&(cancelAnimationFrame(P.current),P.current=0),F.current={},f(Object.assign({phase:'end'},r)),E.current='none',O.current=null),I.current.delete(t.pointerId)},X=(0,r.streamGeometry)(v).rotationDegrees,Y=90===Math.abs(X),$=Object.assign({position:'relative',width:'100%',height:'100%',overflow:'hidden',backgroundColor:'#000',borderRadius:a},l?{cornerShape:'squircle'}:{}),U=0===X?{display:'block',position:'absolute',inset:0,width:'100%',height:'100%',objectFit:'cover'}:{display:'block',position:'absolute',top:'50%',left:'50%',width:Y&&R?`${R.h}px`:'100%',height:Y&&R?`${R.w}px`:'100%',transform:`translate(-50%, -50%) rotate(${X}deg)`,transformOrigin:'center center',objectFit:'cover'};return Object.assign(U,{userSelect:'none',WebkitUserSelect:'none',pointerEvents:'none'}),(0,t.jsxs)("div",{style:$,children:['canvas'===p?(0,t.jsx)("canvas",{ref:h,style:U}):(0,t.jsx)("img",{ref:h,alt:"Device screen",draggable:!1,style:U}),(0,t.jsx)("div",{ref:j,style:{position:'absolute',inset:0,cursor:c,touchAction:'none'},onPointerDown:t=>{if('mouse'===t.pointerType&&0!==t.button)return;const n=T(t.clientX,t.clientY);if(!n)return;t.preventDefault();try{j.current?.setPointerCapture(t.pointerId)}catch{}if(I.current.set(t.pointerId,n),w&&'mouse'===t.pointerType&&t.altKey&&'none'===E.current){E.current='alt',D.current=t.shiftKey,k.current={x:1-2*n.x,y:1-2*n.y};const r=_(n);return S({a:n,b:r}),void b?.({phase:'begin',a:n,b:r})}if(w&&I.current.size>=2&&'alt'!==E.current){'single'===E.current&&(f(Object.assign({phase:'end'},n)),O.current=null);const[t,r]=[...I.current.values()];return E.current='two',S({a:t,b:r}),void b?.({phase:'begin',a:t,b:r})}'none'===E.current&&(E.current='single',O.current=t.pointerId,f(Object.assign({phase:'begin'},n)))},onPointerMove:t=>{if(!I.current.get(t.pointerId))return;const n=t.nativeEvent,r='function'==typeof n.getCoalescedEvents?n.getCoalescedEvents():null,o=r&&r.length>0?r[r.length-1]:t,c=T(o.clientX,o.clientY);if(!c)return;if(t.preventDefault(),I.current.set(t.pointerId,c),'alt'===E.current)F.current.multi={phase:'move',a:c,b:_(c)},z();else if('two'===E.current){const[t,n]=[...I.current.values()];F.current.multi={phase:'move',a:t,b:n},z()}else'single'===E.current&&t.pointerId===O.current&&(F.current.single=c,z())},onPointerUp:K,onPointerCancel:K,onContextMenu:t=>t.preventDefault()}),M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s,{point:M.a}),(0,t.jsx)(s,{point:M.b})]}),'streaming'!==x&&(0,t.jsx)("div",{style:{position:'absolute',inset:0,display:'flex',alignItems:'center',justifyContent:'center',padding:24,textAlign:'center',pointerEvents:'none',backgroundColor:'rgba(0, 0, 0, 0.55)',color:'error'===x?'#fca5a5':'rgba(255, 255, 255, 0.7)',fontSize:13,fontFamily:'var(--expo-font-mono)'},children:'error'===x?y??'Disconnected':'connecting'===x?'Connecting\u2026':'Not connected'})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const o=t=>Math.min(1,Math.max(0,t)),c="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='9' fill='rgba(255,255,255,0.45)' stroke='rgba(0,0,0,0.55)' stroke-width='1.25'/%3E%3C/svg%3E\") 12 12, pointer";function s({point:n}){return(0,t.jsx)("div",{style:{position:'absolute',left:100*n.x+"%",top:100*n.y+"%",width:20,height:20,borderRadius:'50%',background:'rgba(255, 255, 255, 0.45)',border:'1.25px solid rgba(0, 0, 0, 0.55)',boxShadow:'0 1px 3px rgba(0, 0, 0, 0.45)',transform:'translate(-50%, -50%)',pointerEvents:'none'}})}},150,[151,38,153]);
196
+ __d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceScreen=function({client:u,borderRadius:a,squircle:l}){const{videoKind:p,attachVideo:h,sendTouch:f,sendMultiTouch:b,screen:v,status:x,error:y}=u,w=!!b,j=(0,n.useRef)(null),[R,C]=(0,n.useState)(null);(0,n.useEffect)(()=>{const t=j.current;if(!t||'undefined'==typeof ResizeObserver)return;const n=new ResizeObserver(t=>{const n=t[0]?.contentRect;n&&C({w:n.width,h:n.height})});return n.observe(t),()=>n.disconnect()},[]);const I=(0,n.useRef)(new Map),E=(0,n.useRef)('none'),O=(0,n.useRef)(null),D=(0,n.useRef)(!1),k=(0,n.useRef)({x:0,y:0}),[M,S]=(0,n.useState)(null),F=(0,n.useRef)({}),P=(0,n.useRef)(0),A=()=>{P.current=0;const t=F.current;F.current={},t.single&&f(Object.assign({phase:'move'},t.single)),t.multi&&(b?.(t.multi),S({a:t.multi.a,b:t.multi.b}))},z=()=>{P.current||(P.current=requestAnimationFrame(A))},T=(t,n)=>{const r=j.current?.getBoundingClientRect();return r&&0!==r.width&&0!==r.height?{x:o((t-r.left)/r.width),y:o((n-r.top)/r.height)}:null},_=t=>D.current?{x:o(t.x+k.current.x),y:o(t.y+k.current.y)}:{x:1-t.x,y:1-t.y},K=(t,n)=>{P.current&&(cancelAnimationFrame(P.current),P.current=0),F.current={},b?.({phase:'end',a:t,b:n}),S(null)},X=t=>{const n=I.current.get(t.pointerId);if(!n)return;t.preventDefault();const r=T(t.clientX,t.clientY)??n;try{j.current?.releasePointerCapture(t.pointerId)}catch{}if('alt'===E.current)return K(r,_(r)),E.current='none',void I.current.clear();if('two'===E.current){const[t,n]=[...I.current.values()];return K(t??r,n??r),E.current='none',void I.current.clear()}'single'===E.current&&t.pointerId===O.current&&(P.current&&(cancelAnimationFrame(P.current),P.current=0),F.current={},f(Object.assign({phase:'end'},r)),E.current='none',O.current=null),I.current.delete(t.pointerId)},Y=(0,r.streamGeometry)(v).rotationDegrees,$=90===Math.abs(Y),q=Object.assign({position:'relative',width:'100%',height:'100%',overflow:'hidden',backgroundColor:'#000',borderRadius:a},l?{cornerShape:'superellipse(1.3)'}:{}),U=0===Y?{display:'block',position:'absolute',inset:0,width:'100%',height:'100%',objectFit:'cover'}:{display:'block',position:'absolute',top:'50%',left:'50%',width:$&&R?`${R.h}px`:'100%',height:$&&R?`${R.w}px`:'100%',transform:`translate(-50%, -50%) rotate(${Y}deg)`,transformOrigin:'center center',objectFit:'cover'};return Object.assign(U,{userSelect:'none',WebkitUserSelect:'none',pointerEvents:'none'}),(0,t.jsxs)("div",{style:q,children:['canvas'===p?(0,t.jsx)("canvas",{ref:h,style:U}):(0,t.jsx)("img",{ref:h,alt:"Device screen",draggable:!1,style:U}),(0,t.jsx)("div",{ref:j,style:{position:'absolute',inset:0,cursor:c,touchAction:'none'},onPointerDown:t=>{if('mouse'===t.pointerType&&0!==t.button)return;const n=T(t.clientX,t.clientY);if(!n)return;t.preventDefault();try{j.current?.setPointerCapture(t.pointerId)}catch{}if(I.current.set(t.pointerId,n),w&&'mouse'===t.pointerType&&t.altKey&&'none'===E.current){E.current='alt',D.current=t.shiftKey,k.current={x:1-2*n.x,y:1-2*n.y};const r=_(n);return S({a:n,b:r}),void b?.({phase:'begin',a:n,b:r})}if(w&&I.current.size>=2&&'alt'!==E.current){'single'===E.current&&(f(Object.assign({phase:'end'},n)),O.current=null);const[t,r]=[...I.current.values()];return E.current='two',S({a:t,b:r}),void b?.({phase:'begin',a:t,b:r})}'none'===E.current&&(E.current='single',O.current=t.pointerId,f(Object.assign({phase:'begin'},n)))},onPointerMove:t=>{if(!I.current.get(t.pointerId))return;const n=t.nativeEvent,r='function'==typeof n.getCoalescedEvents?n.getCoalescedEvents():null,o=r&&r.length>0?r[r.length-1]:t,c=T(o.clientX,o.clientY);if(!c)return;if(t.preventDefault(),I.current.set(t.pointerId,c),'alt'===E.current)F.current.multi={phase:'move',a:c,b:_(c)},z();else if('two'===E.current){const[t,n]=[...I.current.values()];F.current.multi={phase:'move',a:t,b:n},z()}else'single'===E.current&&t.pointerId===O.current&&(F.current.single=c,z())},onPointerUp:X,onPointerCancel:X,onContextMenu:t=>t.preventDefault()}),M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s,{point:M.a}),(0,t.jsx)(s,{point:M.b})]}),'streaming'!==x&&(0,t.jsx)("div",{style:{position:'absolute',inset:0,display:'flex',alignItems:'center',justifyContent:'center',padding:24,textAlign:'center',pointerEvents:'none',backgroundColor:'rgba(0, 0, 0, 0.55)',color:'error'===x?'#fca5a5':'rgba(255, 255, 255, 0.7)',fontSize:13,fontFamily:'var(--expo-font-mono)'},children:'error'===x?y??'Disconnected':'connecting'===x?'Connecting\u2026':'Not connected'})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]);const o=t=>Math.min(1,Math.max(0,t)),c="url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='9' fill='rgba(255,255,255,0.45)' stroke='rgba(0,0,0,0.55)' stroke-width='1.25'/%3E%3C/svg%3E\") 12 12, pointer";function s({point:n}){return(0,t.jsx)("div",{style:{position:'absolute',left:100*n.x+"%",top:100*n.y+"%",width:20,height:20,borderRadius:'50%',background:'rgba(255, 255, 255, 0.45)',border:'1.25px solid rgba(0, 0, 0, 0.55)',boxShadow:'0 1px 3px rgba(0, 0, 0, 0.45)',transform:'translate(-50%, -50%)',pointerEvents:'none'}})}},150,[151,38,153]);
197
197
  __d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},151,[152]);
198
198
  __d(function(g,r,i,a,m,e,d){
199
199
  /**
@@ -209,15 +209,15 @@ __d(function(g,r,i,a,m,e,d){
209
209
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HID_EDGE_LEFT",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HID_EDGE_TOP",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"HID_EDGE_BOTTOM",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"HID_EDGE_RIGHT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"HOME_INDICATOR_BAND_NORM",{enumerable:!0,get:function(){return s}}),e.homeIndicatorEdge=function(t){return t>=s?u:void 0},e.isLandscapeOrientation=o,e.rotationDegreesForOrientation=h,e.displayScreen=l,e.streamGeometry=function(t){const n=l(t),u=h(t?.orientation),c=90===Math.abs(u),s=!!t&&t.width>t.height,o=180===u||c&&!s;return{display:n,rotationDegrees:o?u:0,needsRotation:o,inputOrientation:o?t?.orientation:void 0}},e.rawPointForDisplayPoint=function(t,n,u){switch(t){case'landscape_left':return{x:u,y:1-n};case'landscape_right':return{x:1-u,y:n};case'portrait_upside_down':return{x:1-n,y:1-u};default:return{x:n,y:u}}},e.rawEdgeForDisplayEdge=function(s,o){switch(s){case'landscape_left':switch(o){case t:return u;case c:return n;case n:return t;case u:return c;default:return o}case'landscape_right':switch(o){case t:return n;case c:return u;case n:return c;case u:return t;default:return o}case'portrait_upside_down':switch(o){case t:return c;case c:return t;case n:return u;case u:return n;default:return o}default:return o}};const t=1,n=2,u=3,c=4,s=.93;function o(t){return'landscape_left'===t||'landscape_right'===t}function h(t){switch(t){case'landscape_left':return 90;case'landscape_right':return-90;case'portrait_upside_down':return 180;default:return 0}}function l(t){if(!t||t.width<=0||t.height<=0)return null;const n=o(t.orientation)||t.width>t.height,u=n?Math.max(t.width,t.height):Math.min(t.width,t.height),c=n?Math.min(t.width,t.height):Math.max(t.width,t.height);return u===t.width&&c===t.height?t:Object.assign({},t,{width:u,height:c})}},153,[]);
210
210
  __d(function(g,_r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useIosDeviceClient=function(f){const{baseUrl:S,enabled:b=!0,device:k=null}=f,E=b&&!!S,[T,x]=(0,t.useState)('idle'),[U,O]=(0,t.useState)(null),[P,W]=(0,t.useState)(null),[C,$]=(0,t.useState)([]),[A,N]=(0,t.useState)(!1),[R,D]=(0,t.useState)(d),[L,I]=(0,t.useState)(null),[J,_]=(0,t.useState)(null),j=(0,t.useRef)(null),H=(0,t.useRef)(0),M=(0,t.useRef)(null),B=(0,t.useRef)(null),F=(0,t.useRef)(!1),G=(0,t.useRef)(null);(0,t.useEffect)(()=>{G.current=P},[P]);const K=(0,t.useRef)(!1),V=(0,t.useCallback)(()=>{const t=M.current,r=B.current;t&&r&&(t.src=`${r}${r.includes('?')?'&':'?'}t=${Date.now()}`)},[]),q=(0,t.useCallback)(t=>{M.current=t??null,t&&V()},[V]),z=(0,t.useCallback)(t=>{const n=j.current;if(!n||n.readyState!==WebSocket.OPEN)return;const c=(0,r.streamGeometry)(G.current).inputOrientation;let a;'begin'===t.phase?(F.current=void 0!==(0,r.homeIndicatorEdge)(t.y),F.current&&(a=r.HID_EDGE_BOTTOM)):F.current&&(a=r.HID_EDGE_BOTTOM,'end'===t.phase&&(F.current=!1));const l=(0,r.rawPointForDisplayPoint)(c,t.x,t.y),o=void 0===a?void 0:(0,r.rawEdgeForDisplayEdge)(c,a),i=void 0===o?Object.assign({type:t.phase},l):Object.assign({type:t.phase},l,{edge:o});n.send(y(s,i))},[]),Q=(0,t.useCallback)(t=>{const n=j.current;if(!n||n.readyState!==WebSocket.OPEN)return;const c=(0,r.streamGeometry)(G.current).inputOrientation,s=(0,r.rawPointForDisplayPoint)(c,t.a.x,t.a.y),a=(0,r.rawPointForDisplayPoint)(c,t.b.x,t.b.y);n.send(y(l,{type:t.phase,x1:s.x,y1:s.y,x2:a.x,y2:a.y}))},[]),X=(0,t.useCallback)(t=>{const r=j.current;if(!r||r.readyState!==WebSocket.OPEN)return;const n=h[t];n&&r.send(y(a,{button:n}))},[]),Y=(0,t.useCallback)(async()=>{const t=j.current;if(!t||t.readyState!==WebSocket.OPEN)return;const r=(r,n)=>t.send(y(o,{type:r,usage:n}));r('down',u),await new Promise(t=>setTimeout(t,30)),r('up',u)},[]),Z=(0,t.useCallback)(async()=>{if(!S)return null;const t=L?.device??k,r=`${S.replace(/\/$/,'')}/api/screenshot${t?`?device=${encodeURIComponent(t)}`:''}`;try{const t=await fetch(r,{cache:'no-store'});return t.ok?await t.blob():null}catch{return null}},[S,k,L]),ee=(0,t.useCallback)(t=>{const r=L;r&&r.execWsUrl&&r.execToken&&r.device&&(_(t),w(r.execWsUrl,r.execToken,{device:r.device,option:'appearance',value:t}).catch(()=>{}))},[L]),te=(0,t.useCallback)(()=>N(!0),[]),re=(0,t.useCallback)(()=>N(!1),[]),ne=(0,t.useCallback)(()=>$([]),[]);(0,t.useEffect)(()=>{if(!E||!S)return I(null),void x('idle');let t=!1,r=null;x('connecting'),O(null);const s=`${S.replace(/\/$/,'')}/api${k?`?device=${encodeURIComponent(k)}`:''}`,a=()=>({mode:'helper',streamUrl:new URL('/stream.mjpeg',S).toString(),wsUrl:v(new URL('/ws',S).toString()),device:null,execWsUrl:null,execToken:null,logsPath:null,gridApiUrl:null}),l=t=>{const r=t.basePath??'';return{mode:'middleware',streamUrl:t.streamUrl??`${t.url}/stream.mjpeg`,wsUrl:t.wsUrl??`${v(t.url)}/ws`,device:t.device??null,execWsUrl:v(new URL(`${r}/exec-ws`,S).toString()),execToken:t.execToken??null,logsPath:t.logsEndpoint??null,gridApiUrl:new URL(t.gridApiEndpoint??'/grid/api',S).toString()}};let o=!1;const i=async()=>{if(!t)try{const u=await fetch(s,{signal:AbortSignal.timeout(3e3)});if(!u.ok)return void(t||I(a()));const d=await u.json();if(d&&d.url&&d.device)return void(t||I(l(d)));k&&!o&&(o=!0,(0,n.startIosHelper)(k,S).catch(()=>{})),t||(r=setTimeout(i,c))}catch{t||I(a())}};return i(),()=>{t=!0,r&&clearTimeout(r)}},[E,S,k]);const ce=L?.streamUrl??null;(0,t.useEffect)(()=>{if(!ce)return void(B.current=null);B.current=ce,x('connecting'),O(null);let t=!1,r=!1,n=null;const s=M.current,a=()=>{if(t||r)return;const n=M.current;n&&0!==n.naturalWidth&&0!==n.naturalHeight&&(r=!0,x('streaming'),O(null),K.current||W(t=>t&&t.width===n.naturalWidth&&t.height===n.naturalHeight?t:{width:n.naturalWidth,height:n.naturalHeight}))},l=()=>{t||(r=!1,x('error'),O('Stream unavailable \u2014 retrying\u2026'),n=setTimeout(()=>{t||V()},c))};s?.addEventListener('load',a),s?.addEventListener('error',l),V();const o=setInterval(a,400);return()=>{t=!0,clearInterval(o),n&&clearTimeout(n),s?.removeEventListener('load',a),s?.removeEventListener('error',l);const r=M.current;r&&r.removeAttribute('src'),W(null)}},[ce,V]);const se=L?.wsUrl??null;(0,t.useEffect)(()=>{if(!se)return;let t=!1,r=null;K.current=!1;const n=()=>{if(t)return;let s;try{s=new WebSocket(se)}catch{return}s.binaryType='arraybuffer',j.current=s,s.onmessage=t=>{if(!(t.data instanceof ArrayBuffer))return;const r=new Uint8Array(t.data);if(!(r.length<1||r[0]!==i))try{const t=JSON.parse(p.decode(r.subarray(1)));t.width>0&&t.height>0&&(K.current=!0,W(r=>r&&r.width===t.width&&r.height===t.height&&r.orientation===t.orientation?r:t))}catch{}},s.onclose=()=>{t||(j.current=null,r=setTimeout(n,c))},s.onerror=()=>{try{s.close()}catch{}}};return n(),()=>{t=!0,r&&clearTimeout(r);try{j.current?.close()}catch{}j.current=null}},[se]);const ae=L?.execWsUrl??null,le=L?.execToken??null,oe=L?.logsPath??null;(0,t.useEffect)(()=>{if(!(A&&ae&&le&&oe))return;let t=!1,r=null,n=null,s='';const a=t=>{const r=t.split('\n').filter(t=>t.startsWith('data:')).map(t=>t.slice(5).replace(/^ /,'')).join('\n');if(!r)return;let n=r;try{const t=JSON.parse(r);'string'==typeof t.eventMessage&&(n=t.eventMessage)}catch{}n&&$(t=>[...t,{id:"i"+ ++H.current,source:'syslog',message:n}].slice(-200))},l=()=>{if(!t){s='';try{r=new WebSocket(ae)}catch{return}r.onopen=()=>r?.send(JSON.stringify({token:le})),r.onmessage=t=>{let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.ready)r?.send(JSON.stringify({sub:1,path:oe}));else if(1===n.sub&&'string'==typeof n.data){let t;for(s+=n.data.replace(/\r\n/g,'\n');-1!==(t=s.indexOf('\n\n'));)a(s.slice(0,t)),s=s.slice(t+2)}},r.onclose=()=>{t||(n=setTimeout(l,c))},r.onerror=()=>{try{r?.close()}catch{}}}};return l(),()=>{t=!0,n&&clearTimeout(n);try{r?.close()}catch{}}},[A,ae,le,oe]);const ie=L?.device??null;(0,t.useEffect)(()=>{if(!ae||!le||!ie)return void _(null);let t=!1;return w(ae,le,{device:ie}).then(r=>{const n=r.status?.appearance;t||'light'!==n&&'dark'!==n||_(n)}).catch(()=>{}),()=>{t=!0}},[ae,le,ie]);const ue=L?.gridApiUrl??null;return(0,t.useEffect)(()=>{if(!ue)return void D(d);let t=!1;return fetch(ue,{signal:AbortSignal.timeout(3e3)}).then(t=>t.json()).then(r=>{!t&&Array.isArray(r.devices)&&0!==r.devices.length&&D(r.devices.map(t=>({id:String(t.device??t.id??'ios'),name:String(t.name??t.device??'Simulator'),system:'string'==typeof t.runtime?t.runtime:void 0,platform:'ios',current:null!=t.helper})))}).catch(()=>{}),()=>{t=!0}},[ue]),{platform:'ios',status:T,error:U,screen:P,fps:0,devices:R,logs:C,logsEnabled:A,attachLogs:te,detachLogs:re,clearLogs:ne,videoKind:'img',attachVideo:q,sendTouch:z,sendMultiTouch:Q,pressButton:X,reload:Y,screenshot:Z,appearance:J,setAppearance:ee}};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]);const c=1500,s=3,a=4,l=5,o=6,i=130,u=21,d=[{id:'ios',name:'iPhone Simulator',platform:'ios',current:!0}],h={home:'home',appSwitcher:'app_switcher',power:'lock',back:null,recents:null},f=new TextEncoder,p=new TextDecoder;function y(t,r){const n=f.encode(JSON.stringify(r)),c=new Uint8Array(1+n.length);return c[0]=t,c.set(n,1),c}function v(t){return t.replace(/^http/,'ws')}function w(t,r,n){return new Promise((c,s)=>{let a;try{a=new WebSocket(t)}catch(t){return void s(t)}let l,o=!1;const i=t=>{if(!o){o=!0,clearTimeout(l);try{a.close()}catch{}t()}};l=setTimeout(()=>i(()=>s(new Error('exec-ws timeout'))),5e3),a.onopen=()=>a.send(JSON.stringify({token:r})),a.onmessage=t=>{let r;try{r=JSON.parse(String(t.data))}catch{return}r.ready?a.send(JSON.stringify({id:1,ui:n})):1===r.id&&(r.error?i(()=>s(new Error(r.error))):i(()=>c(r)))},a.onerror=()=>i(()=>s(new Error('exec-ws error'))),a.onclose=()=>i(()=>s(new Error('exec-ws closed')))})}},154,[38,153,155]);
211
211
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVE_SIM_PLUGIN_PATH",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SERVE_EMU_PLUGIN_PATH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DEFAULT_ENDPOINTS",{enumerable:!0,get:function(){return o}}),e.endpointFor=c,e.startIosHelper=async function(n,t){const o=c('ios',t).replace(/\/$/,'');await fetch(`${o}/grid/api/start`,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({udid:n}),signal:AbortSignal.timeout(19e4)})};const n='/_expo/plugins/expo-device-hub/vendor/serve-sim',t='/_expo/plugins/expo-device-hub/vendor/serve-emu',o={ios:n,android:t};function u(n){return n.startsWith('http')?n:'undefined'!=typeof window&&window.location?.origin?`${window.location.origin}${n}`:n}function c(n,t){if(t)return u(t);return u(('undefined'!=typeof window?window.__EXPO_HUB_ENDPOINTS__?.[n]:void 0)??o[n])}},155,[]);
212
- __d(function(g,_r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAndroidDeviceClient=function(f){const{baseUrl:y,enabled:v=!0,device:b=null}=f,S=v&&!!y,[k,w]=(0,t.useState)('idle'),[C,E]=(0,t.useState)(null),[$,R]=(0,t.useState)(null),[O,P]=(0,t.useState)(0),[U,K]=(0,t.useState)([]),[W,A]=(0,t.useState)(!1),[I,L]=(0,t.useState)(d),[M,T]=(0,t.useState)(null),N=(0,t.useRef)(null),j=(0,t.useRef)(null),F=(0,t.useRef)(0),z=(0,t.useCallback)(t=>{j.current=t??null},[]),H=(0,t.useCallback)(()=>A(!0),[]),J=(0,t.useCallback)(()=>A(!1),[]),_=(0,t.useCallback)(()=>K([]),[]),x=(0,t.useCallback)(t=>{const r=N.current;r&&r.readyState===WebSocket.OPEN&&r.send(JSON.stringify(Object.assign({ack:!1},t)))},[]),D=(0,t.useCallback)(t=>{x({type:'touch',action:u[t.phase],x:t.x,y:t.y,pointerId:0})},[x]),V=(0,t.useCallback)(t=>{const r=l[t];r&&x(r)},[x]),B=(0,t.useCallback)(()=>{x({type:'key',keycode:s,record:!1})},[x]),q=(0,t.useCallback)(async()=>{if(!y)return null;const t=`${p(y,'/api/screenshot')}${b?`?device=${encodeURIComponent(b)}`:''}`;try{const r=await fetch(t,{cache:'no-store'});return r.ok?await r.blob():null}catch{return null}},[y,b]),Q=(0,t.useCallback)(t=>{if(!y)return;T(t);const r=`${p(y,'/api/uimode')}${b?`?device=${encodeURIComponent(b)}`:''}`;fetch(r,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({night:'dark'===t?'yes':'no'})}).catch(()=>{})},[y,b]);return(0,t.useEffect)(()=>{if(!S||!y)return void w('idle');const t=!(0,r.isWebCodecsSupported)();if(t&&!n.MsePlayer.isSupported())return w('error'),void E('This browser cannot decode H.264 (WebCodecs unavailable).');w('connecting'),E(null);let s=!1,d=null,l=!1,u=500,p=null,f=null,v=!1,k=!1,C=0,$=0,O=0,U=performance.now();const K=()=>{if(f&&'closed'!==f.state)try{f.close()}catch{}f=null},W=()=>{const t=N.current,r=performance.now();t&&t.readyState===WebSocket.OPEN&&(r-C<c||(C=r,t.send(JSON.stringify({type:'reset-video',ack:!1}))))},A=t=>{const r=j.current,n=r?.getContext('2d',{alpha:!1,desynchronized:!0});if(!r||!n)return void t.close();r.width===t.displayWidth&&r.height===t.displayHeight||(r.width=t.displayWidth,r.height=t.displayHeight,R({width:t.displayWidth,height:t.displayHeight})),n.drawImage(t,0,0),t.close(),s||l||(l=!0,w('streaming')),O++;const o=performance.now();if(o-U>=1e3){const t=Math.round(1e3*O/(o-U));O=0,U=o,P(r=>r===t?r:t)}},I=t=>{if('configured'===f?.state)return!0;K();const n=new VideoDecoder({output:t=>{s||f!==n?t.close():A(t)},error:()=>{f===n&&(K(),v=!1,k=!0,W())}});try{return n.configure({codec:(0,r.buildCodecString)(t),optimizeForLatency:!0}),f=n,!0}catch{try{n.close()}catch{}return W(),!1}},L=c=>{const u=(0,r.parseFramePacket)(c);if(t){const t=u.isKey??(0,r.scanAU)(u.data).isKey;if(!d){const t=j.current;if(!t)return void W();d=new n.MsePlayer(t,{onFirstFrame:()=>{s||l||(l=!0,w('streaming'))},onResize:(t,r)=>{s||R({width:t,height:r})},onFps:t=>{s||P(r=>r===t?r:t)},onError:t=>{s||(w('error'),E(t))},requestKeyframe:W})}return void d.feed(u.data,t,u.timestamp)}const p=null===u.isKey||u.isKey&&(!f||'configured'!==f.state||k)?(0,r.scanAU)(u.data):null,h=u.isKey??p?.isKey??!1,y=p?.spsBytes??null;if(!y||I(y)){if(k){if(!h)return;if(!f||'configured'!==f.state)return void W();k=!1}if(f&&'configured'===f.state){if(f.decodeQueueSize>o)return K(),v=!1,k=!0,void W();if(!v){if(!h)return void W();v=!0}try{f.decode(new EncodedVideoChunk({type:h?'key':'delta',timestamp:u.timestamp??Math.round(1e6*$/60),data:u.data})),$++}catch{K(),v=!1,k=!0,W()}}else h||W()}},M=()=>{if(s)return;let r;try{r=new WebSocket(h(y,b))}catch(t){return w('error'),void E(t instanceof Error?t.message:'Invalid server URL')}r.binaryType='arraybuffer',N.current=r,r.onopen=()=>{s||(u=500,E(null),w(t=>'streaming'===t?t:'connecting'),t&&W())},r.onerror=()=>{s||w('error')},r.onclose=()=>{s||(K(),d?.destroy(),d=null,v=!1,l=!1,$=0,w('error'),E(t=>t??'Disconnected \u2014 retrying\u2026'),p=setTimeout(M,u),u=Math.min(Math.round(1.6*u),5e3))},r.onmessage=t=>{s||'string'==typeof t.data||L(t.data)}};return M(),()=>{s=!0,p&&clearTimeout(p),K(),d?.destroy(),d=null;try{N.current?.close()}catch{}N.current=null,w('idle'),R(null),P(0)}},[S,y,b]),(0,t.useEffect)(()=>{if(!W||!S||!y)return;let t=null;try{t=new EventSource(p(y,"/api/logcat"+(b?`?device=${encodeURIComponent(b)}`:'')))}catch{return}return t.addEventListener('log',t=>{try{const r=JSON.parse(t.data);K(t=>[...t,{id:"a"+ ++F.current,source:'logcat',message:r.line}].slice(-200))}catch{}}),()=>t?.close()},[W,S,y,b]),(0,t.useEffect)(()=>{if(!S||!y)return void L(d);let t=!1;return fetch(p(y,'/api/devices')).then(t=>t.json()).then(r=>{if(t||!Array.isArray(r.devices)||0===r.devices.length)return;const n=b??r.defaultSerial??null;L(r.devices.map(t=>{const r=String(t.serial??t.id??'android');return{id:r,name:String(t.model??t.name??t.product??r),platform:'android',current:r===n}}))}).catch(()=>{}),()=>{t=!0}},[S,y,b]),(0,t.useEffect)(()=>{if(!S||!y)return void T(null);let t=!1;const r=`${p(y,'/api/uimode')}${b?`?device=${encodeURIComponent(b)}`:''}`;return fetch(r,{cache:'no-store'}).then(t=>t.json()).then(r=>{!t&&r.ok&&T('yes'===r.night?'dark':'light')}).catch(()=>{}),()=>{t=!0}},[S,y,b]),{platform:'android',status:k,error:C,screen:$,fps:O,devices:I,logs:U,logsEnabled:W,attachLogs:H,detachLogs:J,clearLogs:_,videoKind:'canvas',attachVideo:z,sendTouch:D,pressButton:V,reload:B,screenshot:q,appearance:M,setAppearance:Q}};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]);const o=4,c=1500,s=46,d=[{id:'android',name:'Emulator Android',platform:'android',current:!0}],l={home:{type:'home'},back:{type:'back'},recents:{type:'recents'},appSwitcher:{type:'recents'},power:{type:'power'}},u={begin:'down',move:'move',end:'up'};function p(t,r){return`${t.replace(/\/$/,'')}${r}`}function h(t,r){const n=new URL(p(t,'/ws'));return n.protocol='https:'===n.protocol?'wss:':'ws:',n.searchParams.set('frame-meta','1'),r&&n.searchParams.set('device',r),n.toString()}},156,[38,157,158]);
212
+ __d(function(g,_r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAndroidDeviceClient=function(f){const{baseUrl:y,enabled:v=!0,device:b=null}=f,S=v&&!!y,[k,w]=(0,t.useState)('idle'),[C,E]=(0,t.useState)(null),[$,R]=(0,t.useState)(null),[O,P]=(0,t.useState)(0),[U,K]=(0,t.useState)([]),[W,A]=(0,t.useState)(!1),[I,L]=(0,t.useState)(d),[M,T]=(0,t.useState)(null),N=(0,t.useRef)(null),j=(0,t.useRef)(null),F=(0,t.useRef)(0),z=(0,t.useCallback)(t=>{j.current=t??null},[]),H=(0,t.useCallback)(()=>A(!0),[]),J=(0,t.useCallback)(()=>A(!1),[]),_=(0,t.useCallback)(()=>K([]),[]),x=(0,t.useCallback)(t=>{const r=N.current;r&&r.readyState===WebSocket.OPEN&&r.send(JSON.stringify(Object.assign({ack:!1},t)))},[]),D=(0,t.useCallback)(t=>{x({type:'touch',action:u[t.phase],x:t.x,y:t.y,pointerId:0})},[x]),V=(0,t.useCallback)(t=>{const r=l[t];r&&x(r)},[x]),B=(0,t.useCallback)(()=>{x({type:'key',keycode:s,record:!1})},[x]),q=(0,t.useCallback)(async()=>{if(!y)return null;const t=`${p(y,'/api/screenshot')}${b?`?device=${encodeURIComponent(b)}`:''}`;try{const r=await fetch(t,{cache:'no-store'});return r.ok?await r.blob():null}catch{return null}},[y,b]),Q=(0,t.useCallback)(t=>{if(!y)return;T(t);const r=`${p(y,'/api/uimode')}${b?`?device=${encodeURIComponent(b)}`:''}`;fetch(r,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({night:'dark'===t?'yes':'no'})}).catch(()=>{})},[y,b]);return(0,t.useEffect)(()=>{if(!S||!y)return void w('idle');const t=!(0,r.isWebCodecsSupported)();if(t&&!n.MsePlayer.isSupported())return w('error'),void E('This browser cannot decode H.264 (WebCodecs unavailable).');w('connecting'),E(null);let s=!1,d=null,l=!1,u=500,p=null,f=null,v=!1,k=!1,C=0,$=0,O=0,U=performance.now();const K=()=>{if(f&&'closed'!==f.state)try{f.close()}catch{}f=null},W=()=>{const t=N.current,r=performance.now();t&&t.readyState===WebSocket.OPEN&&(r-C<c||(C=r,t.send(JSON.stringify({type:'reset-video',ack:!1}))))},A=t=>{const r=j.current,n=r?.getContext('2d',{alpha:!1,desynchronized:!0});if(!r||!n)return void t.close();r.width===t.displayWidth&&r.height===t.displayHeight||(r.width=t.displayWidth,r.height=t.displayHeight,R({width:t.displayWidth,height:t.displayHeight})),n.drawImage(t,0,0),t.close(),s||l||(l=!0,w('streaming'),E(null)),O++;const o=performance.now();if(o-U>=1e3){const t=Math.round(1e3*O/(o-U));O=0,U=o,P(r=>r===t?r:t)}},I=t=>{if('configured'===f?.state)return!0;K();const n=new VideoDecoder({output:t=>{s||f!==n?t.close():A(t)},error:()=>{f===n&&(K(),v=!1,k=!0,W())}});try{return n.configure({codec:(0,r.buildCodecString)(t),optimizeForLatency:!0}),f=n,!0}catch{try{n.close()}catch{}return W(),!1}},L=c=>{const u=(0,r.parseFramePacket)(c);if(t){const t=u.isKey??(0,r.scanAU)(u.data).isKey;if(!d){const t=j.current;if(!t)return void W();d=new n.MsePlayer(t,{onFirstFrame:()=>{s||l||(l=!0,w('streaming'),E(null))},onResize:(t,r)=>{s||R({width:t,height:r})},onFps:t=>{s||P(r=>r===t?r:t)},onError:t=>{s||(w('error'),E(t))},requestKeyframe:W})}return void d.feed(u.data,t,u.timestamp)}const p=null===u.isKey||u.isKey&&(!f||'configured'!==f.state||k)?(0,r.scanAU)(u.data):null,h=u.isKey??p?.isKey??!1,y=p?.spsBytes??null;if(!y||I(y)){if(k){if(!h)return;if(!f||'configured'!==f.state)return void W();k=!1}if(f&&'configured'===f.state){if(f.decodeQueueSize>o)return K(),v=!1,k=!0,void W();if(!v){if(!h)return void W();v=!0}try{f.decode(new EncodedVideoChunk({type:h?'key':'delta',timestamp:u.timestamp??Math.round(1e6*$/60),data:u.data})),$++}catch{K(),v=!1,k=!0,W()}}else h||W()}},M=()=>{if(s)return;let r;try{r=new WebSocket(h(y,b))}catch(t){return w('error'),void E(t instanceof Error?t.message:'Invalid server URL')}r.binaryType='arraybuffer',N.current=r,r.onopen=()=>{s||(u=500,t&&W())},r.onerror=()=>{},r.onclose=()=>{s||(K(),d?.destroy(),d=null,v=!1,$=0,l&&(l=!1,w('error'),E(t=>t??'Disconnected \u2014 retrying\u2026')),p=setTimeout(M,u),u=Math.min(Math.round(1.6*u),5e3))},r.onmessage=t=>{s||'string'==typeof t.data||L(t.data)}};return M(),()=>{s=!0,p&&clearTimeout(p),K(),d?.destroy(),d=null;try{N.current?.close()}catch{}N.current=null,w('idle'),R(null),P(0)}},[S,y,b]),(0,t.useEffect)(()=>{if(!W||!S||!y)return;let t=null;try{t=new EventSource(p(y,"/api/logcat"+(b?`?device=${encodeURIComponent(b)}`:'')))}catch{return}return t.addEventListener('log',t=>{try{const r=JSON.parse(t.data);K(t=>[...t,{id:"a"+ ++F.current,source:'logcat',message:r.line}].slice(-200))}catch{}}),()=>t?.close()},[W,S,y,b]),(0,t.useEffect)(()=>{if(!S||!y)return void L(d);let t=!1;return fetch(p(y,'/api/devices')).then(t=>t.json()).then(r=>{if(t||!Array.isArray(r.devices)||0===r.devices.length)return;const n=b??r.defaultSerial??null;L(r.devices.map(t=>{const r=String(t.serial??t.id??'android');return{id:r,name:String(t.model??t.name??t.product??r),platform:'android',current:r===n}}))}).catch(()=>{}),()=>{t=!0}},[S,y,b]),(0,t.useEffect)(()=>{if(!S||!y)return void T(null);let t=!1;const r=`${p(y,'/api/uimode')}${b?`?device=${encodeURIComponent(b)}`:''}`;return fetch(r,{cache:'no-store'}).then(t=>t.json()).then(r=>{!t&&r.ok&&T('yes'===r.night?'dark':'light')}).catch(()=>{}),()=>{t=!0}},[S,y,b]),{platform:'android',status:k,error:C,screen:$,fps:O,devices:I,logs:U,logsEnabled:W,attachLogs:H,detachLogs:J,clearLogs:_,videoKind:'canvas',attachVideo:z,sendTouch:D,pressButton:V,reload:B,screenshot:q,appearance:M,setAppearance:Q}};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]);const o=4,c=1500,s=46,d=[{id:'android',name:'Emulator Android',platform:'android',current:!0}],l={home:{type:'home'},back:{type:'back'},recents:{type:'recents'},appSwitcher:{type:'recents'},power:{type:'power'}},u={begin:'down',move:'move',end:'up'};function p(t,r){return`${t.replace(/\/$/,'')}${r}`}function h(t,r){const n=new URL(p(t,'/ws'));return n.protocol='https:'===n.protocol?'wss:':'ws:',n.searchParams.set('frame-meta','1'),r&&n.searchParams.set('device',r),n.toString()}},156,[38,157,158]);
213
213
  __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildCodecString=function(t){const n=t[1].toString(16).padStart(2,'0'),i=t[2].toString(16).padStart(2,'0'),o=t[3].toString(16).padStart(2,'0');return`avc1.${n}${i}${o}`},e.scanAU=function(t){let n=!1,i=null;const o=t.length;let s=0;for(;s+2<o;){if(0===t[s]&&0===t[s+1]){let u=0;if(1===t[s+2]?u=3:s+3<o&&0===t[s+2]&&1===t[s+3]&&(u=4),u){const o=31&t[s+u];7!==o||i||(i=t.subarray(s+u)),5===o&&(n=!0),s+=u+1;continue}}s++}return{isKey:n,spsBytes:i}},e.parseFramePacket=function(s){const u=s instanceof Uint8Array?s:new Uint8Array(s);if(u.byteLength>i){const s=new DataView(u.buffer,u.byteOffset,i);if(s.getUint32(0,!1)===t&&s.getUint8(4)===n){const t=s.getBigUint64(8,!1);return{data:u.subarray(i),isKey:0!==(s.getUint8(5)&o),timestamp:t<=BigInt(Number.MAX_SAFE_INTEGER)?Number(t):null}}}return{data:u,isKey:null,timestamp:null}},e.isWebCodecsSupported=function(){return'undefined'!=typeof globalThis&&'VideoDecoder'in globalThis&&'EncodedVideoChunk'in globalThis};const t=1397050709,n=1,i=16,o=1},157,[]);
214
214
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MsePlayer",{enumerable:!0,get:function(){return o}});var t=r(d[0]);const s='video/mp4; codecs="avc1.42E01E"';class o{static isSupported(){if('undefined'==typeof window||'undefined'==typeof MediaSource)return!1;try{return MediaSource.isTypeSupported(s)}catch{return!1}}muxer=new t.FragmentedMp4Muxer;sourceBuffer=null;queue=[];destroyed=!1;painted=!1;rafHandle=0;fpsWindowStart=0;fpsBaseFrames=0;constructor(t,s={}){this.canvas=t,this.callbacks=s,this.ctx=t.getContext('2d',{alpha:!1,desynchronized:!0});const o=document.createElement('video');o.muted=!0,o.defaultMuted=!0,o.autoplay=!0,o.playsInline=!0,o.setAttribute('playsinline',''),o.style.cssText='position:fixed;left:0;bottom:0;width:4px;height:4px;opacity:0.01;pointer-events:none;z-index:-1;',(document.body??document.documentElement).appendChild(o),this.video=o,this.mediaSource=new MediaSource,this.objectUrl=URL.createObjectURL(this.mediaSource),o.src=this.objectUrl,this.mediaSource.addEventListener('sourceopen',this.onSourceOpen,{once:!0}),o.addEventListener('error',this.onVideoError),this.rafHandle=requestAnimationFrame(this.tick)}feed(t,s,o){if(this.destroyed)return;if(!this.muxer.ready&&!s)return void this.callbacks.requestKeyframe?.();const{init:n,segment:c}=this.muxer.append(t,s,o);n&&(this.queue.push(n),this.setupSourceBuffer()),c&&this.queue.push(c),this.pump()}destroy(){this.destroyed=!0,this.rafHandle&&cancelAnimationFrame(this.rafHandle),this.rafHandle=0,this.video.removeEventListener('error',this.onVideoError);try{this.sourceBuffer&&this.sourceBuffer.removeEventListener('updateend',this.pump)}catch{}try{'open'===this.mediaSource.readyState&&this.mediaSource.endOfStream()}catch{}try{this.video.pause(),this.video.removeAttribute('src'),this.video.load(),this.video.remove()}catch{}try{URL.revokeObjectURL(this.objectUrl)}catch{}this.queue.length=0}onSourceOpen=()=>{try{URL.revokeObjectURL(this.objectUrl)}catch{}this.setupSourceBuffer(),this.pump()};onVideoError=()=>{this.destroyed||this.callbacks.onError?.('Video playback error')};setupSourceBuffer(){if(this.sourceBuffer||'open'!==this.mediaSource.readyState)return;const t=this.muxer.codec;if(!t)return;let o=`video/mp4; codecs="${t}"`;if(!MediaSource.isTypeSupported(o)){if(!MediaSource.isTypeSupported(s))return void this.callbacks.onError?.('This browser cannot decode this H.264 profile.');o=s}try{const t=this.mediaSource.addSourceBuffer(o);t.mode='segments',t.addEventListener('updateend',this.pump),this.sourceBuffer=t}catch{this.callbacks.onError?.('Failed to start MSE video buffer.')}}pump=()=>{const t=this.sourceBuffer;if(this.destroyed||!t||t.updating||'open'!==this.mediaSource.readyState)return;if(this.pruneBackBuffer())return;const s=this.queue.shift();if(s)try{t.appendBuffer(s)}catch(t){'QuotaExceededError'===t?.name?(this.queue.unshift(s),this.pruneBackBuffer(!0)):this.callbacks.onError?.('Failed to append video data.')}};pruneBackBuffer(t=!1){const s=this.sourceBuffer;if(!s||s.updating||0===s.buffered.length)return!1;const o=s.buffered.start(0),n=this.video.currentTime-(t?3:30);if(n>o+.1)try{return s.remove(o,n),!0}catch{return!1}return!1}tick=()=>{if(this.destroyed)return;this.rafHandle=requestAnimationFrame(this.tick);const t=this.video,s=t.buffered;if(s.length>0){const o=s.start(0),n=s.end(s.length-1),c=n-t.currentTime;if(t.currentTime>n+.05||t.currentTime<o-.05||c>.5){try{t.currentTime=Math.max(o,n-.03)}catch{}t.playbackRate=1}else t.playbackRate=c>.05?1+Math.min(8*(c-.05),1.5):1}t.paused&&t.readyState>=2&&t.play().catch(()=>{}),0!==t.videoWidth&&(this.painted||(this.painted=!0,this.canvas.width=t.videoWidth,this.canvas.height=t.videoHeight,this.callbacks.onResize?.(t.videoWidth,t.videoHeight),this.callbacks.onFirstFrame?.(),this.fpsWindowStart=performance.now(),this.fpsBaseFrames=t.getVideoPlaybackQuality?.().totalVideoFrames??0),this.ctx&&this.ctx.drawImage(t,0,0),this.reportFps())};reportFps(){const t=performance.now();if(t-this.fpsWindowStart<1e3)return;const s=this.video.getVideoPlaybackQuality?.().totalVideoFrames;if(null!=s){const o=Math.round(1e3*(s-this.fpsBaseFrames)/(t-this.fpsWindowStart));this.callbacks.onFps?.(o),this.fpsBaseFrames=s}this.fpsWindowStart=t}}},158,[159]);
215
215
  __d(function(g,_r,_i,a,m,e,d){"use strict";function t(t){return new Uint8Array([t>>8&255,255&t])}function n(t){return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function i(t){const i=Math.floor(t/4294967296),s=t>>>0;return new Uint8Array([...n(i),...n(s)])}function s(t){return new Uint8Array([t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)])}function r(t){let n=0;for(const i of t)n+=i.byteLength;const i=new Uint8Array(n);let s=0;for(const n of t)i.set(n,s),s+=n.byteLength;return i}function o(t,...i){const o=r(i);return r([n(8+o.byteLength),s(t),o])}function*h(t){const n=t.length,i=i=>{for(let s=i;s+2<n;s++)if(0===t[s]&&0===t[s+1]){if(1===t[s+2])return{pos:s,len:3};if(s+3<n&&0===t[s+2]&&1===t[s+3])return{pos:s,len:4}}return null};let s=i(0);for(;s;){const r=s.pos+s.len,o=i(r),h=o?o.pos:n;h>r&&(yield t.subarray(r,h)),s=o}}function u(t){const n=[];for(let i=0;i<t.length;i++)i+2<t.length&&0===t[i]&&0===t[i+1]&&3===t[i+2]?(n.push(0,0),i+=2):n.push(t[i]);return new Uint8Array(n)}Object.defineProperty(e,'__esModule',{value:!0}),e.codecStringFromSps=y,Object.defineProperty(e,"FragmentedMp4Muxer",{enumerable:!0,get:function(){return w}});class c{pos=0;constructor(t){this.data=t}bit(){const t=(this.data[this.pos>>3]??0)>>7-(7&this.pos)&1;return this.pos++,t}bits(t){let n=0;for(let i=0;i<t;i++)n=n<<1|this.bit();return n>>>0}ue(){let t=0;for(;0===this.bit()&&t<32;)t++;return 0===t?0:(1<<t)-1+this.bits(t)}se(){const t=this.ue();return 1&t?t+1>>1:-(t>>1)}}const l=new Set([100,110,122,244,44,83,86,118,128,138,139,134,135]);function f(t,n){let i=8,s=8;for(let r=0;r<n;r++){if(0!==s){s=(i+t.se()+256)%256}i=0===s?i:s}}function b(t){const n=new c(u(t.subarray(1))),i=n.bits(8);n.bits(8),n.bits(8),n.ue();let s=1;if(l.has(i)&&(s=n.ue(),3===s&&n.bit(),n.ue(),n.ue(),n.bit(),n.bit())){const t=3!==s?8:12;for(let i=0;i<t;i++)n.bit()&&f(n,i<6?16:64)}n.ue();const r=n.ue();if(0===r)n.ue();else if(1===r){n.bit(),n.se(),n.se();const t=n.ue();for(let i=0;i<t;i++)n.se()}n.ue(),n.bit();const o=n.ue(),h=n.ue(),b=n.bit();b||n.bit(),n.bit();let y=0,p=0,w=0,A=0;n.bit()&&(y=n.ue(),p=n.ue(),w=n.ue(),A=n.ue());const U=16*(o+1),v=(2-b)*(h+1)*16,L=0===s?1:0===s?1:2,M=(0===s?1:0===s?1:2)*(2-b);return{width:Math.max(0,U-L*(y+p)),height:Math.max(0,v-M*(w+A))}}function y(t){const n=t=>t.toString(16).padStart(2,'0');return`avc1.${n(t[1])}${n(t[2])}${n(t[3])}`}const p=r([n(65536),n(0),n(0),n(0),n(65536),n(0),n(0),n(0),n(1073741824)]);class w{sps=null;pps=null;codecKey='';width=0;height=0;seq=1;baseMediaDecodeTime=0;prevPtsTicks=null;get codec(){return this.sps?y(this.sps):null}get ready(){return!!this.sps&&!!this.pps}append(t,n,i){const s=[];let r,o=null,u=null;for(const n of h(t)){const t=31&n[0];7===t?o=n.slice():8===t?u=n.slice():t>=1&&t<=6&&s.push(n)}if(o&&u){const t=`${o.join(',')}|${u.join(',')}`;if(t!==this.codecKey){this.sps=o,this.pps=u,this.codecKey=t;const n=b(o);this.width=n.width,this.height=n.height,r=this.buildInit()}}if(!this.ready||0===s.length)return{init:r};const c=null==i?null:Math.round(9e4*i/1e6);let l=3e3;if(null!=c&&null!=this.prevPtsTicks){const t=c-this.prevPtsTicks;l=t>0?Math.min(t,45e4):3e3}null!=c&&(this.prevPtsTicks=c);return{init:r,segment:this.buildSegment(s,n,l)}}get dimensions(){return this.width&&this.height?{width:this.width,height:this.height}:null}buildInit(){const i=this.sps,h=this.pps,u=o('avcC',new Uint8Array([1,i[1],i[2],i[3],255,225]),t(i.byteLength),i,new Uint8Array([1]),t(h.byteLength),h),c=o('avc1',new Uint8Array(6),t(1),new Uint8Array(16),t(this.width),t(this.height),n(4718592),n(4718592),n(0),t(1),new Uint8Array(32),t(24),new Uint8Array([255,255]),u),l=o('stbl',o('stsd',n(0),n(1),c),o('stts',n(0),n(0)),o('stsc',n(0),n(0)),o('stsz',n(0),n(0),n(0)),o('stco',n(0),n(0))),f=o('dinf',o('dref',n(0),n(1),o('url ',n(1)))),b=o('minf',o('vmhd',n(1),n(0),n(0)),f,l),y=o('mdhd',n(0),n(0),n(0),n(9e4),n(0),t(21956),t(0)),w=o('hdlr',n(0),n(0),s('vide'),n(0),n(0),n(0),new Uint8Array([...s('Vide'),...s('oHan'),...s('dler'),0])),A=o('mdia',y,w,b),U=o('tkhd',new Uint8Array([0,0,0,7]),n(0),n(0),n(1),n(0),n(0),n(0),n(0),t(0),t(0),t(0),t(0),p,n(this.width<<16),n(this.height<<16)),v=o('trak',U,A),L=o('mvhd',n(0),n(0),n(0),n(1e3),n(0),n(65536),t(256),t(0),n(0),n(0),p,n(0),n(0),n(0),n(0),n(0),n(0),n(2)),M=o('trex',n(0),n(1),n(1),n(0),n(0),n(0)),S=o('moov',L,v,o('mvex',M));return r([o('ftyp',s('isom'),n(0),s('isom'),s('iso6'),s('avc1'),s('mp41')),S])}buildSegment(t,s,h){let u=0;for(const n of t)u+=4+n.byteLength;const c=new Uint8Array(u);let l=0;for(const i of t)c.set(n(i.byteLength),l),l+=4,c.set(i,l),l+=i.byteLength;const f=o('mfhd',n(0),n(this.seq++)),b=o('tfhd',new Uint8Array([0,2,0,0]),n(1)),y=o('tfdt',new Uint8Array([1,0,0,0]),i(this.baseMediaDecodeTime)),p=o('trun',new Uint8Array([0,0,7,1]),n(1),n(0),n(h),n(u),n(s?33554432:16842752)),w=o('moof',f,o('traf',b,y,p));return new DataView(w.buffer,w.byteOffset,w.byteLength).setInt32(w.byteLength-16,w.byteLength+8,!1),this.baseMediaDecodeTime+=h,r([w,o('mdat',c)])}}},159,[]);
216
216
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useActiveDeviceClient=function(t){const u='ios'===t?.platform,s='android'===t?.platform,c=(0,o.useIosDeviceClient)({baseUrl:u?(0,l.endpointFor)('ios',t?.baseUrl):null,enabled:u,device:u?t?.device??null:null}),v=(0,n.useAndroidDeviceClient)({baseUrl:s?(0,l.endpointFor)('android',t?.baseUrl):null,enabled:s,device:s?t?.device??null:null});return s?v:c};var l=r(d[0]),n=r(d[1]),o=r(d[2])},160,[155,156,154]);
217
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Button",{enumerable:!0,get:function(){return t.Button}}),Object.defineProperty(e,"ControlButton",{enumerable:!0,get:function(){return n.ControlButton}}),Object.defineProperty(e,"DeviceListItem",{enumerable:!0,get:function(){return o.DeviceListItem}}),Object.defineProperty(e,"DialogRoot",{enumerable:!0,get:function(){return u.DialogRoot}}),Object.defineProperty(e,"DialogContent",{enumerable:!0,get:function(){return u.DialogContent}}),Object.defineProperty(e,"DialogTitle",{enumerable:!0,get:function(){return u.DialogTitle}}),Object.defineProperty(e,"DialogContentContainer",{enumerable:!0,get:function(){return u.DialogContentContainer}}),Object.defineProperty(e,"DialogFooter",{enumerable:!0,get:function(){return u.DialogFooter}}),Object.defineProperty(e,"DialogClose",{enumerable:!0,get:function(){return u.DialogClose}}),Object.defineProperty(e,"Dropdown",{enumerable:!0,get:function(){return c.Dropdown}}),Object.defineProperty(e,"DropdownItem",{enumerable:!0,get:function(){return b.DropdownItem}}),Object.defineProperty(e,"Logo",{enumerable:!0,get:function(){return f.Logo}}),Object.defineProperty(e,"SidebarToggle",{enumerable:!0,get:function(){return l.SidebarToggle}}),Object.defineProperty(e,"Switch",{enumerable:!0,get:function(){return p.Switch}}),Object.defineProperty(e,"cx",{enumerable:!0,get:function(){return y.cx}}),Object.defineProperty(e,"Sidebar",{enumerable:!0,get:function(){return j.Sidebar}}),Object.defineProperty(e,"LogSidebar",{enumerable:!0,get:function(){return D.LogSidebar}}),Object.defineProperty(e,"StreamPanel",{enumerable:!0,get:function(){return s.StreamPanel}}),Object.defineProperty(e,"EmptyState",{enumerable:!0,get:function(){return S.EmptyState}}),Object.defineProperty(e,"DeviceSection",{enumerable:!0,get:function(){return C.DeviceSection}}),Object.defineProperty(e,"OutputSection",{enumerable:!0,get:function(){return L.OutputSection}}),Object.defineProperty(e,"PhoneFrame",{enumerable:!0,get:function(){return w.PhoneFrame}}),Object.defineProperty(e,"TabBar",{enumerable:!0,get:function(){return h.TabBar}}),Object.defineProperty(e,"LogControls",{enumerable:!0,get:function(){return v.LogControls}}),Object.defineProperty(e,"LogList",{enumerable:!0,get:function(){return B.LogList}}),Object.defineProperty(e,"LogRow",{enumerable:!0,get:function(){return R.LogRow}}),Object.defineProperty(e,"StreamControls",{enumerable:!0,get:function(){return T.StreamControls}}),Object.defineProperty(e,"RecentDevicesModal",{enumerable:!0,get:function(){return E.RecentDevicesModal}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),c=r(d[4]),b=r(d[5]),f=r(d[6]),l=r(d[7]),p=r(d[8]),y=r(d[9]),O=r(d[10]);Object.keys(O).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return O[t]}})});var P=r(d[11]);Object.keys(P).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return P[t]}})});var j=r(d[12]),D=r(d[13]),s=r(d[14]),S=r(d[15]),C=r(d[16]),L=r(d[17]),w=r(d[18]),h=r(d[19]),v=r(d[20]),B=r(d[21]),R=r(d[22]),T=r(d[23]),E=r(d[24]),F=r(d[25]);Object.keys(F).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return F[t]}})})},161,[162,164,165,166,224,238,239,240,241,222,223,163,242,246,253,256,244,247,254,251,248,249,250,255,245,252]);
217
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Button",{enumerable:!0,get:function(){return t.Button}}),Object.defineProperty(e,"ControlButton",{enumerable:!0,get:function(){return n.ControlButton}}),Object.defineProperty(e,"DeviceListItem",{enumerable:!0,get:function(){return o.DeviceListItem}}),Object.defineProperty(e,"DialogRoot",{enumerable:!0,get:function(){return u.DialogRoot}}),Object.defineProperty(e,"DialogContent",{enumerable:!0,get:function(){return u.DialogContent}}),Object.defineProperty(e,"DialogTitle",{enumerable:!0,get:function(){return u.DialogTitle}}),Object.defineProperty(e,"DialogContentContainer",{enumerable:!0,get:function(){return u.DialogContentContainer}}),Object.defineProperty(e,"DialogFooter",{enumerable:!0,get:function(){return u.DialogFooter}}),Object.defineProperty(e,"DialogClose",{enumerable:!0,get:function(){return u.DialogClose}}),Object.defineProperty(e,"Dropdown",{enumerable:!0,get:function(){return c.Dropdown}}),Object.defineProperty(e,"DropdownItem",{enumerable:!0,get:function(){return b.DropdownItem}}),Object.defineProperty(e,"Logo",{enumerable:!0,get:function(){return f.Logo}}),Object.defineProperty(e,"SidebarToggle",{enumerable:!0,get:function(){return l.SidebarToggle}}),Object.defineProperty(e,"Switch",{enumerable:!0,get:function(){return p.Switch}}),Object.defineProperty(e,"cx",{enumerable:!0,get:function(){return y.cx}}),Object.defineProperty(e,"Sidebar",{enumerable:!0,get:function(){return j.Sidebar}}),Object.defineProperty(e,"LogSidebar",{enumerable:!0,get:function(){return D.LogSidebar}}),Object.defineProperty(e,"StreamPanel",{enumerable:!0,get:function(){return s.StreamPanel}}),Object.defineProperty(e,"EmptyState",{enumerable:!0,get:function(){return S.EmptyState}}),Object.defineProperty(e,"DeviceSection",{enumerable:!0,get:function(){return C.DeviceSection}}),Object.defineProperty(e,"OutputSection",{enumerable:!0,get:function(){return L.OutputSection}}),Object.defineProperty(e,"PhoneFrame",{enumerable:!0,get:function(){return w.PhoneFrame}}),Object.defineProperty(e,"LogControls",{enumerable:!0,get:function(){return h.LogControls}}),Object.defineProperty(e,"LogList",{enumerable:!0,get:function(){return v.LogList}}),Object.defineProperty(e,"LogRow",{enumerable:!0,get:function(){return E.LogRow}}),Object.defineProperty(e,"StreamControls",{enumerable:!0,get:function(){return B.StreamControls}}),Object.defineProperty(e,"RecentDevicesModal",{enumerable:!0,get:function(){return R.RecentDevicesModal}}),Object.defineProperty(e,"BootErrorModal",{enumerable:!0,get:function(){return M.BootErrorModal}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),c=r(d[4]),b=r(d[5]),f=r(d[6]),l=r(d[7]),p=r(d[8]),y=r(d[9]),O=r(d[10]);Object.keys(O).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return O[t]}})});var P=r(d[11]);Object.keys(P).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return P[t]}})});var j=r(d[12]),D=r(d[13]),s=r(d[14]),S=r(d[15]),C=r(d[16]),L=r(d[17]),w=r(d[18]),h=r(d[19]),v=r(d[20]),E=r(d[21]),B=r(d[22]),R=r(d[23]),M=r(d[24]),F=r(d[25]);Object.keys(F).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return F[t]}})})},161,[162,164,165,166,224,238,239,240,241,222,223,163,242,246,251,254,244,247,252,248,249,250,253,245,255,256]);
218
218
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Button=function({children:n,theme:l="primary",size:u="sm",leftSlot:b,rightSlot:h,block:x=!1,disabled:p=!1,href:y,target:v,onClick:j,className:f,style:k}){const[S,O]=(0,s.useState)(!1),[z,I]=(0,s.useState)(!1),R=o[l],C=Object.assign({display:'inline-flex',alignItems:'center',justifyContent:'center',gap:'2xs'===u?4:'xs'===u?6:8,border:'1px solid',fontWeight:500,whiteSpace:'nowrap',cursor:p?'default':'pointer',textDecoration:'none',transition:'background-color 150ms ease, transform 100ms ease, opacity 150ms ease',width:x?'100%':void 0,transform:!p&&z?'scale(0.98)':void 0},c[u],{backgroundColor:p?R.disabledBackground:S?R.hover:R.background,borderColor:p?R.disabledBorder:R.border,color:p?R.disabledText:R.text,opacity:p?.8:1,pointerEvents:p?'none':void 0},k),B=(0,t.jsxs)(t.Fragment,{children:[b,null!=n&&(0,t.jsx)("span",{style:{display:'flex',lineHeight:1},children:n}),h]}),M={onMouseEnter:()=>O(!0),onMouseLeave:()=>{O(!1),I(!1)},onMouseDown:()=>I(!0),onMouseUp:()=>I(!1)};if(y)return(0,t.jsx)("a",Object.assign({href:p?void 0:y,target:v,className:f,style:C,onClick:p?void 0:j},M,{children:B}));return(0,t.jsx)("button",Object.assign({type:"button",className:f,style:C,disabled:p,onClick:p?void 0:j},M,{children:B}))};var t=r(d[0]),s=r(d[1]),n=r(d[2]);const o={primary:l('primary'),secondary:l('secondary'),tertiary:l('tertiary'),quaternary:l('quaternary'),'primary-destructive':l('primary-destructive'),'secondary-destructive':l('secondary-destructive'),'tertiary-destructive':l('tertiary-destructive')};function l(t){const s=s=>`var(--expo-theme-button-${t}-${s})`;return{background:s('background'),hover:s('hover'),text:s('text'),border:s('border'),disabledBackground:s('disabled-background'),disabledBorder:s('disabled-border'),disabledText:s('disabled-text')}}const c={'2xs':Object.assign({height:28,paddingInline:8,borderRadius:n.radius.lg},n.textSize.xs),xs:Object.assign({height:32,paddingInline:12,borderRadius:n.radius.lg},n.textSize.xs),sm:Object.assign({height:36,paddingInline:16,borderRadius:n.radius.lg},n.textSize.sm),md:Object.assign({height:40,paddingInline:16,borderRadius:n.radius.lg},n.textSize.sm),lg:Object.assign({height:44,paddingInline:24,borderRadius:n.radius.lg},n.textSize.base),xl:Object.assign({height:48,paddingInline:24,borderRadius:n.radius.lg},n.textSize.base),'2xl':Object.assign({height:60,paddingInline:24,borderRadius:n.radius.lg},n.textSize.lg)}},162,[151,38,163]);
219
219
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"bg",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"text",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"icon",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"border",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"radius",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"font",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"textSize",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"heading",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return u}});const t={default:'var(--expo-theme-background-default)',screen:'var(--expo-theme-background-screen)',subtle:'var(--expo-theme-background-subtle)',element:'var(--expo-theme-background-element)',hover:'var(--expo-theme-background-hover)',selected:'var(--expo-theme-background-selected)',overlay:'var(--expo-theme-background-overlay)',success:'var(--expo-theme-background-success)',warning:'var(--expo-theme-background-warning)',danger:'var(--expo-theme-background-danger)',info:'var(--expo-theme-background-info)',preview:'var(--expo-theme-background-preview)'},n={default:'var(--expo-theme-text-default)',secondary:'var(--expo-theme-text-secondary)',tertiary:'var(--expo-theme-text-tertiary)',quaternary:'var(--expo-theme-text-quaternary)',link:'var(--expo-theme-text-link)',success:'var(--expo-theme-text-success)',warning:'var(--expo-theme-text-warning)',danger:'var(--expo-theme-text-danger)',info:'var(--expo-theme-text-info)',preview:'var(--expo-theme-text-preview)'},o={default:'var(--expo-theme-icon-default)',secondary:'var(--expo-theme-icon-secondary)',tertiary:'var(--expo-theme-icon-tertiary)',quaternary:'var(--expo-theme-icon-quaternary)',success:'var(--expo-theme-icon-success)',warning:'var(--expo-theme-icon-warning)',danger:'var(--expo-theme-icon-danger)',info:'var(--expo-theme-icon-info)',preview:'var(--expo-theme-icon-preview)'},x={default:'var(--expo-theme-border-default)',secondary:'var(--expo-theme-border-secondary)',success:'var(--expo-theme-border-success)',warning:'var(--expo-theme-border-warning)',danger:'var(--expo-theme-border-danger)',info:'var(--expo-theme-border-info)',preview:'var(--expo-theme-border-preview)'},p={none:'0',xs:'var(--expo-radius-xs)',sm:'var(--expo-radius-sm)',md:'var(--expo-radius-md)',lg:'var(--expo-radius-lg)',xl:'var(--expo-radius-xl)','2xl':'var(--expo-radius-2xl)','3xl':'var(--expo-radius-3xl)',full:'var(--expo-radius-full)'},c={none:'var(--expo-theme-shadows-none)',xs:'var(--expo-theme-shadows-xs)',sm:'var(--expo-theme-shadows-sm)',md:'var(--expo-theme-shadows-md)',lg:'var(--expo-theme-shadows-lg)',xl:'var(--expo-theme-shadows-xl)'},h={sans:'var(--expo-font-sans)',mono:'var(--expo-font-mono)'},l={'2xl':{fontSize:24,fontWeight:500,lineHeight:1.2,letterSpacing:'-0.5px'},xl:{fontSize:20,fontWeight:500,lineHeight:1.2,letterSpacing:'-0.25px'},lg:{fontSize:18,fontWeight:400,lineHeight:1.4,letterSpacing:'0'},base:{fontSize:16,fontWeight:400,lineHeight:1.6,letterSpacing:'0'},sm:{fontSize:14,fontWeight:400,lineHeight:1.6,letterSpacing:'0'},xs:{fontSize:12,fontWeight:400,lineHeight:1.6,letterSpacing:'0'},'2xs':{fontSize:10,fontWeight:500,lineHeight:1.6,letterSpacing:'0'}},s={'5xl':{fontSize:64,fontWeight:600,lineHeight:1.1,letterSpacing:'-3px'},'4xl':{fontSize:48,fontWeight:600,lineHeight:1.1,letterSpacing:'-2px'},'3xl':{fontSize:32,fontWeight:600,lineHeight:1.1,letterSpacing:'-0.5px'},'2xl':{fontSize:24,fontWeight:600,lineHeight:1.2,letterSpacing:'-0.5px'},xl:{fontSize:20,fontWeight:600,lineHeight:1.4,letterSpacing:'-0.25px'},lg:{fontSize:18,fontWeight:600,lineHeight:1.4,letterSpacing:'0'},base:{fontSize:16,fontWeight:600,lineHeight:1.4,letterSpacing:'0'},sm:{fontSize:14,fontWeight:600,lineHeight:1.4,letterSpacing:'0'},xs:{fontSize:12,fontWeight:600,lineHeight:1.6,letterSpacing:'0'}},u={bg:t,text:n,icon:o,border:x,radius:p,shadow:c,font:h,textSize:l,heading:s}},163,[]);
220
- __d(function(g,r,i,a,m,_e,d){"use strict";const e=["icon","label","variant","style","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ControlButton",{enumerable:!0,get:function(){return c}});var n,o=r(d[0]),t=(n=o)&&n.__esModule?n:{default:n},s=r(d[1]),l=r(d[2]),u=r(d[3]);const c=(0,l.forwardRef)(function(n,o){let{icon:c,label:f,variant:b="default",style:p,onMouseEnter:y,onMouseLeave:x,onMouseDown:M,onMouseUp:j}=n,v=(0,t.default)(n,e);const[h,_]=(0,l.useState)(!1),[w,O]=(0,l.useState)(!1),D='primary'===b,S=D?60:32,k={display:'flex',alignItems:'center',justifyContent:'center',width:S,height:S,borderRadius:u.radius.full,boxSizing:'border-box',border:D?'none':`1px solid ${u.border.default}`,backgroundColor:D?u.text.default:h?u.bg.element:'transparent',color:D?u.bg.default:u.icon.default,opacity:D&&h?.85:1,transition:'background-color 150ms ease, opacity 150ms ease'};return(0,s.jsxs)("button",Object.assign({ref:o,type:"button",onMouseEnter:e=>{_(!0),y?.(e)},onMouseLeave:e=>{_(!1),O(!1),x?.(e)},onMouseDown:e=>{O(!0),M?.(e)},onMouseUp:e=>{O(!1),j?.(e)},style:Object.assign({display:'flex',flexDirection:'column',alignItems:'center',gap:6,padding:0,border:'none',background:'none',cursor:'pointer',fontFamily:'inherit',transition:'transform 100ms ease',transform:w?'scale(0.98)':void 0},p)},v,{children:[(0,s.jsx)("span",{style:k,children:c}),(0,s.jsx)("span",{style:Object.assign({},u.textSize['2xs'],{color:u.text.secondary,textAlign:'center'}),children:f})]}))})},164,[131,151,38,163]);
220
+ __d(function(g,r,i,a,m,_e,d){"use strict";const e=["icon","label","variant","style","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ControlButton",{enumerable:!0,get:function(){return c}});var n,o=r(d[0]),t=(n=o)&&n.__esModule?n:{default:n},s=r(d[1]),l=r(d[2]),u=r(d[3]);const c=(0,l.forwardRef)(function(n,o){let{icon:c,label:f,variant:b="default",style:p,onMouseEnter:y,onMouseLeave:x,onMouseDown:M,onMouseUp:j}=n,v=(0,t.default)(n,e);const[h,_]=(0,l.useState)(!1),[w,O]=(0,l.useState)(!1),D='primary'===b,S=D?60:32,k={display:'flex',alignItems:'center',justifyContent:'center',width:S,height:S,borderRadius:u.radius.full,boxSizing:'border-box',border:D?'none':`1px solid ${u.border.default}`,backgroundColor:D?u.text.default:h?u.bg.element:'transparent',color:D?u.bg.default:u.icon.default,opacity:D&&h?.85:1,transition:'background-color 150ms ease, opacity 150ms ease, transform 100ms ease',transform:w?'scale(0.98)':void 0};return(0,s.jsxs)("button",Object.assign({ref:o,type:"button",onMouseEnter:e=>{_(!0),y?.(e)},onMouseLeave:e=>{_(!1),O(!1),x?.(e)},onMouseDown:e=>{O(!0),M?.(e)},onMouseUp:e=>{O(!1),j?.(e)},style:Object.assign({display:'flex',flexDirection:'column',alignItems:'center',gap:6,padding:0,border:'none',background:'none',cursor:'pointer',fontFamily:'inherit'},p)},v,{children:[(0,s.jsx)("span",{style:k,children:c}),(0,s.jsx)("span",{style:Object.assign({},u.textSize['2xs'],{color:u.text.secondary,textAlign:'center'}),children:f})]}))})},164,[131,151,38,163]);
221
221
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceListItem=function({name:o,version:l,selected:c=!1,onClick:u}){const[b,f]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),y={display:'flex',justifyContent:'space-between',alignItems:'center',gap:16,width:'100%',padding:16,border:'none',borderRadius:s.radius.xl,backgroundColor:c?s.bg.hover:b?s.bg.element:'transparent',cursor:'pointer',textAlign:'left',fontFamily:'inherit',transition:'background-color 150ms ease, transform 100ms ease',transform:p?'scale(0.98)':void 0};return(0,t.jsxs)("button",{type:"button",style:y,onClick:u,"aria-pressed":c,onMouseEnter:()=>f(!0),onMouseLeave:()=>{f(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),children:[(0,t.jsx)("span",{style:Object.assign({},s.textSize.sm,{fontWeight:500,color:s.text.default}),children:o}),(0,t.jsx)("span",{style:Object.assign({},s.textSize.sm,{fontWeight:500,color:s.text.secondary}),children:l})]})};var t=r(d[0]),n=r(d[1]),s=r(d[2])},165,[151,38,163]);
222
222
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","className","containerClassName","overlayClassName"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.DialogRoot=function({children:e,open:l,onOpenChange:t}){return(0,s.jsx)(o.Root,{open:l,onOpenChange:t,children:e})},_e.DialogContent=function(l){let{children:t,className:u,containerClassName:h,overlayClassName:f}=l,p=(0,n.default)(l,e);return(0,s.jsx)(o.Portal,{children:(0,s.jsxs)(o.Overlay,{className:"dialog-overlay group absolute z-dialogOverlay-600",children:[(0,s.jsx)("div",{className:(0,x.cx)('fixed inset-0 bg-[#000000]/50','group-data-[state=open]:animate-fadeIn group-data-[state=closed]:animate-fadeOut',f)}),(0,s.jsx)("div",{className:"fixed top-0 left-0 z-dialogContent-601 flex h-dvh w-dvw items-center justify-center",children:(0,s.jsxs)(o.Content,Object.assign({className:(0,x.cx)('overflow-hidden rounded-lg shadow-md outline-0','data-[state=open]:animate-largeSlideUpAndFadeIn data-[state=closed]:animate-fadeOut',h)},p,{children:[(0,s.jsx)(c.VisuallyHidden,{asChild:!0,children:(0,s.jsx)(o.Description,{})}),(0,s.jsx)("div",{className:(0,x.cx)('w-[90vw] max-w-125 overflow-hidden rounded-lg border border-default bg-default text-default outline-0',u),children:t})]}))})]})})},_e.DialogTitle=function({title:e}){return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2.5 border-b border-b-default px-6 py-4",children:[(0,s.jsx)(o.Title,{asChild:!0,children:(0,s.jsx)("h2",{style:Object.assign({},u.heading.base,{margin:0}),children:e})}),(0,s.jsx)(f,{children:(0,s.jsx)("button",{type:"button","aria-label":"Close",className:"dialog-close-button",children:(0,s.jsx)(h.CloseIcon,{size:20})})})]})},_e.DialogContentContainer=function({children:e,className:l}){return(0,s.jsx)("div",{className:(0,x.cx)('flex max-h-[calc(90vh-69px-53px)] flex-col gap-1.5 overflow-y-auto p-6 pt-4 outline-0',l),children:e})},_e.DialogFooter=function({children:e}){return(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 border-t border-t-default bg-subtle px-3 py-4 max-md:py-2",children:e})},_e.DialogClose=f;var l,t=r(d[0]),n=(l=t)&&l.__esModule?l:{default:l},s=r(d[1]),o=r(d[2]),c=r(d[3]),u=r(d[4]),x=r(d[5]),h=r(d[6]);function f({children:e}){return(0,s.jsx)(o.Close,{asChild:!0,children:e})}},166,[131,151,167,221,163,222,223]);
223
223
  __d(function(g,r,i,a,m,_e,_d){"use strict";const e=["__scopeDialog"],t=["forceMount"],n=["__scopeDialog"],o=["forceMount"],s=["__scopeDialog","trapFocus","onOpenAutoFocus","onCloseAutoFocus"],c=["__scopeDialog"],u=["__scopeDialog"],l=["__scopeDialog"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Close",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"Content",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"Description",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"Dialog",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"DialogClose",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"DialogContent",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"DialogDescription",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"DialogOverlay",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"DialogPortal",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"DialogTitle",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"DialogTrigger",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"Overlay",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"Portal",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"Title",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"Trigger",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"WarningProvider",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"createDialogScope",{enumerable:!0,get:function(){return N}});var d,f=r(_d[0]),p=(d=f)&&d.__esModule?d:{default:d},b=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),O=r(_d[2]),j=r(_d[3]),D=r(_d[4]),_=r(_d[5]),v=r(_d[6]),y=r(_d[7]),P=r(_d[8]),C=r(_d[9]),R=r(_d[10]),h=r(_d[11]),x=r(_d[12]),F=r(_d[13]),w=r(_d[14]),I=r(_d[15]),E=r(_d[16]),M="Dialog",[A,N]=(0,D.createContextScope)(M),[S,T]=A(M),k=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:s,onOpenChange:c,modal:u=!0}=e,l=b.useRef(null),d=b.useRef(null),[f,p]=(0,v.useControllableState)({prop:o,defaultProp:s??!1,onChange:c,caller:M});return(0,E.jsx)(S,{scope:t,triggerRef:l,contentRef:d,contentId:(0,_.useId)(),titleId:(0,_.useId)(),descriptionId:(0,_.useId)(),open:f,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(e=>!e),[p]),modal:u,children:n})};k.displayName=M;var H="DialogTrigger",L=b.forwardRef((t,n)=>{const{__scopeDialog:o}=t,s=(0,p.default)(t,e),c=T(H,o),u=(0,j.useComposedRefs)(n,c.triggerRef);return(0,E.jsx)(h.Primitive.button,Object.assign({type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":ae(c.open)},s,{ref:u,onClick:(0,O.composeEventHandlers)(t.onClick,c.onOpenToggle)}))});L.displayName=H;var G="DialogPortal",[K,U]=A(G,{forceMount:void 0}),W=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:s}=e,c=T(G,t);return(0,E.jsx)(K,{scope:t,forceMount:n,children:b.Children.map(o,e=>(0,E.jsx)(R.Presence,{present:n||c.open,children:(0,E.jsx)(C.Portal,{asChild:!0,container:s,children:e})}))})};W.displayName=G;var Z="DialogOverlay",q=b.forwardRef((e,n)=>{const o=U(Z,e.__scopeDialog),{forceMount:s=o.forceMount}=e,c=(0,p.default)(e,t),u=T(Z,e.__scopeDialog);return u.modal?(0,E.jsx)(R.Presence,{present:s||u.open,children:(0,E.jsx)(B,Object.assign({},c,{ref:n}))}):null});q.displayName=Z;var z=(0,I.createSlot)("DialogOverlay.RemoveScroll"),B=b.forwardRef((e,t)=>{const{__scopeDialog:o}=e,s=(0,p.default)(e,n),c=T(Z,o),u=(0,y.useDismissableLayerSurface)(),l=(0,j.useComposedRefs)(t,u);return(0,E.jsx)(F.RemoveScroll,{as:z,allowPinchZoom:!0,shards:[c.contentRef],children:(0,E.jsx)(h.Primitive.div,Object.assign({"data-state":ae(c.open)},s,{ref:l,style:Object.assign({pointerEvents:"auto"},s.style)}))})}),J="DialogContent",Q=b.forwardRef((e,t)=>{const n=U(J,e.__scopeDialog),{forceMount:s=n.forceMount}=e,c=(0,p.default)(e,o),u=T(J,e.__scopeDialog);return(0,E.jsx)(R.Presence,{present:s||u.open,children:u.modal?(0,E.jsx)(V,Object.assign({},c,{ref:t})):(0,E.jsx)(X,Object.assign({},c,{ref:t}))})});Q.displayName=J;var V=b.forwardRef((e,t)=>{const n=T(J,e.__scopeDialog),o=b.useRef(null),s=(0,j.useComposedRefs)(t,n.contentRef,o);return b.useEffect(()=>{const e=o.current;if(e)return(0,w.hideOthers)(e)},[]),(0,E.jsx)(Y,Object.assign({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:(0,O.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,O.composeEventHandlers)(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,O.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())}))}),X=b.forwardRef((e,t)=>{const n=T(J,e.__scopeDialog),o=b.useRef(!1),s=b.useRef(!1);return(0,E.jsx)(Y,Object.assign({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||n.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const c=t.target,u=n.triggerRef.current?.contains(c);u&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}}))}),Y=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u}=e,l=(0,p.default)(e,s),d=T(J,n);return(0,x.useFocusGuards)(),(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(P.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:(0,E.jsx)(y.DismissableLayer,Object.assign({role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ae(d.open)},l,{ref:t,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)}))})})}),$="DialogTitle",ee=b.forwardRef((e,t)=>{const{__scopeDialog:n}=e,o=(0,p.default)(e,c),s=T($,n);return(0,E.jsx)(h.Primitive.h2,Object.assign({id:s.titleId},o,{ref:t}))});ee.displayName=$;var te="DialogDescription",ne=b.forwardRef((e,t)=>{const{__scopeDialog:n}=e,o=(0,p.default)(e,u),s=T(te,n);return(0,E.jsx)(h.Primitive.p,Object.assign({id:s.descriptionId},o,{ref:t}))});ne.displayName=te;var oe="DialogClose",re=b.forwardRef((e,t)=>{const{__scopeDialog:n}=e,o=(0,p.default)(e,l),s=T(oe,n);return(0,E.jsx)(h.Primitive.button,Object.assign({type:"button"},o,{ref:t,onClick:(0,O.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))}))});re.displayName=oe;var ie=e=>e.children;function ae(e){return e?"open":"closed"}},167,[131,38,168,169,170,171,173,175,180,181,182,176,183,184,220,177,151]);
@@ -294,23 +294,23 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";const e=["__scopeRovingFocusGroup","o
294
294
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["label","description","Icon","rightSlot","disabled","destructive","onSelect","preventAutoClose"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.DropdownItem=function(t){let{label:s,description:x,Icon:u,rightSlot:f,disabled:p,destructive:v,onSelect:h,preventAutoClose:j}=t,b=(0,l.default)(t,e);return(0,n.jsx)(c.Item,Object.assign({"aria-disabled":p,className:(0,o.cx)('relative z-40 flex cursor-pointer items-center justify-between rounded-lg p-2 transition select-none','hocus:bg-hover','hover:outline-0',!p&&'active:scale-98',p&&'cursor-default opacity-60 hocus:bg-default'),onSelect:e=>{p?e.preventDefault():(j&&e.preventDefault(),h?.(e))}},b,{children:(0,n.jsxs)("div",{className:"flex flex-1 flex-col gap-0.5",children:[(0,n.jsxs)("div",{className:(0,o.cx)('flex items-center justify-between',p&&'pointer-events-none'),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[u&&(0,n.jsx)("span",{className:(0,o.cx)('flex',v?'text-icon-danger':'text-icon-default'),children:(0,n.jsx)(u,{size:16})}),'string'==typeof s?(0,n.jsx)("p",{className:(0,o.cx)(v?'text-danger':'text-default','text-sm font-medium'),children:s}):s]}),'string'==typeof f?(0,n.jsx)("p",{className:"text-xs text-secondary",children:f}):f]}),x&&'string'==typeof x?(0,n.jsx)("p",{className:"text-xs leading-4.5 text-tertiary",children:x}):null,x&&'string'!=typeof x?x:null]})}))};var t,s=r(d[0]),l=(t=s)&&t.__esModule?t:{default:t},n=r(d[1]),c=r(d[2]),o=r(d[3])},238,[131,151,225,222]);
295
295
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Logo=function({style:c}){return(0,l.jsx)("svg",{viewBox:"0 0 71 20",width:72,height:20,fill:"none",role:"img","aria-label":"Expo",style:Object.assign({color:t.text.default,userSelect:'none',WebkitUserSelect:'none',flexShrink:0},c),children:(0,l.jsx)("path",{d:"M9.258 6.342c.158-.23.331-.26.472-.26.14 0 .374.03.532.26 2.06 2.806 6.332 10.208 6.727 10.611.585.597 1.388.225 1.854-.452.46-.667.587-1.135.587-1.634 0-.34-6.653-12.614-7.324-13.636C11.462.248 11.252 0 10.15 0h-.825c-1.1 0-1.259.248-1.903 1.23C6.75 2.254.097 14.528.097 14.868c0 .5.127.967.587 1.634.466.677 1.269 1.05 1.854.452.395-.403 4.661-7.805 6.72-10.61zm14.941-5.237v15.344h9.35v-3.113h-6.125v-3.244h5.45V6.98h-5.45V4.218h6.125V1.105h-9.35zM46.25 16.449l-3.88-5.568 3.619-5.195h-3.662L40.54 8.23l-1.765-2.543h-3.706l3.618 5.217-3.857 5.546h3.661l2.027-2.915 2.027 2.915h3.705zm7.572-10.982c-1.482 0-2.637.614-3.378 1.732V5.686H47.37V20h3.073v-5.063c.74 1.117 1.896 1.731 3.378 1.731 2.768 0 4.97-2.52 4.97-5.611 0-3.091-2.202-5.59-4.97-5.59zm-.697 8.242c-1.504 0-2.681-1.14-2.681-2.652 0-1.49 1.177-2.653 2.68-2.653 1.483 0 2.681 1.184 2.681 2.653 0 1.49-1.198 2.652-2.68 2.652zm12.188-8.242c-3.16 0-5.558 2.411-5.558 5.612 0 3.2 2.397 5.59 5.557 5.59 3.139 0 5.558-2.39 5.558-5.59 0-3.2-2.42-5.612-5.558-5.612zm0 2.96c1.438 0 2.55 1.117 2.55 2.652 0 1.49-1.112 2.63-2.55 2.63-1.46 0-2.55-1.14-2.55-2.63 0-1.535 1.09-2.653 2.55-2.653z",fill:"currentColor"})})};var l=r(d[0]),t=r(d[1])},239,[151,163]);
296
296
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarToggle=function({onClick:l,floating:u=!1,side:c="left"}){const[b,f]=(0,n.useState)(!1),[h,p]=(0,n.useState)(!1),y=u?{width:40,height:40,borderRadius:t.radius.lg,border:'none',backgroundColor:b?t.bg.element:'transparent'}:{width:32,height:32,borderRadius:t.radius.md,border:'none',backgroundColor:b?t.bg.element:'transparent'};return(0,o.jsx)("button",{type:"button","aria-label":"Toggle sidebar",onClick:l,onMouseEnter:()=>f(!0),onMouseLeave:()=>{f(!1),p(!1)},onMouseDown:()=>p(!0),onMouseUp:()=>p(!1),style:Object.assign({display:'flex',alignItems:'center',justifyContent:'center',padding:0,cursor:'pointer',boxSizing:'border-box',transition:'background-color 150ms ease, transform 100ms ease',transform:h?'scale(0.98)':void 0},y),children:(0,o.jsx)(s.SidebarIcon,{size:20,color:t.icon.default,style:'right'===c?{transform:'scaleX(-1)'}:void 0})})};var o=r(d[0]),n=r(d[1]),t=r(d[2]),s=r(d[3])},240,[151,38,163,223]);
297
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Switch=function({checked:s,onChange:l,label:c}){const[u,b]=(0,n.useState)(!1),[h,x]=(0,n.useState)(!1),f={display:'flex',alignItems:'center',justifyContent:'center',width:32,height:32,boxSizing:'border-box',borderRadius:o.radius.full,border:`1px solid ${o.border.default}`,backgroundColor:u?o.bg.element:'transparent',transition:'background-color 150ms ease'};return(0,t.jsxs)("button",{type:"button",role:"switch","aria-checked":s,"aria-label":c,onClick:()=>l?.(!s),onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),style:{display:'flex',flexDirection:'column',alignItems:'center',gap:6,padding:0,border:'none',background:'none',cursor:'pointer',fontFamily:'inherit',transition:'transform 100ms ease',transform:h?'scale(0.98)':void 0},children:[(0,t.jsx)("span",{style:f,children:(0,t.jsx)("span",{style:{width:16,height:16,borderRadius:o.radius.full,backgroundColor:o.text.default}})}),c&&(0,t.jsx)("span",{style:Object.assign({},o.textSize['2xs'],{color:o.text.secondary,textAlign:'center'}),children:c})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},241,[151,38,163]);
297
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Switch=function({checked:s,onChange:l,label:c}){const[u,b]=(0,n.useState)(!1),[h,x]=(0,n.useState)(!1),f={display:'flex',alignItems:'center',justifyContent:'center',width:32,height:32,boxSizing:'border-box',borderRadius:o.radius.full,border:`1px solid ${o.border.default}`,backgroundColor:u?o.bg.element:'transparent',transition:'background-color 150ms ease, transform 100ms ease',transform:h?'scale(0.98)':void 0};return(0,t.jsxs)("button",{type:"button",role:"switch","aria-checked":s,"aria-label":c,onClick:()=>l?.(!s),onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),style:{display:'flex',flexDirection:'column',alignItems:'center',gap:6,padding:0,border:'none',background:'none',cursor:'pointer',fontFamily:'inherit'},children:[(0,t.jsx)("span",{style:f,children:(0,t.jsx)("span",{style:{width:16,height:16,borderRadius:o.radius.full,backgroundColor:o.text.default}})}),c&&(0,t.jsx)("span",{style:Object.assign({},o.textSize['2xs'],{color:o.text.secondary,textAlign:'center'}),children:c})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},241,[151,38,163]);
298
298
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Sidebar=function({simulators:n,emulators:s,recentSimulators:c,recentEmulators:u,simulatorOptions:p,emulatorOptions:x,selectedId:b,onSelect:v,onAddDevice:S,onToggle:h}){return(0,t.jsxs)("aside",{style:{display:'flex',flexDirection:'column',gap:32,width:'min(400px, 100vw)',flexShrink:0,height:'100vh',boxSizing:'border-box',padding:'32px 24px 32px 48px',overflow:'hidden'},children:[(0,t.jsxs)("div",{style:{display:'flex',alignItems:'center',justifyContent:'space-between',gap:8},children:[(0,t.jsx)(o.Logo,{}),h&&(0,t.jsx)(o.SidebarToggle,{onClick:h})]}),(0,t.jsx)(l.DeviceSection,{title:"Simulators",addLabel:"Add simulator",kind:"simulator",emptyLabel:"No booted simulators. Use the + button to add one.",devices:n,recent:c,options:p,selectedId:b,onSelect:v,onAdd:S}),(0,t.jsx)(l.DeviceSection,{title:"Emulators",addLabel:"Add emulator",kind:"emulator",emptyLabel:"No booted emulators or devices. Use the + button to add one.",devices:s,recent:u,options:x,selectedId:b,onSelect:v,onAdd:S})]})};var t=r(d[0]),o=r(d[1]),l=r(d[2])},242,[151,243,244]);
299
299
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var c=r(d[2]);Object.keys(c).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}})});var o=r(d[3]);Object.keys(o).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var u=r(d[4]);Object.keys(u).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})});var f=r(d[5]);Object.keys(f).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}})});var l=r(d[6]);Object.keys(l).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})});var b=r(d[7]);Object.keys(b).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return b[t]}})});var p=r(d[8]);Object.keys(p).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}})});var y=r(d[9]);Object.keys(y).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return y[t]}})});var O=r(d[10]);Object.keys(O).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return O[t]}})});var j=r(d[11]);Object.keys(j).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return j[t]}})})},243,[162,164,165,166,224,238,239,240,241,222,223,163]);
300
300
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceSection=function({title:l,addLabel:c,kind:u,emptyLabel:p,devices:b,recent:x,options:f,selectedId:y,onSelect:h,onAdd:v}){const[j,S]=(0,s.useState)(!1),[k,C]=(0,s.useState)(!1),[M,I]=(0,s.useState)(!1),D=new Set(b.map(t=>t.id)),L=x.filter(t=>!D.has(t.id));return(0,t.jsxs)("section",{style:{display:'grid',gap:12},children:[(0,t.jsxs)("div",{style:{display:'flex',alignItems:'center',gap:8},children:[(0,t.jsx)("span",{style:Object.assign({},n.textSize.sm,{fontWeight:500,color:n.text.default}),children:l}),!!v&&(0,t.jsx)("button",{type:"button","aria-label":c,onClick:()=>I(!0),onMouseEnter:()=>S(!0),onMouseLeave:()=>{S(!1),C(!1)},onMouseDown:()=>C(!0),onMouseUp:()=>C(!1),style:{display:'flex',alignItems:'center',justifyContent:'center',width:26,height:26,padding:0,borderRadius:n.radius.full,border:`1px solid ${n.border.default}`,backgroundColor:j?n.bg.hover:n.bg.default,cursor:'pointer',transition:'background-color 150ms ease, transform 100ms ease',transform:k?'scale(0.98)':void 0},children:(0,t.jsx)(n.PlusIcon,{size:18,color:n.icon.secondary})})]}),(0,t.jsx)("div",{style:{display:'grid',gap:6},children:0===b.length?(0,t.jsx)("p",{style:Object.assign({},n.textSize.sm,{color:n.text.secondary,margin:0,padding:'12px 16px',borderRadius:n.radius.xl,border:`1px dashed ${n.border.default}`,backgroundColor:n.bg.default}),children:p}):b.map(s=>(0,t.jsx)(n.DeviceListItem,{name:s.name,version:s.version,selected:s.id===y,onClick:()=>h(s.id)},s.id))}),(0,t.jsx)(o.RecentDevicesModal,{open:M,onClose:()=>I(!1),kind:u,devices:L,options:f,onAdd:v||(()=>{})})]})};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3])},244,[151,38,243,245]);
301
301
  __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.RecentDevicesModal=function({open:c,onClose:u,kind:f,devices:h,options:p,onAdd:x}){const y='simulator'===f?'ios':'android',b=f,j=`Add a${'emulator'===f?'n':''} ${b}`,k=(0,n.useMemo)(()=>[...h].sort((t,n)=>(n.lastUsedAt??0)-(t.lastUsedAt??0)),[h]),[S,$]=(0,n.useState)({kind:'new'}),[C,w]=(0,n.useState)(''),[v,M]=(0,n.useState)(''),[D,z]=(0,n.useState)(''),[R,A]=(0,n.useState)(!1),[I,B]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!c)return;const t=p.osVersions[0]??'',n=p.models[0]??'';w(t),M(n),z(l(n,k)),A(!1),B(!1),$(k.length?{kind:'recent',id:k[0].id}:{kind:'new'})},[c]);const _='new'===S.kind,F='recent'===S.kind?k.find(t=>t.id===S.id):void 0,U=_?D.trim().length>0:!!F;return(0,t.jsx)(o.DialogRoot,{open:c,onOpenChange:t=>{t||u()},children:(0,t.jsxs)(o.DialogContent,{children:[(0,t.jsx)(o.DialogTitle,{title:j}),(0,t.jsxs)(o.DialogContentContainer,{children:[(0,t.jsx)(s,{children:"Recents"}),(0,t.jsx)("div",{style:{display:'flex',flexDirection:'column',gap:3},children:0===k.length?(0,t.jsxs)("p",{style:{margin:0,padding:'2px 2px 6px 2px',fontSize:13,color:o.text.tertiary},children:["No recent ",b,"s."]}):k.map(n=>(0,t.jsx)(a,{device:n,selected:'recent'===S.kind&&S.id===n.id,onSelect:()=>$({kind:'recent',id:n.id})},n.id))})]}),(0,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(o.Button,{theme:"quaternary",onClick:u,children:"Cancel"}),(0,t.jsx)(o.Button,{theme:"primary",disabled:!U,onClick:function(){if(U){if(_){const t=D.trim();x({id:`new:${y}:${t}`,name:t,version:C,platform:y,physical:!1,booted:!1})}else F&&x(F);u()}},children:"Boot"})]})]})})};var t=r(d[0]),n=r(d[1]),o=r(d[2]);function s({children:n,active:s=!1}){return(0,t.jsx)("span",{style:{display:'block',marginBottom:4,fontFamily:o.font.mono,fontSize:11,fontWeight:s?600:400,letterSpacing:'0.06em',textTransform:'uppercase',color:s?o.text.default:o.text.tertiary},children:n})}function a({device:s,selected:a,onSelect:l}){const[u,f]=(0,n.useState)(!1);return(0,t.jsxs)("button",{type:"button","aria-pressed":a,onClick:l,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{display:'flex',alignItems:'center',gap:12,width:'100%',padding:'9px 11px',border:'none',borderRadius:o.radius.lg,textAlign:'left',fontFamily:'inherit',cursor:'pointer',backgroundColor:a?o.bg.hover:u?o.bg.element:'transparent',transition:'background-color 150ms ease'},children:[(0,t.jsx)("span",{style:{display:'flex',alignItems:'center',justifyContent:'center',width:31,height:31,flex:'0 0 auto',borderRadius:o.radius.lg,backgroundColor:o.bg.element,color:a?o.text.default:o.icon.default},children:a?(0,t.jsx)(o.CheckIcon,{size:16}):(0,t.jsx)(o.SmartphoneIcon,{size:16})}),(0,t.jsxs)("span",{style:{display:'flex',flexDirection:'column',gap:2,minWidth:0},children:[(0,t.jsx)("span",{style:{fontSize:14,fontWeight:a?600:500,color:o.text.default,lineHeight:1.25},children:s.name}),(0,t.jsxs)("span",{style:{display:'flex',alignItems:'center',gap:6,fontSize:12,color:o.text.tertiary,lineHeight:1.25},children:[(0,t.jsx)("span",{style:{width:6,height:6,flex:'0 0 auto',borderRadius:'50%',backgroundColor:s.booted?o.icon.success:o.icon.quaternary}}),s.booted?'Booted \xb7 now':c(s.lastUsedAt)]})]}),(0,t.jsx)("span",{style:{marginLeft:'auto',flex:'0 0 auto',fontSize:11,color:o.text.secondary,backgroundColor:o.bg.element,borderRadius:o.radius.full,padding:'3px 9px',fontVariantNumeric:'tabular-nums',whiteSpace:'nowrap'},children:s.version})]})}function l(t,n){if(!t)return'';const o=new Set(n.map(t=>t.name));if(!o.has(t))return t;let s=2;for(;o.has(`${t} ${s}`);)s++;return`${t} ${s}`}function c(t){if(!t)return'Idle';const n=Date.now()-t,o=Math.round(n/6e4);if(o<1)return'now';if(o<60)return`${o}m ago`;const s=Math.round(o/60);if(s<24)return`${s}h ago`;const a=Math.round(s/24);if(a<7)return`${a} day${1===a?'':'s'} ago`;const l=Math.round(a/7);if(l<5)return`${l} week${1===l?'':'s'} ago`;const c=Math.round(a/30);return`${c} month${1===c?'':'s'} ago`}},245,[151,38,243]);
302
302
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogSidebar=function({onToggle:o,client:s}){return(0,t.jsxs)("aside",{style:{display:'flex',flexDirection:'column',gap:32,width:'min(400px, 100vw)',flexShrink:0,height:'100vh',boxSizing:'border-box',padding:'32px 48px 32px 24px',overflow:'hidden'},children:[o&&(0,t.jsx)("div",{style:{display:'flex',alignItems:'center',justifyContent:'flex-start'},children:(0,t.jsx)(n.SidebarToggle,{side:"right",onClick:o})}),(0,t.jsx)(l.OutputSection,{client:s})]})};var t=r(d[0]),n=r(d[1]),l=r(d[2])},246,[151,243,247]);
303
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OutputSection=function({client:c}){const[u,h]=(0,o.useState)('logs'),x=c?.logs,L=c?.logsEnabled??!1;return(0,t.jsxs)("section",{style:{display:'flex',flexDirection:'column',gap:16,flex:1,minHeight:0},children:[(0,t.jsx)(l.TabBar,{active:u,onChange:h}),(0,t.jsx)(n.LogControls,{enabled:L,hasLogs:(x?.length??0)>0,onAttach:()=>c?.attachLogs(),onDetach:()=>c?.detachLogs(),onClear:()=>c?.clearLogs()}),(0,t.jsx)(s.LogList,{logs:x,enabled:L})]})};var t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]),l=r(d[4])},247,[151,38,248,249,251]);
303
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OutputSection=function({client:l}){const c=l?.logs,h=l?.logsEnabled??!1;return(0,t.jsxs)("section",{style:{display:'flex',flexDirection:'column',gap:16,flex:1,minHeight:0},children:[(0,t.jsx)("span",{style:Object.assign({},s.textSize.sm,{fontWeight:500,color:s.text.default}),children:"Logs"}),(0,t.jsx)(o.LogControls,{enabled:h,hasLogs:(c?.length??0)>0,onAttach:()=>l?.attachLogs(),onDetach:()=>l?.detachLogs(),onClear:()=>l?.clearLogs()}),(0,t.jsx)(n.LogList,{logs:c,enabled:h})]})};var t=r(d[0]),s=r(d[1]),o=r(d[2]),n=r(d[3])},247,[151,243,248,249]);
304
304
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogControls=function({enabled:n,hasLogs:l,onAttach:o,onDetach:c,onClear:h}){return(0,t.jsxs)("div",{style:{display:'flex',gap:8},children:[(0,t.jsx)(s.Button,{size:"2xs",theme:"secondary",disabled:n,onClick:o,children:"Attach"}),(0,t.jsx)(s.Button,{size:"2xs",theme:"secondary",disabled:!n,onClick:c,children:"Detach"}),(0,t.jsx)(s.Button,{size:"2xs",theme:"tertiary",disabled:!l,onClick:h,children:"Clear"})]})};var t=r(d[0]),s=r(d[1])},248,[151,243]);
305
305
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogList=function({logs:b=[],enabled:u=!1}){const h=(0,l.useRef)(null);(0,l.useEffect)(()=>{const o=h.current;o&&(o.scrollTop=o.scrollHeight)},[b]);const p=u?'Waiting for device logs\u2026':'Logs are paused. Press Attach to stream device logs.';return(0,o.jsxs)("div",{ref:h,className:"hub-log-scroll",style:c,children:[(0,o.jsx)("style",{children:s}),0===b.length?(0,o.jsx)("span",{style:Object.assign({},n.textSize.xs,{fontWeight:500,color:n.text.tertiary,paddingLeft:8}),children:p}):b.map(l=>(0,o.jsx)(t.LogRow,{entry:l},l.id))]})};var o=r(d[0]),l=r(d[1]),n=r(d[2]),t=r(d[3]);const s="\n.hub-log-scroll::-webkit-scrollbar { width: 12px; }\n.hub-log-scroll::-webkit-scrollbar-track { background: transparent; }\n.hub-log-scroll::-webkit-scrollbar-thumb {\n background-color: var(--expo-theme-background-selected);\n border-radius: 8px;\n border: 3px solid transparent;\n background-clip: padding-box;\n min-height: 24px;\n}\n.hub-log-scroll::-webkit-scrollbar-thumb:hover {\n background-color: var(--expo-theme-border-default);\n}\n",c={flex:1,minHeight:0,overflowY:'auto',overflowX:'hidden',display:'flex',flexDirection:'column',gap:8,margin:'0 -8px',padding:'0 8px',overflowAnchor:'none'}},249,[151,38,243,250]);
306
306
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogRow=function({entry:s}){const[l,c]=(0,n.useState)(!1);return(0,t.jsxs)("div",{onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{display:'flex',alignItems:'flex-start',gap:8,padding:'4px 8px',margin:'0 -8px',borderRadius:o.radius.md,backgroundColor:l?o.bg.element:'transparent',transition:'background-color 150ms ease'},children:[(0,t.jsx)("span",{style:{display:'flex',alignItems:'center',padding:4,borderRadius:o.radius.sm,backgroundColor:o.bg.element,fontFamily:o.font.mono,fontSize:10,lineHeight:1,letterSpacing:'-0.02em',color:o.text.tertiary,flexShrink:0},children:s.source}),(0,t.jsx)("span",{style:{flex:1,minWidth:0,fontSize:12,fontWeight:500,lineHeight:1.6,color:o.text.tertiary,overflowWrap:'anywhere'},children:s.message})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},250,[151,38,243]);
307
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TabBar=function({active:l,onChange:u}){const[c,y]=(0,t.useState)(null),[b,p]=(0,t.useState)(null);return(0,n.jsx)("div",{style:{display:'flex',gap:8},children:s.tabs.map(t=>{const s=t.key===l,k=c===t.key&&!s,f=Object.assign({padding:'6px 16px',border:'none',borderRadius:o.radius.lg,backgroundColor:s?o.bg.hover:k?o.bg.element:'transparent',color:s||k?o.text.default:o.text.secondary,cursor:'pointer',fontFamily:'inherit',transition:'background-color 150ms ease, color 150ms ease, transform 100ms ease',transform:b===t.key?'scale(0.98)':void 0},o.textSize.sm,{fontWeight:500});return(0,n.jsx)("button",{type:"button",style:f,onClick:()=>u(t.key),onMouseEnter:()=>y(t.key),onMouseLeave:()=>{y(null),p(null)},onMouseDown:()=>p(t.key),onMouseUp:()=>p(null),children:t.label},t.key)})})};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3])},251,[151,38,243,252]);
308
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tabs",{enumerable:!0,get:function(){return t}});const t=[{key:'logs',label:'Logs'}]},252,[]);
309
- __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamPanel=function({device:s,client:p,DeviceScreen:u,displayScreen:f,onShutdown:h,onRemove:b}){return(0,n.jsxs)("section",{style:{flex:1,minWidth:0,display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',gap:40,padding:40,margin:16,boxSizing:'border-box',backgroundColor:o.bg.default,border:`1px solid ${o.border.secondary}`,borderRadius:o.radius.lg,boxShadow:o.shadow.sm,overflow:'hidden'},children:[(0,n.jsx)(a.PhoneFrame,{platform:s.platform,client:p,DeviceScreen:u,displayScreen:f}),(0,n.jsx)(t.StreamControls,{platform:s.platform,physical:s.physical,appearance:p.appearance,onToggleAppearance:()=>p.setAppearance('dark'===p.appearance?'light':'dark'),onHome:()=>p.pressButton('home'),onBack:()=>p.pressButton('back'),onRecents:()=>p.pressButton('recents'),onReload:()=>p.reload(),onSave:async()=>{const n=await p.screenshot();n&&c(n,l(s.name))},onShutdown:h,onRemove:b})]})};var n=r(d[0]),o=r(d[1]),a=r(d[2]),t=r(d[3]);function c(n,o){const a=URL.createObjectURL(n),t=document.createElement('a');t.href=a,t.download=o,document.body.appendChild(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(a),0)}function l(n){return`${n.trim().replace(/[^a-zA-Z0-9._-]+/g,'-').replace(/^-+|-+$/g,'')||'device'}-${(new Date).toISOString().replace(/[:.]/g,'-').replace(/Z$/,'')}.png`}},253,[151,243,254,255]);
310
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PhoneFrame=function({platform:l,client:u,DeviceScreen:h,displayScreen:p}){const{ratio:b,radiusFraction:x,squircle:j}=o[l],q=u?p(u.screen):null,v=q&&q.height>0?q.width/q.height:b,w={width:`min(320px, calc((100vh - ${n}px) * ${v}), 100%)`,aspectRatio:`${v}`,containerType:'inline-size'},y=`${(100*x).toFixed(3)}cqw`,F=u&&'idle'!==u.status;return(0,t.jsx)("div",{style:Object.assign({},w,{boxShadow:c,borderRadius:y}),children:F?(0,t.jsx)(h,{client:u,borderRadius:y,squircle:j}):(0,t.jsx)("div",{style:Object.assign({width:'100%',height:'100%',backgroundColor:s.bg.element,borderRadius:y},j?{cornerShape:'squircle'}:{})})})};var t=r(d[0]),s=r(d[1]);const c='0 40px 80px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.28)',n=210,o={ios:{ratio:.460431654676259,radiusFraction:.26153846153846155,squircle:!0},android:{ratio:.450070323488045,radiusFraction:.02564102564102564,squircle:!1}}},254,[151,243]);
311
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamControls=function({platform:t,physical:l,appearance:c,onToggleAppearance:s,onHome:p,onBack:x,onRecents:I,onReload:j,onSave:u,onShutdown:h,onRemove:C}){const b='android'===t,f=(0,o.jsxs)(n.Dropdown,{side:"top",align:"end",alignOffset:-80,onCloseAutoFocus:o=>o.preventDefault(),trigger:(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.DotsIcon,{}),label:"More"}),children:[b&&(0,o.jsx)(n.DropdownItem,{label:"Back",Icon:n.BackIcon,onSelect:x}),b&&(0,o.jsx)(n.DropdownItem,{label:"Recents",Icon:n.RecentsIcon,onSelect:I}),(0,o.jsx)(n.DropdownItem,{label:"Shutdown",Icon:n.PowerIcon,onSelect:h}),!l&&(0,o.jsx)(n.DropdownItem,{label:"Remove",Icon:n.TrashIcon,destructive:!0,onSelect:C})]});return(0,o.jsxs)("div",{style:{display:'flex',alignItems:'flex-end',gap:24},children:[(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.CameraIcon,{}),label:"Save",onClick:u}),(0,o.jsx)(n.Switch,{checked:'dark'===c,onChange:s,label:"Theme"}),(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.HomeIcon,{}),label:"Home",variant:"primary",onClick:p}),(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.RefreshIcon,{}),label:"Reload",onClick:j}),f]})};var o=r(d[0]),n=r(d[1])},255,[151,243]);
312
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EmptyState=function(){return(0,o.jsxs)("section",{style:{flex:1,minWidth:0,display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',gap:16,padding:40,margin:16,boxSizing:'border-box',backgroundColor:t.bg.default,border:`1px solid ${t.border.secondary}`,borderRadius:t.radius.lg,boxShadow:t.shadow.sm,overflow:'hidden',textAlign:'center'},children:[(0,o.jsx)("div",{style:{display:'flex',alignItems:'center',justifyContent:'center',width:56,height:56,borderRadius:t.radius.full,border:`1px solid ${t.border.secondary}`,backgroundColor:t.bg.subtle},children:(0,o.jsx)(t.PhoneIcon,{size:28,color:t.icon.secondary})}),(0,o.jsx)("h2",{style:Object.assign({},t.heading.lg,{color:t.text.default,margin:0}),children:"No booted devices"}),(0,o.jsx)("p",{style:Object.assign({},t.textSize.sm,{color:t.text.secondary,margin:0,maxWidth:320}),children:"There are no booted simulators, emulators, or connected devices. Use the + button to add a simulator or emulator."})]})};var o=r(d[0]),t=r(d[1])},256,[151,243]);
313
- __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shutdownDevice=function(t){return c(o,t)},e.removeDevice=function(o){return c(t,o)},e.bootDevice=async function(o){try{const t=await fetch(n,{method:'POST',headers:{'Content-Type':'application/json',Accept:'application/json'},body:JSON.stringify({platform:o.platform,id:o.id,name:o.name}),signal:AbortSignal.timeout(2e5)});if(!t.ok)throw new Error(`Unexpected ${t.status}`);const c=await t.json();return c.ok&&c.serial?c.serial:null}catch(o){return console.warn('[expo-device-hub] Device boot failed:',o),null}};const o='/_expo/plugins/expo-device-hub/api/devices/shutdown',t='/_expo/plugins/expo-device-hub/api/devices/remove',n='/_expo/plugins/expo-device-hub/api/devices/boot';async function c(o,t){try{const n=await fetch(o,{method:'POST',headers:{'Content-Type':'application/json',Accept:'application/json'},body:JSON.stringify({platform:t.platform,id:t.id,name:t.name})});if(!n.ok)throw new Error(`Unexpected ${n.status}`);return!0===(await n.json()).ok}catch(o){return console.warn('[expo-device-hub] Device action failed:',o),!1}}},257,[]);
307
+ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamPanel=function({device:s,client:p,DeviceScreen:u,displayScreen:f,onShutdown:h,onRemove:b}){return(0,n.jsxs)("section",{style:{flex:1,minWidth:0,display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',gap:40,padding:40,margin:16,boxSizing:'border-box',backgroundColor:o.bg.default,border:`1px solid ${o.border.secondary}`,borderRadius:o.radius.lg,boxShadow:o.shadow.sm,overflow:'hidden'},children:[(0,n.jsx)(a.PhoneFrame,{platform:s.platform,client:p,DeviceScreen:u,displayScreen:f}),(0,n.jsx)(t.StreamControls,{platform:s.platform,physical:s.physical,appearance:p.appearance,onToggleAppearance:()=>p.setAppearance('dark'===p.appearance?'light':'dark'),onHome:()=>p.pressButton('home'),onBack:()=>p.pressButton('back'),onRecents:()=>p.pressButton('recents'),onReload:()=>p.reload(),onSave:async()=>{const n=await p.screenshot();n&&c(n,l(s.name))},onShutdown:h,onRemove:b})]})};var n=r(d[0]),o=r(d[1]),a=r(d[2]),t=r(d[3]);function c(n,o){const a=URL.createObjectURL(n),t=document.createElement('a');t.href=a,t.download=o,document.body.appendChild(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(a),0)}function l(n){return`${n.trim().replace(/[^a-zA-Z0-9._-]+/g,'-').replace(/^-+|-+$/g,'')||'device'}-${(new Date).toISOString().replace(/[:.]/g,'-').replace(/Z$/,'')}.png`}},251,[151,243,252,253]);
308
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PhoneFrame=function({platform:l,client:u,DeviceScreen:h,displayScreen:p}){const{ratio:b,radiusFraction:x,squircle:j}=o[l],v=u?p(u.screen):null,q=v&&v.height>0?v.width/v.height:b,w={width:`min(320px, calc((100vh - ${c}px) * ${q}), 100%)`,aspectRatio:`${q}`,containerType:'inline-size'},y=`${(100*x).toFixed(3)}cqw`,F=u&&'idle'!==u.status;return(0,t.jsx)("div",{style:Object.assign({},w,{boxShadow:n,borderRadius:y}),children:F?(0,t.jsx)(h,{client:u,borderRadius:y,squircle:j}):(0,t.jsx)("div",{style:Object.assign({width:'100%',height:'100%',backgroundColor:s.bg.element,borderRadius:y},j?{cornerShape:'superellipse(1.3)'}:{})})})};var t=r(d[0]),s=r(d[1]);const n='0 40px 80px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.28)',c=210,o={ios:{ratio:.460431654676259,radiusFraction:.14066496163682865,squircle:!0},android:{ratio:.450070323488045,radiusFraction:.02564102564102564,squircle:!1}}},252,[151,243]);
309
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamControls=function({platform:t,physical:l,appearance:c,onToggleAppearance:s,onHome:p,onBack:x,onRecents:I,onReload:j,onSave:u,onShutdown:h,onRemove:C}){const b='android'===t,f=(0,o.jsxs)(n.Dropdown,{side:"top",align:"end",alignOffset:-80,onCloseAutoFocus:o=>o.preventDefault(),trigger:(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.DotsIcon,{}),label:"More"}),children:[b&&(0,o.jsx)(n.DropdownItem,{label:"Back",Icon:n.BackIcon,onSelect:x}),b&&(0,o.jsx)(n.DropdownItem,{label:"Recents",Icon:n.RecentsIcon,onSelect:I}),(0,o.jsx)(n.DropdownItem,{label:"Shutdown",Icon:n.PowerIcon,onSelect:h}),!l&&(0,o.jsx)(n.DropdownItem,{label:"Remove",Icon:n.TrashIcon,destructive:!0,onSelect:C})]});return(0,o.jsxs)("div",{style:{display:'flex',alignItems:'flex-end',gap:24},children:[(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.CameraIcon,{}),label:"Save",onClick:u}),(0,o.jsx)(n.Switch,{checked:'dark'===c,onChange:s,label:"Theme"}),(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.HomeIcon,{}),label:"Home",variant:"primary",onClick:p}),(0,o.jsx)(n.ControlButton,{icon:(0,o.jsx)(n.RefreshIcon,{}),label:"Reload",onClick:j}),f]})};var o=r(d[0]),n=r(d[1])},253,[151,243]);
310
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EmptyState=function(){return(0,o.jsxs)("section",{style:{flex:1,minWidth:0,display:'flex',flexDirection:'column',alignItems:'center',justifyContent:'center',gap:16,padding:40,margin:16,boxSizing:'border-box',backgroundColor:t.bg.default,border:`1px solid ${t.border.secondary}`,borderRadius:t.radius.lg,boxShadow:t.shadow.sm,overflow:'hidden',textAlign:'center'},children:[(0,o.jsx)("div",{style:{display:'flex',alignItems:'center',justifyContent:'center',width:56,height:56,borderRadius:t.radius.full,border:`1px solid ${t.border.secondary}`,backgroundColor:t.bg.subtle},children:(0,o.jsx)(t.PhoneIcon,{size:28,color:t.icon.secondary})}),(0,o.jsx)("h2",{style:Object.assign({},t.heading.lg,{color:t.text.default,margin:0}),children:"No booted devices"}),(0,o.jsx)("p",{style:Object.assign({},t.textSize.sm,{color:t.text.secondary,margin:0,maxWidth:320}),children:"There are no booted simulators, emulators, or connected devices. Use the + button to add a simulator or emulator."})]})};var o=r(d[0]),t=r(d[1])},254,[151,243]);
311
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.BootErrorModal=function({open:n,onClose:l,deviceName:s,message:c}){return(0,o.jsx)(t.DialogRoot,{open:n,onOpenChange:o=>{o||l()},children:(0,o.jsxs)(t.DialogContent,{children:[(0,o.jsx)(t.DialogTitle,{title:"Failed to boot device"}),(0,o.jsxs)(t.DialogContentContainer,{children:[(0,o.jsxs)("p",{style:{margin:0,fontSize:14,lineHeight:1.5,color:t.text.secondary},children:[(0,o.jsx)("strong",{style:{color:t.text.default,fontWeight:600},children:s})," could not be booted."]}),(0,o.jsx)("pre",{style:{margin:'6px 0 0',padding:'10px 12px',overflowX:'auto',whiteSpace:'pre-wrap',overflowWrap:'anywhere',backgroundColor:t.bg.subtle,border:`1px solid ${t.border.default}`,borderRadius:t.radius.lg,color:t.text.danger,fontFamily:t.font.mono,fontSize:12,lineHeight:1.5},children:c})]}),(0,o.jsx)(t.DialogFooter,{children:(0,o.jsx)(t.Button,{theme:"primary",onClick:l,children:"Close"})})]})})};var o=r(d[0]),t=r(d[1])},255,[151,243]);
312
+ __d(function(g,r,i,a,m,e,d){},256,[]);
313
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shutdownDevice=function(n){return c(o,n)},e.removeDevice=function(o){return c(n,o)},e.bootDevice=async function(o){try{const n=await fetch(t,{method:'POST',headers:{'Content-Type':'application/json',Accept:'application/json'},body:JSON.stringify({platform:o.platform,id:o.id,name:o.name}),signal:AbortSignal.timeout(2e5)});if(!n.ok)throw new Error(`Unexpected ${n.status}`);const c=await n.json();return c.ok&&c.serial?{serial:c.serial,error:null}:{serial:null,error:c.error??'The emulator did not come online.'}}catch(o){return console.warn('[expo-device-hub] Device boot failed:',o),{serial:null,error:o instanceof Error?o.message:String(o)}}};const o='/_expo/plugins/expo-device-hub/api/devices/shutdown',n='/_expo/plugins/expo-device-hub/api/devices/remove',t='/_expo/plugins/expo-device-hub/api/devices/boot';async function c(o,n){try{const t=await fetch(o,{method:'POST',headers:{'Content-Type':'application/json',Accept:'application/json'},body:JSON.stringify({platform:n.platform,id:n.id,name:n.name})});if(!t.ok)throw new Error(`Unexpected ${t.status}`);return!0===(await t.json()).ok}catch(o){return console.warn('[expo-device-hub] Device action failed:',o),!1}}},257,[]);
314
314
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useColorScheme=function(){const[n,c]=(0,t.useState)('light');return(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.matchMedia)return;const t=window.matchMedia('(prefers-color-scheme: dark)'),n=()=>c(t.matches?'dark':'light');return n(),t.addEventListener('change',n),()=>t.removeEventListener('change',n)},[]),n};var t=r(d[0])},258,[38]);
315
315
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDevices=function(){return f('?booted=true',c)},e.useRecentDevices=function(){return f('',u)};var t=r(d[0]);const o='/_expo/plugins/expo-device-hub/api/devices',n={simulators:[],emulators:[]};async function s(t){const n=await fetch(`${o}${t}`,{headers:{Accept:'application/json'}});if(!n.ok)throw new Error(`Unexpected ${n.status}`);return await n.json()}const c=t=>t,u=t=>({simulators:t.simulators.filter(t=>!t.booted),emulators:t.emulators.filter(t=>!t.booted)}),l=500;function f(o,c){const[u,f]=(0,t.useState)(n);return(0,t.useEffect)(()=>{let t,n=!1;return(async function u(){try{const p=await s(o);if(n)return;f(c(p)),t=setTimeout(u,l)}catch(t){console.warn('[expo-device-hub] No device endpoint, showing empty state:',t)}})(),()=>{n=!0,clearTimeout(t)}},[o,c]),u}},259,[38]);
316
316
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useIsNarrow=function(n){const[c,o]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.matchMedia)return;const t=window.matchMedia(`(max-width: ${n}px)`),c=()=>o(t.matches);return c(),t.addEventListener('change',c),()=>t.removeEventListener('change',c)},[n]),c};var t=r(d[0])},260,[38]);
@@ -34,6 +34,6 @@
34
34
  </noscript>
35
35
  <!-- The root element for your Expo app. -->
36
36
  <div id="root"></div>
37
- <script src="/_expo/plugins/expo-device-hub/_expo/static/js/web/index-e0065d74914c87f40148e5cd9896b40d.js" defer></script>
37
+ <script src="/_expo/plugins/expo-device-hub/_expo/static/js/web/index-13af7f69e15c1e50e69a1f011ced02ea.js" defer></script>
38
38
  </body>
39
39
  </html>
@@ -11,13 +11,20 @@ function buildEmulatorArgs(options) {
11
11
  "-avd",
12
12
  options.name,
13
13
  "-no-audio",
14
+ "-no-window",
14
15
  "-gpu",
15
- "auto",
16
+ "host",
16
17
  "-no-boot-anim",
17
18
  "-port",
18
19
  String(options.port)
19
20
  ];
20
21
  }
22
+ function formatEmulatorCommand(emulatorPath, options) {
23
+ return [
24
+ emulatorPath,
25
+ ...buildEmulatorArgs(options)
26
+ ].map((part) => /\s/.test(part) ? JSON.stringify(part) : part).join(" ");
27
+ }
21
28
  function spawnEmulator(emulatorPath, options) {
22
29
  try {
23
30
  const child = spawn(emulatorPath, buildEmulatorArgs(options), {
@@ -82,9 +89,21 @@ function bootDevice(options) {
82
89
  const child = spawnEmulator(emulator, options);
83
90
  if (!child)
84
91
  return null;
92
+ const exited = new Promise((resolve) => {
93
+ child.once("exit", (code, signal) => resolve({
94
+ code,
95
+ signal
96
+ }));
97
+ child.once("error", () => resolve({
98
+ code: null,
99
+ signal: null
100
+ }));
101
+ });
85
102
  return {
86
103
  serial: emulatorSerial(options.port),
87
- pid: child.pid ?? null
104
+ pid: child.pid ?? null,
105
+ command: formatEmulatorCommand(emulator, options),
106
+ exited
88
107
  };
89
108
  } catch (error) {
90
109
  console.error("[android-utils] Failed to boot device:", error);
@@ -505,9 +524,11 @@ async function shutdownDevice(options) {
505
524
  }
506
525
  // ../@expo/hub-android-utils/dist/wait-for-adb-online.js
507
526
  var BOOT_POLL_INTERVAL_MS = 1500;
508
- async function waitForAdbOnline(serial, timeoutMs, { listDevicesFn = listDevices, pollIntervalMs = BOOT_POLL_INTERVAL_MS } = {}) {
527
+ async function waitForAdbOnline(serial, timeoutMs, { listDevicesFn = listDevices, pollIntervalMs = BOOT_POLL_INTERVAL_MS, signal } = {}) {
509
528
  const deadline = Date.now() + timeoutMs;
510
529
  while (Date.now() < deadline) {
530
+ if (signal?.aborted)
531
+ return false;
511
532
  try {
512
533
  const devices = await listDevicesFn();
513
534
  if (devices.some((device) => device.serial === serial && device.booted))
@@ -718,8 +739,24 @@ async function bootHubDevice({
718
739
  const booted = bootDevice({ name: avdName, port });
719
740
  if (!booted)
720
741
  return { ok: false, error: `Failed to spawn emulator for ${avdName}` };
721
- const online = await waitForAdbOnline(booted.serial, BOOT_READY_TIMEOUT_MS);
722
- return online ? { ok: true, serial: booted.serial } : { ok: false, serial: booted.serial, error: "Timed out waiting for the emulator to come online" };
742
+ const abort = new AbortController;
743
+ const outcome = await Promise.race([
744
+ waitForAdbOnline(booted.serial, BOOT_READY_TIMEOUT_MS, { signal: abort.signal }).then((online) => ({ kind: "wait", online })),
745
+ booted.exited.then((exit) => ({ kind: "exited", exit }))
746
+ ]);
747
+ abort.abort();
748
+ if (outcome.kind === "exited") {
749
+ const ended = outcome.exit.code != null ? `exited with code ${outcome.exit.code}` : outcome.exit.signal ? `was killed by ${outcome.exit.signal}` : "exited";
750
+ return {
751
+ ok: false,
752
+ serial: booted.serial,
753
+ error: `The emulator process for "${avdName}" ${ended} before coming online.
754
+
755
+ ` + `For details, try running it manually:
756
+ ${booted.command}`
757
+ };
758
+ }
759
+ return outcome.online ? { ok: true, serial: booted.serial } : { ok: false, serial: booted.serial, error: "Timed out waiting for the emulator to come online" };
723
760
  }
724
761
 
725
762
  // src/server/devices.ts
@@ -989,5 +1026,5 @@ export {
989
1026
  handler as default
990
1027
  };
991
1028
 
992
- //# debugId=EC35A555101BECB064756E2164756E21
1029
+ //# debugId=79A5167DA3D251D464756E2164756E21
993
1030
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-device-hub",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Expo DevTools plugin for managing iOS simulators and Android emulators.",
5
5
  "keywords": [
6
6
  "expo",
Binary file