expo-device-hub 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/_expo/static/js/web/{index-311f7272425a23c5acab2673716de892.js → index-a2652e658f45bc1f80e36da920386302.js} +120 -120
- package/dist/client/index.html +10 -10
- package/dist/server/cli.mjs +5 -2
- package/dist/server/index.mjs +15 -5
- package/package.json +19 -19
- package/vendor/serve-emu/dist/accessibility.js +1 -1
- package/vendor/serve-emu/dist/scrcpy.js +17 -1
- package/vendor/serve-sim/dist/middleware.js +2 -2
- package/vendor/serve-sim/dist/native/serve-sim-native.node +0 -0
- package/vendor/serve-sim/dist/serve-sim.js +3 -3
|
@@ -188,13 +188,13 @@ __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,153]);
|
|
191
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return E}}),r(d[0]),r(d[1]);var t=r(d[2]),o=r(d[3]),s=r(d[4]),n=r(d[5]),c=e(r(d[6])),l=e(r(d[7])),h=e(r(d[8])),u=r(d[9]),v=r(d[10]),f=r(d[11]),p=r(d[12]),S=r(d[13]),D=r(d[14]),b=r(d[15]),w=r(d[16]),y=r(d[17]),O=r(d[18]),x=r(d[19]),M=r(d[20]),k=r(d[21]),R=r(d[22]),j=r(d[23]),A=r(d[24]);function C(e,t){const o=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!o.has(e.id))]}const F=280,I=560,T=320,W={
|
|
191
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return E}}),r(d[0]),r(d[1]);var t=r(d[2]),o=r(d[3]),s=r(d[4]),n=r(d[5]),c=e(r(d[6])),l=e(r(d[7])),h=e(r(d[8])),u=r(d[9]),v=r(d[10]),f=r(d[11]),p=r(d[12]),S=r(d[13]),D=r(d[14]),b=r(d[15]),w=r(d[16]),y=r(d[17]),O=r(d[18]),x=r(d[19]),M=r(d[20]),k=r(d[21]),R=r(d[22]),j=r(d[23]),A=r(d[24]);function C(e,t){const o=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!o.has(e.id))]}const F=280,I=560,T=320,W={"android:pixel-9":{src:String(l.default),width:1935,height:4096,screen:{x:95,y:94,width:1737,height:3907},screenRadius:236},"android:pixel-10-pro":{src:String(c.default),width:1250,height:2631,screen:{x:50,y:48,width:1138,height:2532},screenRadius:150},"ios:iphone-17-pro":{src:String(h.default),width:2620,height:5420,screen:{x:104,y:88,width:2412,height:5244},screenRadius:340}};function z(e,t){const o=("undefined"==typeof window?1/0:window.innerWidth)-t-T,s=Math.max(F,Math.min(I,o));return Math.min(Math.max(e,F),s)}function E(e){const c=(0,b.useColorScheme)(),l=(0,v.dashboardHideBootDevice)(),h=(0,j.dashboardPlatformFilter)(),{booted:F,recent:I,connectionStatus:E}=(0,w.useDeviceLists)(),L=(0,x.useNewDeviceOptions)(),_=(0,D.useHideUnsupportedDevices)(),H=(0,S.useDashboardStore)(e=>e.selectedDeviceId),P=(0,S.useDashboardStore)(e=>e.selectDevice),U=(0,S.useDashboardStore)(e=>e.reconcileSelectedDevice),N=(0,S.useDashboardStore)(e=>e.addedDevices),B=(0,S.useDashboardStore)(e=>e.trackAddedDevice),q=(0,S.useDashboardStore)(e=>e.dismissDevice),G=(0,s.useMemo)(R.browserStreamModeAvailability,[]),J=(0,S.useDashboardStore)(e=>e.streamMode),K=(0,S.useDashboardStore)(e=>e.chooseStreamMode),Q=(0,S.useDashboardStore)(e=>e.showDeviceFrame),V=(0,S.useDashboardStore)(e=>e.setShowDeviceFrame),[X,Y]=(0,s.useState)(()=>"mjpeg"===J?"mjpeg":"h264"===J?"h264":"auto"),Z=(0,S.useDashboardStore)(e=>e.sidebarWidths.left),$=(0,S.useDashboardStore)(e=>e.sidebarWidths.right),ee=(0,S.useDashboardStore)(e=>e.resizeSidebar),ie=(0,s.useRef)(S.DEFAULT_SIDEBAR_WIDTH),te=(0,s.useRef)(S.DEFAULT_SIDEBAR_WIDTH),[oe,re]=(0,s.useState)(!1),de=(0,k.useSidebarLayout)({leftWidth:Z,rightWidth:$,minStreamWidth:T}),se=(0,s.useMemo)(()=>"android"===h?[]:C(F.simulators,N.filter(e=>"ios"===e.platform)),[F.simulators,N,h]),ne=(0,s.useMemo)(()=>"ios"===h?[]:C(F.emulators,N.filter(e=>"android"===e.platform)),[F.emulators,N,h]),ae=(0,s.useMemo)(()=>(0,D.visibleDevices)(I.simulators,_),[I.simulators,_]),ce=(0,s.useMemo)(()=>(0,D.visibleDevices)(I.emulators,_),[I.emulators,_]),le=(0,s.useMemo)(()=>(0,D.visibleNewDeviceOptions)(L.ios,_),[L.ios,_]),he=(0,s.useMemo)(()=>(0,D.visibleNewDeviceOptions)(L.android,_),[L.android,_]);async function ue(e){const t="new"===e.kind?await(0,p.createDevice)(e.device):e.device.booted?{id:e.device.id,error:null}:await(0,p.bootDevice)(e.device);if(!t.id)return{ok:!1,error:t.error??"The device did not come online."};const o="new"===e.kind?{id:t.id,name:e.device.name,version:e.device.version,platform:e.device.platform,physical:!1,booted:!0,supported:e.device.supported,deviceFrame:e.device.deviceFrame,lastUsedAt:Date.now()}:Object.assign({},e.device,{id:t.id,booted:!0,lastUsedAt:Date.now()}),s="new"===e.kind?[e.device.name,t.id]:[e.device.name,e.device.id,t.id];return B(o,s),{ok:!0}}async function me(e){await(0,p.shutdownDevice)(e),q(e.id)}async function ve(e){await(0,p.removeDevice)(e),q(e.id)}(0,s.useEffect)(()=>{const e=document.documentElement;return e.classList.toggle("dark-theme","dark"===c),()=>e.classList.remove("dark-theme")},[c]),(0,s.useEffect)(()=>{const e=[...se,...ne];U(e.map(e=>e.id))},[se,ne,U]);const fe=[...se,...ne],ge=fe.find(e=>e.id===H)??fe[0],pe="android"===ge?.platform?(0,R.androidStreamModeAvailability)(G,void 0!==window.MediaSource):G,Se=e=>{K(e,pe)},De=(0,t.useActiveDeviceClient)("connected"===E&&ge?{platform:ge.platform,device:ge.id,streamMode:J}:null,(0,f.basePath)()),be=(0,O.useArgentInteractions)(),we=ge?be[ge.id]??null:null,ye=Object.keys(be),Oe="connected"!==E;return(0,A.jsxs)("div",{ref:de.containerRef,"aria-hidden":Oe||void 0,className:"dark"===c?"dark-theme":void 0,inert:Oe||void 0,style:{display:"flex",position:"relative",flex:1,width:"100%",minWidth:0,height:"100vh",boxSizing:"border-box",backgroundColor:o.bg.default,color:o.text.default,fontFamily:"var(--expo-font-sans)",overflow:"hidden"},children:[(0,A.jsx)(u.AnimatedDockedSidebar,{side:"left",width:Z,open:de.leftDocked,sidebarOpen:de.leftOpen,resizing:oe,children:(0,A.jsx)(o.Sidebar,{simulators:se,emulators:ne,recentSimulators:ae,recentEmulators:ce,simulatorOptions:le,emulatorOptions:he,agentDeviceIds:ye,selectedId:H,onSelect:P,onAddDevice:l?void 0:ue,onToggle:de.closeLeft,platform:h,width:Z})}),de.leftDocked&&(0,A.jsx)(o.ResizeHandle,{side:"left",offset:Z,onResizeStart:()=>{ie.current=Z,re(!0)},onResizeEnd:()=>re(!1),onResize:e=>ee("left",z(ie.current+e,de.rightDocked?$:0))}),ge?(0,A.jsx)(o.StreamPanel,{device:ge,client:De,agentInteraction:we,DeviceScreen:t.DeviceScreen,displayScreen:t.displayScreen,framed:de.containerWidth>=600,showDeviceFrame:Q,deviceFrameAssets:W}):(0,A.jsx)(o.EmptyState,{platform:h,framed:de.containerWidth>=600}),de.rightDocked&&(0,A.jsx)(o.ResizeHandle,{side:"right",offset:$,onResizeStart:()=>{te.current=$,re(!0)},onResizeEnd:()=>re(!1),onResize:e=>ee("right",z(te.current+e,de.leftDocked?Z:0))}),(0,A.jsx)(u.AnimatedDockedSidebar,{side:"right",width:$,open:de.rightDocked,sidebarOpen:de.rightOpen,resizing:oe,children:(0,A.jsx)(o.LogSidebar,{device:ge,client:De,showDeviceFrame:Q,onShowDeviceFrameChange:V,streamMode:J,httpCodec:X,streamModeAvailability:pe,onStreamModeChange:Se,onHttpCodecChange:Y,onShutdown:ge?()=>me(ge):void 0,onRemove:ge?()=>ve(ge):void 0,onToggle:de.closeRight,width:$})}),(0,A.jsx)(M.SidebarOverlay,{side:"left",open:de.leftOverlay,sidebarOpen:de.leftOpen,topmost:"left"===de.lastOpened||!de.rightOverlay,onDismiss:de.closeLeft,children:(0,A.jsx)(o.Sidebar,{simulators:se,emulators:ne,recentSimulators:ae,recentEmulators:ce,simulatorOptions:le,emulatorOptions:he,agentDeviceIds:ye,selectedId:H,onSelect:P,onAddDevice:l?void 0:ue,onToggle:de.closeLeft,platform:h,width:Z})}),(0,A.jsx)(M.SidebarOverlay,{side:"right",open:de.rightOverlay,sidebarOpen:de.rightOpen,topmost:"right"===de.lastOpened||!de.leftOverlay,onDismiss:de.closeRight,children:(0,A.jsx)(o.LogSidebar,{device:ge,client:De,showDeviceFrame:Q,onShowDeviceFrameChange:V,streamMode:J,httpCodec:X,streamModeAvailability:pe,onStreamModeChange:Se,onHttpCodecChange:Y,onShutdown:ge?()=>me(ge):void 0,onRemove:ge?()=>ve(ge):void 0,onToggle:de.closeRight,width:$})}),!de.leftOpen&&(0,A.jsx)(y.FloatingSidebarToggle,{side:"left",inset:(0,y.floatingSidebarToggleInset)(de.rightOverlay,de.containerWidth,$),onClick:de.openLeft}),!de.rightOpen&&(0,A.jsx)(y.FloatingSidebarToggle,{side:"right",inset:(0,y.floatingSidebarToggleInset)(de.leftOverlay,de.containerWidth,Z),onClick:de.openRight}),Oe&&(0,n.createPortal)((0,A.jsx)(o.ServerConnectionOverlay,{status:E,onReload:()=>window.location.reload()}),document.body)]})}},145,[146,147,148,236,38,40,396,397,398,399,401,402,404,406,413,414,415,417,418,421,422,423,412,424,153]);
|
|
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,"resolveDeviceStreamMode",{enumerable:!0,get:function(){return n.resolveDeviceStreamMode}}),Object.defineProperty(e,"areRecordingControlsLocked",{enumerable:!0,get:function(){return o.areRecordingControlsLocked}}),Object.defineProperty(e,"DeviceScreen",{enumerable:!0,get:function(){return u.DeviceScreen}}),Object.defineProperty(e,"DeviceClientProvider",{enumerable:!0,get:function(){return c.DeviceClientProvider}}),Object.defineProperty(e,"useDeviceClientSelector",{enumerable:!0,get:function(){return c.useDeviceClientSelector}}),Object.defineProperty(e,"useDeviceClient",{enumerable:!0,get:function(){return b.useDeviceClient}}),Object.defineProperty(e,"useDeviceScreenClient",{enumerable:!0,get:function(){return f.useDeviceScreenClient}}),Object.defineProperty(e,"KeyboardCapture",{enumerable:!0,get:function(){return l.KeyboardCapture}}),Object.defineProperty(e,"AGENT_INTERACTION_IDLE_TIMEOUT_MS",{enumerable:!0,get:function(){return y.AGENT_INTERACTION_IDLE_TIMEOUT_MS}}),Object.defineProperty(e,"agentInteractionCursorExpiresAt",{enumerable:!0,get:function(){return y.agentInteractionCursorExpiresAt}}),Object.defineProperty(e,"agentInteractionEndMs",{enumerable:!0,get:function(){return y.agentInteractionEndMs}}),Object.defineProperty(e,"agentInteractionPointsAt",{enumerable:!0,get:function(){return y.agentInteractionPointsAt}}),Object.defineProperty(e,"displayScreen",{enumerable:!0,get:function(){return s.displayScreen}}),Object.defineProperty(e,"streamGeometry",{enumerable:!0,get:function(){return s.streamGeometry}}),Object.defineProperty(e,"useIosDeviceClient",{enumerable:!0,get:function(){return p.useIosDeviceClient}}),Object.defineProperty(e,"useAndroidDeviceClient",{enumerable:!0,get:function(){return P.useAndroidDeviceClient}}),Object.defineProperty(e,"useActiveDeviceClient",{enumerable:!0,get:function(){return O.useActiveDeviceClient}}),Object.defineProperty(e,"useCoarsePointer",{enumerable:!0,get:function(){return v.useCoarsePointer}}),Object.defineProperty(e,"isVisualViewportKeyboardRaised",{enumerable:!0,get:function(){return j.isVisualViewportKeyboardRaised}}),Object.defineProperty(e,"readNativeKeyboardRaised",{enumerable:!0,get:function(){return j.readNativeKeyboardRaised}}),Object.defineProperty(e,"KEYBOARD_CAPTURE_ATTRIBUTES",{enumerable:!0,get:function(){return C.KEYBOARD_CAPTURE_ATTRIBUTES}}),Object.defineProperty(e,"keydownForward",{enumerable:!0,get:function(){return C.keydownForward}}),Object.defineProperty(e,"keyEventsForBeforeInput",{enumerable:!0,get:function(){return C.keyEventsForBeforeInput}}),Object.defineProperty(e,"keyEventsForInputType",{enumerable:!0,get:function(){return C.keyEventsForInputType}}),Object.defineProperty(e,"keyEventsForTextChange",{enumerable:!0,get:function(){return C.keyEventsForTextChange}}),Object.defineProperty(e,"createPacedKeySender",{enumerable:!0,get:function(){return E.createPacedKeySender}}),Object.defineProperty(e,"textToKeyEventsLenient",{enumerable:!0,get:function(){return T.textToKeyEventsLenient}});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]),o=r(d[2]),u=r(d[3]),c=r(d[4]),b=r(d[5]),f=r(d[6]),l=r(d[7]),y=r(d[8]),s=r(d[9]),p=r(d[10]),P=r(d[11]),O=r(d[12]),v=r(d[13]),j=r(d[14]),C=r(d[15]),E=r(d[16]),T=r(d[17])},148,[149,150,151,152,161,228,229,230,159,156,211,168,234,235,233,231,221,232]);
|
|
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.resolveDeviceStreamMode=function(t,n){return n[t]?t:[
|
|
197
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseScreenRecordingStatus=function(n){if(!n||
|
|
196
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveDeviceStreamMode=function(t,n){return n[t]?t:["h264","mjpeg","webrtc"].find(t=>n[t])??t}},150,[]);
|
|
197
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseScreenRecordingStatus=function(n){if(!n||"object"!=typeof n||!("status"in n))return null;switch(n.status){case"waiting":case"recording":case"finalizing":case"complete":case"failed":return n.status;default:return null}},e.areRecordingControlsLocked=function(n){return"unknown"===n||"waiting"===n||"recording"===n||"finalizing"===n}},151,[]);
|
|
198
198
|
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_SCREEN_SURFACE_LAYOUT_STYLE",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"DEVICE_SCREEN_STATUS_LAYOUT_STYLE",{enumerable:!0,get:function(){return h}}),e.deviceScreenPresentsMedia=b,e.deviceScreenSurfaceStyle=v,e.deviceScreenMediaStyle=y,e.DeviceScreen=function({client:f,borderRadius:x,squircle:w,agentInteraction:I}){const{videoKind:C,attachVideo:E,sendTouch:j,sendMultiTouch:S,sendScroll:k,sendKey:R,cancelInput:D,screen:P,status:O,error:T}=f,K=!!S,F=(0,n.useRef)(null),M=(0,n.useRef)(null),A=(0,n.useRef)(new Map),_=(0,n.useCallback)(()=>{for(const t of A.current.values())R(Object.assign({},t,{phase:"up",repeat:!1}));A.current.clear()},[R]),L=(t,n)=>({phase:n,code:t.code,key:t.key,repeat:t.repeat,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),Y=(0,n.useRef)(new Map),U=(0,n.useRef)(new Set),X=(0,n.useRef)("none"),q=(0,n.useRef)(null),z=(0,n.useRef)(null),B=(0,n.useRef)(!1),N=(0,n.useRef)({x:0,y:0}),[V,G]=(0,n.useState)(null),W=(0,n.useRef)({}),$=(0,n.useRef)(0),H=()=>{$.current=0;const t=W.current;W.current={},t.single&&(j(Object.assign({phase:"move"},t.single)),z.current=t.single),t.multi&&(S?.(t.multi),G({a:t.multi.a,b:t.multi.b}))},J=()=>{$.current||($.current=requestAnimationFrame(H))},Q=(t,n)=>{const c=F.current?.getBoundingClientRect();return c&&0!==c.width&&0!==c.height?{x:l((t-c.left)/c.width),y:l((n-c.top)/c.height)}:null},Z=(0,n.useCallback)(t=>B.current?{x:l(t.x+N.current.x),y:l(t.y+N.current.y)}:{x:1-t.x,y:1-t.y},[]),ee=(t,n)=>{$.current&&(cancelAnimationFrame($.current),$.current=0),W.current={},S?.({phase:"end",a:t,b:n}),G(null)},te=(0,n.useCallback)(()=>{$.current&&cancelAnimationFrame($.current),$.current=0;const t=W.current;W.current={};const n=X.current,c=[...Y.current.values()],o=[...Y.current.keys()];Y.current.clear(),U.current.clear(),X.current="none",q.current=null,z.current=null;const u=t.multi?.a??c[0];let s=t.multi?.b??c[1];"single"===n&&u?j(Object.assign({phase:"end"},t.single??u)):!u||"two"!==n&&"alt"!==n||(s??=Z(u),S?.({phase:"end",a:u,b:s}));for(const t of o)try{F.current?.releasePointerCapture(t)}catch{}G(null)},[j,S,Z]),ne=(0,n.useCallback)(()=>{M.current?.cancel(),D?.(),_(),te(),D?.()},[_,te,D]);(0,n.useLayoutEffect)(()=>{const t=(0,c.listenForInputCancellation)(ne);return()=>{t(),ne()}},[ne]);(0,n.useEffect)(()=>{const t=F.current;if(!t||!k)return;const n=(0,u.createFrameScrollSender)(k);M.current=n;const c=c=>{if("none"!==X.current)return;const o=t.getBoundingClientRect();if(0===o.width||0===o.height)return;const s=(0,u.wheelDeltaToPixels)(c.deltaX,c.deltaMode,o.width),a=(0,u.wheelDeltaToPixels)(c.deltaY,c.deltaMode,o.height);0===s&&0===a||(n.send({dx:s/o.width,dy:a/o.height,x:l((c.clientX-o.left)/o.width),y:l((c.clientY-o.top)/o.height)}),c.preventDefault(),c.stopPropagation())},o=()=>{document.hidden&&n.cancel()};return t.addEventListener("wheel",c,{passive:!1}),document.addEventListener("visibilitychange",o),()=>{t.removeEventListener("wheel",c),document.removeEventListener("visibilitychange",o),n.cancel(),M.current=null}},[k]);const re=(0,o.streamGeometry)(P).rotationDegrees,ce=Object.assign({},v(O),{borderRadius:x},w?{cornerShape:"superellipse(1.3)"}:{}),oe=y(re);return(0,t.jsxs)("div",{style:ce,children:["canvas"===C?(0,t.jsx)("canvas",{ref:E,style:oe}):"video"===C?(0,t.jsx)("video",{ref:E,autoPlay:!0,muted:!0,playsInline:!0,style:oe}):(0,t.jsx)("img",{ref:E,alt:"Device screen",draggable:!1,style:oe}),(0,t.jsx)("div",{ref:F,role:"application","aria-label":"Interactive device screen. Focus to control it with your keyboard. Press Shift and Escape to stop keyboard control.",tabIndex:0,style:{position:"absolute",inset:0,cursor:p,touchAction:"none",borderRadius:x,outline:"none"},onBlur:()=>{_(),[...Y.current.keys()].some(t=>!U.current.has(t))&&ne()},onKeyDown:t=>{if("Escape"===t.key&&t.shiftKey)return t.preventDefault(),_(),void t.currentTarget.blur();if(t.nativeEvent.isComposing)return;const n=L(t,"down");R(n)&&(t.preventDefault(),A.current.set(t.code||t.key,n))},onKeyUp:t=>{const n=t.code||t.key,c=A.current.delete(n),o=R(L(t,"up"));(c||o)&&t.preventDefault()},onPointerDown:t=>{if("mouse"===t.pointerType&&0!==t.button)return;const n=Q(t.clientX,t.clientY);if(n){M.current?.cancel(),t.preventDefault(),F.current?.focus({preventScroll:!0});try{const n=F.current;n?.setPointerCapture(t.pointerId),n&&U.current.add(t.pointerId)}catch{}if(Y.current.set(t.pointerId,n),K&&"mouse"===t.pointerType&&t.altKey&&"none"===X.current){X.current="alt",B.current=t.shiftKey,N.current={x:1-2*n.x,y:1-2*n.y};const c=Z(n);return G({a:n,b:c}),void S?.({phase:"begin",a:n,b:c})}if(K&&Y.current.size>=2&&"alt"!==X.current){if("single"===X.current){$.current&&cancelAnimationFrame($.current),$.current=0,W.current={};const t=z.current??Y.current.get(q.current)??n;j(Object.assign({phase:"end"},t,{cancelled:!0})),q.current=null,z.current=null}const[t,c]=[...Y.current.values()];return X.current="two",G({a:t,b:c}),void S?.({phase:"begin",a:t,b:c})}"none"===X.current&&(X.current="single",q.current=t.pointerId,z.current=n,j(Object.assign({phase:"begin"},n)))}},onPointerMove:t=>{if(!Y.current.get(t.pointerId))return;const n=t.nativeEvent,c="function"==typeof n.getCoalescedEvents?n.getCoalescedEvents():null,o=c&&c.length>0?c[c.length-1]:t,u=Q(o.clientX,o.clientY);if(u)if(t.preventDefault(),Y.current.set(t.pointerId,u),"alt"===X.current)W.current.multi={phase:"move",a:u,b:Z(u)},J();else if("two"===X.current){const[t,n]=[...Y.current.values()];W.current.multi={phase:"move",a:t,b:n},J()}else"single"===X.current&&t.pointerId===q.current&&(W.current.single=u,J())},onPointerLeave:t=>{Y.current.has(t.pointerId)&&!U.current.has(t.pointerId)&&ne()},onPointerUp:t=>{const n=Y.current.get(t.pointerId);if(!n)return;t.preventDefault();const c=Q(t.clientX,t.clientY)??n;U.current.delete(t.pointerId);try{F.current?.releasePointerCapture(t.pointerId)}catch{}if("alt"===X.current)return ee(c,Z(c)),X.current="none",Y.current.clear(),void U.current.clear();if("two"===X.current){const[t,n]=[...Y.current.values()];return ee(t??c,n??c),X.current="none",Y.current.clear(),void U.current.clear()}"single"===X.current&&t.pointerId===q.current&&($.current&&(cancelAnimationFrame($.current),$.current=0),W.current={},j(Object.assign({phase:"end"},c)),X.current="none",q.current=null,z.current=null),Y.current.delete(t.pointerId)},onPointerCancel:t=>{Y.current.has(t.pointerId)&&ne()},onLostPointerCapture:t=>{U.current.delete(t.pointerId)&&Y.current.has(t.pointerId)&&ne()},onContextMenu:t=>t.preventDefault()}),V&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.TouchIndicator,{point:V.a}),(0,t.jsx)(a.TouchIndicator,{point:V.b})]}),(0,t.jsx)(s.AgentInteractionIndicator,{interaction:I}),!b(O)&&(0,t.jsx)("div",{style:Object.assign({},h,{color:"error"===O?"#fca5a5":"rgba(255, 255, 255, 0.7)"}),children:"error"===O?T??"Disconnected":"connecting"===O?"Connecting\u2026":"Not connected"})]})};var t=r(d[0]),n=r(d[1]),c=r(d[2]),o=r(d[3]),u=r(d[4]),s=r(d[5]),a=r(d[6]);const l=t=>Math.min(1,Math.max(0,t)),p="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",f={position:"absolute",inset:0,containerType:"size",overflow:"hidden"},h={position:"absolute",inset:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",padding:24,textAlign:"center",pointerEvents:"none",backgroundColor:"rgba(0, 0, 0, 0.55)",fontSize:13,fontFamily:"var(--expo-font-mono)"};function b(t){return"streaming"===t||"reconnecting"===t}function v(t){return Object.assign({},f,b(t)?{}:{backgroundColor:"#000"})}function y(t){const n=90===Math.abs(t),c=0===t?{display:"block",position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}:{display:"block",position:"absolute",top:"50%",left:"50%",width:n?"100cqh":"100%",height:n?"100cqw":"100%",transform:`translate(-50%, -50%) rotate(${t}deg)`,transformOrigin:"center center",objectFit:"cover"};return Object.assign({},c,{userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"})}},152,[153,38,155,156,157,158,160]);
|
|
199
199
|
__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},153,[154]);
|
|
200
200
|
__d(function(g,r,i,a,m,e,d){
|
|
@@ -209,11 +209,11 @@ __d(function(g,r,i,a,m,e,d){
|
|
|
209
209
|
*/
|
|
210
210
|
"use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},154,[]);
|
|
211
211
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.listenForInputCancellation=function(n){if("undefined"==typeof window||"undefined"==typeof document)return()=>{};const t=()=>{document.hidden&&n()};return window.addEventListener("blur",n),window.addEventListener("pagehide",n),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("blur",n),window.removeEventListener("pagehide",n),document.removeEventListener("visibilitychange",t)}}},155,[]);
|
|
212
|
-
__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({y:t,edgeGestures:n=!0}){return n&&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
|
|
212
|
+
__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({y:t,edgeGestures:n=!0}){return n&&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.rawDeltaForDisplayDelta=function(t,n,u){switch(t){case"landscape_left":return{dx:u,dy:-n};case"landscape_right":return{dx:-u,dy:n};case"portrait_upside_down":return{dx:-n,dy:-u};default:return{dx:n,dy: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})}},156,[]);
|
|
213
213
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WHEEL_LINE_HEIGHT_PX",{enumerable:!0,get:function(){return n}}),e.wheelDeltaToPixels=function(t,l,u){if(!Number.isFinite(t))return 0;const c=Number.isFinite(u)&&u>0?u:1;return 1===l?t*n:2===l?t*c:t},e.createFrameScrollSender=function(n){let t=null,l=null;const u=()=>{const c=l;l=null,c?(t=requestAnimationFrame(u),0===c.dx&&0===c.dy||n(c)):t=null};return{send(c){null===t?(t=requestAnimationFrame(u),n(c)):l=Object.assign({},c,{dx:(l?.dx??0)+c.dx,dy:(l?.dy??0)+c.dy})},cancel(){null!==t&&cancelAnimationFrame(t),t=null,l=null}}};const n=16},157,[]);
|
|
214
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentInteractionIndicator=function({interaction:u}){const l=(0,n.useRef)([]),f=(0,n.useRef)([]),h=t=>{f.current=t;for(let n=0;n<l.current.length;n++){const o=l.current[n];if(!o)continue;const s=t[n];o.hidden=!s,s&&(o.style.transform=`translate3d(${100*s.x}%, ${100*s.y}%, 0)`)}};return(0,n.useEffect)(()=>{if(!u)return void h([]);const t=u,n=window.matchMedia?.(c).matches??!1,s=f.current,l=n?0:(0,o.agentInteractionTravelMs)(s,t),v=(0,o.agentInteractionEndMs)(t),T=l+v,w=Date.now(),p=Date.parse(t.timestamp),A=Number.isFinite(p)?p:w,I=(0,o.agentInteractionCursorExpiresAt)(t,A);if(w>=I)return void h([]);const _=l>0?w:A;let x=0,y=0,E=0;const b=()=>{cancelAnimationFrame(x),x=0,clearTimeout(y),y=0,h([])};function j(){if(Date.now()>=I)return void b();const c=n?v:Math.max(0,Date.now()-_);h(n?(0,o.agentInteractionPointsAt)(t,c):(0,o.agentInteractionPointsWithTravelAt)(t,s,c)),!n&&c<T&&(x=requestAnimationFrame(()=>{clearTimeout(y),y=0,j()}),y=window.setTimeout(()=>{cancelAnimationFrame(x),x=0,j()},100))}return E=window.setTimeout(b,I-w),j(),()=>{cancelAnimationFrame(x),clearTimeout(y),clearTimeout(E)}},[u]),(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"agent-interaction-indicator",style:{position:
|
|
215
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AGENT_INTERACTION_IDLE_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),e.agentInteractionEndMs=s,e.agentInteractionCursorExpiresAt=function(t,o=Date.now()){const u=Date.parse(t.timestamp);return(Number.isFinite(u)?u:o)+s(t)+n},e.agentInteractionPointsAt=o,e.agentInteractionTravelMs=u,e.agentInteractionPointsWithTravelAt=function(t,n,s){const c=u(n,t);if(0===c)return o(t,s);if(s>=c)return o(t,s-c);return f(n,o(t,0),M(s/c))};const t=220,n=6e4;function s(t){return t.segments.reduce((t,n)=>Math.max(t,n.startMs+(n.frames.at(-1)?.atMs??0)),0)}function o(t,n){const s=t.segments[0];if(!s)return[];let o=0;for(let s=0;s<t.segments.length;s++){const u=t.segments[s];if(u){if(u.startMs>n)break;o=s}}const u=t.segments[o]??s,p=t.segments[o+1],h=u.frames.at(-1),l=u.startMs+(h?.atMs??0);if(p&&h&&n>=l){const t=p.frames[0],s=p.startMs-l;if(t&&s>0&&h.points.length===t.points.length)return f(h.points,t.points,M((n-l)/s))}return c(u,Math.max(0,n-u.startMs))}function u(n,s){const u=o(s,0);return n.length!==u.length||0===n.length?0:n.some((t,n)=>{const s=u[n];return s&&(t.x!==s.x||t.y!==s.y)})?t:0}function c(t,n){const s=t.frames[0];if(!s)return[];const o=t.frames.at(-1)??s;if(n<=s.atMs)return s.points;if(n>=o.atMs)return o.points;for(let s=1;s<t.frames.length;s++){const o=t.frames[s],u=t.frames[s-1];if(!o||!u||n>o.atMs)continue;if(u.points.length!==o.points.length||o.atMs===u.atMs)return o.points;const c=(n-u.atMs)/(o.atMs-u.atMs),M=
|
|
216
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TOUCH_INDICATOR_STYLE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AGENT_TOUCH_INDICATOR_STYLE",{enumerable:!0,get:function(){return n}}),e.TouchIndicator=function({point:n}){return(0,t.jsx)("div",{style:Object.assign({},o,{left:100*n.x+"%",top:100*n.y+"%",transform:
|
|
214
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentInteractionIndicator=function({interaction:u}){const l=(0,n.useRef)([]),f=(0,n.useRef)([]),h=t=>{f.current=t;for(let n=0;n<l.current.length;n++){const o=l.current[n];if(!o)continue;const s=t[n];o.hidden=!s,s&&(o.style.transform=`translate3d(${100*s.x}%, ${100*s.y}%, 0)`)}};return(0,n.useEffect)(()=>{if(!u)return void h([]);const t=u,n=window.matchMedia?.(c).matches??!1,s=f.current,l=n?0:(0,o.agentInteractionTravelMs)(s,t),v=(0,o.agentInteractionEndMs)(t),T=l+v,w=Date.now(),p=Date.parse(t.timestamp),A=Number.isFinite(p)?p:w,I=(0,o.agentInteractionCursorExpiresAt)(t,A);if(w>=I)return void h([]);const _=l>0?w:A;let x=0,y=0,E=0;const b=()=>{cancelAnimationFrame(x),x=0,clearTimeout(y),y=0,h([])};function j(){if(Date.now()>=I)return void b();const c=n?v:Math.max(0,Date.now()-_);h(n?(0,o.agentInteractionPointsAt)(t,c):(0,o.agentInteractionPointsWithTravelAt)(t,s,c)),!n&&c<T&&(x=requestAnimationFrame(()=>{clearTimeout(y),y=0,j()}),y=window.setTimeout(()=>{cancelAnimationFrame(x),x=0,j()},100))}return E=window.setTimeout(b,I-w),j(),()=>{cancelAnimationFrame(x),clearTimeout(y),clearTimeout(E)}},[u]),(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"agent-interaction-indicator",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:[0,1].map(n=>(0,t.jsx)("div",{ref:t=>{l.current[n]=t},hidden:!0,style:{position:"absolute",inset:0,willChange:"transform"},children:(0,t.jsx)("div",{"data-agent-touch":n,style:Object.assign({},s.AGENT_TOUCH_INDICATOR_STYLE,{left:0,top:0,transform:"translate(-50%, -50%)"})})},n))})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);const c="(prefers-reduced-motion: reduce)"},158,[153,38,159,160]);
|
|
215
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AGENT_INTERACTION_IDLE_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),e.agentInteractionEndMs=s,e.agentInteractionCursorExpiresAt=function(t,o=Date.now()){const u=Date.parse(t.timestamp);return(Number.isFinite(u)?u:o)+s(t)+n},e.agentInteractionPointsAt=o,e.agentInteractionTravelMs=u,e.agentInteractionPointsWithTravelAt=function(t,n,s){const c=u(n,t);if(0===c)return o(t,s);if(s>=c)return o(t,s-c);return f(n,o(t,0),M(s/c))};const t=220,n=6e4;function s(t){return t.segments.reduce((t,n)=>Math.max(t,n.startMs+(n.frames.at(-1)?.atMs??0)),0)}function o(t,n){const s=t.segments[0];if(!s)return[];let o=0;for(let s=0;s<t.segments.length;s++){const u=t.segments[s];if(u){if(u.startMs>n)break;o=s}}const u=t.segments[o]??s,p=t.segments[o+1],h=u.frames.at(-1),l=u.startMs+(h?.atMs??0);if(p&&h&&n>=l){const t=p.frames[0],s=p.startMs-l;if(t&&s>0&&h.points.length===t.points.length)return f(h.points,t.points,M((n-l)/s))}return c(u,Math.max(0,n-u.startMs))}function u(n,s){const u=o(s,0);return n.length!==u.length||0===n.length?0:n.some((t,n)=>{const s=u[n];return s&&(t.x!==s.x||t.y!==s.y)})?t:0}function c(t,n){const s=t.frames[0];if(!s)return[];const o=t.frames.at(-1)??s;if(n<=s.atMs)return s.points;if(n>=o.atMs)return o.points;for(let s=1;s<t.frames.length;s++){const o=t.frames[s],u=t.frames[s-1];if(!o||!u||n>o.atMs)continue;if(u.points.length!==o.points.length||o.atMs===u.atMs)return o.points;const c=(n-u.atMs)/(o.atMs-u.atMs),M="ease-out"===t.easing?1-Math.pow(1-c,3):c;return f(u.points,o.points,M)}return o.points}function f(t,n,s){const o=Math.min(1,Math.max(0,s));return t.map((t,s)=>{const u=n[s]??t;return{x:t.x+(u.x-t.x)*o,y:t.y+(u.y-t.y)*o}})}function M(t){const n=Math.min(1,Math.max(0,t));return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}},159,[]);
|
|
216
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TOUCH_INDICATOR_STYLE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"AGENT_TOUCH_INDICATOR_STYLE",{enumerable:!0,get:function(){return n}}),e.TouchIndicator=function({point:n}){return(0,t.jsx)("div",{style:Object.assign({},o,{left:100*n.x+"%",top:100*n.y+"%",transform:"translate(-50%, -50%)"})})};var t=r(d[0]);const o={position:"absolute",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)",pointerEvents:"none",boxSizing:"border-box"},n=Object.assign({},o,{border:"2px solid var(--expo-theme-border-info)"})},160,[153]);
|
|
217
217
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DeviceClientStoreContext",{enumerable:!0,get:function(){return v}}),e.DeviceClientProvider=function({platform:o,options:C,children:b}){const E=(0,l.useIosDeviceClient)(Object.assign({},C,{enabled:"ios"===o&&!1!==C.enabled})),O=(0,s.useAndroidDeviceClient)(Object.assign({},C,{enabled:"android"===o&&!1!==C.enabled})),f="ios"===o?E:"android"===o?O:u.NOOP_DEVICE_CLIENT,[p]=(0,n.useState)(()=>{const t=o?Object.assign({},u.NOOP_DEVICE_CLIENT,{platform:o,videoKind:"android"===o?"canvas":"img"}):u.NOOP_DEVICE_CLIENT;return(0,c.createDeviceClientStore)(f,t)});return(0,n.useLayoutEffect)(()=>{p.publish(f)},[p,f]),(0,t.jsx)(v.Provider,{value:p,children:b})},e.useDeviceClientSelector=function(t,c=Object.is){const s=(0,n.useContext)(v);if(!s)throw new Error("useDeviceClientSelector requires a DeviceClientProvider. Wrap this component in a provider to share its device connection.");return(0,o.useSyncExternalStoreWithSelector)(s.subscribe,s.getSnapshot,s.getServerSnapshot,t,c)};var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),s=r(d[4]),l=r(d[5]),u=r(d[6]);const v=(0,n.createContext)(null)},161,[153,38,162,164,168,211,165]);
|
|
218
218
|
__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},162,[163]);
|
|
219
219
|
__d(function(g,r,i,a,m,e,d){
|
|
@@ -228,83 +228,83 @@ __d(function(g,r,i,a,m,e,d){
|
|
|
228
228
|
*/
|
|
229
229
|
"use strict";var u=r(d[0]);var n="function"==typeof Object.is?Object.is:function(u,n){return u===n&&(0!==u||1/u==1/n)||u!=u&&n!=n},t=u.useSyncExternalStore,l=u.useRef,c=u.useEffect,f=u.useMemo,o=u.useDebugValue;e.useSyncExternalStoreWithSelector=function(u,v,s,S,h){var V=l(null);if(null===V.current){var b={hasValue:!1,value:null};V.current=b}else b=V.current;V=f(function(){function u(u){if(!c){if(c=!0,t=u,u=S(u),void 0!==h&&b.hasValue){var f=b.value;if(h(f,u))return l=f}return l=u}if(f=l,n(t,u))return f;var o=S(u);return void 0!==h&&h(f,o)?(t=u,f):(t=u,l=o)}var t,l,c=!1,f=void 0===s?null:s;return[function(){return u(v())},null===f?void 0:function(){return u(f())}]},[v,s,S,h]);var y=t(u,V[0],V[1]);return c(function(){b.hasValue=!0,b.value=y},[y]),o(y),y}},163,[38]);
|
|
230
230
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createDeviceClientStore=function(n=t.NOOP_DEVICE_CLIENT,o=n){let s=n;const c=new Set;return{getSnapshot:()=>s,getServerSnapshot:()=>o,subscribe:t=>(c.add(t),()=>{c.delete(t)}),publish(t){if(!Object.is(s,t)){s=t;for(const t of c)t()}}}};var t=r(d[0])},164,[165]);
|
|
231
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOOP_DEVICE_CLIENT",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]);const s={platform:
|
|
231
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOOP_DEVICE_CLIENT",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]);const s={platform:"ios",status:"idle",error:null,inputError:null,screen:null,fps:0,devices:[],logs:[],logsEnabled:!1,attachLogs:()=>{},detachLogs:()=>{},clearLogs:()=>{},events:[],eventsEnabled:!1,attachEvents:()=>{},detachEvents:()=>{},clearEvents:()=>{},activity:null,activityStatus:"idle",deviceSettings:null,deviceSettingsStatus:"idle",deviceSettingsPending:new Set,setDeviceSetting:()=>{},displayWidthDp:null,camera:null,cameraPending:n.NO_PENDING_CAMERA_WRITES,cameraError:null,setCameraImage:()=>{},clearCameraImage:()=>{},accessibility:null,accessibilityPending:!1,accessibilityError:null,refreshAccessibility:()=>{},location:null,locationPending:!1,locationError:null,setLocation:()=>{},clearLocation:()=>{},permissions:null,permissionsPending:t.NO_PENDING_PERMISSION_WRITES,permissionsError:null,setPermission:()=>{},resetPermissions:()=>{},refreshPermissions:()=>{},streamCapabilities:null,screenRecording:null,streamSettings:null,streamSettingsPending:!1,updateStreamSettings:()=>{},streamSource:null,streamSourcePending:!1,streamSourceError:null,setStreamSource:()=>{},setGrpcImageMode:()=>{},setGrpcEncoder:()=>{},setGrpcInputSource:()=>{},streamStats:null,setStreamStatsEnabled:()=>{},webRtcCodec:"h264",setWebRtcCodec:()=>{},capabilities:{deviceSettings:!1,activity:!1,events:!1,camera:!1,accessibility:!1,streamSettings:!1,location:!1,permissions:!1},foregroundApp:null,videoKind:"img",attachVideo:()=>{},sendTouch:()=>{},sendKey:()=>!1,pressButton:()=>{},reload:()=>{},rotate:()=>{},screenshot:async()=>null,appearance:null,setAppearance:()=>{},hardwareKeyboardConnected:null,setHardwareKeyboardConnected:()=>{},toggleSoftwareKeyboard:()=>{}}},165,[166,167]);
|
|
232
232
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NO_PENDING_PERMISSION_WRITES",{enumerable:!0,get:function(){return n}}),e.asRecord=t,e.humanize=function(n){const t=n.slice(n.lastIndexOf(".")+1).toLowerCase().replace(/[_-]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)},e.errorMessage=o,e.readPermissions=async function(n,t,s){const c=await n.json().catch(()=>null),u=n.ok?t(c):null;if(u)return u;throw new Error(o(c,s))},e.heldPermissionIds=function(n,t,o,s){const c=new Set(n);for(const n of Object.keys(o))o[n]!==t[n]&&c.add(n);for(const n of s)c.delete(n);return c},e.applyPermissionsRead=function(n,t,o){return n&&0!==o.size?t.map(t=>o.has(t.id)?n.find(n=>n.id===t.id)??t:t):t};const n=new Set;function t(n){return!n||"object"!=typeof n||Array.isArray(n)?null:n}function o(n,o){const s=t(n)?.error;return"string"==typeof s&&s?s:o}},166,[]);
|
|
233
233
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NO_PENDING_CAMERA_WRITES",{enumerable:!0,get:function(){return t}});const t=new Set},167,[]);
|
|
234
234
|
__d(function(g,_r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidWsUrlFor=x,e.parseServeEmuStreamSettings=X,e.useAndroidDeviceClient=function(Q){const{baseUrl:Z,enabled:ee=!0,device:te=null,streamMode:re,token:ne=null}=Q,ae=ee&&!!Z,se=(0,t.useMemo)(()=>(0,_.sessionTokenFetch)(ne),[ne]),ie=(0,t.useMemo)(()=>(0,_.sessionTokenProtocols)("android",ne),[ne]),[oe,ce]=(0,t.useState)("idle"),[ue,le]=(0,t.useState)(null),[de,pe]=(0,t.useState)(null),[fe,me]=(0,t.useState)(0),[he,ye]=(0,t.useState)([]),[ge,Se]=(0,t.useState)(!1),[ve,be]=(0,t.useState)([]),[we,Ee]=(0,t.useState)(!1),[Ae,Ce]=(0,t.useState)(G),[ke,Ie]=(0,t.useState)(null),[Te,Re]=(0,t.useState)(null),[De,Me]=(0,t.useState)(null),[Ne,Oe]=(0,t.useState)(null),[_e,Pe]=(0,t.useState)(()=>new Set),[je,Le]=(0,t.useState)(null),[Ue,Fe]=(0,t.useState)(!1),[We,Ke]=(0,t.useState)(null),[Ve,$e]=(0,t.useState)(C.IDLE_STREAM_SWITCH),[He,ze]=(0,t.useState)(null),[qe,Je]=(0,t.useState)(null),Ye=ae?JSON.stringify([Z,te,ne]):null,{activityStatus:Ge,setActivityStatus:Be}=(0,a.useActivityStatus)(Ye),xe=(0,t.useRef)(0),[Qe,Xe]=(0,t.useState)(null),[Ze,et]=(0,t.useState)(null),tt=(0,t.useRef)(null),rt=(0,t.useRef)(null),[nt,at]=(0,t.useState)(!1),[st,it]=(0,t.useState)(null),[ot,ct]=(0,t.useState)(!1),[ut,lt]=(0,t.useState)(!1),dt=`${Z??""}\0${te??""}`,[pt,ft]=(0,t.useState)(dt);pt!==dt&&(ft(dt),at(!1),it(null),ct(!1),lt(!1));const mt=(0,t.useRef)(null),ht=(0,t.useRef)(null),yt=(0,t.useRef)(0),gt=(0,t.useRef)((0,d.createAndroidEventCursor)()),St=(0,t.useRef)(new b.KeyedWriteTracker),vt=(0,t.useRef)((0,p.createAndroidDeviceSettingVersions)()),bt=`${ae?"active":"inactive"}\0${Z??""}\0${te??""}`,[wt,Et]=(0,t.useState)({scope:bt,status:ae?"unknown":null});wt.scope!==bt&&Et({scope:bt,status:ae?"unknown":null});const At=(0,t.useRef)(bt),Ct=(0,t.useMemo)(()=>({deviceScope:bt,token:ne}),[bt,ne]),kt=(0,t.useRef)(Ct);(0,t.useLayoutEffect)(()=>{At.current=bt,kt.current=Ct},[bt,Ct]);const It=(0,t.useRef)(0),Tt=(0,t.useRef)(null),Rt=(0,t.useRef)(!1),Dt=(0,t.useRef)(C.IDLE_STREAM_SWITCH),Mt=(0,t.useRef)(null),Nt=(0,t.useRef)(!1),Ot=(0,t.useRef)(null),_t=(0,t.useRef)(null),Pt=(0,t.useCallback)(()=>{++It.current,_t.current?.abort(),_t.current=null},[]),jt=(0,t.useCallback)(()=>{const t=Mt.current;t&&(Mt.current=null,Tt.current=t,Le(t))},[]),Lt=(0,t.useCallback)(t=>{const r=(0,C.reduceStreamSwitch)(Dt.current,t);return r!==Dt.current&&(Dt.current=r,$e(r)),(0,C.isStreamSwitchPending)(r)||jt(),r},[jt]),Ut=(0,t.useCallback)(()=>{Mt.current=null,Dt.current=C.IDLE_STREAM_SWITCH,$e(C.IDLE_STREAM_SWITCH)},[]);(0,t.useEffect)(()=>()=>{Ot.current?.abort(),_t.current?.abort()},[]);const Ft=(0,t.useCallback)(t=>{ht.current="CANVAS"===t?.tagName?t:null;const r="VIDEO"===t?.tagName?t:null;tt.current=r,et(t=>t===r?t:r)},[]),Wt=(0,t.useCallback)(()=>Se(!0),[]),Kt=(0,t.useCallback)(()=>Se(!1),[]),Vt=(0,t.useCallback)(()=>ye([]),[]),$t=(0,t.useCallback)(()=>Ee(!0),[]),Ht=(0,t.useCallback)(()=>Ee(!1),[]),zt=(0,t.useCallback)(()=>{gt.current=(0,d.clearAndroidEventCursor)(gt.current),be([])},[]),qt=(0,t.useCallback)(t=>{if(!ae||kt.current!==Ct)return!1;const r=mt.current;return!(!r||r.readyState!==WebSocket.OPEN)&&(r.send(JSON.stringify(Object.assign({ack:!1},t))),!0)},[ae,Ct]),Jt=(0,t.useCallback)(t=>{qt((0,y.androidTouchMessage)(t.phase,t,0))},[qt]),Yt=(0,t.useCallback)(t=>{qt((0,y.androidTouchMessage)(t.phase,t.a,0)),qt((0,y.androidTouchMessage)(t.phase,t.b,1))},[qt]),Gt=(0,t.useCallback)(t=>{const r=B[t];r&&qt(r)},[qt]),Bt=(0,t.useCallback)(t=>{const r=(0,w.androidMessageForKeyboardInput)(t);return!!r&&qt(r)},[qt]),xt=(0,t.useCallback)(()=>{qt({type:"key",keycode:Y,record:!1})},[qt]),Qt=(0,t.useCallback)(()=>{if(!Z)return;const t=de&&de.width>de.height?"portrait":"landscape",r=`${(0,o.apiUrl)(Z,"/api/orientation")}${te?`?device=${encodeURIComponent(te)}`:""}`;se(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orientation:t})}).catch(()=>{})},[Z,te,de,se]),Xt=(0,t.useCallback)(async()=>Z?(0,O.fetchScreenshot)(Z,te,se):null,[Z,te,se]),Zt=(0,t.useCallback)((t,r)=>{if(!Z)return;const n=(0,p.androidDeviceSettingRequest)(t,r);if(!n)return;const a=t,s=St.current,c=s.start(t);if(!c)return;vt.current[a]++;const u=bt,l=Te?.[t],d=(0,o.deviceApiUrl)(Z,n.path,te);Pe(s.pending),Re(n=>Object.assign({},n??{},{[t]:r})),"appearance"===t&&Ie(r),se(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n.body)}).then(async r=>{if(!r.ok)throw new Error(`Device option update failed (${r.status})`);const n=await r.json(),o=(0,p.parseAndroidDeviceSetting)(a,n);if(null===o)throw new Error("Device option update was rejected");s.isCurrent(c)&&At.current===u&&(Re(r=>Object.assign({},r??{},{[t]:o})),"appearance"===t&&Ie(o))}).catch(async()=>{if(!s.isCurrent(c)||At.current!==u)return;let r=null;try{const t=await se(d,{cache:"no-store"});if(!t.ok)throw new Error("Device option refresh failed");r=(0,p.parseAndroidDeviceSetting)(a,await t.json())}catch{r=l??null}s.isCurrent(c)&&At.current===u&&(Re(n=>(0,S.mergeAuthoritativeDeviceSetting)(n,t,null===r?{}:{[t]:r})),"appearance"===t&&Ie("light"===r||"dark"===r?r:null))}).finally(()=>{s.finish(c)&&Pe(s.pending)})},[Z,bt,Te,te,se]),er=(0,t.useCallback)(t=>Zt("appearance",t),[Zt]),{camera:tr,cameraSupported:rr,cameraPending:nr,cameraError:ar,setCameraImage:sr,clearCameraImage:ir}=(0,I.useAndroidCamera)({active:ae,baseUrl:Z??null,device:te,scope:bt,scopeRef:At,token:ne}),or=(0,t.useMemo)(()=>ae&&Z?t=>(0,r.loadAndroidAccessibility)((0,o.deviceApiUrl)(Z,"/api/accessibility",te),t,se):null,[ae,Z,te,se]),cr=(0,k.useAccessibility)(or),ur=ae&&Z?(0,o.deviceApiUrl)(Z,"/api/location",te):null,lr=(0,t.useMemo)(()=>null===ur?null:{read:t=>(0,c.readAndroidLocation)(se,ur,t),set:t=>(0,c.writeAndroidLocation)(se,ur,t)},[ur,se]),{location:dr,locationPending:pr,locationError:fr,setLocation:mr,clearLocation:hr,locationCapabilities:yr}=(0,T.useDeviceLocation)(lr),gr=(0,t.useMemo)(()=>ae&&Z?(0,u.androidPermissionsBackend)(Z,te,se):null,[ae,Z,te,se]),Sr=(0,R.useAppPermissions)({active:ae,appId:He?.id??null,backend:gr}),vr=ae&&Z?(0,o.deviceApiUrl)(Z,"/api/stream-settings",te):null,br=ae&&Z?(0,o.deviceApiUrl)(Z,"/api/stream-mode",te):null,{streamSettings:wr,streamSettingsPending:Er,updateStreamSettings:Ar,refreshStreamSettings:Cr}=(0,D.useStreamSettingsResource)({url:vr,initialSettings:null,parse:f.parseAndroidStreamSettings,toPatch:f.androidStreamSettingsPatch,fetchImpl:se}),kr=(0,t.useCallback)(async(t=!1)=>{if(!br||Ot.current||_t.current||(0,C.isStreamSwitchPending)(Dt.current))return;const r=++It.current,n=new AbortController;_t.current=n;try{const t=await se(br,{cache:"no-store",signal:n.signal});if(!t.ok)throw new Error(`Stream source request failed (${t.status})`);const a=(0,h.parseAndroidStreamSource)(await t.json());if(!a)throw new Error("Stream source request returned an invalid response");n.signal.aborted||It.current!==r||(Tt.current=a,Le(t=>t?.mode===a.mode&&t.grpcImageMode===a.grpcImageMode&&t.encoder===a.encoder&&t.encoderName===a.encoderName&&t.availableEncoders.join()===a.availableEncoders.join()&&t.hardwareEncoderError===a.hardwareEncoderError&&t.inputSource===a.inputSource&&t.sessionGeneration===a.sessionGeneration&&t.availableModes.join()===a.availableModes.join()&&t.availableInputSources.join()===a.availableInputSources.join()?t:a))}catch{}finally{_t.current===n&&(_t.current=null),t&&!n.signal.aborted&&It.current===r&&(Rt.current=!1,Fe(!1))}},[br,se]),Ir=(0,t.useCallback)(t=>{if(!br||Rt.current||(0,C.isStreamSwitchPending)(Dt.current))return;const r=Tt.current?.sessionGeneration??null,n=++It.current,a=new AbortController;Ot.current=a,Mt.current=null,Lt({type:"request-start",live:Nt.current}),Ke(null);let s=!1;se(br,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:a.signal}).then(async t=>{if(!t.ok){let r=null;try{r=await t.json()}catch{}throw new Error((0,h.androidStreamSourceErrorMessage)(t.status,r))}const a=(0,h.parseAndroidStreamSource)(await t.json());if(!a)throw new Error("Stream mode update returned an invalid response");It.current===n&&(Ke(null),Mt.current=a,Lt({type:"request-success",replaced:a.sessionGeneration!==r}))}).catch(t=>{a.signal.aborted||It.current!==n||(Ke(t instanceof Error?t.message:"Unable to change stream source."),s=!0,Lt({type:"request-failure"}))}).finally(()=>{Ot.current===a&&(Ot.current=null,s&&kr())})},[Lt,kr,br,se]),Tr=(0,t.useCallback)(t=>{const r=Tt.current;r&&r.mode!==t&&r.availableModes.includes(t)&&Ir({mode:t})},[Ir]),Rr=(0,t.useCallback)(t=>{const r=Tt.current;r&&"grpc-screenshot"===r.mode&&r.grpcImageMode!==t&&Ir({mode:r.mode,grpcImageMode:t,inputSource:r.inputSource})},[Ir]),Dr=(0,t.useCallback)(t=>{const r=Tt.current;r&&"grpc-screenshot"===r.mode&&r.encoder!==t&&r.availableEncoders.includes(t)&&Ir({mode:r.mode,grpcImageMode:r.grpcImageMode,inputSource:r.inputSource,encoder:t})},[Ir]),Mr=(0,t.useCallback)(t=>{const r=Tt.current;r&&"grpc-screenshot"===r.mode&&r.inputSource!==t&&r.availableInputSources.includes(t)&&Ir({mode:r.mode,grpcImageMode:r.grpcImageMode,inputSource:t})},[Ir]);(0,t.useEffect)(()=>(Ot.current?.abort(),Ot.current=null,Pt(),Tt.current=null,Le(null),Ke(null),Ut(),br?(Rt.current=!0,Fe(!0),kr(!0),Pt):(Rt.current=!1,void Fe(!1))),[Pt,kr,Ut,br]),(0,t.useEffect)(()=>{const t=(0,C.streamSwitchTimeoutMs)(Ve.phase);if(null===t)return;const r=setTimeout(()=>Lt({type:"timeout"}),t);return()=>clearTimeout(r)},[Lt,Ve]),(0,t.useEffect)(()=>{const t="streaming"===oe,r=Nt.current;Nt.current=t,r&&!t?Lt({type:"stream-interrupted"}):!r&&t&&Lt({type:"stream-live"})},[Lt,oe]),(0,t.useEffect)(()=>{if(!vr&&!br)return;const t=()=>{"undefined"!=typeof document&&document.hidden||(Cr(),kr())},r=setInterval(t,V);return"undefined"!=typeof document&&document.addEventListener("visibilitychange",t),()=>{clearInterval(r),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",t)}},[Cr,kr,vr,br]),(0,t.useEffect)(()=>{if(Xe(null),!ae||!Z)return;let t=!1,r=!1,n=null;const a=(0,o.deviceApiUrl)(Z,"/api",te),s=async()=>{if(!t&&!r){r=!0,n=new AbortController;try{const r=await se(a,{cache:"no-store",signal:n.signal});if(!r.ok)return;const s=await r.json();if(t)return;const o=X(s.stream)??{transport:"websocket"},c=(0,N.parseScreenRecordingStatus)(s.screenRecording);Et(t=>t.scope===bt&&t.status===c?t:{scope:bt,status:c}),Xe(t=>JSON.stringify(t)===JSON.stringify(o)?t:o);const u=Number(s.size?.width),l=Number(s.size?.height);u>0&&l>0&&pe(t=>t?.width===u&&t.height===l?t:{width:u,height:l})}catch{}finally{r=!1,n=null}}};s();const c=setInterval(s,K);return()=>{t=!0,clearInterval(c),n?.abort()}},[ae,Z,bt,te,se]);const Nr="webrtc"===re,Or=Nr&&null===Qe,Pr=Nr&&"webrtc"===Qe?.transport,jr=(0,t.useCallback)(()=>{qt({type:"reset-video"})},[qt]),Lr=(0,t.useCallback)(()=>{const t=Ze,r=rt.current;if(t&&t.srcObject&&r?.video===t&&r.stream===t.srcObject&&r.scope===bt){if(!t.poster&&t.readyState>=2&&t.videoWidth>0&&t.videoHeight>0)try{const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const n=r.getContext("2d");if(n){n.drawImage(t,0,0);const a=r.toDataURL("image/png");a&&"data:,"!==a&&(t.poster=a)}}catch{}t.poster&&(t.srcObject=null)}},[bt,Ze]),{stream:Ur,error:Fr,markFrameDecoded:Wr,restart:Kr,streamStats:Vr,setStreamStatsEnabled:$r}=(0,P.useWebRtcStream)({offerUrl:Z?(0,o.deviceApiUrl)(Z,"/webrtc/offer",te):"",closeUrl:Z?(0,o.deviceApiUrl)(Z,"/webrtc/close",te):"",closeBeaconUrl:Z?(0,_.withSessionTokenQuery)((0,o.deviceApiUrl)(Z,"/webrtc/close",te),ne):"",statsUrl:Z?(0,o.deviceApiUrl)(Z,"/webrtc/stats",te):"",enabled:ae&&Pr,codec:"h264",iceServers:"webrtc"===Qe?.transport?Qe.iceServers:void 0,iceTransportPolicy:"webrtc"===Qe?.transport?Qe.iceTransportPolicy:"all",sendIceServersInOffer:!1,allowCodecFallback:!1,expectContinuousFrames:!1,onKeyframeNeeded:jr,onBeforeDisconnect:Lr,fetchImpl:se}),Hr=(0,t.useCallback)(()=>{Lr(),Kr()},[Lr,Kr]),zr=(0,t.useRef)(Hr);(0,t.useLayoutEffect)(()=>{zr.current=Hr},[Hr]);const qr=(0,t.useCallback)(t=>{if(Rt.current||(0,C.isStreamSwitchPending)(Dt.current))return;const r=Ar(t);if(!r||!Pr)return;const n=++It.current;Lt({type:"request-start",live:Nt.current}),r.then(t=>{It.current===n&&(t?(zr.current(),Lt({type:"request-success",replaced:!0})):Lt({type:"request-failure"}))})},[Lt,Pr,Ar]),Jr=Pr&&!Fr&&!!Ur&&nt;(0,t.useEffect)(()=>{if(!Pr)return ct(!1),void lt(!1);if(Jr)return ct(!0),void lt(!1);if(!ot)return;const t=setTimeout(()=>lt(!0),A.STREAM_RECONNECT_GRACE_MS);return()=>clearTimeout(t)},[Pr,Jr,ot]),(0,t.useEffect)(()=>{if(!Pr)return at(!1),void it(null);Jr?(ce("streaming"),le(null)):!ot||ut&&"awaiting-frame"!==Ve.phase?Fr?(ce("error"),le(Fr)):st?(ce("error"),le(st)):(ce("connecting"),le(null)):(ce("reconnecting"),le(null))},[Pr,Fr,ut,st,Jr,ot,Ve.phase]),(0,t.useEffect)(()=>{if(!Pr)return;const t=Ze;if(!t||!Ur)return;let r=!1,n=!0,a=0,s=0,o=performance.now(),c=null;const u=(a=1)=>{if(r)return;if(t.videoWidth>0&&t.videoHeight>0){const r=t.videoWidth,n=t.videoHeight;pe(t=>t?.width===r&&t.height===n?t:{width:r,height:n})}n&&(n=!1,t.removeAttribute("poster"),at(!0)),Wr(a),s+=a;const c=performance.now();if(c-o>=1e3){const t=Math.round(1e3*s/(c-o));s=0,o=c,me(r=>r===t?r:t)}},l=(n,s)=>{if(r)return;const o=(0,j.presentedVideoFrameDelta)(c,s.presentedFrames);Number.isSafeInteger(s.presentedFrames)&&s.presentedFrames>=0&&(c=s.presentedFrames),u(o),a=t.requestVideoFrameCallback(l)},d=()=>u(),p=()=>u(0),f=()=>{const n=rt.current;r||document.hidden||tt.current!==t||n?.video!==t||n.stream!==Ur||n.scope!==At.current||!t.paused||t.play().catch(()=>{})};return t.srcObject=Ur,rt.current={video:t,stream:Ur,scope:At.current},at(!1),"function"==typeof t.requestVideoFrameCallback?a=t.requestVideoFrameCallback(l):t.addEventListener("timeupdate",d),t.addEventListener("loadeddata",p,{once:!0}),document.addEventListener("visibilitychange",f),t.play().catch(()=>{}),()=>{r=!0,document.removeEventListener("visibilitychange",f),t.removeEventListener("loadeddata",p),t.removeEventListener("timeupdate",d),a&&"function"==typeof t.cancelVideoFrameCallback&&t.cancelVideoFrameCallback(a),at(!1),me(0)}},[Pr,Ur,Ze,Wr]),(0,t.useEffect)(()=>{if(!Pr)return;const t=Ze;return t?()=>{t.removeAttribute("poster"),t.srcObject=null}:void 0},[Pr,Ze,Z,te]),(0,t.useEffect)(()=>{if(!ae||!Z)return void ce("idle");if(Or)return ce("connecting"),void le(null);if(Pr)return;const t=!(0,v.isWebCodecsSupported)();if(t&&!E.MsePlayer.isSupported())return ce("error"),void le("This browser cannot decode H.264 (WebCodecs unavailable).");ce("connecting"),le(null);let r=!1,n=null,a=!1,s=A.RECONNECT_BASE_DELAY_MS,o=null,c=null,u=null,l=!1,d=!1,p=0,f=0,h=0,y=performance.now();const S=()=>{if(u&&"closed"!==u.state)try{u.close()}catch{}u=null},b=()=>{const t=mt.current,r=performance.now();t&&t.readyState===WebSocket.OPEN&&(r-p<U||(p=r,t.send(JSON.stringify({type:"reset-video",ack:!1}))))},w=()=>{c&&clearTimeout(c),c=null},C=()=>{r||a||(a=!0,w(),ce("streaming"),le(null))},k=t=>{const r=ht.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,pe({width:t.displayWidth,height:t.displayHeight})),n.drawImage(t,0,0),t.close(),C(),h++;const a=performance.now();if(a-y>=1e3){const t=Math.round(1e3*h/(a-y));h=0,y=a,me(r=>r===t?r:t)}},I=t=>{if("configured"===u?.state)return!0;S();const n=new VideoDecoder({output:t=>{r||u!==n?t.close():k(t)},error:()=>{u===n&&(S(),l=!1,d=!0,b())}});try{return n.configure({codec:(0,v.buildCodecString)(t),optimizeForLatency:!0}),u=n,!0}catch{try{n.close()}catch{}return b(),!1}},T=a=>{const s=(0,v.parseFramePacket)(a);if(t){const t=s.isKey??(0,v.scanAU)(s.data).isKey;if(!n){const t=ht.current;if(!t)return void b();n=new E.MsePlayer(t,{onFirstFrame:C,onResize:(t,n)=>{r||pe({width:t,height:n})},onFps:t=>{r||me(r=>r===t?r:t)},onError:t=>{r||(ce("error"),le(t))},requestKeyframe:b})}return void n.feed(s.data,t,s.timestamp)}const o=null===s.isKey||s.isKey&&(!u||"configured"!==u.state||d)?(0,v.scanAU)(s.data):null,c=s.isKey??o?.isKey??!1,p=o?.spsBytes??null;if(!p||I(p)){if(d){if(!c)return;if(!u||"configured"!==u.state)return void b();d=!1}if(u&&"configured"===u.state){if(u.decodeQueueSize>L)return S(),l=!1,d=!0,void b();if(!l){if(!c)return void b();l=!0}try{u.decode(new EncodedVideoChunk({type:c?"key":"delta",timestamp:s.timestamp??Math.round(1e6*f/60),data:s.data})),f++}catch{S(),l=!1,d=!0,b()}}else c||b()}},R=()=>{if(r)return;let u;try{u=new WebSocket(x(Z,te,!0),ie)}catch(t){return ce("error"),void le(t instanceof Error?t.message:"Invalid server URL")}u.binaryType="arraybuffer",mt.current=u,u.onopen=()=>{r||(s=A.RECONNECT_BASE_DELAY_MS,t&&b())},u.onerror=()=>{},u.onclose=t=>{if(r)return;S(),n?.destroy(),n=null,l=!1,f=0;const u=a;a&&(a=!1,ce("reconnecting"),le(null),c||(c=setTimeout(()=>{c=null,r||a||(ce("error"),le(t=>t??"Disconnected \u2014 retrying\u2026"))},A.STREAM_RECONNECT_GRACE_MS)));const d=(0,A.scheduleReconnect)({code:t.code,wasHealthy:u,currentDelay:s});s=d.nextDelay,o=setTimeout(R,d.retryIn)},u.onmessage=t=>{if(!r)if("string"!=typeof t.data)T(t.data);else try{const r=JSON.parse(t.data);"video-session"===r.type&&r.size&&Number.isFinite(r.size.width)&&Number.isFinite(r.size.height)&&(S(),n?.destroy(),n=null,f=0,l=!1,d=!0,pe({width:r.size.width,height:r.size.height}),b())}catch{}}};return R(),()=>{r=!0,o&&clearTimeout(o),w(),S(),n?.destroy(),n=null;try{mt.current?.close()}catch{}mt.current=null,ce("idle"),pe(null),me(0)}},[ae,Z,te,Or,Pr,ie]),(0,t.useEffect)(()=>{if(!ae||!Z||!Pr)return void it(null);let t=!1,r=A.RECONNECT_BASE_DELAY_MS,n=null,a=!1;const s=x(Z,te,!1);it(null);const o=(a,s,o)=>{if(t)return;it(a);const u=(0,A.scheduleReconnect)({code:s,wasHealthy:o,currentDelay:r});r=u.nextDelay,n=setTimeout(c,u.retryIn)};function c(){if(t)return;let n;try{n=new WebSocket(s,ie)}catch{return void o("WebRTC input connection failed. Retrying...",1006,!1)}mt.current=n,n.onopen=()=>{t||(a=!0,r=A.RECONNECT_BASE_DELAY_MS,it(null),n.send(JSON.stringify({type:"reset-video",ack:!1})))},n.onerror=()=>{},n.onclose=r=>{if(t)return;mt.current===n&&(mt.current=null);const s=a;a=!1,s&&(0,A.isDeliberateServerClose)(r.code)&&zr.current(),o("WebRTC input disconnected. Retrying...",r.code,s)},n.onmessage=r=>{if(!t&&"string"==typeof r.data)try{const t=JSON.parse(r.data);!1===t.ok&&t.error&&le(t.error)}catch{}}}return c(),()=>{t=!0,n&&clearTimeout(n);const r=mt.current;try{r?.close()}catch{}mt.current===r&&(mt.current=null)}},[ae,Z,te,Pr,ie]),(0,t.useEffect)(()=>{if(!ge||!ae||!Z)return;let t=null;try{t=new EventSource((0,_.withSessionTokenQuery)((0,o.apiUrl)(Z,"/api/logcat"+(te?`?device=${encodeURIComponent(te)}`:"")),ne))}catch{return}return t.addEventListener("log",t=>{try{const r=JSON.parse(t.data);ye(t=>[...t,{id:"a"+ ++yt.current,source:"logcat",message:r.line}].slice(-200))}catch{}}),()=>t?.close()},[ge,ae,Z,te,ne]),(0,t.useEffect)(()=>{if(xe.current=0,!ae||!Z)return void Je(null);Je(s.EMPTY_ANDROID_ACTIVITY);let t,r=!1;try{t=new EventSource((0,_.withSessionTokenQuery)((0,o.deviceApiUrl)(Z,"/api/metrics",te),ne))}catch{return Be("error"),void Je(Object.assign({},s.EMPTY_ANDROID_ACTIVITY,{errored:!0}))}const a=t=>{if(r)return;const a=(0,s.parseAndroidActivityFrame)(t.type,String(t.data));a&&(Be("ready"),"meta"!==a.kind?(xe.current=Date.now(),Je(t=>(0,n.appendActivitySample)(t??s.EMPTY_ANDROID_ACTIVITY,a.sample))):Je(t=>t&&(t.hostCores!==a.hostCores||t.errored)?Object.assign({},t,{hostCores:a.hostCores,errored:!1}):t))};t.addEventListener("meta",a),t.addEventListener("message",a),t.onerror=()=>{r||(Be("error"),Je(t=>t&&!t.errored?Object.assign({},t,{errored:!0}):t))};const c=Date.now(),u=setInterval(()=>{r||(0===xe.current&&Date.now()-c>s.ANDROID_ACTIVITY_STALE_MS&&Be("error"),Je(t=>{if(!t)return t;const r={openedAt:c,lastSampleAt:xe.current,now:Date.now()};return(0,s.nextAndroidActivityAfterSilence)(t,r)??t}))},1e3);return()=>{r=!0,clearInterval(u),t.close()}},[ae,Z,te,ne,Be]),(0,t.useEffect)(()=>{be([]),gt.current=(0,d.createAndroidEventCursor)()},[Z,te]),(0,t.useEffect)(()=>{if(!we||!ae||!Z)return;let t=!1,r=!1,n=null;const a=`${(0,o.apiUrl)(Z,"/api/session")}${te?`?device=${encodeURIComponent(te)}`:""}`,s=te??"default",c=async()=>{if(!t&&!r){r=!0,n=new AbortController;try{const r=await se(a,{cache:"no-store",signal:n.signal});if(!r.ok)return;const o=await r.json();if(t||!Array.isArray(o.events))return;const c=o.events;gt.current=(0,d.mergeAndroidEventSnapshotCursor)(gt.current,c),be(t=>(0,d.reconcileAndroidSessionEvents)(t,c.filter(t=>t.id>gt.current.clearedThroughId),s))}catch{}finally{r=!1,n=null}}};c();const u=setInterval(c,W);return()=>{t=!0,clearInterval(u),n?.abort()}},[we,ae,Z,te,se]),(0,t.useEffect)(()=>{if(!ae||!Z)return void Ce(G);let t=!1;return se((0,o.apiUrl)(Z,"/api/devices")).then(t=>t.json()).then(r=>{if(t||!Array.isArray(r.devices)||0===r.devices.length)return;const n=te??r.defaultSerial??null;Ce(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}},[ae,Z,te,se]),(0,t.useEffect)(()=>{if(ze(null),!ae||!Z)return;let t=!1;const r=`${(0,o.apiUrl)(Z,"/api/foreground")}${te?`?device=${encodeURIComponent(te)}`:""}`,n=async()=>{try{const n=await se(r,{cache:"no-store"}),a=await n.json();if(t||!a.ok||!a.app?.packageName)return;const s={id:a.app.packageName,label:a.app.label??void 0,pid:a.app.pid??void 0,activity:a.app.activity??void 0,version:a.app.versionName??void 0,build:a.app.versionCode??void 0,minSdk:a.app.minSdk??void 0,debuggable:a.app.debuggable??void 0};ze(t=>{return t&&(n=s,(r=t).id===n.id&&r.label===n.label&&r.pid===n.pid&&r.activity===n.activity&&r.version===n.version&&r.build===n.build&&r.minSdk===n.minSdk&&r.debuggable===n.debuggable)?t:(0,l.carryForwardAppIcon)(t,s);var r,n})}catch{}};n();const a=setInterval(n,F);return()=>{t=!0,clearInterval(a)}},[ae,Z,te,se]);const Yr=He?.id??null;(0,t.useEffect)(()=>{if(!ae||!Z||!Yr)return;let t=!1;return(0,l.fetchAndroidAppIcon)(Z,te,Yr,se).then(r=>{!t&&r&&ze(t=>t&&t.id===Yr?Object.assign({},t,{iconDataUrl:r}):t)}).catch(()=>{}),()=>{t=!0}},[ae,Z,te,Yr,se]);const Gr=ae&&Z?JSON.stringify([Z,te,ne]):null,{deviceSettingsStatus:Br,resetRead:xr,settleRead:Qr}=(0,M.useDeviceSettingsReadStatus)(Gr);(0,t.useEffect)(()=>{const t=St.current;t.reset();for(const t of p.ANDROID_DEVICE_SETTING_KEYS)vt.current[t]++;if(Pe(new Set),Re(null),xr(),Ie(null),Me(null),Oe(null),!ae||!Z)return;let r=!1,n=!1,a=!1,s=0,c=null,u=[];const l=bt,d="undefined"==typeof document?null:document,f=()=>!0===d?.hidden,h=()=>{c&&clearTimeout(c),c=null},y=async n=>{const a=[];u=a;const c=await Promise.all(p.ANDROID_DEVICE_SETTING_KEYS.map(async r=>{const n=vt.current[r],s=t.pending.has(r),c=new AbortController;a.push(c);try{const t=await se((0,o.deviceApiUrl)(Z,(0,p.androidDeviceSettingPathFor)(r),te),{cache:"no-store",signal:AbortSignal.any([c.signal,AbortSignal.timeout(H)])});if(!t.ok)return{key:r,version:n,pendingAtStart:s,handled:!1};const a=await t.json();return a&&"object"==typeof a&&"ok"in a&&!0===a.ok?{key:r,version:n,pendingAtStart:s,handled:!0,value:(0,p.parseAndroidDeviceSetting)(r,a),payload:a}:{key:r,version:n,pendingAtStart:s,handled:!1}}catch{return{key:r,version:n,pendingAtStart:s,handled:!1}}}));if(r||At.current!==l||n!==s)return;if(!c.some(t=>t.handled))return void Qr("error");Re(r=>{let n=r??{};for(const a of c)a.handled&&(a.pendingAtStart||vt.current[a.key]===a.version&&(t.pending.has(a.key)||(null!==a.value||Object.hasOwn(n,a.key))&&(null!==a.value&&n[a.key]===a.value||(n===r&&(n=Object.assign({},n)),null===a.value?delete n[a.key]:n[a.key]=a.value))));return n}),Qr("ready");const d=c.find(t=>"appearance"===t.key);!d?.handled||d.pendingAtStart||vt.current.appearance!==d.version||t.pending.has("appearance")||"light"!==d.value&&"dark"!==d.value||Ie(d.value);const f=c.find(t=>"display-size"===t.key);!f||f.pendingAtStart||vt.current["display-size"]!==f.version||t.pending.has("display-size")||Me(f.handled?(0,p.androidDisplayWidthDpFromPayload)(f.payload):null)},S=async()=>{if(r||f())return;const t=++s;if(n)a=!0;else{h(),a=!1,n=!0;try{await y(t)}finally{n=!1,r||f()||(a?S():c=setTimeout(()=>{S()},$))}}},v=()=>{f()?(a=!1,h()):S()};return d?.addEventListener("visibilitychange",v),S(),se((0,o.deviceApiUrl)(Z,"/api/software-keyboard",te),{cache:"no-store"}).then(t=>t.ok?t.json():null).then(t=>{if(r||At.current!==bt)return;const n=t?.softwareKeyboard;"boolean"==typeof n?.hardwareKeyboard&&Oe(n.hardwareKeyboard)}).catch(()=>{}),()=>{r=!0,h(),d?.removeEventListener("visibilitychange",v);for(const t of u)t.abort();t.reset()}},[ae,Z,bt,te,se,xr,Qr]);const Xr="webrtc"===Qe?.transport,Zr=(0,t.useMemo)(()=>({modeAvailability:{mjpeg:!1,h264:!0,webrtc:Xr},httpCodecs:q,webRtcCodecs:q}),[Xr]),en=null!==or,tn=null!==gr,rn=(0,t.useMemo)(()=>({deviceSettings:!0,activity:!0,events:!0,camera:rr,accessibility:en,location:yr,permissions:tn,streamSettings:J}),[rr,en,yr,tn]);return Object.assign({platform:"android",status:"streaming"===oe&&((0,C.isStreamSwitchPending)(Ve)||Er)?"reconnecting":oe,error:ue,inputError:st,screen:de,fps:fe,devices:Ae,logs:he,logsEnabled:ge,attachLogs:Wt,detachLogs:Kt,clearLogs:Vt,events:ve,eventsEnabled:we,attachEvents:$t,detachEvents:Ht,clearEvents:zt,activity:qe,activityStatus:Ge,deviceSettings:Te,deviceSettingsStatus:Br,deviceSettingsPending:_e,setDeviceSetting:Zt,displayWidthDp:De,camera:tr,cameraPending:nr,cameraError:ar,setCameraImage:sr,clearCameraImage:ir},cr,{location:dr,locationPending:pr,locationError:fr,setLocation:mr,clearLocation:hr},Sr,{streamSettings:wr,streamSettingsPending:Er||Ue||(0,C.isStreamSwitchPending)(Ve),updateStreamSettings:qr,streamSource:je,screenRecording:wt.scope===bt?wt.status:ae?"unknown":null,streamSourcePending:Ue||(0,C.isStreamSwitchPending)(Ve),streamSourceError:We,setStreamSource:Tr,setGrpcImageMode:Rr,setGrpcEncoder:Dr,setGrpcInputSource:Mr,streamStats:Vr,setStreamStatsEnabled:$r,webRtcCodec:"h264",setWebRtcCodec:z,streamCapabilities:Zr,capabilities:rn,foregroundApp:He,videoKind:Pr?"video":"canvas",attachVideo:Ft,sendTouch:Jt,sendMultiTouch:Yt,sendKey:Bt,pressButton:Gt,reload:xt,rotate:Qt,screenshot:Xt,appearance:ke,setAppearance:er,hardwareKeyboardConnected:Ne,setHardwareKeyboardConnected:z,toggleSoftwareKeyboard:z})};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]),a=_r(_d[3]),s=_r(_d[4]),o=_r(_d[5]),c=_r(_d[6]),u=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),p=_r(_d[10]),f=_r(_d[11]),h=_r(_d[12]),y=_r(_d[13]),S=_r(_d[14]),v=_r(_d[15]),b=_r(_d[16]),w=_r(_d[17]),E=_r(_d[18]),A=_r(_d[19]),C=_r(_d[20]),k=_r(_d[21]),I=_r(_d[22]),T=_r(_d[23]),R=_r(_d[24]),D=_r(_d[25]),M=_r(_d[26]),N=_r(_d[27]),O=_r(_d[28]),_=_r(_d[29]),P=_r(_d[30]),j=_r(_d[31]);const L=4,U=1500,F=5e3,W=1e3,K=1500,V=3e3,$=5e3,H=5e3,z=()=>{},q=["h264"],J={maxDimension:!0,h264Fps:!0,h264Bitrate:!0},Y=46;const G=[{id:"android",name:"Emulator Android",platform:"android",current:!0}],B={home:{type:"home"},back:{type:"back"},recents:{type:"recents"},appSwitcher:{type:"recents"},power:{type:"power"},hideKeyboard:{type:"key",keycode:111}};function x(t,r,n){const a=new URL((0,o.apiUrl)(t,"/ws"));return a.protocol="https:"===a.protocol?"wss:":"ws:",n?a.searchParams.set("frame-meta","1"):a.searchParams.set("video","0"),r&&a.searchParams.set("device",r),a.toString()}function Q(t){if(!t||"object"!=typeof t||Array.isArray(t))return!1;const r=t;return Array.isArray(r.urls)&&r.urls.length>0&&r.urls.every(t=>"string"==typeof t)&&(void 0===r.username||"string"==typeof r.username)&&(void 0===r.credential||"string"==typeof r.credential)}function X(t){if(!t||"object"!=typeof t||Array.isArray(t))return null;const r=t;return"websocket"===r.transport?{transport:"websocket"}:"webrtc"!==r.transport||"h264"!==r.codec||!Array.isArray(r.iceServers)||!r.iceServers.every(Q)||"all"!==r.iceTransportPolicy&&"relay"!==r.iceTransportPolicy?null:{transport:"webrtc",codec:"h264",iceServers:r.iceServers,iceTransportPolicy:r.iceTransportPolicy}}},168,[38,169,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,190,191,192,193,196,197,198,199,151,200,195,201,210]);
|
|
235
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_AX_SETTLE_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"IOS_CLICKABLE_ROLES",{enumerable:!0,get:function(){return o}}),e.parseAndroidAccessibility=A,e.parseIosAccessibility=k,e.loadAndroidAccessibility=async function(t,n,o=fetch){const l=await o(t,{cache:
|
|
236
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,l){let s,o=`${t}${n}`.replace(/\r\n/g,
|
|
237
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_ACTIVITY_SAMPLES",{enumerable:!0,get:function(){return n}}),e.parseActivitySample=function(n){if(!n||
|
|
235
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_AX_SETTLE_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"IOS_CLICKABLE_ROLES",{enumerable:!0,get:function(){return o}}),e.parseAndroidAccessibility=A,e.parseIosAccessibility=k,e.loadAndroidAccessibility=async function(t,n,o=fetch){const l=await o(t,{cache:"no-store",signal:n});let s;try{s=await l.json()}catch{return{ok:!1,error:`Accessibility read failed (HTTP ${l.status})`}}return A(s)},e.loadIosAccessibility=async function(o,s,c=fetch,u=Date.now){const f=await(0,t.readSseSnapshot)(o,{fetchImpl:c,signal:s,settleMs:n});if(null===f)return{ok:!1,error:"No accessibility snapshot received"};let h;try{h=JSON.parse(f)}catch{return{ok:!1,error:l}}return k(h,u())};var t=r(d[0]);const n=2e3,o=new Set(["button","link","cell","switch","tab","toggle","checkbox","menu item","slider","stepper","text field","search field","search text field"]),l="Malformed accessibility response";function s(t){return t&&"object"==typeof t&&!Array.isArray(t)?t:null}function c(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function u(t){return"string"==typeof t?t:""}function f(t){const n=s(t);return u(n?.message)||u(t)}function h(t){return Math.min(Math.max(t,0),1)}function b(t,n,o,l,s,c){const u=h(t/s),f=h(n/c),b=h(o/s)-u,p=h(l/c)-f;return b<=0||p<=0?null:{x:u,y:f,width:b,height:p}}function p(t,n){const o=t.lastIndexOf(n);return-1===o?t:t.slice(o+n.length)}function y(t){const n=s(t);if(!n)return null;const o=c(n.left),l=c(n.top),u=c(n.right),f=c(n.bottom);return null===o||null===l||null===u||null===f?null:{left:o,top:l,right:u,bottom:f}}function A(t){const n=s(t);if(!n)return{ok:!1,error:l};if(!1===n.ok)return{ok:!1,error:f(n.error)||l};const o=Date.parse(u(n.capturedAt)),h=s(n.screen),A=h?c(h.width):null,k=h?c(h.height):null;if(!0!==n.ok||!Array.isArray(n.nodes)||!Number.isFinite(o)||null===A||null===k||A<=0||k<=0)return{ok:!1,error:l};const w=[];for(const t of n.nodes){const n=s(t),o=n?y(n.bounds):null;if(!n||!o)continue;const l=u(n.contentDescription)||u(n.text)||p(u(n.resourceId),"/"),c=b(o.left,o.top,o.right,o.bottom,A,k);l&&c&&w.push({id:u(n.id),label:l,role:p(u(n.className),"."),enabled:!1!==n.enabled,clickable:!0===n.clickable,frame:c})}return{ok:!0,snapshot:{capturedAt:o,nodes:w}}}function k(t,n){const f=s(t);if(!f)return{ok:!1,error:l};if(Array.isArray(f.errors)){const t=f.errors.filter(t=>"string"==typeof t);if(t.length>0)return{ok:!1,error:t.join(" ")}}const h=s(f.screen),p=h?c(h.width):null,y=h?c(h.height):null;if(null===p||null===y||p<=0||y<=0)return{ok:!1,error:l};if(!Array.isArray(f.elements))return{ok:!1,error:l};const A=[];for(const t of f.elements){const n=s(t),l=n?s(n.frame):null;if(!n||!l)continue;const f=c(l.x),h=c(l.y),k=c(l.width),w=c(l.height);if(null===f||null===h||null===k||null===w)continue;const S=u(n.label)||u(n.value),_=b(f,h,f+k,h+w,p,y);if(!S||!_)continue;const x=u(n.role)||u(n.type);A.push({id:u(n.id),label:S,role:x,enabled:!1!==n.enabled,clickable:o.has(x.toLowerCase()),frame:_})}return{ok:!0,snapshot:{capturedAt:n,nodes:A}}}},169,[170]);
|
|
236
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,l){let s,o=`${t}${n}`.replace(/\r\n/g,"\n").replace(/\r/g,"\n");for(;-1!==(s=o.indexOf("\n\n"));){const t=o.slice(0,s).split("\n");o=o.slice(s+2);const n=t.find(t=>t.startsWith("event:"))?.slice(6).trim()||"message",c=t.filter(t=>t.startsWith("data:")).map(t=>t.slice(5).replace(/^ /,"")).join("\n");c&&l({event:n,data:c})}return o}Object.defineProperty(e,'__esModule',{value:!0}),e.drainSseChunk=t,e.readSseSnapshot=async function(n,{fetchImpl:l=fetch,signal:s,settleMs:o}){if(s.aborted)return null;const c=new AbortController,u=()=>c.abort();s.addEventListener("abort",u);let f=null;try{const s=await l(n,{cache:"no-store",headers:{accept:"text/event-stream"},signal:c.signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);if(!s.body)return null;const h=s.body.getReader(),b=new TextDecoder,p=[];let v="";try{for(;p.length<2;){const{done:n,value:l}=await h.read();if(n)break;v=t(v,b.decode(l,{stream:!0}),t=>{p.push(t.data)}),p.length>0&&null===f&&(f=setTimeout(u,o))}}catch(t){if(!c.signal.aborted)throw t}finally{await h.cancel().catch(()=>{})}return p.at(-1)??null}finally{null!==f&&clearTimeout(f),c.abort(),s.removeEventListener("abort",u)}}},170,[]);
|
|
237
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_ACTIVITY_SAMPLES",{enumerable:!0,get:function(){return n}}),e.parseActivitySample=function(n){if(!n||"object"!=typeof n||Array.isArray(n))return null;const l=n,u=t(l.t),s=t(l.cpuPct),c=t(l.memBytes),o=t(l.netInBytesPerSec),y=t(l.netOutBytesPerSec);if(null===u||null===s||null===c||null===o||null===y||null!==l.bundleId&&"string"!=typeof l.bundleId)return null;return{t:u,bundleId:l.bundleId,cpuPct:s,memBytes:c,netInBytesPerSec:o,netOutBytesPerSec:y}},e.parseActivityHostCores=function(n){if(!n||"object"!=typeof n||Array.isArray(n))return null;const l=t(n.hostCores);return null!==l&&l>0?l:null},e.appendActivitySample=function(n,t){const l=[...n.samples].reverse().find(n=>null!==n.bundleId)?.bundleId,u=void 0!==l&&null!==t.bundleId&&l!==t.bundleId;return Object.assign({},n,{samples:[...u?[]:n.samples,t].slice(-60),errored:!1,stale:!1})};const n=60;function t(n){return"number"==typeof n&&Number.isFinite(n)?n:null}},171,[]);
|
|
238
238
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useActivityStatus=function(s){const u=null===s?"idle":"loading",[c,o]=(0,t.useState)({scope:s,status:u});c.scope!==s&&o({scope:s,status:u});const n=(0,t.useCallback)(t=>{o(u=>null!==s&&u.scope===s&&u.status!==t?{scope:s,status:t}:u)},[s]);return{activityStatus:c.scope===s?c.status:u,setActivityStatus:n}};var t=r(d[0])},172,[38]);
|
|
239
239
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANDROID_ACTIVITY_STALE_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"EMPTY_ANDROID_ACTIVITY",{enumerable:!0,get:function(){return l}}),e.parseAndroidActivityFrame=function(n,l){let s;try{s=JSON.parse(l)}catch{return null}if("meta"===n)return!s||"object"!=typeof s||Array.isArray(s)?null:{kind:"meta",hostCores:(0,t.parseActivityHostCores)(s)};if("message"!==n)return null;const o=(0,t.parseActivitySample)(s);return o?{kind:"sample",sample:o}:null},e.nextAndroidActivityAfterSilence=function(t,l){const s=l.lastSampleAt>0?l.lastSampleAt:l.openedAt;return l.now-s<=n?null:l.lastSampleAt>0?t.stale?null:Object.assign({},t,{stale:!0}):t.errored?null:Object.assign({},t,{errored:!0})};var t=r(d[0]);const n=8e3,l={hostCores:null,samples:[],errored:!1,stale:!1}},173,[171]);
|
|
240
240
|
__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return`${t.replace(/\/$/,"")}${n}`}Object.defineProperty(e,'__esModule',{value:!0}),e.apiUrl=t,e.deviceApiUrl=function(n,c,u){const o=new URL(t(n,c));u&&o.searchParams.set("device",u);return o.toString()}},174,[]);
|
|
241
241
|
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return!t||"object"!=typeof t||Array.isArray(t)?null:t}function n(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function o(o){const u=t(o);if(!u)return null;const l=n(u.latitude),c=n(u.longitude);return null===l||null===c?null:{latitude:l,longitude:c}}Object.defineProperty(e,'__esModule',{value:!0}),e.parseAndroidFix=o,e.readAndroidLocation=async function(n,u,l){try{const c=await n(u,{cache:"no-store",signal:l});if(!c.ok)return null;const s=t(await c.json());return s&&"boolean"==typeof s.emulator?s.emulator?{supported:!0,location:o(s.location)}:{supported:!1,location:null}:null}catch{return null}},e.writeAndroidLocation=async function(n,u,l){const c=await n(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(l)}),s=t(await c.json().catch(()=>null));if(!c.ok||!0!==s?.ok){const t=s?.error;throw new Error("string"==typeof t?t:`Location update failed (${c.status})`)}return o(s.location)??l}},175,[]);
|
|
242
242
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseAndroidPermissions=o,e.androidPermissionsBackend=function(c,p,u=fetch){const l=async t=>{const l=`/api/apps/permissions?packageName=${encodeURIComponent(t)}`,f=await u((0,n.deviceApiUrl)(c,l,p),{cache:"no-store"});return(0,s.readPermissions)(f,o,"Could not read permissions")},f=async(o,t)=>{const l=await u((0,n.deviceApiUrl)(c,o,p),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(l.ok)return;const f=await l.json().catch(()=>null);throw new Error((0,s.errorMessage)(f,"Permission update failed"))};return{list:l,write:async(n,s,o)=>(await f(t[o],{packageName:n,permission:s}),l(n)),reset:async n=>(await f("/api/apps/reset-permissions",{packageName:n}),l(n))}};var n=r(d[0]),s=r(d[1]);function o(n){const o=(0,s.asRecord)(n);if(!o||!0!==o.ok||!Array.isArray(o.permissions))return null;const t=[];for(const n of o.permissions){const o=(0,s.asRecord)(n);if(!o||"string"!=typeof o.name||"boolean"!=typeof o.granted)return null;t.push({id:o.name,label:(0,s.humanize)(o.name),state:o.granted?"granted":"denied"})}return t}const t={grant:"/api/apps/grant",revoke:"/api/apps/revoke"}},176,[174,166]);
|
|
243
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseAppIconResponse=c,e.fetchAndroidAppIcon=async function(o,t,s,p=fetch){const f=new URL((0,n.deviceApiUrl)(o,
|
|
244
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_ANDROID_DEVICE_EVENTS",{enumerable:!0,get:function(){return t}}),e.createAndroidEventCursor=function(){return{latestId:0,clearedThroughId:0,hasSnapshot:!1,clearPending:!1}},e.clearAndroidEventCursor=function(t){return t.hasSnapshot?Object.assign({},t,{clearedThroughId:Math.max(t.clearedThroughId,t.latestId),clearPending:!1}):Object.assign({},t,{clearPending:!0})},e.mergeAndroidEventSnapshotCursor=function(t,n){const s=n.reduce((t,n)=>Number.isSafeInteger(n.id)&&n.id>0?Math.max(t,n.id):t,0);let o=t.hasSnapshot&&(t.latestId>0&&0===s||s>0&&s<t.latestId)?0:t.clearedThroughId;t.clearPending&&(o=Math.max(o,s));return{latestId:s,clearedThroughId:o,hasSnapshot:!0,clearPending:!1}},e.mapAndroidSessionEvent=p,e.mapAndroidSessionEvents=y,e.reconcileAndroidSessionEvents=function(t,n,s){const o=y(n,s);return t.length===o.length&&t.every((t,n)=>{const s=o[n];return void 0!==s&&t.id===s.id&&t.timestamp===s.timestamp&&t.source===s.source&&t.kind===s.kind&&t.action===s.action&&t.status===s.status&&t.message===s.message&&JSON.stringify(t.details)===JSON.stringify(s.details)})?t:o};const t=500;function n(t,n){return`android:${encodeURIComponent(t)}:${n}`}function s(t){return
|
|
245
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidScaleForSizeStep=t,e.androidSizeStepForScale=o,Object.defineProperty(e,"androidFontScaleForTextSize",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"androidTextSizeForFontScale",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"ANDROID_DEVICE_SETTING_KEYS",{enumerable:!0,get:function(){return h}}),e.createAndroidDeviceSettingVersions=function(){return Object.fromEntries(h.map(n=>[n,0]))},e.androidDeviceSettingPathFor=function(n){return f[n].path},e.androidDeviceSettingRequest=function(n,t){if(!b(n))return null;const o=f[n],l=o.encode(t);return null===l?null:{path:o.path,body:l}},e.parseAndroidDeviceSetting=function(n,t){const o=u(t);return o&&!0===o.ok?f[n].decode(o):null},e.androidDisplayWidthDpFromPayload=function(n){const t=u(n);if(!t||!0!==t.ok)return null;const o=u(t.displayDensity)?.widthDp;return
|
|
246
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidStreamSettingsPatch=function(t){const o={};for(const s of[
|
|
247
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_STREAM_SETTING_BOUNDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DEFAULT_DEVICE_STREAM_SETTINGS",{enumerable:!0,get:function(){return n}}),e.sameDeviceStreamSettings=function(t,n){return t?.mjpegFps===n.mjpegFps&&t.mjpegQuality===n.mjpegQuality&&t.maxDimension===n.maxDimension&&t.h264Bitrate===n.h264Bitrate&&t.h264Fps===n.h264Fps},e.normalizeDeviceStreamSettings=function(a,u=n){const o=a&&
|
|
248
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidStreamSourceErrorMessage=function(n,o){const t=o&&
|
|
249
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidTouchMessage=function(o,t,u){return{type:
|
|
250
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.mergeAuthoritativeDeviceSetting=function(t,n,c){const o=Object.assign({},t??{}),s=c[n];
|
|
251
|
-
__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,
|
|
243
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseAppIconResponse=c,e.fetchAndroidAppIcon=async function(o,t,s,p=fetch){const f=new URL((0,n.deviceApiUrl)(o,"/api/apps/icon",t));f.searchParams.set("packageName",s);const u=await p(f.toString(),{cache:"no-store"});if(!u.ok)throw new Error(`app icon request failed with ${u.status}`);return c(await u.json())},e.carryForwardAppIcon=function(n,o){return n&&n.id===o.id&&n.iconDataUrl&&!o.iconDataUrl?Object.assign({},o,{iconDataUrl:n.iconDataUrl}):o};var n=r(d[0]),o=r(d[1]);const t=["image/png","image/webp","image/jpeg","image/gif"];function c(n){const c=(0,o.asRecord)(n);if(!c||!0!==c.ok)throw new Error("app icon response is invalid");if(null===c.icon)return null;const s=(0,o.asRecord)(c.icon);if(!s)throw new Error("app icon must be an object");const{mimeType:p,data:f}=s;if("string"!=typeof p||!t.includes(p))throw new Error("app icon mimeType is invalid");if("string"!=typeof f||!f)throw new Error("app icon data is invalid");return`data:${p};base64,${f}`}},177,[174,166]);
|
|
244
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_ANDROID_DEVICE_EVENTS",{enumerable:!0,get:function(){return t}}),e.createAndroidEventCursor=function(){return{latestId:0,clearedThroughId:0,hasSnapshot:!1,clearPending:!1}},e.clearAndroidEventCursor=function(t){return t.hasSnapshot?Object.assign({},t,{clearedThroughId:Math.max(t.clearedThroughId,t.latestId),clearPending:!1}):Object.assign({},t,{clearPending:!0})},e.mergeAndroidEventSnapshotCursor=function(t,n){const s=n.reduce((t,n)=>Number.isSafeInteger(n.id)&&n.id>0?Math.max(t,n.id):t,0);let o=t.hasSnapshot&&(t.latestId>0&&0===s||s>0&&s<t.latestId)?0:t.clearedThroughId;t.clearPending&&(o=Math.max(o,s));return{latestId:s,clearedThroughId:o,hasSnapshot:!0,clearPending:!1}},e.mapAndroidSessionEvent=p,e.mapAndroidSessionEvents=y,e.reconcileAndroidSessionEvents=function(t,n,s){const o=y(n,s);return t.length===o.length&&t.every((t,n)=>{const s=o[n];return void 0!==s&&t.id===s.id&&t.timestamp===s.timestamp&&t.source===s.source&&t.kind===s.kind&&t.action===s.action&&t.status===s.status&&t.message===s.message&&JSON.stringify(t.details)===JSON.stringify(s.details)})?t:o};const t=500;function n(t,n){return`android:${encodeURIComponent(t)}:${n}`}function s(t){return"number"==typeof t&&Number.isFinite(t)?`${Math.round(100*t)}%`:"?"}function o(t,n){return`${s(t)}, ${s(n)}`}function c(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function u(t){return"string"==typeof t?Array.from(t).length:0}function l(t){return t?"text"!==t.type?Object.assign({},t):{type:"text",textLength:u(t.text),redacted:!0}:{}}function h(t,s){const h=t.gesture,p="string"==typeof h?.type?h.type:"unknown",y={id:n(s,t.id),timestamp:t.at,source:t.source,details:{delayMs:t.delayMs,gesture:l(h)}};switch(p){case"touch":{const t="string"==typeof h?.action?h.action:"unknown";return Object.assign({},y,{kind:"touch",action:t,message:`Touch ${t} at ${o(h?.x,h?.y)}`})}case"tap":return Object.assign({},y,{kind:"touch",action:"tap",message:`Tap at ${o(h?.x,h?.y)}`});case"swipe":{const t=c(h?.durationMs);return Object.assign({},y,{kind:"touch",action:"swipe",message:`Swipe ${o(h?.x1,h?.y1)} \u2192 ${o(h?.x2,h?.y2)}${null===t?"":` (${Math.round(t)} ms)`}`})}case"key":{const t=c(h?.keycode);return Object.assign({},y,{kind:"keyboard",action:"key",message:null===t?"Key input":`Keycode ${t}`})}case"text":{const t=u(h?.text);return Object.assign({},y,{kind:"keyboard",action:"text",message:`Text input (${t} ${1===t?"character":"characters"}, redacted)`})}case"back":case"home":case"recents":case"power":return Object.assign({},y,{kind:"button",action:p,message:`Button ${f=p,f.length>0?`${f[0].toUpperCase()}${f.slice(1)}`:f}`});default:return Object.assign({},y,{kind:"gesture",action:p,message:`Gesture ${p}`})}var f}function p(t,s){if("gesture"===t.kind)return h(t,s);if("location"===t.kind){const o=c(t.location?.latitude),u=c(t.location?.longitude),l=null===o||null===u?"unknown coordinates":`${o.toFixed(5)}, ${u.toFixed(5)}`;return{id:n(s,t.id),timestamp:t.at,source:t.source,kind:"location",action:"set",message:`Location ${l}`,details:{delayMs:t.delayMs,location:Object.assign({},t.location)}}}return{id:n(s,t.id),timestamp:t.at,source:t.source,kind:t.kind||"event",message:`Event ${t.kind||"unknown"}`,details:{delayMs:t.delayMs}}}function y(t,n){return t.slice(-500).map(t=>p(t,n))}},178,[]);
|
|
245
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidScaleForSizeStep=t,e.androidSizeStepForScale=o,Object.defineProperty(e,"androidFontScaleForTextSize",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"androidTextSizeForFontScale",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"ANDROID_DEVICE_SETTING_KEYS",{enumerable:!0,get:function(){return h}}),e.createAndroidDeviceSettingVersions=function(){return Object.fromEntries(h.map(n=>[n,0]))},e.androidDeviceSettingPathFor=function(n){return f[n].path},e.androidDeviceSettingRequest=function(n,t){if(!b(n))return null;const o=f[n],l=o.encode(t);return null===l?null:{path:o.path,body:l}},e.parseAndroidDeviceSetting=function(n,t){const o=u(t);return o&&!0===o.ok?f[n].decode(o):null},e.androidDisplayWidthDpFromPayload=function(n){const t=u(n);if(!t||!0!==t.ok)return null;const o=u(t.displayDensity)?.widthDp;return"number"==typeof o&&Number.isFinite(o)&&o>0?o:null};const n=[{value:"small",scale:.85},{value:"medium",scale:1},{value:"large",scale:1.15},{value:"extra-large",scale:1.3}];function t(t){return n.find(n=>n.value===t)?.scale??null}function o(t){const o=Number(t);return!Number.isFinite(o)||o<=0?null:n.reduce((n,t)=>Math.abs(t.scale-o)<Math.abs(n.scale-o)?t:n).value}const l=t,c=o;function u(n){return!n||"object"!=typeof n||Array.isArray(n)?null:n}function s(n){return"on"===n||"off"===n?{enabled:"on"===n}:null}function p(n){const t=u(n)?.enabled;return!0===t?"on":!1===t?"off":null}const f={appearance:{path:"/api/uimode",encode:n=>"light"===n||"dark"===n?{night:"dark"===n?"yes":"no"}:null,decode:n=>"yes"===n.night?"dark":"no"===n.night||"auto"===n.night?"light":null},network:{path:"/api/network",encode:s,decode:n=>{const t=u(n.network);return t?!0===t.enabled?"on":!1===t.enabled?"off":null===t.enabled?"unknown":null:null}},"text-size":{path:"/api/font-scale",encode:n=>{const o=t(n);return null===o?null:{scale:o}},decode:n=>{const t=u(n.fontScale);return null===t?null:o(t.scale)}},"display-size":{path:"/api/display-density",encode:n=>{const o=t(n);return null===o?null:{scale:o}},decode:n=>{const t=u(n.displayDensity);return null===t?null:o(t.scale)}},"reduce-motion":{path:"/api/reduce-motion",encode:s,decode:n=>p(n.reduceMotion)},"bold-text":{path:"/api/font-weight",encode:s,decode:n=>p(n.fontWeight)},"increase-contrast":{path:"/api/high-text-contrast",encode:s,decode:n=>p(n.highTextContrast)},"onscreen-keyboard":{path:"/api/software-keyboard",encode:s,decode:n=>p(n.softwareKeyboard)}},h=Object.keys(f);function b(n){return Object.hasOwn(f,n)}},179,[]);
|
|
246
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidStreamSettingsPatch=function(t){const o={};for(const s of["maxDimension","h264Fps","h264Bitrate"]){const[u,S]=n.DEVICE_STREAM_SETTING_BOUNDS[s],c=t[s];if(void 0!==c){if("number"!=typeof c||!Number.isInteger(c)||c<u||c>S)return null;o[s]=c}}return Object.keys(o).length>0?o:null},e.parseAndroidStreamSettings=function(t,o=n.DEFAULT_DEVICE_STREAM_SETTINGS){if(!t||"object"!=typeof t||Array.isArray(t))return null;const s=t.maxDimension,[u,S]=n.DEVICE_STREAM_SETTING_BOUNDS.maxDimension;if("number"!=typeof s||!Number.isInteger(s)||s<u||s>S)return null;return(0,n.normalizeDeviceStreamSettings)(t,o)};var n=r(d[0])},180,[181]);
|
|
247
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_STREAM_SETTING_BOUNDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DEFAULT_DEVICE_STREAM_SETTINGS",{enumerable:!0,get:function(){return n}}),e.sameDeviceStreamSettings=function(t,n){return t?.mjpegFps===n.mjpegFps&&t.mjpegQuality===n.mjpegQuality&&t.maxDimension===n.maxDimension&&t.h264Bitrate===n.h264Bitrate&&t.h264Fps===n.h264Fps},e.normalizeDeviceStreamSettings=function(a,u=n){const o=a&&"object"==typeof a&&!Array.isArray(a)?a:{};return{mjpegFps:s(o.mjpegFps,u.mjpegFps,...t.mjpegFps),mjpegQuality:p(o.mjpegQuality,u.mjpegQuality,...t.mjpegQuality),maxDimension:s(o.maxDimension,u.maxDimension,...t.maxDimension),h264Bitrate:s(o.h264Bitrate,u.h264Bitrate,...t.h264Bitrate),h264Fps:s(o.h264Fps,u.h264Fps,...t.h264Fps)}};const t={mjpegFps:[1,120],mjpegQuality:[.05,1],maxDimension:[0,4096],h264Bitrate:[1e5,5e7],h264Fps:[1,120]},n={mjpegFps:60,mjpegQuality:.7,maxDimension:0,h264Bitrate:6e6,h264Fps:60};function a(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function p(t,n,p,s){const u=a(t);return null===u?n:Math.min(s,Math.max(p,u))}function s(t,n,a,s){return Math.round(p(t,n,a,s))}},181,[]);
|
|
248
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidStreamSourceErrorMessage=function(n,o){const t=o&&"object"==typeof o&&!Array.isArray(o)?o:null,s=t?.error,l=s&&"object"==typeof s&&!Array.isArray(s)&&"message"in s?s.message:void 0,u="string"==typeof s?s.trim():"string"==typeof l?l.trim():"string"==typeof t?.message?t.message.trim():"";return u?`Unable to change stream source: ${u}`:`Unable to change stream source (HTTP ${n}).`},e.parseAndroidStreamSource=function(n){if(!n||"object"!=typeof n||Array.isArray(n))return null;const u=n,c=void 0===u.encoder?"software":u.encoder,p=void 0===u.encoderName?null:u.encoderName,b=void 0===u.availableEncoders?["software"]:u.availableEncoders;if(!(!0===u.ok&&o(u.mode)&&t(u.grpcImageMode)&&s(c)&&l(u.inputSource)))return null;if(!((null===p||"string"==typeof p&&p.trim())&&Array.isArray(b)&&b.every(s)&&new Set(b).size===b.length&&b.includes("software")&&(void 0===u.hardwareEncoderError||"string"==typeof u.hardwareEncoderError&&u.hardwareEncoderError.trim())))return null;if(!Array.isArray(u.availableInputSources)||0===u.availableInputSources.length||!u.availableInputSources.every(l)||new Set(u.availableInputSources).size!==u.availableInputSources.length||!u.availableInputSources.includes(u.inputSource))return null;if(!Array.isArray(u.availableModes)||0===u.availableModes.length||!u.availableModes.every(o)||new Set(u.availableModes).size!==u.availableModes.length||!u.availableModes.includes(u.mode))return null;if("number"!=typeof u.sessionGeneration||!Number.isInteger(u.sessionGeneration)||u.sessionGeneration<0)return null;return Object.assign({mode:u.mode,grpcImageMode:u.grpcImageMode,encoder:c,encoderName:p,availableEncoders:b},"string"==typeof u.hardwareEncoderError?{hardwareEncoderError:u.hardwareEncoderError}:{},{inputSource:u.inputSource,availableInputSources:u.availableInputSources,availableModes:u.availableModes,sessionGeneration:u.sessionGeneration})};const n=["scrcpy","grpc-screenshot"];function o(o){return n.some(n=>n===o)}function t(n){return"png"===n||"mmap"===n||"rgb888"===n}function s(n){return"software"===n||"hardware"===n}function l(n){return"scrcpy"===n||"grpc"===n}},182,[]);
|
|
249
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.androidTouchMessage=function(o,t,u){return{type:"touch",action:n[o],x:t.x,y:t.y,pointerId:u}};const n={begin:"down",move:"move",end:"up"}},183,[]);
|
|
250
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.mergeAuthoritativeDeviceSetting=function(t,n,c){const o=Object.assign({},t??{}),s=c[n];"string"==typeof s?o[n]=s:delete o[n];return o}},184,[]);
|
|
251
|
+
__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},185,[]);
|
|
252
252
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"KeyedWriteTracker",{enumerable:!0,get:function(){return t}});class t{#e=new Map;#t=0;#i=0;start(t){if(this.#e.has(t))return null;const n={key:t,generation:this.#t,id:++this.#i};return this.#e.set(t,n),n}isCurrent(t){return t.generation===this.#t&&this.#e.get(t.key)===t}finish(t){return!!this.isCurrent(t)&&(this.#e.delete(t.key),!0)}reset(){this.#t++,this.#e.clear()}get pending(){return new Set(this.#e.keys())}}},186,[]);
|
|
253
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hidUsageForCode=o,e.androidMessageForKeyboardInput=function(t){if(
|
|
254
|
-
__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(
|
|
255
|
-
__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,
|
|
253
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hidUsageForCode=o,e.androidMessageForKeyboardInput=function(t){if("down"!==t.phase)return null;if("Escape"===t.key)return{type:"back"};const o=n[t.key];return void 0!==o?{type:"key",keycode:o}:1===t.key.length?{type:"text",text:t.key}:null},e.iosMessageForKeyboardInput=function(t){const n=o(t.code);if(null===n)return null;const y="down"===t.phase&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&1===t.key.length,u=y&&t.shiftKey&&" "!==t.key;return Object.assign({type:t.phase,usage:n},y?{key:t.key}:{},u?{shifted:!0}:{})};const t={KeyA:4,KeyB:5,KeyC:6,KeyD:7,KeyE:8,KeyF:9,KeyG:10,KeyH:11,KeyI:12,KeyJ:13,KeyK:14,KeyL:15,KeyM:16,KeyN:17,KeyO:18,KeyP:19,KeyQ:20,KeyR:21,KeyS:22,KeyT:23,KeyU:24,KeyV:25,KeyW:26,KeyX:27,KeyY:28,KeyZ:29,Digit1:30,Digit2:31,Digit3:32,Digit4:33,Digit5:34,Digit6:35,Digit7:36,Digit8:37,Digit9:38,Digit0:39,Enter:40,Escape:41,Backspace:42,Tab:43,Space:44,Minus:45,Equal:46,BracketLeft:47,BracketRight:48,Backslash:49,Semicolon:51,Quote:52,Backquote:53,Comma:54,Period:55,Slash:56,CapsLock:57,F1:58,F2:59,F3:60,F4:61,F5:62,F6:63,F7:64,F8:65,F9:66,F10:67,F11:68,F12:69,PrintScreen:70,ScrollLock:71,Pause:72,Insert:73,Home:74,PageUp:75,Delete:76,End:77,PageDown:78,ArrowRight:79,ArrowLeft:80,ArrowDown:81,ArrowUp:82,NumLock:83,NumpadDivide:84,NumpadMultiply:85,NumpadSubtract:86,NumpadAdd:87,NumpadEnter:88,Numpad1:89,Numpad2:90,Numpad3:91,Numpad4:92,Numpad5:93,Numpad6:94,Numpad7:95,Numpad8:96,Numpad9:97,Numpad0:98,NumpadDecimal:99,ControlLeft:224,ShiftLeft:225,AltLeft:226,MetaLeft:227,ControlRight:228,ShiftRight:229,AltRight:230,MetaRight:231};function o(o){return t[o]??null}const n={ArrowUp:19,ArrowDown:20,ArrowLeft:21,ArrowRight:22,Tab:61,Enter:66,Backspace:67,Delete:112,Home:122,End:123,PageUp:92,PageDown:93}},187,[]);
|
|
254
|
+
__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}}},188,[189]);
|
|
255
|
+
__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)])}}},189,[]);
|
|
256
256
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STREAM_RECONNECT_GRACE_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"RECONNECT_BASE_DELAY_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"RECONNECT_MAX_DELAY_MS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"RECONNECT_BACKOFF_FACTOR",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"SERVER_RESTART_RECONNECT_DELAY_MS",{enumerable:!0,get:function(){return o}}),e.isDeliberateServerClose=_,e.scheduleReconnect=function({code:t,wasHealthy:n,currentDelay:E}){return{retryIn:n&&_(t)?o:E,nextDelay:Math.min(Math.round(E*c),u)}};const t=5e3,n=500,u=5e3,c=1.6,o=100,E=new Set([1e3,1001,1012]);function _(t){return E.has(t)}},190,[]);
|
|
257
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IDLE_STREAM_SWITCH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"STREAM_SWITCH_INTERRUPTION_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"STREAM_SWITCH_FRAME_TIMEOUT_MS",{enumerable:!0,get:function(){return u}}),e.reduceStreamSwitch=function(n,u){if(
|
|
258
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ACCESSIBILITY_READ_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),e.useAccessibility=function(l,s=n){const[c,u]=(0,t.useState)(null),[o,b]=(0,t.useState)(!1),[f,y]=(0,t.useState)(null),A=(0,t.useRef)(null),S=(0,t.useCallback)(()=>{if(A.current?.abort(),A.current=null,!l)return;const t=new AbortController;A.current=t,b(!0),y(null);const n=AbortSignal.timeout(s);l(AbortSignal.any([t.signal,n])).then(n=>{t.signal.aborted||(n.ok?u(n.snapshot):y(n.error))}).catch(l=>{if(t.signal.aborted)return;if(n.aborted)return void y(
|
|
257
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IDLE_STREAM_SWITCH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"STREAM_SWITCH_INTERRUPTION_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"STREAM_SWITCH_FRAME_TIMEOUT_MS",{enumerable:!0,get:function(){return u}}),e.reduceStreamSwitch=function(n,u){if("request-start"===u.type)return u.live?c:s;switch(n.phase){case"idle":return n;case"requesting":switch(u.type){case"stream-interrupted":return n.interrupted&&!n.recovered?n:Object.assign({},n,{interrupted:!0,recovered:!1});case"stream-live":return n.interrupted&&!n.recovered?Object.assign({},n,{recovered:!0}):n;case"request-failure":return t;case"request-success":return!u.replaced||n.recovered?t:n.interrupted?o:p;case"timeout":return n}return n;case"awaiting-interruption":return"stream-interrupted"===u.type?o:"timeout"===u.type?t:n;case"awaiting-frame":return"stream-live"===u.type||"timeout"===u.type?t:n}return n},e.streamSwitchTimeoutMs=function(t){return"awaiting-interruption"===t?n:"awaiting-frame"===t?u:null},e.isStreamSwitchPending=function(t){return"idle"!==t.phase};const t={phase:"idle",interrupted:!1,recovered:!1},n=3e3,u=8e3,c={phase:"requesting",interrupted:!1,recovered:!1},s={phase:"requesting",interrupted:!0,recovered:!1},p={phase:"awaiting-interruption",interrupted:!1,recovered:!1},o={phase:"awaiting-frame",interrupted:!0,recovered:!1}},191,[]);
|
|
258
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ACCESSIBILITY_READ_TIMEOUT_MS",{enumerable:!0,get:function(){return n}}),e.useAccessibility=function(l,s=n){const[c,u]=(0,t.useState)(null),[o,b]=(0,t.useState)(!1),[f,y]=(0,t.useState)(null),A=(0,t.useRef)(null),S=(0,t.useCallback)(()=>{if(A.current?.abort(),A.current=null,!l)return;const t=new AbortController;A.current=t,b(!0),y(null);const n=AbortSignal.timeout(s);l(AbortSignal.any([t.signal,n])).then(n=>{t.signal.aborted||(n.ok?u(n.snapshot):y(n.error))}).catch(l=>{if(t.signal.aborted)return;if(n.aborted)return void y("The device did not answer in time");const s=l instanceof Error?l.message:"";y(s||"Accessibility read failed")}).finally(()=>{A.current===t&&b(!1)})},[l,s]);return(0,t.useEffect)(()=>()=>{A.current?.abort(),A.current=null,u(null),b(!1),y(null)},[l]),{accessibility:c,accessibilityPending:o,accessibilityError:f,refreshAccessibility:S}};var t=r(d[0]);const n=1e4},192,[38]);
|
|
259
259
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAndroidCamera=function({active:p,baseUrl:f,device:A,scope:h,scopeRef:E,token:_=null}){const R=(0,t.useMemo)(()=>(0,u.sessionTokenFetch)(_),[_]),[I,S]=(0,t.useState)(s.NO_ANDROID_CAMERA),[y,N]=(0,t.useState)(c.NO_PENDING_CAMERA_WRITES),[k,v]=(0,t.useState)(null),b=(0,t.useRef)(new o.KeyedWriteTracker),M=(0,t.useRef)({back:0,front:0}),O=(0,t.useCallback)((t,c)=>{if(!f)return;const o=b.current,u=o.start(t);if(!u)return;M.current[t]++;const l=C(f,A,_),p=(0,n.deviceApiUrl)(f,"/api/camera",A),I=new Set(s.CAMERA_FACINGS.filter(n=>n!==t)),y=t=>{S(n=>(0,s.applyCameraRead)(n,(0,s.parseAndroidCameraStatus)(t,l),I))};v(null),N(o.pending),R((0,n.deviceApiUrl)(f,(0,s.androidCameraImagePath)(t,null),A),c).then(async t=>{const n=await t.json().catch(()=>null);if(!o.isCurrent(u)||E.current!==h)return;if(t.ok)return void y(n);v((0,s.androidCameraErrorMessage)(t.status,n));const c=await R(p,{cache:"no-store"}).then(t=>t.ok?t.json():null).catch(()=>null);o.isCurrent(u)&&E.current===h&&y(c)}).catch(()=>{o.isCurrent(u)&&E.current===h&&v("Camera update failed")}).finally(()=>{o.finish(u)&&N(o.pending)})},[f,A,h,E,R,_]),w=(0,t.useCallback)((t,n)=>O(t,{method:"POST",headers:{"Content-Type":"image/png"},body:n}),[O]),T=(0,t.useCallback)(t=>O(t,{method:"DELETE"}),[O]);return(0,t.useEffect)(()=>{const t=b.current;t.reset();for(const t of s.CAMERA_FACINGS)M.current[t]++;if(N(c.NO_PENDING_CAMERA_WRITES),S(s.NO_ANDROID_CAMERA),v(null),!p||!f)return;let o=!1,u=!1,I=null;const y=C(f,A,_),k=(0,n.deviceApiUrl)(f,"/api/camera",A),O=async()=>{if(o||u)return;u=!0;const n=t.pending,c=Object.assign({},M.current),l=new AbortController;I=l;try{const u=await R(k,{cache:"no-store",signal:l.signal}),C=u.ok?(0,s.parseAndroidCameraStatus)(await u.json(),y):null;if(o||E.current!==h)return;const p=(0,s.staleCameraFacings)(n,t.pending,c,M.current);S(t=>(0,s.applyCameraRead)(t,C,p))}catch{}finally{u=!1}};O();const w=setInterval(()=>{O()},l);return()=>{o=!0,clearInterval(w),I?.abort(),t.reset()}},[p,f,A,h,E,R,_]),{camera:I.status,cameraSupported:I.supported,cameraPending:y,cameraError:k,setCameraImage:w,clearCameraImage:T}};var t=r(d[0]),n=r(d[1]),s=r(d[2]),c=r(d[3]),o=r(d[4]),u=r(d[5]);const l=3e3;function C(t,c,o){return(l,C)=>(0,u.withSessionTokenQuery)((0,n.deviceApiUrl)(t,(0,s.androidCameraImagePath)(l,C),c),o)}},193,[38,174,194,167,186,195]);
|
|
260
260
|
__d(function(g,r,i,a,m,e,d){"use strict";function n(n){return!n||"object"!=typeof n||Array.isArray(n)?null:n}function t(n){return"number"==typeof n&&Number.isFinite(n)?n:null}function o(o,u){const s=n(o);if(!s)return null;const f=s.facing;if("back"!==f&&"front"!==f)return null;const c=s.placeholder,l=s.present;if("boolean"!=typeof c||"boolean"!=typeof l)return null;const p="string"==typeof s.digest?s.digest:null;return{facing:f,placeholder:c,width:t(s.width),height:t(s.height),bytes:t(s.bytes),imageUrl:l?u(f,p):null}}function u(n,t,o){return 0!==o.size&&n?Object.assign({},t,{feeds:t.feeds.map(t=>o.has(t.facing)?n.feeds.find(n=>n.facing===t.facing)??t:t)}):t}Object.defineProperty(e,'__esModule',{value:!0}),e.parseAndroidCameraStatus=function(t,u){const s=n(t);if(!s||!0!==s.ok)return null;const f=n(s.camera);if(!f)return null;const c=f.supported,l=f.wiredAtLaunch;if("boolean"!=typeof c||"boolean"!=typeof l)return null;if(!Array.isArray(f.feeds))return null;const p=f.feeds.map(n=>o(n,u)).filter(n=>null!==n);return{supported:c,status:{wiredAtLaunch:l,feeds:p}}},e.androidCameraImagePath=function(n,t){const o=`/api/camera/image?facing=${n}`;return null===t?o:`${o}&v=${encodeURIComponent(t)}`},e.androidCameraErrorMessage=function(t,o){const u=n(o);return u&&"string"==typeof u.error?u.error:`Camera update failed (${t})`},e.keepPendingCameraFeeds=u,Object.defineProperty(e,"CAMERA_FACINGS",{enumerable:!0,get:function(){return s}}),e.staleCameraFacings=function(n,t,o,u){const f=new Set([...n,...t]);for(const n of s)o[n]!==u[n]&&f.add(n);return f},Object.defineProperty(e,"NO_ANDROID_CAMERA",{enumerable:!0,get:function(){return f}}),e.applyCameraRead=function(n,t,o){return t?{status:u(n.status,t.status,o),supported:t.supported}:n};const s=["back","front"];const f={status:null,supported:!1}},194,[]);
|
|
261
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sessionTokenFetch=function(n){return n?(o,t)=>{const s=new Headers(t?.headers??(o instanceof Request?o.headers:void 0));return s.set(
|
|
261
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sessionTokenFetch=function(n){return n?(o,t)=>{const s=new Headers(t?.headers??(o instanceof Request?o.headers:void 0));return s.set("Authorization",`Bearer ${n}`),fetch(o,Object.assign({},t,{headers:s}))}:(n,o)=>fetch(n,o)},e.withSessionTokenQuery=function(n,o){return o?`${n}${n.includes("?")?"&":"?"}token=${encodeURIComponent(o)}`:n},e.sessionTokenProtocols=function(o,t){return t?[`${n[o]}${t}`]:void 0};const n={ios:"serve-sim.token.",android:"serve-emu.token."}},195,[]);
|
|
262
262
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDeviceLocation=function(u){const[f,p]=(0,n.useState)(l),b=(0,n.useRef)(0),v=(0,n.useRef)(!1);(0,n.useEffect)(()=>{const n=++b.current;v.current=!1,p(l);const c=u?.read;if(!c)return;let o=!1,s=!1,f=null;const j=async()=>{if(!o&&!s){s=!0,f=new AbortController;try{const t=await c(f.signal);if(o||b.current!==n||!t)return;clearInterval(C),p(n=>Object.assign({},n,t))}catch{}finally{s=!1}}};j();const C=setInterval(()=>{j()},t);return()=>{o=!0,clearInterval(C),f?.abort()}},[u]);const j=(0,n.useCallback)(n=>{if(v.current)return;const t=b.current;v.current=!0,p(n=>Object.assign({},n,{pending:!0,error:null})),n().then(n=>{b.current===t&&(v.current=!1,p(t=>Object.assign({},t,{location:n,pending:!1})))},n=>{b.current===t&&(v.current=!1,p(t=>Object.assign({},t,{pending:!1,error:s(n)})))})},[]),C=(0,n.useCallback)(n=>{u&&j(()=>u.set(n))},[u,j]),O=(0,n.useCallback)(()=>{const n=u?.clear;n&&j(()=>n().then(()=>null))},[u,j]),y=!(!u||u.read&&!f.supported)&&(u?.clear?o:c);return{location:f.location,locationPending:f.pending,locationError:f.error,setLocation:C,clearLocation:O,locationCapabilities:y}};var n=r(d[0]);const t=3e3,c={},o={clear:!0},l={supported:!1,location:null,pending:!1,error:null};function s(n){return(n instanceof Error?n.message:"")||"Location update failed"}},196,[38]);
|
|
263
263
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAppPermissions=function({active:u,backend:c,appId:l}){const[o,f]=(0,s.useState)(null),[p,I]=(0,s.useState)(n.NO_PENDING_PERMISSION_WRITES),[P,_]=(0,s.useState)(null),E=(0,s.useRef)(new t.KeyedWriteTracker),N=(0,s.useRef)({}),S=(0,s.useMemo)(()=>u&&c&&l?{backend:c,appId:l}:null,[u,c,l]),b=(0,s.useRef)(S);(0,s.useEffect)(()=>{b.current=S,E.current.reset(),N.current={},f(null),I(n.NO_PENDING_PERMISSION_WRITES),_(null)},[S]);const R=s=>{const t=s.pending;I(0===t.size?n.NO_PENDING_PERMISSION_WRITES:t)},k=(0,s.useCallback)((s,t)=>{if(!S)return Promise.resolve();const u=E.current,c=N.current;return t(S.backend,S.appId).then(t=>{if(S!==b.current)return;const l=(0,n.heldPermissionIds)(u.pending,c,N.current,s);f(s=>(0,n.applyPermissionsRead)(s,t,l)),_(null)},s=>{S===b.current&&_(s instanceof Error?s.message:"Permission request failed")})},[S]),O=(0,s.useCallback)((s,n)=>{const t=E.current,u=t.pending;if(0===s.length||s.some(s=>u.has(s)))return;const c=s.flatMap(s=>{const n=t.start(s);return n?[n]:[]}),l=Object.assign({},N.current);for(const n of s)l[n]=(l[n]??0)+1;N.current=l,_(null),R(t),k(s,n).finally(()=>{let s=!1;for(const n of c)s=t.finish(n)||s;s&&R(t)})},[k]),h=(0,s.useCallback)((s,n)=>O([s],(t,u)=>t.write(u,s,n)),[O]),M=(0,s.useCallback)(()=>O((o??[]).map(s=>s.id),(s,n)=>s.reset(n)),[O,o]),C=(0,s.useCallback)(()=>{k([],(s,n)=>s.list(n))},[k]);return{permissions:o,permissionsPending:p,permissionsError:P,setPermission:h,resetPermissions:M,refreshPermissions:C}};var s=r(d[0]),n=r(d[1]),t=r(d[2])},197,[38,166,186]);
|
|
264
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useStreamSettingsResource=function({url:u,initialSettings:s,parse:c,toPatch:o,fetchImpl:l=fetch}){const[f,S]=(0,t.useState)(s),[b,E]=(0,t.useState)(!1),h=(0,t.useRef)(0),w=(0,t.useRef)(s),p=(0,t.useRef)(!1),C=(0,t.useRef)(null),T=(0,t.useRef)(null),_=(0,t.useCallback)(()=>{++h.current,C.current?.abort(),C.current=null,T.current?.abort(),T.current=null},[]),y=(0,t.useCallback)(async t=>{if(!u||C.current||T.current)return;const s=++h.current,o=new AbortController;C.current=o;try{const t=await l(u,{cache:
|
|
264
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useStreamSettingsResource=function({url:u,initialSettings:s,parse:c,toPatch:o,fetchImpl:l=fetch}){const[f,S]=(0,t.useState)(s),[b,E]=(0,t.useState)(!1),h=(0,t.useRef)(0),w=(0,t.useRef)(s),p=(0,t.useRef)(!1),C=(0,t.useRef)(null),T=(0,t.useRef)(null),_=(0,t.useCallback)(()=>{++h.current,C.current?.abort(),C.current=null,T.current?.abort(),T.current=null},[]),y=(0,t.useCallback)(async t=>{if(!u||C.current||T.current)return;const s=++h.current,o=new AbortController;C.current=o;try{const t=await l(u,{cache:"no-store",signal:o.signal});if(!t.ok)throw new Error(`Stream settings request failed (${t.status})`);const f=c(await t.json(),w.current??n.DEFAULT_DEVICE_STREAM_SETTINGS);if(!f)throw new Error("Stream settings request returned an invalid response");o.signal.aborted||h.current!==s||(w.current=f,S(t=>(0,n.sameDeviceStreamSettings)(t,f)?t:f))}catch{}finally{C.current===o&&(C.current=null),t&&!o.signal.aborted&&h.current===s&&(p.current=!1,E(!1))}},[l,c,u]);(0,t.useEffect)(()=>(_(),w.current=s,S(s),u?(p.current=!0,E(!0),y(!0),_):(p.current=!1,void E(!1))),[_,s,y,u]);const R=(0,t.useCallback)(t=>{const s=o(t);if(!u||!s||p.current||T.current)return;const f=w.current??n.DEFAULT_DEVICE_STREAM_SETTINGS,b=c(Object.assign({},f,s),f);if(!b)return;C.current?.abort(),C.current=null;const _=++h.current,y=new AbortController;return T.current=y,p.current=!0,w.current=b,S(b),E(!0),l(u,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:y.signal}).then(async t=>{if(!t.ok)throw new Error(`Stream settings update failed (${t.status})`);const n=c(await t.json(),b);if(!n)throw new Error("Stream settings update returned an invalid response");return!y.signal.aborted&&h.current===_&&(w.current=n,S(n),!0)}).catch(()=>(y.signal.aborted||h.current!==_||(w.current=f,S(f)),!1)).finally(()=>{T.current===y&&(T.current=null),y.signal.aborted||h.current!==_||(p.current=!1,E(!1))})},[l,c,o,u]),A=(0,t.useCallback)(()=>{y(!1)},[y]);return{streamSettings:f,streamSettingsPending:b,updateStreamSettings:R,refreshStreamSettings:A}};var t=r(d[0]),n=r(d[1])},198,[38,181]);
|
|
265
265
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDeviceSettingsReadStatus=function(s){const[u,l]=(0,t.useState)({scope:null,status:"idle"}),n=(0,t.useCallback)(()=>{l({scope:s,status:null===s?"idle":"loading"})},[s]),c=(0,t.useCallback)(t=>{l(u=>null===s||u.scope!==s||u.status===t?u:{scope:s,status:t})},[s]);return{deviceSettingsStatus:null===s?"idle":u.scope===s?u.status:"loading",resetRead:n,settleRead:c}};var t=r(d[0])},199,[38]);
|
|
266
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchScreenshot=async function(o,c,s=fetch){const u=`${(0,t.apiUrl)(o,
|
|
267
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preferredVideoCodecs=T,e.buildWebRtcOfferPayload=C,e.isRetryableWebRtcOfferStatus=W,e.shouldFallbackCodecAfterFirstFrameTimeout=function(t,n){return t&&
|
|
266
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchScreenshot=async function(o,c,s=fetch){const u=`${(0,t.apiUrl)(o,"/api/screenshot")}${c?`?device=${encodeURIComponent(c)}`:""}`;try{const t=await s(u,{method:"POST",cache:"no-store"});return t.ok?{blob:await t.blob(),artifact:n(t.headers)}:null}catch{return null}};var t=r(d[0]);function n(t){const n=t.get("X-Expo-Screenshot-Artifact");if(null===n)return null;if("failed"===n){const o=t.get("X-Expo-Screenshot-Artifact-Error")?.trim();return o?{status:n,error:o}:{status:n}}return"saved"===n||"disabled"===n?{status:n}:(console.warn(`Ignoring unknown X-Expo-Screenshot-Artifact value: ${n}`),null)}},200,[174]);
|
|
267
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preferredVideoCodecs=T,e.buildWebRtcOfferPayload=C,e.isRetryableWebRtcOfferStatus=W,e.shouldFallbackCodecAfterFirstFrameTimeout=function(t,n){return t&&"codec"===(0,s.webRtcFailureDisposition)("first-frame-timeout",n)},e.videoRtpArriving=I,e.useWebRtcStream=function({offerUrl:t,closeUrl:c,closeBeaconUrl:L=c,statsUrl:E="",enabled:P,codec:O,iceServers:D,iceTransportPolicy:F="all",sendIceServersInOffer:U=!0,allowCodecFallback:A=!0,expectContinuousFrames:$=!0,onKeyframeNeeded:M,onBeforeDisconnect:j,fetchImpl:H=fetch,transportLocked:B=!1,raiseH264Level:_=!1}){const[q,x]=(0,o.useState)(null),[G,N]=(0,o.useState)(null),[V,z]=(0,o.useState)(null),[J,K]=(0,o.useState)(null),[Q,X]=(0,o.useState)(!1),[Y,Z]=(0,o.useState)(0),ee=(0,o.useRef)(void 0),te=(0,o.useRef)(!1),ne=(0,o.useRef)(0),re=(0,o.useRef)(0),ie=(0,o.useRef)(null),oe=(0,o.useRef)(j);(0,o.useLayoutEffect)(()=>{oe.current=j},[j]);const ce=(0,o.useRef)(new Set),se=(0,o.useCallback)(t=>(ce.current.add(t),()=>{ce.current.delete(t)}),[]),ae=(0,l.useWebRtcStreamStats)(J,E,ne,Q,H,se),de=(0,o.useCallback)((t=1)=>{ne.current+=t,te.current||(te.current=!0,re.current=0,void 0!==ee.current&&(window.clearTimeout(ee.current),ee.current=void 0),N(null),z(null))},[]),ue=(0,o.useCallback)(()=>{re.current=0,x(null),Z(t=>t+1)},[]);return(0,o.useEffect)(()=>{re.current=0,ie.current=null},[P,t,c,L,E,O,D,F,U,A,$,B,_]),(0,o.useEffect)(()=>{if(!P||!t)return;if(N(null),"undefined"==typeof RTCPeerConnection||"undefined"==typeof RTCRtpReceiver)return x(null),K(null),z("WebRTC is not supported by this browser."),void N({sessionId:k(),kind:"permanent"});let o,j,q=!1,G=null,V=!1,J=null,Q=!1,X=!1,Y=!1,ne=!1,se=0;const ae=new AbortController,de=k(),ue=D?.length?D:f;x(null),N(null),z(null),te.current=!1,void 0!==ee.current&&(window.clearTimeout(ee.current),ee.current=void 0);const le=(t=!1)=>J||(J=(0,u.closeWebRtcSession)({url:c,beaconUrl:L,sessionId:de,keepalive:t,fetchImpl:H}),J),fe=()=>{le(!0)};window.addEventListener("pagehide",fe),window.addEventListener("beforeunload",fe);const ve=()=>{se+=1,void 0!==ee.current&&(window.clearTimeout(ee.current),ee.current=void 0)},me=()=>{void 0!==j&&(window.clearTimeout(j),j=void 0)},pe=()=>{if(ve(),me(),!V){if(V=!0,G)try{oe.current?.()}catch{}x(null),K(t=>t?.sessionId===de?null:t),G?.close()}},be=()=>{try{M?.()}catch{}},we=t=>{q||Q||(Q=!0,z(t),N({sessionId:de,kind:"permanent"}),pe(),le())},ye=()=>{q||Q||(Q=!0,pe(),le().finally(()=>{q||N({sessionId:de,kind:"codec",codec:O})}))},ge=t=>{if(q||Q)return;Q=!0,N(null);const n=re.current++,c=Math.min(R*2**Math.min(n,4),S);be(),z(`${t} Retrying...`),pe(),le(),o=window.setTimeout(()=>{q||Z(t=>t+1)},c)},Re=async()=>{if(!E)return null;try{return await(0,l.requestWebRtcServerStats)(E,de,AbortSignal.any([ae.signal,AbortSignal.timeout(2e3)]),H)}catch{return null}},Se=()=>{q||Q||document.hidden||te.current||!X||!Y||void 0!==ee.current||(ee.current=window.setTimeout(()=>{if(ee.current=void 0,q||te.current)return;const t=se;(async()=>{const n=await I(G);if(q||Q||te.current||t!==se)return;const o=await Re();if(q||Q||document.hidden||te.current||t!==se)return;if(!0===o?.capture?.rebooting)return ne=!1,void Se();const c=o?.encoder?.framesEncoded,u=n||"number"!=typeof c?null:c>0,l=G?.connectionState??"closed",f=(0,s.webRtcFailureDisposition)("first-frame-timeout",l,{mediaArriving:n,senderEncoding:u});"wait"!==f||ne?"transport"!==f&&A?(be(),ye()):ge("WebRTC did not establish a video path."):(ne=!0,Se())})()},b))},he=()=>!q&&!Q&&null!==G&&!document.hidden,Te=(0,n.startPlaybackStallWatchdog)({peer:()=>G,readable:he,judgeable:()=>he()&&"connected"===G?.connectionState&&te.current,publish:(t,n)=>{for(const o of ce.current)o(t,n)},reconnectedAt:ie,failCodec:()=>A?ye():ge("WebRTC playback stalled."),retryTransport:ge,expectContinuousFrames:$,capturePaused:async()=>!0===(await Re())?.capture?.rebooting}),Ce=()=>{ve(),document.hidden||Se()};document.addEventListener("visibilitychange",Ce);return(async()=>{try{G=new RTCPeerConnection({iceServers:ue,iceTransportPolicy:F}),K({peerConnection:G,sessionId:de});const o=G.addTransceiver("video",{direction:"recvonly"}),c=RTCRtpReceiver.getCapabilities("video");c?.codecs.length&&"setCodecPreferences"in o&&o.setCodecPreferences(T(c.codecs,O)),G.ontrack=t=>{q||(X=!0,te.current=!1,t.track.onended=()=>ge("WebRTC video track ended."),x(t.streams[0]??new MediaStream([t.track])),ve(),Se())},G.onconnectionstatechange=()=>{!q&&G&&("connected"===G.connectionState?(Y=!0,me(),Se()):"disconnected"===G.connectionState?(Y=!1,ve(),void 0===j&&(j=window.setTimeout(()=>{j=void 0,!q&&G&&"connected"!==G.connectionState&&ge("WebRTC remained disconnected.")},h))):"failed"!==G.connectionState&&"closed"!==G.connectionState||ge("WebRTC connection failed."))};const s=await G.createOffer();await G.setLocalDescription(s),await(n=G,new Promise(t=>{if("complete"===n.iceGatheringState)return void t();let o,c=!1;const s=()=>{c||(c=!0,n.removeEventListener("icegatheringstatechange",u),void 0!==o&&window.clearTimeout(o),t())},u=()=>{"complete"===n.iceGatheringState&&s()};n.addEventListener("icegatheringstatechange",u),o=window.setTimeout(s,v)}));const l=G.localDescription;if(!l)throw new Error("WebRTC offer was not created");const f=await(0,u.postWebRtcOffer)({url:t,fetchImpl:H,signal:ae.signal,requestTimeoutMs:p,busyRetryIntervalMs:w,busyRetryCount:y,body:JSON.stringify(C({description:l,sessionId:de,codec:O,iceServers:ue,sendIceServersInOffer:U,raiseH264Level:_}))});if(!f.ok){const t=f.status;await(f.body?.cancel());const n=`WebRTC offer failed: HTTP ${t}.`;return void(W(t,B)?ge(n):we(n))}const b=await f.json();if(q)return void await le(!0);try{await G.setRemoteDescription(b)}catch{we("WebRTC returned an invalid session description.")}}catch(t){if(q||ae.signal.aborted)return;if(t instanceof u.WebRtcSignalingBusyError)return void ge("WebRTC signaling stayed busy for too long.");const n=t instanceof u.WebRtcSignalingTimeoutError?"WebRTC signaling timed out.":"WebRTC signaling failed.";ge(n)}var n})(),()=>{q=!0,Te.stop(),document.removeEventListener("visibilitychange",Ce),window.removeEventListener("pagehide",fe),window.removeEventListener("beforeunload",fe),ae.abort(),void 0!==o&&window.clearTimeout(o),pe(),le(!0)}},[P,t,c,L,E,O,D,F,U,A,$,M,Y,H,B,_]),{stream:q,failure:G,error:V,markFrameDecoded:de,restart:ue,streamStats:ae,setStreamStatsEnabled:X,subscribeStats:se}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),s=r(d[4]),u=r(d[5]),l=r(d[6]);const f=[{urls:["stun:stun.l.google.com:19302"]},{urls:["stun:stun1.l.google.com:19302"]}],v=3e3,p=2e4,b=4e3,w=500,y=30,R=500,S=5e3,h=1e4;function T(t,n){const o="h264"===n?"video/h264":"vp9"===n?"video/vp9":"video/vp8";if("h264"!==n)return[...t.filter(t=>t.mimeType.toLowerCase()===o),...t.filter(t=>t.mimeType.toLowerCase()!==o)];const c=t=>t.mimeType.toLowerCase()===o,s=t=>/(?:^|;)\s*packetization-mode=1(?:\s*;|$)/i.test(t.sdpFmtpLine??"");return[...t.filter(t=>c(t)&&s(t)),...t.filter(t=>c(t)&&!s(t)),...t.filter(t=>!c(t))]}function C({description:n,sessionId:o,codec:c,iceServers:s,sendIceServersInOffer:u=!0,raiseH264Level:l=!1}){return Object.assign({type:n.type,sdp:l&&"h264"===c&&n.sdp?(0,t.raiseH264OfferLevel)(n.sdp):n.sdp,sessionId:o,codec:c},u?{iceServers:s}:{})}function W(t,n=!1){return n&&404===t||408===t||425===t||429===t||t>=500}async function I(t){if(!t)return!1;try{let n=!1;return(await(0,c.readStatsBeforeDeadline)(t))?.forEach(t=>{if("inbound-rtp"!==t.type)return;const o=t;"video"!==o.kind&&"video"!==o.mediaType||(o.framesReceived??0)>0&&(n=!0)}),n}catch{return!1}}function k(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint8Array(16));t[6]=15&t[6]|64,t[8]=63&t[8]|128;const n=Array.from(t,t=>t.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}},201,[202,203,38,204,206,208,209]);
|
|
268
268
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"H264_SEND_LEVEL_IDC",{enumerable:!0,get:function(){return t}}),e.raiseH264OfferLevel=function(u,o=t){if(!Number.isInteger(o)||o<=0||o>255)return u;const f=o.toString(16).padStart(2,"0"),p=(t,l,c)=>{const u=Number.parseInt(c.slice(0,2),16),p=Number.parseInt(c.slice(2,4),16),b=Number.parseInt(c.slice(4,6),16);if(b>=o)return t;const _=b===n&&s.has(u)?-17&p:p;return`${l}${c.slice(0,2)}${_.toString(16).padStart(2,"0")}${f}`};return u.replace(c,t=>t.replace(l,p))};const t=52,n=11,s=new Set([66,77,88]),l=/(profile-level-id=)([0-9a-fA-F]{6})(?![0-9a-fA-F])/g,c=/^a=fmtp:[^\r\n]*\blevel-asymmetry-allowed=1\b[^\r\n]*$/gm},202,[]);
|
|
269
269
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseInboundVideo=u,e.startPlaybackStallWatchdog=function({peer:f,readable:v,judgeable:p,publish:S,reconnectedAt:b,failCodec:L,retryTransport:y,expectContinuousFrames:P=!0,capturePaused:A}){let _=c.initialPlaybackStallState,k=null,R=[],D=0,w=null;const C=()=>{D+=1,_=c.initialPlaybackStallState,R=[],w=null},T=(0,n.startExclusivePoll)(async()=>{if(!v())return void C();const n=D,T=f(),h=await(0,t.readStatsBeforeDeadline)(T,o);if(h&&v()&&f()===T&&S(h,Date.now()),!p()||!T)return void C();if(n!==D)return;const B=performance.now();if(null!==w&&B-w>s)return C(),void(w=B);w=B;const O=h?u(h):[],E=(0,c.selectInboundReport)(O,k,R);if(R=O,!E)return void(_=c.initialPlaybackStallState);if(E.id!==k?.id&&(_=c.initialPlaybackStallState),k={id:E.id,framesReceived:E.framesReceived},!P&&E.framesReceived<=_.received)return void(_={decoded:E.framesDecoded,received:E.framesReceived,stalledPolls:0});const K=(0,c.nextPlaybackStallState)(_,{decoded:E.framesDecoded,received:E.framesReceived});if(_=K.stalled?c.initialPlaybackStallState:K.state,!K.stalled)return;if(A){const t=await A();if(n!==D||f()!==T||!p())return;if(t)return void C()}const M=(0,l.webRtcFailureDisposition)("playback-stall",T.connectionState,{mediaArriving:K.mediaArriving}),Y=b.current,x=(0,l.playbackStallAction)(M,null===Y?null:performance.now()-Y);if("fail-codec"===x)return b.current=null,void L();"retry-transport"===x&&("codec"===M&&(b.current=performance.now()),y("WebRTC playback stalled."))},c.PLAYBACK_STALL_POLL_MS);"undefined"!=typeof document&&document.addEventListener("visibilitychange",C);return{stop(){"undefined"!=typeof document&&document.removeEventListener("visibilitychange",C),C(),T()},invalidate:C}};var t=r(d[0]),n=r(d[1]),l=r(d[2]),c=r(d[3]);const o=2*c.PLAYBACK_STALL_POLL_MS,s=c.PLAYBACK_STALL_POLL_MS*c.PLAYBACK_STALL_POLLS;function u(t){const n=[];return t.forEach(t=>{if("inbound-rtp"!==t.type)return;const l=t;"video"!==l.kind&&"video"!==l.mediaType||n.push({id:l.id,framesReceived:l.framesReceived??0,framesDecoded:"number"==typeof l.framesDecoded?l.framesDecoded:null})}),n}},203,[204,205,206,207]);
|
|
270
270
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readStatsBeforeDeadline=async function(n,l=2e3){if(!n)return null;let o,s=t.get(n);s||(s=Promise.resolve().then(()=>n.getStats()).catch(()=>null),t.set(n,s),s.then(()=>t.delete(n)));try{return await Promise.race([s,new Promise(t=>{o=setTimeout(()=>t(null),l)})])}finally{void 0!==o&&clearTimeout(o)}};const t=new WeakMap},204,[]);
|
|
271
271
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.startExclusivePoll=function(t,n){let c=!1,l=!1;const s=async()=>{if(!l&&!c){c=!0;try{await t()}catch{}finally{c=!1}}};s();const o=setInterval(()=>{s()},n);return()=>{l=!0,clearInterval(o)}}},205,[]);
|
|
272
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.nextWebRtcFallbackCodec=n,e.webRtcFallbackDecision=function(t,c,o,l=!1){if(
|
|
272
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.nextWebRtcFallbackCodec=n,e.webRtcFallbackDecision=function(t,c,o,l=!1){if("permanent"===o.kind)return l?null:{type:"switch-to-http"};if(o.codec!==c)return null;const u=n(t,c);return u&&u!==c?{type:"retry-codec",codec:u}:l?{type:"restart-ladder",codec:t}:{type:"switch-to-http"}},e.createLadderBackoff=function(){let t=0,n=null;return{noteFailure(c){null!==n&&c-n>=9e4&&(t=0),n=c},takeRestartDelayMs:()=>Math.min(2e3*2**Math.min(t++,4),3e4)}},e.webRtcFailureDisposition=function(t,n,c={mediaArriving:!1}){if("connected"!==n)return"transport";if("first-frame-timeout"===t)return c.mediaArriving?"wait":!0===c.senderEncoding?"transport":"codec";return"playback-stall"===t&&c.mediaArriving?"codec":"transport"},Object.defineProperty(e,"STALL_RECONNECT_TTL_MS",{enumerable:!0,get:function(){return c}}),e.playbackStallAction=function(t,n){return"transport"===t?"retry-transport":"codec"!==t?"none":null===n?"retry-transport":n<c?"fail-codec":"retry-transport"};const t={h264:["h264","vp8","vp9"],vp9:["vp9","vp8"],vp8:["vp8"]};function n(n,c){const o=t[n],l=o.indexOf(c);return-1===l?o[0]??null:o[l+1]??null}const c=3e4},206,[]);
|
|
273
273
|
__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PLAYBACK_STALL_POLL_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"PLAYBACK_STALL_POLLS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"initialPlaybackStallState",{enumerable:!0,get:function(){return n}}),e.nextPlaybackStallState=function(t,n){const c=n.received>t.received,l=t=>({state:{decoded:n.decoded,received:n.received,stalledPolls:t},stalled:!1,mediaArriving:c});if(null===n.decoded||null===t.decoded)return l(0);if(n.decoded!==t.decoded)return l(0);const o=t.stalledPolls+1;return{state:{decoded:n.decoded,received:t.received,stalledPolls:o},stalled:o>=r,mediaArriving:c}},e.selectInboundReport=function(t,r,n=[]){if(0===t.length)return null;const c=t.reduce((t,r)=>r.framesReceived>t.framesReceived?r:t);if(!r)return c;const l=t.find(t=>t.id===r.id);if(!l)return c;if(l.framesReceived>r.framesReceived)return l;let o=null,a=0;for(const r of t){if(r.id===l.id)continue;const t=n.find(t=>t.id===r.id),c=t?r.framesReceived-t.framesReceived:0;c>a&&(o=r,a=c)}return o||(n.length>0?l:c.framesReceived>l.framesReceived?c:l)};const t=1e3,r=8,n={decoded:null,received:0,stalledPolls:0}},207,[]);
|
|
274
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WebRtcSignalingBusyError",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"WebRtcSignalingTimeoutError",{enumerable:!0,get:function(){return o}}),e.closeWebRtcSession=async function({url:n,beaconUrl:o=n,sessionId:s,keepalive:c=!1,sendBeacon:u,fetchImpl:l=fetch}){const b=JSON.stringify({sessionId:s}),f=u??("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon?navigator.sendBeacon.bind(navigator):void 0);if(c&&f)try{if(f(o,new Blob([b],{type:
|
|
275
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readWebRtcClientCounters=b,e.describeWebRtcClientCounters=M,e.readWebRtcServerStats=D,e.describeWebRtcPublisherCounters=S,e.appendStreamStatsSample=j,e.requestWebRtcServerStats=k,e.useWebRtcStreamStats=function(s,c,p,f,y=fetch,F){const[B,R]=(0,t.useState)(null),v=(0,t.useRef)(null),h=(0,t.useRef)(0);return(0,t.useEffect)(()=>{if(v.current=null,h.current=0,!f||null===s||!c)return void R(null);R({samples:[],encoder:null,capture:null,stale:!1,serverStale:!1});const t=Date.now();let B=!1,w=!1,C=!1,D={serverFps:null,encoder:null,capture:null,publisherCounters:null},T=null,L=0,P=null;const I=async()=>{if(C||B)return;C=!0,P=new AbortController;const t=P,n=window.setTimeout(()=>t.abort(),o);try{const n=await k(c,s.sessionId,t.signal,y);if(B)return;const l=n.publisherCounters?S(T,n.publisherCounters):{publisherFps:null,payloadBitrateBps:null};n.publisherCounters&&(T=n.publisherCounters);const u=n.encoder?Object.assign({},n.encoder,l):null;D=Object.assign({},n,{encoder:u}),L=Date.now(),R(t=>t?Object.assign({},t,{encoder:u,capture:n.capture,serverStale:!1}):t)}catch{}finally{window.clearTimeout(n),P===t&&(P=null),C=!1}},E=(t,n)=>{if(B)return;const s=b(t,n,p.current);if(null===s)return;const l=M(v.current,s);v.current=s,h.current=n;const u=Object.assign({atMs:n,serverFps:D.serverFps},l);R(t=>{const n=t??{samples:[],encoder:null,capture:null,stale:!1,serverStale:!1};return Object.assign({},n,{samples:j(n.samples,u),stale:!1})})},z=async()=>{if(!(F||w||B)){w=!0;try{const t=await(0,n.readStatsBeforeDeadline)(s.peerConnection);null!==t&&E(t,Date.now())}catch{}finally{w=!1}}},O=F?.(E);I(),z();const W=window.setInterval(()=>{I(),z()},l),q=window.setInterval(()=>{const n=Date.now(),s=n-(h.current||t)>u,l=n-(L||t)>u;R(t=>null===t||t.stale===s&&t.serverStale===l?t:Object.assign({},t,{stale:s,serverStale:l}))},l);return()=>{B=!0,O?.(),P?.abort(),window.clearInterval(W),window.clearInterval(q)}},[s,f,p,c,y,F]),B};var t=r(d[0]),n=r(d[1]);const s=250,l=1e3,u=4e3,o=3e3;function c(t){return
|
|
274
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WebRtcSignalingBusyError",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"WebRtcSignalingTimeoutError",{enumerable:!0,get:function(){return o}}),e.closeWebRtcSession=async function({url:n,beaconUrl:o=n,sessionId:s,keepalive:c=!1,sendBeacon:u,fetchImpl:l=fetch}){const b=JSON.stringify({sessionId:s}),f=u??("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon?navigator.sendBeacon.bind(navigator):void 0);if(c&&f)try{if(f(o,new Blob([b],{type:"text/plain;charset=UTF-8"})))return}catch{}await l(n,{method:"POST",headers:{"Content-Type":"application/json"},body:b,keepalive:c,signal:c?void 0:AbortSignal.timeout(t)}).then(()=>{},()=>{})},e.postWebRtcOffer=async function({url:t,body:l,signal:b,requestTimeoutMs:f,busyRetryIntervalMs:y,busyRetryCount:p,fetchImpl:w=fetch}){for(let h=0;h<=p;h++){if(b?.aborted)throw s(b);const v=new AbortController;let T=!1;const E=()=>v.abort(b?s(b):void 0);b?.addEventListener("abort",E,{once:!0});const R=setTimeout(()=>{T=!0,v.abort()},f);let O,S;try{O=await w(t,{method:"POST",headers:{"Content-Type":"application/json"},signal:v.signal,body:l}),S=409===O.status&&await u(O)}catch(t){if(T&&!b?.aborted)throw new o;throw t}finally{clearTimeout(R),b?.removeEventListener("abort",E)}if(!S)return O;if(await(O.body?.cancel()),h===p)throw new n;await c(y,b)}throw new n};const t=2e3;class n extends Error{constructor(){super("WebRTC signaling stayed busy for too long. Reload to try again."),this.name="WebRtcSignalingBusyError"}}class o extends Error{constructor(){super("WebRTC signaling timed out."),this.name="WebRtcSignalingTimeoutError"}}function s(t){return t.reason??new DOMException("The operation was aborted","AbortError")}function c(t,n){return n?.aborted?Promise.reject(s(n)):new Promise((o,c)=>{const u=setTimeout(function(){n?.removeEventListener("abort",l),o()},t);function l(){clearTimeout(u),c(n?s(n):new DOMException("The operation was aborted","AbortError"))}n?.addEventListener("abort",l,{once:!0})})}async function u(t){const n=await t.clone().text();let o,s;try{const t=JSON.parse(n);o=t?.error,s=t?.code}catch{}return"webrtc_session_busy"===s||"webrtc_session_busy"===o||void 0===s&&void 0===o}},208,[]);
|
|
275
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readWebRtcClientCounters=b,e.describeWebRtcClientCounters=M,e.readWebRtcServerStats=D,e.describeWebRtcPublisherCounters=S,e.appendStreamStatsSample=j,e.requestWebRtcServerStats=k,e.useWebRtcStreamStats=function(s,c,p,f,y=fetch,F){const[B,R]=(0,t.useState)(null),v=(0,t.useRef)(null),h=(0,t.useRef)(0);return(0,t.useEffect)(()=>{if(v.current=null,h.current=0,!f||null===s||!c)return void R(null);R({samples:[],encoder:null,capture:null,stale:!1,serverStale:!1});const t=Date.now();let B=!1,w=!1,C=!1,D={serverFps:null,encoder:null,capture:null,publisherCounters:null},T=null,L=0,P=null;const I=async()=>{if(C||B)return;C=!0,P=new AbortController;const t=P,n=window.setTimeout(()=>t.abort(),o);try{const n=await k(c,s.sessionId,t.signal,y);if(B)return;const l=n.publisherCounters?S(T,n.publisherCounters):{publisherFps:null,payloadBitrateBps:null};n.publisherCounters&&(T=n.publisherCounters);const u=n.encoder?Object.assign({},n.encoder,l):null;D=Object.assign({},n,{encoder:u}),L=Date.now(),R(t=>t?Object.assign({},t,{encoder:u,capture:n.capture,serverStale:!1}):t)}catch{}finally{window.clearTimeout(n),P===t&&(P=null),C=!1}},E=(t,n)=>{if(B)return;const s=b(t,n,p.current);if(null===s)return;const l=M(v.current,s);v.current=s,h.current=n;const u=Object.assign({atMs:n,serverFps:D.serverFps},l);R(t=>{const n=t??{samples:[],encoder:null,capture:null,stale:!1,serverStale:!1};return Object.assign({},n,{samples:j(n.samples,u),stale:!1})})},z=async()=>{if(!(F||w||B)){w=!0;try{const t=await(0,n.readStatsBeforeDeadline)(s.peerConnection);null!==t&&E(t,Date.now())}catch{}finally{w=!1}}},O=F?.(E);I(),z();const W=window.setInterval(()=>{I(),z()},l),q=window.setInterval(()=>{const n=Date.now(),s=n-(h.current||t)>u,l=n-(L||t)>u;R(t=>null===t||t.stale===s&&t.serverStale===l?t:Object.assign({},t,{stale:s,serverStale:l}))},l);return()=>{B=!0,O?.(),P?.abort(),window.clearInterval(W),window.clearInterval(q)}},[s,f,p,c,y,F]),B};var t=r(d[0]),n=r(d[1]);const s=250,l=1e3,u=4e3,o=3e3;function c(t){return"number"==typeof t&&Number.isFinite(t)&&t>=0?t:null}function p(t){return"string"==typeof t&&t.length>0?t:null}function f(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function b(t,n,s){const l=new Map,u=new Map;let o=null,f=null,b=null,y=null,F=null,B=-1;for(const n of t.values()){const t=n;switch(t.type){case"inbound-rtp":{if("video"!==t.kind&&"video"!==t.mediaType)break;const n=c(t.framesDecoded)??0;if(n<B)break;B=n,F=t;break}case"transport":"string"==typeof t.selectedCandidatePairId&&(o=t.selectedCandidatePairId);break;case"candidate-pair":"string"==typeof t.id&&l.set(t.id,t),!0===t.selected?f=t:!0===t.nominated&&"succeeded"===t.state?b??=t:"succeeded"===t.state&&(y??=t);break;case"local-candidate":case"remote-candidate":"string"==typeof t.id&&u.set(t.id,t)}}if(null===F)return null;let R=f??b??y;null!==o&&(R=l.get(o)??R);const M=null===R?null:c(R.currentRoundTripTime);let v="unknown";if(null!==R){const t=[R.localCandidateId,R.remoteCandidateId].map(t=>"string"==typeof t?p(u.get(t)?.candidateType):null);t.every(t=>null!==t)&&(v=t.includes("relay")?"relay":"direct")}const h=c(F.totalFreezesDuration),w=c(F.jitter);return{atMs:n,presentedFrames:s,bytesReceived:c(F.bytesReceived),framesDropped:c(F.framesDropped),freezeCount:c(F.freezeCount),freezeDurationMs:null===h?null:1e3*h,packetsReceived:c(F.packetsReceived),packetsLost:c(F.packetsLost),jitterMs:null===w?null:1e3*w,jitterBufferDelaySeconds:c(F.jitterBufferDelay),jitterBufferEmittedCount:c(F.jitterBufferEmittedCount),roundTripMs:null===M?null:1e3*M,icePath:v}}function y(t){return{clientFps:null,clientBitrateBps:null,clientPacketLossRatio:null,clientJitterMs:t.jitterMs,clientJitterBufferMs:null,clientDroppedFrames:null,clientFreezeCount:null,clientFreezeDurationMs:null,clientRoundTripMs:t.roundTripMs,clientIcePath:t.icePath}}function F(t,n){if(null===t.packetsReceived||null===n.packetsReceived||null===t.packetsLost||null===n.packetsLost)return null;const s=n.packetsLost-t.packetsLost,l=n.packetsReceived-t.packetsReceived;if(s<0||l<0)return null;const u=l+s;return u>0?s/u:null}function B(t,n){if(null===t.jitterBufferDelaySeconds||null===n.jitterBufferDelaySeconds||null===t.jitterBufferEmittedCount||null===n.jitterBufferEmittedCount)return null;const s=n.jitterBufferDelaySeconds-t.jitterBufferDelaySeconds,l=n.jitterBufferEmittedCount-t.jitterBufferEmittedCount;return s<0||l<=0?null:s/l*1e3}function R(t,n){if(null===t||null===n)return null;const s=n-t;return s<0?null:s}function M(t,n){const l=y(n);if(null===t)return l;const u=n.atMs-t.atMs;if(u<s)return l;const o=R(t.presentedFrames,n.presentedFrames),c=R(t.bytesReceived,n.bytesReceived),p=R(t.framesDropped,n.framesDropped),f=R(t.freezeCount,n.freezeCount),b=R(t.freezeDurationMs,n.freezeDurationMs),M=u/1e3;return{clientFps:null===o?null:o/M,clientBitrateBps:null===c?null:8*c/M,clientPacketLossRatio:F(t,n),clientJitterMs:n.jitterMs,clientJitterBufferMs:B(t,n),clientDroppedFrames:p,clientFreezeCount:f,clientFreezeDurationMs:b,clientRoundTripMs:n.roundTripMs,clientIcePath:n.icePath}}function v(t){if(!f(t))return null;const n=c(t.targetBitrateBps),s=c(t.targetKbps);return{codec:p(t.codec),encodeFps:c(t.encodeFps)??c(t.reportedFps),targetBitrateBps:n??(null===s?null:1e3*s),encodeMsPerFrame:c(t.encodeMsPerFrame),framesEncoded:c(t.framesEncoded),framesSent:c(t.framesSent),framesDropped:c(t.framesDropped)??c(t.sourceFramesDropped),packetLossRatio:c(t.packetLossRatio)??c(t.lossRatio),qualityLimitationReason:p(t.qualityLimitationReason),publisherFps:c(t.publisherFps),publisherSubmittedFrames:c(t.publisherSubmittedFrames)??c(t.submittedFrames),publisherDroppedFrames:c(t.publisherDroppedFrames),payloadBitrateBps:c(t.payloadBitrateBps)}}function h(t){if(!f(t))return null;const n=f(t.grpc)?t.grpc:null,s=t=>{const s=null!==n&&f(n[t])?n[t]:null;return{p50:c(s?.p50),p95:c(s?.p95)}};return Object.assign({},"boolean"==typeof t.rebooting?{rebooting:t.rebooting}:{},{screenFrames:c(t.screenFrames),idleFrames:c(t.idleFrames),offeredFrames:c(t.offeredFrames),forwardedFrames:c(t.forwardedFrames),pumpRestarts:c(t.pumpRestarts),grpc:null===n?null:{imageMode:"png"===n.imageMode||"mmap"===n.imageMode||"rgb888"===n.imageMode?n.imageMode:null,producerFps:c(n.sourceTimestampFps),receiveFps:c(n.rawMessageReceiveFps),usableImageFps:c(n.usableImageFps),encoderInputFps:c(n.freshEncoderWriteFps),messagesReceived:c(n.rawGrpcMessagesReceived),messagesEmitted:c(n.rawGrpcMessagesEmitted),messagesCoalesced:c(n.rawGrpcMessagesCoalesced),sequenceGaps:c(n.sequenceGaps),imagePayloadBytes:c(n.imagePayloadBytes),transportBytes:c(n.transportBytes),messageBytesReceived:c(n.grpcMessageBytesReceived),mmapFileBytesRead:c(n.mmapFileBytesRead),mmapReadRetries:c(n.mmapReadRetries),mmapTornFramesDropped:c(n.mmapTornFramesDropped),productionToReceiveLatencyMs:s("productionToReceiveLatencyMs"),productionToUsableLatencyMs:s("productionToUsableLatencyMs"),protobufDecodeTimeMs:s("protobufDecodeTimeMs"),mmapReadCopyTimeMs:s("sharedReadCopyTimeMs")}})}function w(t,n){return{codec:p(t.codec),encodeFps:c(t.fps),targetBitrateBps:c(t.configuredBitrateBps),encodeMsPerFrame:null,framesEncoded:c(t.frames),framesSent:null,framesDropped:null,packetLossRatio:null,qualityLimitationReason:null,publisherFps:null,publisherSubmittedFrames:c(n?.submittedFrames),publisherDroppedFrames:c(n?.publisherDroppedFrames),payloadBitrateBps:null}}function C(t,n){if(null===n)return null;const s=c(t.sampledAt),l=c(n.submittedFrames),u=c(n.payloadBytesSubmitted);return null===s||null===l||null===u?null:{atMs:s,submittedFrames:l,payloadBytesSubmitted:u}}function D(t,n){if(!f(t))return{serverFps:null,encoder:null,capture:null,publisherCounters:null};const s=Array.isArray(t.sessions)?t.sessions.find(t=>f(t)&&t.sessionId===n):null,l=f(s)?s:null,u=f(t.source)?t.source:null;if(null!==u)return{serverFps:c(u.fps),encoder:w(u,l),capture:h(t.capture),publisherCounters:C(t,l)};const o=c(t.serverFps);return{serverFps:null===l?o:c(l.sourceFps)??c(l.reportedFps)??o,encoder:v(l??t.encoder),capture:h(t.capture),publisherCounters:null}}function S(t,n){if(null===t)return{publisherFps:null,payloadBitrateBps:null};const l=n.atMs-t.atMs;if(l<s)return{publisherFps:null,payloadBitrateBps:null};const u=n.submittedFrames-t.submittedFrames,o=n.payloadBytesSubmitted-t.payloadBytesSubmitted,c=l/1e3;return{publisherFps:u<0?null:u/c,payloadBitrateBps:o<0?null:8*o/c}}function j(t,n){return[...t,n].slice(-60)}async function k(t,n,s,l){const u=new URL(t,window.location.href);u.searchParams.set("sessionId",n);const o=await l(u,{cache:"no-store",signal:s});if(!o.ok)throw await(o.body?.cancel()),new Error(`WebRTC server statistics unavailable (${o.status})`);return D(await o.json(),n)}},209,[38,204]);
|
|
276
276
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.presentedVideoFrameDelta=function(t,n){if(!Number.isSafeInteger(n)||n<0)return 1;if(null===t||!Number.isSafeInteger(t)||n<=t)return 1;return n-t}},210,[]);
|
|
277
277
|
__d(function(g,_r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WS_TAG_SCREEN_CONFIG",{enumerable:!0,get:function(){return G.WS_MSG_CONFIG}}),e.iosStreamCapabilities=oe,e.toQueryStyleHelperWsUrl=me,e.useIosDeviceClient=function(ae){const{baseUrl:ie,enabled:ve=!0,device:Se=null,streamMode:be,token:ye=null}=ae,we=ve&&!!ie,Ee=(0,n.useMemo)(()=>(0,A.sessionTokenFetch)(ye),[ye]),ke=(0,n.useMemo)(()=>(0,A.sessionTokenProtocols)("ios",ye),[ye]),Ce=we?JSON.stringify([ie,Se,ye]):null,{deviceSettingsStatus:Re,resetRead:Ie,settleRead:Ae}=(0,N.useDeviceSettingsReadStatus)(Ce),Te=(0,n.useRef)(new Map),[Ue,Oe]=(0,n.useState)("idle"),[xe,Le]=(0,n.useState)(null),[Pe,De]=(0,n.useState)(null),[Fe,Ne]=(0,n.useState)(!1),[Me,je]=(0,n.useState)(null),[We,_e]=(0,n.useState)(0),[$e,Ge]=(0,n.useState)([]),[Be,He]=(0,n.useState)(!1),[Je,Qe]=(0,n.useState)(p.createIosEventLogState),Ke=Je.events,[Ve,qe]=(0,n.useState)(!1),[ze,Xe]=(0,n.useState)(null),[Ye,Ze]=(0,n.useState)(null),[et,tt]=(0,n.useState)(se),[rt,nt]=(0,n.useState)(null),st=rt?.key===Ce?rt:null,at=st?.config??null,it=we?JSON.stringify([ie,Se,ye,at?.url,at?.device,at?.pid,at?.metricsPath,at?.execWsUrl,at?.execToken]):null,{activityStatus:ct,setActivityStatus:ot}=(0,c.useActivityStatus)(it),lt=(0,n.useRef)(null),ut=(0,n.useRef)(null),dt=(0,n.useRef)(!1),pt=at?oe(at.initialStreamSettings):null,ft=pt?(0,O.resolveDeviceStreamMode)(be,pt.modeAvailability):be,mt=st?.middleware.execWsUrl??null,gt=st?.middleware.execToken??null,ht=(0,n.useMemo)(()=>mt&>?(0,r.createControlSocket)(mt,gt,{retryMs:B,openSocket:t=>new WebSocket(t,ke)}):null,[mt,gt,ke]);(0,n.useEffect)(()=>(ht?.activate(),()=>ht?.dispose()),[ht]);const vt=(0,n.useCallback)((t,r,n)=>(0,f.hostUiRequest)(t,r,n,ke,ht??void 0),[ht,ke]),[St,bt]=(0,n.useState)(null),[yt,wt]=(0,n.useState)(null),[Et,kt]=(0,n.useState)(()=>new Set),[Ct,Rt]=(0,n.useState)(null),[It,At]=(0,n.useState)(null),Tt=(0,n.useRef)(null),Ut=(0,n.useRef)({scope:null,helper:null,messages:[]}),Ot=at?JSON.stringify([at.device,at.wsUrl,at.pid,at.execToken]):null,[xt,Lt]=(0,n.useState)(()=>({scope:Ce,helper:Ot,identity:Symbol("ios-input")}));xt.scope!==Ce||null!==xt.helper&&null!==Ot&&xt.helper!==Ot?Lt({scope:Ce,helper:Ot,identity:Symbol("ios-input")}):null===xt.helper&&null!==Ot&&Lt(Object.assign({},xt,{helper:Ot}));const Pt=xt.identity,Dt=(0,n.useRef)(Pt);(0,n.useLayoutEffect)(()=>{Dt.current=Pt},[Pt]);const Ft=(0,n.useCallback)(()=>Dt.current===Pt&&null!==Ut.current.scope,[Pt]);(0,n.useLayoutEffect)(()=>{const t=Ut.current,r=t.scope===Ce,n=Ot??(r?t.helper:null);!r||null!==t.helper&&t.helper!==n?(Tt.current?.dispose(),Tt.current=null,Ut.current={scope:Ce,helper:n,messages:[]}):t.helper=n},[Ce,Ot]);const Nt=(0,n.useRef)(0),Mt=(0,n.useRef)(null),jt=(0,n.useRef)(null),Wt=(0,n.useRef)(null),[_t,$t]=(0,n.useState)(null),Gt=(0,n.useRef)(null),[Bt,Ht]=(0,n.useReducer)(s.avccFallbackReducer,s.initialAvccFallback),[Jt,Qt]=(0,n.useState)("h264"),[Kt,Vt]=(0,n.useState)("h264"),qt=(0,n.useRef)(new k.KeyedWriteTracker),zt=(0,n.useRef)(at);(0,n.useLayoutEffect)(()=>{zt.current=at},[at]);const Xt=(0,n.useRef)(0),Yt=at?.transportLocked??!1,Zt="webrtc"===ft,er="h264"===ft&&(0,l.isAvccSupported)()&&!Bt.fellBack;(0,n.useEffect)(()=>{"webrtc"!==ft&&Vt(Jt)},[ft,Jt]);const tr=(0,n.useRef)(!1),rr=(0,n.useRef)(null);(0,n.useEffect)(()=>{rr.current=Me},[Me]);const nr=(0,n.useRef)((0,R.createRotationCursor)());(0,n.useEffect)(()=>{nr.current.updateReadback(Me?.orientation)},[Me?.orientation]);const sr=(0,n.useRef)(!1),ar=(0,n.useCallback)(()=>{const t=Mt.current,r=Gt.current;t&&r&&(t.src=`${r}${r.includes("?")?"&":"?"}t=${Date.now()}`)},[]),ir=(0,n.useCallback)(t=>{Zt?(Wt.current=t??null,$t(Wt.current),jt.current=null,Mt.current=null):er?(jt.current=t??null,Wt.current=null,$t(null),Mt.current=null):(Mt.current=t??null,jt.current=null,Wt.current=null,$t(null),t&&ar())},[ar,er,Zt]),cr=(0,n.useCallback)((t,r,n)=>{if(!Ft())return!1;const s=Ut.current;return Tt.current&&zt.current?Tt.current.send(t,r,n):s.messages=(0,$.sendOrQueueWsMessage)(null,s.messages,t,r,Date.now(),n),!0},[Ft]),or=(0,n.useCallback)(t=>{if(!Ft())return;const r=(0,u.streamGeometry)(rr.current).inputOrientation;let n;"begin"===t.phase?(tr.current=void 0!==(0,u.homeIndicatorEdge)(t),tr.current&&(n=u.HID_EDGE_BOTTOM)):tr.current&&(n=u.HID_EDGE_BOTTOM,"end"===t.phase&&(tr.current=!1));const s=(0,u.rawPointForDisplayPoint)(r,t.x,t.y),a=void 0===n?void 0:(0,u.rawEdgeForDisplayEdge)(r,n),c=void 0===a?Object.assign({type:t.phase},s):Object.assign({type:t.phase},s,{edge:a});if("end"===t.phase&&t.cancelled){const t=Ut.current;t.messages=(0,$.discardUnfinishedQueuedGestures)(t.messages,V);const r=Tt.current;r?.discardUnfinishedGestures(V),r?.trySend(V,c)}else cr(V,c)},[cr,Ft]),lr=(0,n.useCallback)(t=>{const r=(0,u.streamGeometry)(rr.current).inputOrientation,n=(0,u.rawPointForDisplayPoint)(r,t.a.x,t.a.y),s=(0,u.rawPointForDisplayPoint)(r,t.b.x,t.b.y);cr(z,{type:t.phase,x1:n.x,y1:n.y,x2:s.x,y2:s.y})},[cr]),ur=(0,n.useCallback)(t=>{if(!Number.isFinite(t.dx)||!Number.isFinite(t.dy))return;if(0===t.dx&&0===t.dy)return;const r=(0,u.streamGeometry)(rr.current).inputOrientation,n=(0,u.rawDeltaForDisplayDelta)(r,t.dx,t.dy),s=(0,u.rawPointForDisplayPoint)(r,t.x,t.y);cr(Z,{dx:n.dx,dy:n.dy,x:s.x,y:s.y})},[cr]),dr=(0,n.useCallback)(t=>{const r=(0,b.iosMessageForKeyboardInput)(t);return!!r&&cr(X,r)},[cr]),pr=(0,n.useMemo)(()=>(0,C.createPacedKeySender)(t=>cr(X,{type:t.type,usage:t.usage})),[cr]),fr=(0,n.useCallback)(()=>{const t=pr.cancel();if(!Ft())return;const r=Ut.current;r.messages=r.messages.filter(t=>t.tag!==X&&t.tag!==Z),r.messages=(0,$.discardUnfinishedQueuedGestures)(r.messages,V),r.messages=(0,$.discardUnfinishedQueuedGestures)(r.messages,z);const n=Tt.current;n?.discardQueued(X),n?.discardQueued(Z),n?.discardUnfinishedGestures(V),n?.discardUnfinishedGestures(z);for(const r of t)n?.trySend(X,r)},[pr,Ft]);(0,n.useEffect)(()=>{const r=(0,t.listenForInputCancellation)(fr);return()=>{r(),pr.dispose()}},[fr,pr]);const mr=(0,n.useCallback)(t=>{Ft()&&pr.enqueue(t)},[pr,Ft]),gr=(0,n.useCallback)(t=>{const r=at;if(!(r&&r.execWsUrl&&r.execToken&&r.device))return;const n=Ct;Rt(t),vt(r.execWsUrl,r.execToken,{device:r.device,option:ne,value:t?"on":"off"}).catch(()=>Rt(n))},[at,Ct,vt]),hr=(0,n.useCallback)(()=>{cr(ee,{})},[cr]),vr=(0,n.useCallback)(t=>{const r=le[t];r&&cr(q,{button:r})},[cr]),Sr=(0,n.useCallback)(async()=>{const t=(t,r)=>cr(X,{type:t,usage:r});t("down",re),await new Promise(t=>setTimeout(t,30)),t("up",re)},[cr]),br=(0,n.useCallback)(()=>{cr(Y,()=>({orientation:nr.current.peekNext()}),t=>nr.current.recordSent(t.orientation))},[cr]),yr=(0,n.useCallback)(async()=>{if(!ie)return null;const t=at?.device??Se;return(0,S.fetchScreenshot)(ie,t,Ee)},[ie,Se,at,Ee]),wr=(0,n.useCallback)((t,r)=>{const n=at;if(!n?.execWsUrl||!n.execToken||!n.device)return;const{device:s,execToken:a,execWsUrl:c}=n,o=qt.current,l=o.start(t);l&&(Te.current.set(t,(Te.current.get(t)??0)+1),kt(o.pending),wt(n=>Object.assign({},n??{},{[t]:r})),"appearance"!==t||"light"!==r&&"dark"!==r||bt(r),vt(c,a,{device:s,option:t,value:r}).catch(async()=>{if(o.isCurrent(l)&&zt.current===n)try{const r=await vt(c,a,{device:s});if(!o.isCurrent(l)||zt.current!==n)return;const u={};for(const[t,n]of Object.entries(r.status??{}))"string"==typeof n&&(u[t]=n);if(wt(r=>(0,w.mergeAuthoritativeDeviceSetting)(r,t,u)),"appearance"===t){const t=u.appearance;"light"!==t&&"dark"!==t||bt(t)}}catch{}}).finally(()=>{o.finish(l)&&kt(o.pending)}))},[at,vt]),Er=(0,n.useCallback)(t=>wr("appearance",t),[wr]),kr=(0,n.useCallback)(t=>{Qt(t),Vt(t)},[]),Cr=(0,n.useCallback)(()=>He(!0),[]),Rr=(0,n.useCallback)(()=>He(!1),[]),Ir=(0,n.useCallback)(()=>Ge([]),[]),Ar=(0,n.useCallback)(()=>qe(!0),[]),Tr=(0,n.useCallback)(()=>qe(!1),[]),Ur=(0,n.useCallback)(()=>{const t=at?.device;t&&Qe(r=>(0,p.clearIosEventLogState)(r,t))},[at?.device]);(0,n.useEffect)(()=>{if(!we||!ie)return nt(null),void Oe("idle");let t=!1,r=null,n=!1,s=0,a=null,c=null;Oe("connecting"),Le(null);const o=`${ie.replace(/\/$/,"")}/api${Se?`?device=${encodeURIComponent(Se)}`:""}`,l=t=>{const r=new URL(ie,window.location.href),n=(0,I.proxyPreviewConfigForBrowser)(t,r),s="/"===n.basePath?"":n.basePath??"",a=t=>t?n.proxyHelpers?(0,I.middlewareEndpointForBrowser)(t,r,s):new URL(t,r).toString():null,c=a(n.appStateEndpoint);return Object.assign({url:n.url,streamUrl:(0,A.withSessionTokenQuery)(n.streamUrl??`${n.url}/stream.mjpeg`,ye),wsUrl:me(n.wsUrl??`${fe(n.url)}/ws`),inputAdmission:!0===n.inputAdmission,device:n.device??null,pid:n.pid??null,configEventsPath:`${s}/api/events${Se?`?device=${encodeURIComponent(Se)}`:""}`,execWsUrl:fe(a(`${s}/exec-ws`)),execToken:n.execToken??null,logsPath:n.logsEndpoint??null,appStateUrl:c&&(0,A.withSessionTokenQuery)(c,ye),appIconUrl:a(n.appIconEndpoint),eventsPath:n.eventLogEventsEndpoint??null,metricsPath:n.metricsEndpoint??null,axUrl:a(n.axEndpoint),streamSettingsUrl:n.streamSettingsEndpoint?n.proxyHelpers?`${n.url}/stream-settings`:a(n.streamSettingsEndpoint):null,initialStreamSettings:n.streamSettings,transportLocked:"webrtc"===n.streamSettings?.transport,gridApiUrl:a(n.gridApiEndpoint??`${s}/grid/api`),webRtcCodec:"webrtc"===n.streamSettings?.transport?n.streamSettings.codec:"h264"},"webrtc"===n.streamSettings?.transport&&n.streamSettings.iceServers?{webRtcIceServers:n.streamSettings.iceServers}:{})};let u=!1;const p=n=>{if(t)return;const o=n?.url&&n.device?l(n):null;if(s++,r&&clearTimeout(r),r=null,!o)return a=null,nt(t=>t?.key===ge(ie,Se,ye)?Object.assign({},t,{config:null}):t),Oe("connecting"),Le(null),void(r=setTimeout(f,B));if(a&&he(a)===he(o))return;a&&JSON.stringify(a.webRtcIceServers)===JSON.stringify(o.webRtcIceServers)&&(o.webRtcIceServers=a.webRtcIceServers);const u=c&&oe(c.initialStreamSettings),d=oe(o.initialStreamSettings);c&&c.device===o.device&&u?.modeAvailability.webrtc===d.modeAvailability.webrtc&&c.webRtcCodec===o.webRtcCodec||kr(o.webRtcCodec),a=o,c=o,nt({key:ge(ie,Se,ye),config:o,middleware:{execWsUrl:o.execWsUrl,execToken:o.execToken,configEventsPath:o.configEventsPath}})},f=async()=>{if(t||n)return;r&&clearTimeout(r),r=null,n=!0;const c=s;try{const r=await Ee(o,{signal:AbortSignal.timeout(3e3),cache:"no-store"});if(!r.ok)throw new Error(`Discovery failed: ${r.status}`);const n=await r.json();if(t||c!==s)return;Ze(null),p(n),n?.url&&n.device||!Se||u||(u=!0,(0,d.startIosHelper)(Se,ie,Ee).catch(()=>{}))}catch{t||c!==s||(a||(Ae("error"),Ze(ge(ie,Se,ye))),r=setTimeout(f,B))}finally{n=!1}},h=()=>{f()};return lt.current=h,ut.current=p,h(),()=>{t=!0,r&&clearTimeout(r),lt.current===h&&(lt.current=null),ut.current===p&&(ut.current=null)}},[we,ie,Se,kr,Ee,ye,Ae]);const Or=at?JSON.stringify([at.url,at.device,at.pid,at.execToken]):null,xr=(0,n.useMemo)(()=>Or?(...t)=>Ee(...t):Ee,[Ee,Or]),Lr=(0,n.useRef)({frames:0,startedAt:0}),Pr=(0,n.useCallback)((t=1)=>{const r=performance.now(),n=Lr.current;if(0===n.startedAt&&(n.startedAt=r),n.frames+=t,r-n.startedAt<1e3)return;const s=Math.round(1e3*n.frames/(r-n.startedAt));n.frames=0,n.startedAt=r,_e(t=>t===s?t:s)},[]),{stream:Dr,failure:Fr,error:Nr,markFrameDecoded:Mr,restart:jr,streamStats:Wr,setStreamStatsEnabled:$r}=(0,M.useWebRtcStream)({offerUrl:at?`${at.url}/webrtc/offer`:"",closeUrl:at?`${at.url}/webrtc/close`:"",closeBeaconUrl:at?(0,A.withSessionTokenQuery)(`${at.url}/webrtc/close`,ye):"",statsUrl:at?`${at.url}/webrtc/stats`:"",enabled:we&&Zt&&!!at,codec:Kt,iceServers:at?.webRtcIceServers,fetchImpl:xr,transportLocked:Yt,raiseH264Level:!0}),Gr=(0,n.useRef)(null),Br=(0,n.useRef)((0,W.createLadderBackoff)());(0,n.useEffect)(()=>{Br.current=(0,W.createLadderBackoff)()},[at?.url,Jt]);const Hr="codec"===Fr?.kind?(0,W.webRtcFallbackDecision)(Jt,Kt,Fr,Yt)?.type:void 0,Jr="switch-to-http"===Hr||"restart-ladder"===Hr,Qr=(0,n.useCallback)(t=>{kr(t),Br.current=(0,W.createLadderBackoff)(),t===Kt&&Fr&&jr()},[Kt,Fr,jr,kr]);(0,n.useEffect)(()=>{if(!Zt||!Fr)return;if(Gr.current===Fr.sessionId)return;Gr.current=Fr.sessionId;const t=(0,W.webRtcFallbackDecision)(Jt,Kt,Fr,Yt),r=Br.current;if(Yt&&t&&r.noteFailure(performance.now()),"retry-codec"===t?.type&&Vt(t.codec),"restart-ladder"!==t?.type)return;const n=setTimeout(()=>{Vt(t.codec),jr()},r.takeRestartDelayMs());return()=>clearTimeout(n)},[Zt,Fr,Jt,Kt,Yt,jr]),(0,n.useEffect)(()=>{Zt&&(Nr||Jr?(Oe("error"),Le(Nr??"No supported WebRTC codec could establish a video stream.")):Dr||(Oe("connecting"),Le(null)))},[Zt,Nr,Dr,Jr]),(0,n.useEffect)(()=>{if(!Zt)return;const t=_t;if(!t)return;let r=!1,n=!0,s=0,a=null;const c=(s=1)=>{if(r)return;const{videoWidth:a,videoHeight:c}=t;a>0&&c>0&&!sr.current&&je(t=>t&&void 0===t.orientation&&t.width===a&&t.height===c?t:{width:a,height:c}),Pr(s),Mr(s),n&&(n=!1,Oe("streaming"),Le(null))},o=(n,l)=>{if(r)return;const u=(0,j.presentedVideoFrameDelta)(a,l.presentedFrames);Number.isSafeInteger(l.presentedFrames)&&l.presentedFrames>=0&&(a=l.presentedFrames),c(u),s=t.requestVideoFrameCallback(o)},l=()=>c(),u=()=>c(0),d=()=>{r||document.hidden||Wt.current!==t||!t.paused||t.play().catch(()=>{})};if(t.srcObject=Dr,Dr){"function"==typeof t.requestVideoFrameCallback?s=t.requestVideoFrameCallback(o):t.addEventListener("timeupdate",l),t.addEventListener("loadeddata",u,{once:!0}),document.addEventListener("visibilitychange",d),t.play().catch(()=>{})}return()=>{r=!0,document.removeEventListener("visibilitychange",d),t.removeEventListener("loadeddata",u),t.removeEventListener("timeupdate",l),s&&"function"==typeof t.cancelVideoFrameCallback&&t.cancelVideoFrameCallback(s),t.srcObject=null}},[Zt,Dr,_t,Mr,Pr]),(0,n.useEffect)(()=>{Ht("reset"),_e(0)},[ft,Or,at?.webRtcCodec]),(0,n.useEffect)(()=>{if(!er||!at?.url)return;const t=setTimeout(()=>Ht("timeout"),s.AVCC_FRAME_TIMEOUT_MS);return()=>clearTimeout(t)},[er,at?.url,Or]),(0,P.useAvccStream)({url:at?.url??"",enabled:we&&er&&!!at,canvasRef:jt,fetchImpl:xr,onFirstFrame:()=>{Oe("streaming"),Le(null)},onFrame:Pr,onDecodedFrame:()=>Ht("decoded-frame"),onResize:(t,r)=>{sr.current||je(n=>n&&void 0===n.orientation&&n.width===t&&n.height===r?n:{width:t,height:r})},onError:t=>{Oe("error"),Le(t)},onDecoderError:()=>Ht("error")});const Kr=er||Zt?null:at?.streamUrl??null;(0,n.useEffect)(()=>{if(!Kr)return void(Gt.current=null);Gt.current=Kr,Oe("connecting"),Le(null);let t=!1,r=!1,n=null;const s=Mt.current,a=()=>{if(t||r)return;const n=Mt.current;n&&0!==n.naturalWidth&&0!==n.naturalHeight&&(r=!0,Oe("streaming"),Le(null),sr.current||je(t=>t&&void 0===t.orientation&&t.width===n.naturalWidth&&t.height===n.naturalHeight?t:{width:n.naturalWidth,height:n.naturalHeight}))},c=()=>{t||(r=!1,Oe("error"),Le("Stream unavailable \u2014 retrying\u2026"),n=setTimeout(()=>{t||ar()},B))};s?.addEventListener("load",a),s?.addEventListener("error",c),ar();const o=setInterval(a,400);return()=>{t=!0,clearInterval(o),n&&clearTimeout(n),s?.removeEventListener("load",a),s?.removeEventListener("error",c);const r=Mt.current;r&&r.removeAttribute("src"),je(null),_e(0)}},[Kr,Or,ar]);const Vr=at?.wsUrl??null,qr=at?.inputAdmission??!1,zr=at?.device??null;(0,n.useEffect)(()=>{nr.current=(0,R.createRotationCursor)(rr.current?.orientation??"portrait")},[Vr,zr,Or]);const Xr=(0,n.useRef)(void 0),Yr=(0,n.useRef)(null);(0,n.useEffect)(()=>{const t=Yr.current,r=null!==t&&t.scope===Ce,n=Vr?JSON.stringify([zr,Vr]):r?t.helper:null;null===t||r&&t.helper===n||(clearTimeout(Xr.current),Xr.current=void 0,De(null)),Yr.current={scope:Ce,helper:n}},[Ce,Vr,zr]),(0,n.useEffect)(()=>()=>clearTimeout(Xr.current),[]),(0,n.useEffect)(()=>{if(Rt(null),De(t=>void 0===Xr.current?null:t),Ne(!1),!Vr)return;let t;sr.current=!1;const r=Ut.current,n=r.messages;r.messages=[];const s=(0,_.createInputSocket)(Vr,{onAdmitted(){if(!s.trySend(te,{enabled:!1}))return!1;Rt(!1)},onMessage(t){if(!(t instanceof ArrayBuffer))return!1;const r=new Uint8Array(t);if(r[0]!==G.WS_MSG_CONFIG)return!1;try{const t=JSON.parse(ue.decode(r.subarray(1)));return!("number"!=typeof t.width||"number"!=typeof t.height||!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||void 0!==t.inputUnavailable&&"boolean"!=typeof t.inputUnavailable)&&(nr.current.updateReadback(t.orientation),Ne(!0===t.inputUnavailable),sr.current=!0,je(r=>r?.width===t.width&&r.height===t.height&&r.orientation===t.orientation?r:t),!0)}catch{return!1}},onDisconnect(){Rt(null),clearTimeout(t),t=setTimeout(()=>{dt.current||lt.current?.()},B)},onRefused(t){clearTimeout(Xr.current),Xr.current=void 0,De(t),t!==G.WS_REASON_INPUT_UNAVAILABLE&&(Xr.current=setTimeout(()=>{Xr.current=void 0,De(r=>r===t?null:r)},5e3))},onRecovered(){De(null)}},{initialMessages:n,requireAdmission:qr,reconnectDelayMs:B,openSocket:t=>new WebSocket(t,ke)});return Tt.current=s,s.start(),()=>{clearTimeout(t);let n=s.takePending();if(s.dispose(),Ut.current===r){for(const t of r.messages)n=(0,$.enqueueWsMessage)(n,t);r.messages=n}Tt.current===s&&(Tt.current=null),Rt(null)}},[Vr,qr,zr,ke,Or]);const Zr=st?.middleware.execWsUrl??null,en=st?.middleware.execToken??null,tn=st?.middleware.configEventsPath??null,rn=at?.logsPath??null,nn=at?.eventsPath??null,sn=at?.metricsPath??null,an=at?.device??null,cn=at?.axUrl??null,on=(0,n.useMemo)(()=>cn?t=>(0,o.loadIosAccessibility)(cn,t,Ee):null,[cn,Ee]),ln=(0,x.useAccessibility)(on),un=(0,n.useMemo)(()=>Zr&&en?(t,r)=>(0,f.runHostAction)(Zr,en,t,r,ke,ht??void 0):null,[Zr,en,ke,ht]),dn=(0,n.useMemo)(()=>un&&an?{set:t=>(0,v.setIosLocation)(un,an,t),clear:()=>(0,v.clearIosLocation)(un,an)}:null,[un,an]),{location:pn,locationPending:fn,locationError:mn,setLocation:gn,clearLocation:hn,locationCapabilities:vn}=(0,D.useDeviceLocation)(dn),Sn=(0,L.useAppPermissions)({active:we,appId:null,backend:null});(0,n.useEffect)(()=>{Qe((0,p.createIosEventLogState)())},[nn,an]),(0,n.useEffect)(()=>{if(Xt.current=0,!sn)return void Xe(null);Xe({hostCores:null,samples:[],errored:!1,stale:!1});const t=setInterval(()=>{const t=Xt.current;t>0&&Date.now()-t>Q&&Xe(t=>t&&!t.stale?Object.assign({},t,{stale:!0}):t)},1e3);return()=>clearInterval(t)},[sn,it]);const bn=(0,n.useCallback)((t,r)=>{if("logs"===t){let t=r.data;try{const n=JSON.parse(r.data);"string"==typeof n.eventMessage&&(t=n.eventMessage)}catch{}return void(t&&Ge(r=>[...r,{id:"i"+ ++Nt.current,source:"syslog",message:t}].slice(-200)))}if("events"===t&&an)Qe(t=>(0,p.mergeIosEventLogPayload)(t,r.data,an));else if("metrics"===t)try{const t=JSON.parse(r.data);if("meta"===r.event){if(!t||"object"!=typeof t||Array.isArray(t))return;const r=(0,a.parseActivityHostCores)(t);return ot("ready"),void Xe(t=>t&&(t.hostCores!==r||t.errored)?Object.assign({},t,{hostCores:r,errored:!1}):t)}const n=(0,a.parseActivitySample)(t);if(!n)return;ot("ready"),Xt.current=Date.now(),Xe(t=>(0,a.appendActivitySample)(t??{hostCores:null,samples:[],errored:!1,stale:!1},n))}catch{}},[an,ot]),yn=(0,n.useCallback)((t,r)=>{if(!ht)return;let n="";return"metrics"===t&&ot("loading"),ht.subscribe(r,r=>{n=(0,T.drainSseChunk)(n,r,r=>bn(t,r))},()=>{n="","metrics"===t&&(ot("error"),Xe(t=>t&&!t.errored?Object.assign({},t,{errored:!0}):t))})},[ht,bn,ot]);(0,n.useEffect)(()=>{if(Be&&rn)return yn("logs",rn)},[Be,rn,yn]),(0,n.useEffect)(()=>{if(Ve&&nn&&an)return yn("events",nn)},[Ve,nn,an,yn]),(0,n.useEffect)(()=>{if(sn)return yn("metrics",sn)},[sn,yn]),(0,n.useEffect)(()=>{if(!ht||!tn)return;let t,r="";const n=ht.subscribe(tn,t=>{r=(0,T.drainSseChunk)(r,t,t=>{try{ut.current?.(JSON.parse(t.data)),dt.current=!0}catch{}})},()=>{r="",dt.current=!1,clearTimeout(t),t=setTimeout(()=>lt.current?.(),B)});return()=>{clearTimeout(t),dt.current=!1,n()}},[ht,tn]),(0,n.useEffect)(()=>{const t=qt.current;if(t.reset(),Te.current.clear(),kt(new Set),Ie(),bt(null),wt(null),!Zr||!en||!an)return void(an&&Ae("error"));let r=!1,n=!1,s=!1,a=0,c=!1,o=B,l=null;const u="undefined"==typeof document?null:document,d=()=>!0===u?.hidden,p=()=>{l&&clearTimeout(l),l=null},f=t=>{p(),r||n||d()||(l=setTimeout(()=>{h()},t))},h=async()=>{if(r||n||d())return;const l=++a;if(s)return void(c=!0);c=!1,p(),s=!0;const u=new Map(Te.current),v=t.pending;try{const n=await vt(Zr,en,{device:an});if(r||l!==a)return;if(!n.status||"object"!=typeof n.status||Array.isArray(n.status))throw new Error("Simulator settings request returned an invalid status");const s={};for(const[t,r]of Object.entries(n.status))"string"==typeof r&&(s[t]=r);const c=t.pending,d=t=>!v.has(t)&&!c.has(t)&&Te.current.get(t)===u.get(t);wt(t=>{let r=t??{};for(const n of new Set([...Object.keys(r),...Object.keys(s)])){const a=n;d(a)&&r[a]!==s[a]&&(r===t&&(r=Object.assign({},r)),void 0===s[a]?delete r[a]:r[a]=s[a])}return r}),Ae("ready"),!d("appearance")||"light"!==s.appearance&&"dark"!==s.appearance||bt(s.appearance);const p=n.status?.[ne];"on"!==p&&"off"!==p||Rt(t=>t??"on"===p),o=B,f(H)}catch{r||l!==a||(Ae("error"),f(o),o=Math.min(2*o,J))}finally{s=!1,!r&&c&&h()}},v=()=>{d()?(c=!1,p()):(o=B,h())};u?.addEventListener("visibilitychange",v);const S=ht?.onConnectionChange(t=>{r||(t?n&&(n=!1,o=B,h()):(n=!0,a++,c=!1,p(),Ae("error")))});return h(),()=>{r=!0,p(),S?.(),u?.removeEventListener("visibilitychange",v)}},[Zr,en,an,ht,vt,Ie,Ae]);const wn=at?.streamSettingsUrl??null,En=at?.initialStreamSettings,kn=(0,n.useMemo)(()=>wn?(0,U.normalizeDeviceStreamSettings)(En):null,[En,wn]),{streamSettings:Cn,streamSettingsPending:Rn,updateStreamSettings:In}=(0,F.useStreamSettingsResource)({url:wn,initialSettings:kn,parse:de,toPatch:pe,fetchImpl:Ee}),An=at?.appStateUrl??null;(0,n.useEffect)(()=>{if(At(null),!An)return;let t=null;try{t=new EventSource(An)}catch{return}return t.onmessage=t=>{try{const r=JSON.parse(String(t.data));r.bundleId&&At(t=>t&&t.id===r.bundleId?t.pid===r.pid&&t.isReactNative===r.isReactNative?t:Object.assign({},t,{pid:r.pid,isReactNative:r.isReactNative}):{id:r.bundleId,pid:r.pid,isReactNative:r.isReactNative})}catch{}},()=>t?.close()},[An]);const Tn=It?.id??null,Un=at?.appIconUrl??null;(0,n.useEffect)(()=>{if(!Tn||!un||!an)return;let t=!1;return(0,h.getIosAppDetails)(un,an,Tn,{includeIcon:!Un}).then(r=>{!t&&r&&At(t=>t&&t.id===Tn?Object.assign({},t,r):t)}).catch(()=>{}),()=>{t=!0}},[Tn,un,an,Un]),(0,n.useEffect)(()=>{if(!Tn||!Un)return;const t=new AbortController;return(0,h.fetchIosAppIcon)(Un,Tn,{fetchImpl:Ee,signal:t.signal}).then(r=>{!t.signal.aborted&&r&&At(t=>t&&t.id===Tn?Object.assign({},t,{iconDataUrl:r}):t)}).catch(()=>{}),()=>t.abort()},[Tn,Un,Ee]);const On=at?.gridApiUrl??null;(0,n.useEffect)(()=>{if(!On)return void tt(se);let t=!1;return Ee(On,{signal:AbortSignal.timeout(3e3)}).then(t=>t.json()).then(r=>{!t&&Array.isArray(r.devices)&&0!==r.devices.length&&tt(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}},[On,Ee]);const xn=!!Zr&&!!en&&!!an,Ln=!!sn,Pn=!!nn,Dn=null!==on,Fn=!!wn,Nn=(0,n.useMemo)(()=>({deviceSettings:xn,activity:Ln,events:Pn,camera:!1,accessibility:Dn,streamSettings:!!Fn&&ce,location:vn,permissions:!1}),[xn,Ln,Pn,Dn,Fn,vn]);return Object.assign({platform:"ios",status:Ue,error:xe,inputError:Fe?E.IOS_INPUT_UNAVAILABLE_MESSAGE:Pe,screen:Me,fps:We,devices:et,logs:$e,logsEnabled:Be,attachLogs:Cr,detachLogs:Rr,clearLogs:Ir,events:Ke,eventsEnabled:Ve,attachEvents:Ar,detachEvents:Tr,clearEvents:Ur,activity:ze,activityStatus:!we||at&&!sn?"idle":!at&&Ye===Ce||sn&&(!Zr||!en)?"error":ct,deviceSettings:yt,deviceSettingsStatus:Re,deviceSettingsPending:Et,setDeviceSetting:wr,displayWidthDp:null,camera:null,cameraPending:y.NO_PENDING_CAMERA_WRITES,cameraError:null,setCameraImage:K,clearCameraImage:K},ln,{location:pn,locationPending:fn,locationError:mn,setLocation:gn,clearLocation:hn},Sn,{streamCapabilities:pt,screenRecording:null,streamSettings:Cn,streamSettingsPending:Rn,updateStreamSettings:In,streamSource:null,streamSourcePending:!1,streamSourceError:null,setStreamSource:K,setGrpcImageMode:K,setGrpcEncoder:K,setGrpcInputSource:K,streamStats:Wr,setStreamStatsEnabled:$r,webRtcCodec:Jt,setWebRtcCodec:Qr,capabilities:Nn,foregroundApp:It,videoKind:Zt?"video":er?"canvas":"img",attachVideo:ir,sendTouch:or,sendMultiTouch:lr,cancelInput:fr,sendKey:dr,sendKeyEvents:mr,sendScroll:ur,pressButton:vr,reload:Sr,rotate:br,screenshot:yr,appearance:St,setAppearance:Er,hardwareKeyboardConnected:Ct,setHardwareKeyboardConnected:gr,toggleSoftwareKeyboard:hr})};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),c=_r(_d[5]),o=_r(_d[6]),l=_r(_d[7]),u=_r(_d[8]),d=_r(_d[9]),p=_r(_d[10]),f=_r(_d[11]),h=_r(_d[12]),v=_r(_d[13]),S=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),E=_r(_d[18]),k=_r(_d[19]),C=_r(_d[20]),R=_r(_d[21]),I=_r(_d[22]),A=_r(_d[23]),T=_r(_d[24]),U=_r(_d[25]),O=_r(_d[26]),x=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),D=_r(_d[30]),F=_r(_d[31]),N=_r(_d[32]),M=_r(_d[33]),j=_r(_d[34]),W=_r(_d[35]),_=_r(_d[36]),$=_r(_d[37]),G=_r(_d[38]);const B=1500,H=5e3,J=3e4,Q=8e3,K=()=>{},V=3,q=4,z=5,X=6,Y=7,Z=11,ee=12,te=14,re=21,ne="hardware-keyboard",se=[{id:"ios",name:"iPhone Simulator",platform:"ios",current:!0}],ae={modeAvailability:{mjpeg:!0,h264:!0,webrtc:!1},httpCodecs:["auto","h264","mjpeg"],webRtcCodecs:[]},ie={modeAvailability:{mjpeg:!1,h264:!1,webrtc:!0},httpCodecs:[],webRtcCodecs:["h264","vp9","vp8"]},ce={mjpegFps:!0,mjpegQuality:!0,maxDimension:!0,h264Bitrate:!0,h264Fps:!0};function oe(t){return"webrtc"===(t&&"object"==typeof t?t.transport:void 0)?ie:ae}const le={home:"home",appSwitcher:"app_switcher",power:"lock",back:null,recents:null,hideKeyboard:null},ue=new TextDecoder;function de(t,r){return(0,U.normalizeDeviceStreamSettings)(t,r)}function pe(t){return Object.keys(t).length>0?t:null}function fe(t){return t.replace(/^http/,"ws")}function me(t){const r=new URL(t),n=r.pathname.match(/^(.*\/helper)\/([^/]+)\/ws$/);if(!n)throw new Error(`Invalid helper ws url, no deviceId matched: ${t}`);return r.pathname=`${n[1]}/ws`,r.searchParams.has("device")||r.searchParams.set("device",decodeURIComponent(n[2])),r.toString()}function ge(t,r,n){return JSON.stringify([t,r,n])}function he(t){const r=t.initialStreamSettings;return JSON.stringify(Object.assign({},t,{initialStreamSettings:Object.assign({},(0,U.normalizeDeviceStreamSettings)(r),{transport:r?.transport??"http",codec:r?.codec??"h264"})}))}},211,[155,212,38,213,171,172,169,214,156,215,216,217,218,219,200,187,167,184,220,186,221,222,223,195,170,181,150,192,197,224,196,198,199,201,210,206,225,226,227]);
|
|
278
278
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createControlSocket=function(o,n,{openSocket:s=t=>new WebSocket(t),connectTimeoutMs:c=5e3,retryMs:u=2e3,healthIntervalMs:l=5e3,healthTimeoutMs:f=5e3}={}){let w,v,h,b,y=null,T=!1,p=!1,E=1;const x=new Map;let z=!1;const M=new Set,S=new Map,k=new Set,O=t=>{for(const o of[...k])try{o(t)}catch{}},_=()=>{clearTimeout(h),h=void 0,b=void 0},j=t=>{try{t.end()}catch{}},C=(t,o)=>{if(!p&&y===t){y=null,T=!1,M.clear(),clearTimeout(w),_();for(const t of[...x.values()])t.finish(o);for(const t of S.values())clearTimeout(t.timer),t.timer=void 0,j(t);try{t?.close()}catch{}O(!1),p||(S.size||k.size)&&void 0===v&&(v=setTimeout(()=>{v=void 0,P()},u))}},A=(t,o)=>{try{t.send(JSON.stringify(o))}catch{C(t,new Error("exec-ws error"))}},J=()=>{const o=y;if(o&&T&&!p&&!z){z=!0;try{if(M.size>=t&&![...M].some(t=>x.has(t))){for(const t of[...x.values()])t.finish(new Error("too many actions in flight on this connection"));return}for(const[n,s]of x){if(y!==o||M.size>=t)break;s.sent||(s.sent=!0,M.add(n),A(o,Object.assign({},s.body,{id:n})))}}finally{z=!1}}},L=t=>{!p&&y===t&&T&&(h=setTimeout(()=>{!p&&y===t&&T&&(b=E++,h=setTimeout(()=>C(t,new Error("exec-ws timeout")),f),A(t,{id:b}))},l))},N=(t,o)=>{T&&y&&A(y,{sub:t,path:o.path})},P=()=>{if(p||y)return;let t;clearTimeout(v),v=void 0;try{t=s(o)}catch{return void C(null,new Error("exec-ws error"))}y=t,w=setTimeout(()=>C(t,new Error("exec-ws timeout")),c),t.onopen=()=>{p||y!==t||A(t,{token:n})},t.onmessage=o=>{if(p||y!==t)return;let n;try{n=JSON.parse(String(o.data))}catch{return}if(n&&"object"==typeof n)if(!0!==n.ready){if(T)if("number"==typeof n.id){if(n.id===b)return _(),void L(t);M.delete(n.id);const o=x.get(n.id);o?.sent&&o.finish("string"==typeof n.error?new Error(n.error):void 0,n),J()}else if("number"==typeof n.sub){const t=n.sub,o=S.get(t);if(!o)return;!0===n.end?(j(o),void 0===o.timer&&(o.timer=setTimeout(()=>{o.timer=void 0,p||S.get(t)!==o||N(t,o)},u))):"string"==typeof n.data&&o.data(n.data)}}else{if(T)return;T=!0,clearTimeout(w),L(t),J();for(const[o,n]of S){if(y!==t)break;N(o,n)}y===t&&O(!0)}},t.onclose=()=>C(t,new Error("exec-ws closed")),t.onerror=()=>C(t,new Error("exec-ws error"))};return{request:(t,o,n)=>new Promise((s,c)=>{if(p)return void c(new Error("exec-ws closed"));if(n?.aborted)return void c(n.reason);const u=E++;let l=!1;const f=(t,o)=>{l||(l=!0,x.delete(u),clearTimeout(v),n?.removeEventListener("abort",w),t?c(t):s(o??{}),J())},w=()=>f(n?.reason??new DOMException("Aborted","AbortError")),v=setTimeout(()=>f(new Error("exec-ws timeout")),o);n?.addEventListener("abort",w,{once:!0}),x.set(u,{body:t,sent:!1,finish:f}),T?J():P()}),subscribe(t,o,n){if(p)return()=>{};const s=E++,c={path:t,data:o,end:n};return S.set(s,c),T?N(s,c):P(),()=>{S.get(s)===c&&(S.delete(s),clearTimeout(c.timer),T&&y&&A(y,{unsub:s}),S.size||k.size||(clearTimeout(v),v=void 0))}},onConnectionChange:t=>p?()=>{}:(k.add(t),T||P(),()=>{k.delete(t),S.size||k.size||(clearTimeout(v),v=void 0)}),activate(){p=!1},dispose(){if(p)return;p=!0,M.clear(),clearTimeout(w),clearTimeout(v),_();for(const t of[...x.values()])t.finish(new Error("exec-ws closed"));for(const t of S.values())clearTimeout(t.timer);S.clear();const t=y;y=null,T=!1;try{t?.close()}catch{}}}};const t=8},212,[]);
|
|
279
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initialAvccFallback",{enumerable:!0,get:function(){return t}}),e.avccFallbackReducer=function(c,n){switch(n){case
|
|
280
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AVCC_TAG_DESCRIPTION",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"AVCC_TAG_KEYFRAME",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AVCC_TAG_DELTA",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AVCC_TAG_SEED",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"AvccDemuxer",{enumerable:!0,get:function(){return u}}),e.avcCodecString=function(t){if(t.length<4)return
|
|
281
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.endpointFor=function(s,c){return o(`${t(c)}${n[s]}`)},e.startIosHelper=async function(n,s,c=fetch){const u=t(o(s));await c(`${u}/grid/api/start`,{method:
|
|
282
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_IOS_DEVICE_EVENTS",{enumerable:!0,get:function(){return t}}),e.parseIosEventLogPayload=p,e.mapIosEventLogEntry=T,e.createIosEventLogState=function(t=0){const n=Math.max(0,Math.floor(t));return{events:[],clearedThroughId:n,latestId:n,hasSnapshot:!1,clearPending:!1}},e.mergeIosEventLogPayload=function(t,n,s){const o=p(n);if(!o)return t;const c=void 0!==o.events,u=(o.events??[]).reduce((t,n)=>Math.max(t,n.id),0),l=c&&t.hasSnapshot&&(t.latestId>0&&0===u||u>0&&u<t.latestId);let f=l?0:t.clearedThroughId;if(c&&t.clearPending)for(const t of o.events??[])f=Math.max(f,t.id);const h=new Map;if(!l)for(const n of t.events){const t=v(n,s);null!==t&&t>f&&h.set(t,n)}const y=[...o.events??[],...o.event?[o.event]:[]];for(const t of y)t.id<=f||h.set(t.id,T(t,s));return{events:[...h.entries()].sort(([t],[n])=>t-n).slice(-500).map(([,t])=>t),clearedThroughId:f,latestId:c?Math.max(u,o.event?.id??0):Math.max(t.latestId,o.event?.id??0),hasSnapshot:t.hasSnapshot||c,clearPending:!c&&t.clearPending}},e.clearIosEventLogState=function(t,n){let s=t.clearedThroughId;for(const o of t.events){const t=v(o,n);null!==t&&(s=Math.max(s,t))}return{events:[],clearedThroughId:s,latestId:t.latestId,hasSnapshot:t.hasSnapshot,clearPending:!t.hasSnapshot}};const t=500,n=/^(?:command|credential|password|path|secret|stderr|stdout|text|token)$/i,s=/^[a-z0-9][a-z0-9._:/-]*$/i,o=128,c=5;function u(t){return null!==t&&
|
|
283
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.runHostAction=async function(o,n,c,u,w,l){let f;try{f=await s(o,n,{action:c,params:u},t,w,l)}catch(t){if(t instanceof Error&&(y=t.message,![
|
|
284
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchIosAppDetails=n,e.fetchIosAppIcon=async function(n,c,{fetchImpl:l=fetch,signal:u,retryDelaysMs:p=o}={}){const f=new URL(n);f.searchParams.set(
|
|
285
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=/Reason:\s*(.+)$/m.exec(t.stderr);if(n)return n[1].trim();return t.stderr.split(
|
|
286
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_INPUT_UNAVAILABLE_MESSAGE",{enumerable:!0,get:function(){return t}});const t=
|
|
279
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initialAvccFallback",{enumerable:!0,get:function(){return t}}),e.avccFallbackReducer=function(c,n){switch(n){case"decoded-frame":return c.streamed?c:Object.assign({},c,{streamed:!0});case"timeout":return c.streamed||c.fellBack?c:Object.assign({},c,{fellBack:!0});case"error":return c.fellBack?c:Object.assign({},c,{fellBack:!0});case"reset":return t}},Object.defineProperty(e,"AVCC_FRAME_TIMEOUT_MS",{enumerable:!0,get:function(){return c}});const t={streamed:!1,fellBack:!1};const c=4e3},213,[]);
|
|
280
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AVCC_TAG_DESCRIPTION",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"AVCC_TAG_KEYFRAME",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"AVCC_TAG_DELTA",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"AVCC_TAG_SEED",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"AvccDemuxer",{enumerable:!0,get:function(){return u}}),e.avcCodecString=function(t){if(t.length<4)return"avc1.42E01E";const n=t=>t.toString(16).padStart(2,"0");return`avc1.${n(t[1])}${n(t[2])}${n(t[3])}`},e.isAvccSupported=function(){return"undefined"!=typeof globalThis&&void 0!==globalThis.VideoDecoder};const t=1,n=2,s=3,h=4,f={[t]:"description",[n]:"keyframe",[s]:"delta",[h]:"seed"};class u{buffer=new Uint8Array(65536);length=0;start=0;append(t){if(this.length+t.length>this.buffer.length&&(this.start>0&&(this.buffer.copyWithin(0,this.start,this.length),this.length-=this.start,this.start=0),this.length+t.length>this.buffer.length)){let n=this.buffer.length;for(;n<this.length+t.length;)n*=2;const s=new Uint8Array(n);s.set(this.buffer.subarray(0,this.length)),this.buffer=s}this.buffer.set(t,this.length),this.length+=t.length}push(t){t.length>0&&this.append(t);const n=[],s=this.buffer;for(;this.length-this.start>=4;){const t=this.start,h=(s[t]<<24|s[t+1]<<16|s[t+2]<<8|s[t+3])>>>0;if(this.length-t-4<h)break;if(h<1){this.start+=4;continue}const u=f[s[t+4]];u&&n.push({type:u,payload:s.slice(t+5,t+4+h)}),this.start+=4+h}return this.start>0&&(this.start<this.length&&this.buffer.copyWithin(0,this.start,this.length),this.length-=this.start,this.start=0),n}reset(){this.length=0,this.start=0}}},214,[]);
|
|
281
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.endpointFor=function(s,c){return o(`${t(c)}${n[s]}`)},e.startIosHelper=async function(n,s,c=fetch){const u=t(o(s));await c(`${u}/grid/api/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({udid:n}),signal:AbortSignal.timeout(19e4)})};const n={ios:"/vendor/serve-sim",android:"/vendor/serve-emu"};function t(n){return n.replace(/\/+$/,"")}function o(n){return n.startsWith("http")?n:"undefined"!=typeof window&&window.location?.origin?`${window.location.origin}${n}`:n}},215,[]);
|
|
282
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_IOS_DEVICE_EVENTS",{enumerable:!0,get:function(){return t}}),e.parseIosEventLogPayload=p,e.mapIosEventLogEntry=T,e.createIosEventLogState=function(t=0){const n=Math.max(0,Math.floor(t));return{events:[],clearedThroughId:n,latestId:n,hasSnapshot:!1,clearPending:!1}},e.mergeIosEventLogPayload=function(t,n,s){const o=p(n);if(!o)return t;const c=void 0!==o.events,u=(o.events??[]).reduce((t,n)=>Math.max(t,n.id),0),l=c&&t.hasSnapshot&&(t.latestId>0&&0===u||u>0&&u<t.latestId);let f=l?0:t.clearedThroughId;if(c&&t.clearPending)for(const t of o.events??[])f=Math.max(f,t.id);const h=new Map;if(!l)for(const n of t.events){const t=v(n,s);null!==t&&t>f&&h.set(t,n)}const y=[...o.events??[],...o.event?[o.event]:[]];for(const t of y)t.id<=f||h.set(t.id,T(t,s));return{events:[...h.entries()].sort(([t],[n])=>t-n).slice(-500).map(([,t])=>t),clearedThroughId:f,latestId:c?Math.max(u,o.event?.id??0):Math.max(t.latestId,o.event?.id??0),hasSnapshot:t.hasSnapshot||c,clearPending:!c&&t.clearPending}},e.clearIosEventLogState=function(t,n){let s=t.clearedThroughId;for(const o of t.events){const t=v(o,n);null!==t&&(s=Math.max(s,t))}return{events:[],clearedThroughId:s,latestId:t.latestId,hasSnapshot:t.hasSnapshot,clearPending:!t.hasSnapshot}};const t=500,n=/^(?:command|credential|password|path|secret|stderr|stdout|text|token)$/i,s=/^[a-z0-9][a-z0-9._:/-]*$/i,o=128,c=5;function u(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function l(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function f(t){return"string"==typeof t&&t.length>0&&t.length<=o&&s.test(t)?t:null}function h(t){if(!u(t))return null;if(!Number.isSafeInteger(t.id)||t.id<0)return null;if("string"!=typeof t.timestamp||!Number.isFinite(Date.parse(t.timestamp)))return null;const n=f(t.source),s=f(t.kind);if(!n||!s)return null;const o=void 0===t.action?void 0:f(t.action);if(void 0!==t.action&&!o)return null;const c="ok"===t.status||"error"===t.status?t.status:void 0,l=u(t.details)?Object.assign({},t.details):void 0;return Object.assign({id:t.id,timestamp:t.timestamp,source:n,kind:s},"string"==typeof t.msg?{msg:t.msg}:{},"string"==typeof t.summary?{summary:t.summary}:{},"string"==typeof t.device?{device:t.device}:{},o?{action:o}:{},c?{status:c}:{},l?{details:l}:{})}function p(t){let n=t;if("string"==typeof n)try{n=JSON.parse(n)}catch{return null}if(!u(n))return null;const s={};let o=!1;if(l(n,"events")){if(!Array.isArray(n.events))return null;s.events=n.events.map(t=>h(t)).filter(t=>null!==t),o=!0}if(l(n,"event")){const t=h(n.event);if(!t)return o?s:null;s.event=t,o=!0}return o?s:null}function y(t,n){return`ios:${encodeURIComponent(t)}:${n}`}function v(t,n){const s=`ios:${encodeURIComponent(n)}:`;if(!t.id.startsWith(s))return null;const o=Number(t.id.slice(s.length));return Number.isSafeInteger(o)&&o>=0?o:null}function k(t){return t.replace(/[-_]+/g," ")}function $(t){const n=k(t);return n.length>0?`${n[0].toUpperCase()}${n.slice(1)}`:n}function I(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function S(t,n){const s=t?.[n];if(!u(s))return null;const o=I(s.x),c=I(s.y);return null===o||null===c?null:{x:o,y:c}}function b(t){return Math.min(1,Math.max(0,t)).toFixed(2)}function w(t){return`${b(t.x)}, ${b(t.y)}`}function M(t){return"string"!=typeof t?"key":"character"===t||/^(?:Arrow(?:Down|Left|Right|Up)|Backspace|CapsLock|Delete|End|Enter|Escape|F\d{1,2}|Home|Insert|Numpad[A-Za-z0-9]+|PageDown|PageUp|Pause|PrintScreen|ScrollLock|Space|Tab)$/.test(t)||/^(?:Alt|Control|Meta|Shift)(?:Left|Right)$/.test(t)?t:"character"}function A(t,s){if(s>=c)return"[truncated]";if(Array.isArray(t))return t.slice(0,100).map(t=>A(t,s+1));if(!u(t))return t;const o={};for(const[c,u]of Object.entries(t))o[c]=n.test(c)?"[redacted]":A(u,s+1);return o}function E(t){if(!t.details)return;const n=A(t.details,0);if("key"===t.kind){const s=M(t.details.key);n.key=s,"character"===s&&(n.redacted=!0,delete n.usage)}return n}function P(t){switch(t.kind){case"tap":case"drag":case"touch":case"multi-touch":case"scroll":return"touch";case"key":case"software-keyboard":return"keyboard";case"ui-setting":return"settings";default:return t.kind}}function x(t){return"tap"===t.kind||"drag"===t.kind||"scroll"===t.kind?t.kind:"software-keyboard"===t.kind?"toggle":"multi-touch"===t.kind?t.action?`multi-touch-${t.action}`:"multi-touch":t.action}function C(t,n){const s=x(t);switch(t.kind){case"tap":{const t=S(n,"current")??S(n,"start");return t?`Tap at ${w(t)}`:"Tap"}case"drag":{const t=S(n,"start"),s=S(n,"current");return t&&s?`Drag from ${w(t)} to ${w(s)}`:"Drag"}case"touch":return s?`Touch ${k(s)}`:"Touch";case"multi-touch":return t.action?`Multi-touch ${k(t.action)}`:"Multi-touch";case"scroll":return"Scroll";case"key":{const t=M(n?.key);return s?`Key ${k(s)} ${t}`:`Key ${t}`}case"software-keyboard":return"Software keyboard";case"button":return s?`Button ${$(s)}`:"Button";case"rotate":return s?`Rotate ${k(s)}`:"Rotate";case"memory-warning":return"Memory warning";case"ca-debug":return s?`Core Animation ${k(s)}`:"Core Animation setting";case"digital-crown":return"Digital Crown";case"app":return s?`${$(s)} app`:"App event";case"media":return"Add media";case"screenshot":{if("error"!==t.status)return"Screenshot";const s="string"==typeof n?.file?"Screenshot not saved to session artifacts":"Screenshot failed";return"string"==typeof n?.error?`${s}: ${n.error}`:s}case"camera":return s?`Camera ${k(s)}`:"Camera";case"ui-setting":{const t=f(n?.value);return s?`Set ${$(s)}${t?` to ${$(t)}`:""}`:"Device setting changed"}default:return`Event ${k(t.kind)}`}}function T(t,n){const s=E(t),o=x(t);return Object.assign({id:y(n,t.id),timestamp:t.timestamp,source:t.source,kind:P(t)},o?{action:o}:{},{message:C(t,s)},t.status?{status:t.status}:{},s?{details:s}:{})}},216,[]);
|
|
283
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.runHostAction=async function(o,n,c,u,w,l){let f;try{f=await s(o,n,{action:c,params:u},t,w,l)}catch(t){if(t instanceof Error&&(y=t.message,!["exec-ws timeout","exec-ws error","exec-ws closed"].includes(y)))return{stdout:"",stderr:t.message,exitCode:1};throw t}var y;return{stdout:f.stdout??"",stderr:f.stderr??"",exitCode:f.exitCode??1}},e.hostUiRequest=async function(t,n,c,u,w){const l=await s(t,n,{ui:c},o,u,w),f={};void 0!==l.status&&(f.status=l.status);void 0!==l.ok&&(f.ok=l.ok);return f};const t=1e4,o=5e3;function s(t,o,s,n,c,u){return u?u.request(s,n):new Promise((u,w)=>{let l;try{l=new WebSocket(t,c)}catch(t){return void w(t)}let f,y=!1,x=!1;const h=t=>{if(!y){y=!0,clearTimeout(f);try{l.close()}catch{}t()}};f=setTimeout(()=>h(()=>w(new Error("exec-ws timeout"))),n),l.onopen=()=>l.send(JSON.stringify({token:o})),l.onmessage=t=>{if(y)return;let o;try{o=JSON.parse(String(t.data))}catch{return}o.ready?x||(x=!0,l.send(JSON.stringify(Object.assign({id:1},s)))):1===o.id&&(o.error?h(()=>w(new Error(o.error))):h(()=>u(o)))},l.onerror=()=>h(()=>w(new Error("exec-ws error"))),l.onclose=()=>h(()=>w(new Error("exec-ws closed")))})}},217,[]);
|
|
284
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchIosAppDetails=n,e.fetchIosAppIcon=async function(n,c,{fetchImpl:l=fetch,signal:u,retryDelaysMs:p=o}={}){const f=new URL(n);f.searchParams.set("bundleId",c);for(let n=0;;n++){const o=n<p.length;let c;try{c=await l(f.toString(),{cache:"no-store",signal:u})}catch(t){if(u?.aborted||!o)throw t;await s(p[n],u);continue}if(c.ok)return(0,t.parseAppIconResponse)(await c.json());if(c.status<500||!o)throw new Error(`app icon request failed with ${c.status}`);await s(p[n],u)}},e.getIosAppDetails=function(t,o,s,l={}){const u=`${o}:${s}:${!1!==l.includeIcon}`,p=c.get(u);if(p)return p;const f=n(t,o,s,l).catch(t=>{throw c.delete(u),t});return c.set(u,f),f};var t=r(d[0]);async function n(t,n,o,{includeIcon:s=!0}={}){const c=await t("app.container",{udid:n,bundleId:o});if(0!==c.exitCode)return null;const l=c.stdout.trim();if(!l)return null;const u=await t("app.infoPlist",{path:`${l}/Info.plist`});let p,f={};if(0===u.exitCode)try{f=JSON.parse(u.stdout)}catch{}const h=f?.CFBundleIcons?.CFBundlePrimaryIcon??f?.["CFBundleIcons~ipad"]?.CFBundlePrimaryIcon,I=h?.CFBundleIconFiles??f?.CFBundleIconFiles;let F;if(I&&I.length>0?p=I[I.length-1]:"string"==typeof f?.CFBundleIconFile&&(p=f.CFBundleIconFile),s&&p){const n=[`${p}@3x.png`,`${p}@2x.png`,`${p}.png`,`${p}60x60@3x.png`,`${p}60x60@2x.png`],o=(await t("app.iconPath",{appPath:l,candidates:n})).stdout.trim();if(o){const n=await t("file.readBase64",{path:o});0===n.exitCode&&(F=`data:image/png;base64,${n.stdout.replace(/\s+/g,"")}`)}}return Object.assign({appPath:l,label:f.CFBundleDisplayName??f.CFBundleName,version:f.CFBundleShortVersionString,build:f.CFBundleVersion,minOS:f.MinimumOSVersion,executable:f.CFBundleExecutable},s?{iconDataUrl:F}:{})}const o=[1e3,2e3,4e3];function s(t,n){return new Promise((o,s)=>{if(n?.aborted)return s(n.reason);const c=()=>{clearTimeout(l),s(n.reason)},l=setTimeout(()=>{n?.removeEventListener("abort",c),o()},t);n?.addEventListener("abort",c,{once:!0})})}const c=new Map},218,[177]);
|
|
285
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=/Reason:\s*(.+)$/m.exec(t.stderr);if(n)return n[1].trim();return t.stderr.split("\n").map(t=>t.trim()).filter(t=>t.length>0).at(-1)??"simctl location failed"}function n(n){if(0!==n.exitCode)throw new Error(t(n))}Object.defineProperty(e,'__esModule',{value:!0}),e.simctlFailureMessage=t,e.setIosLocation=async function(t,o,c){return n(await t("location.set",{udid:o,lat:c.latitude,lng:c.longitude})),c},e.clearIosLocation=async function(t,o){n(await t("location.clear",{udid:o}))}},219,[]);
|
|
286
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IOS_INPUT_UNAVAILABLE_MESSAGE",{enumerable:!0,get:function(){return t}});const t="Simulator input is unavailable. Restart serve-sim to retry."},220,[]);
|
|
287
287
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"KEY_EVENT_PACE_MS",{enumerable:!0,get:function(){return t}}),e.createPacedKeySender=function(n,u=t,l=setTimeout,o=clearTimeout){const c=[];let s=null;const f=new Set,p=()=>{c.length=0,null!=s&&o(s),s=null;const t=[...f].map(t=>({type:"up",usage:t}));return f.clear(),t},_=()=>{s=null;const t=c.shift();void 0!==t&&(n(t),"down"===t.type?f.add(t.usage):f.delete(t.usage),c.length>0&&(s=l(_,u)))};return{enqueue(t){if(0!==t.length){for(const n of t)c.push(n);null==s&&_()}},cancel:p,dispose(){p()}}};const t=4},221,[]);
|
|
288
288
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createRotationCursor=function(o="portrait",p=()=>performance.now()){let c="string"==typeof o&&Object.hasOwn(n,o)?o:"portrait",l=c,s=!1,u=null,_=0;return{peekNext:()=>n[c],recordSent(n){c=n,u=c,_=p()+t},updateReadback(t){"string"==typeof t&&Object.hasOwn(n,t)&&(t===l&&(!s||p()<_)||(l=t,null!==u&&t!==u&&p()<_?s=!0:(s=!1,c=t,u=null)))}}};const t=1500,n={portrait:"landscape_left",landscape_left:"portrait_upside_down",portrait_upside_down:"landscape_right",landscape_right:"portrait"}},222,[]);
|
|
289
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.middlewareEndpointForBrowser=function(t,n,s=""){const o=n.pathname.replace(/\/+$/,
|
|
290
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAvccStream=function({url:s,enabled:l,canvasRef:u,onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F,fetchImpl:E=fetch}){const D=(0,t.useRef)({onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F});D.current={onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F},(0,t.useEffect)(()=>{if(!l||!s||!(0,o.isAvccSupported)())return;const t=new AbortController,f=new o.AvccDemuxer;let h=!1,y=!1,p=!1,w=0,F=null,b=null;const v=()=>!h&&!t.signal.aborted,k=t=>{D.current.onDecoderError?D.current.onDecoderError():D.current.onError?.(t)},R=(t,o,n,c)=>{if(!v())return;const s=u.current;if(!s)return;s.width===o&&s.height===n||(s.width=o,s.height=n,D.current.onResize?.(o,n));const l=s.getContext(
|
|
289
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.middlewareEndpointForBrowser=function(t,n,s=""){const o=n.pathname.replace(/\/+$/,""),p=s.replace(/\/+$/,""),c=new URL(n);c.pathname=`${o}/`,c.search="",c.hash="";const h=new URL(t,new URL(`${p}/`,c)),$=""!==p&&(h.pathname===p||h.pathname.startsWith(`${p}/`)),l=h.pathname.slice($?p.length:0).replace(/^\/+/,"");return c.pathname=`${o}/${l}`,c.search=h.search,c.hash=h.hash,c.toString()},e.proxyPreviewConfigForBrowser=function(t,n){if(!t.device||!t.proxyHelpers)return t;const s=`${n.pathname.replace(/\/+$/,"")}/helper/${encodeURIComponent(t.device)}`,o=n.origin,p="https:"===n.protocol?"wss:":"ws:";return Object.assign({},t,{url:`${o}${s}`,streamUrl:`${o}${s}/stream.mjpeg`,wsUrl:`${p}//${n.host}${s}/ws`,streamSettingsEndpoint:`${o}${s}/stream-settings`})}},223,[]);
|
|
290
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAvccStream=function({url:s,enabled:l,canvasRef:u,onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F,fetchImpl:E=fetch}){const D=(0,t.useRef)({onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F});D.current={onFirstFrame:f,onFrame:h,onDecodedFrame:y,onResize:p,onError:w,onDecoderError:F},(0,t.useEffect)(()=>{if(!l||!s||!(0,o.isAvccSupported)())return;const t=new AbortController,f=new o.AvccDemuxer;let h=!1,y=!1,p=!1,w=0,F=null,b=null;const v=()=>!h&&!t.signal.aborted,k=t=>{D.current.onDecoderError?D.current.onDecoderError():D.current.onError?.(t)},R=(t,o,n,c)=>{if(!v())return;const s=u.current;if(!s)return;s.width===o&&s.height===n||(s.width=o,s.height=n,D.current.onResize?.(o,n));const l=s.getContext("2d");l&&(l.drawImage(t,0,0,o,n),D.current.onFrame?.(),c&&!p&&(p=!0,D.current.onDecodedFrame?.()),y||(y=!0,D.current.onFirstFrame?.()))},z=async t=>{const o=await createImageBitmap(new Blob([t],{type:"image/jpeg"}));try{v()&&R(o,o.width,o.height,!1)}finally{o.close()}},A=t=>{b&&"closed"!==b.state||(b=new VideoDecoder({output:t=>{try{v()&&R(t,t.displayWidth,t.displayHeight,!0)}finally{t.close()}},error:t=>k(`decoder: ${t.message}`)}));try{b.configure({codec:(0,o.avcCodecString)(t),description:t,optimizeForLatency:!0,hardwareAcceleration:"prefer-hardware"})}catch(t){k(`config: ${t.message}`)}},C=(t,o)=>{if("configured"===b?.state)try{b.decode(new EncodedVideoChunk({type:"keyframe"===t?"key":"delta",timestamp:w,data:o})),w+=c}catch{}},$=(t,o)=>{switch(t){case"seed":z(o).catch(()=>{});break;case"description":A(o);break;case"keyframe":case"delta":C(t,o)}},_=async()=>{f.reset();try{const o=await E(`${s}/stream.avcc`,{signal:t.signal});if(!o.ok)throw new Error(`H.264 stream failed (${o.status})`);const n=o.body?.getReader();if(!n)return;for(;;){const{done:t,value:o}=await n.read();if(t)break;if(o)for(const t of f.push(o))$(t.type,t.payload)}}catch{}finally{v()&&v()&&!F&&(F=setTimeout(()=>{F=null,_()},n))}};return _(),()=>{if(h=!0,F&&clearTimeout(F),t.abort(),f.reset(),b&&"closed"!==b.state)try{b.close()}catch{}b=null}},[s,l,u,E])};var t=r(d[0]),o=r(d[1]);const n=1e3,c=16667},224,[38,214]);
|
|
291
291
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createInputSocket=function(t,o,{initialMessages:u=[],requireAdmission:l=!0,legacyOpenGraceMs:c=1e3,reconnectDelayMs:f=1e3,refusalDelayMs:y=13e3,openSocket:T=n=>new WebSocket(n)}={}){let M=null,S=null,_=null,h=null,A=!1,b=!1,p=!1,v=u;const D=()=>{if(p||M)return;let u;A=!1;try{u=T(t)}catch{return void(S=setTimeout(()=>{S=null,D()},f))}u.binaryType="arraybuffer",M=u;const U=()=>{_&&clearTimeout(_),_=null;const n=b;b=!1,n&&o.onRecovered()},W=s=>{const t=!A;if(A=!0,t&&!1===o.onAdmitted())return A=!1,void u.close();v=(0,n.flushWsMessageQueue)(u,v),s&&U()};u.onopen=()=>{p||M!==u||l||(W(!1),h=setTimeout(()=>{h=null,p||M!==u||1!==u.readyState||U()},c))},u.onmessage=n=>{if(p||M!==u)return;const t=n.data instanceof ArrayBuffer&&1===n.data.byteLength&&new Uint8Array(n.data)[0]===s.WS_MSG_INPUT_ADMITTED,c=o.onMessage(n.data);(t||!l&&c)&&W(!0)},u.onclose=n=>{if(!p&&M===u){if(h&&clearTimeout(h),h=null,M=null,A=!1,1013===n.code&&n.reason!==s.WS_REASON_INPUT_UNAVAILABLE)_&&clearTimeout(_),_=null,b=!1,o.onRefused(n.reason||"The server is busy. Try again shortly.");else if(1013===n.code&&!_&&!b){const s=n.reason||"The server is busy. Try again shortly.";_=setTimeout(()=>{_=null,p||A||(b=!0,o.onRefused(s))},y)}o.onDisconnect(),p||(S=setTimeout(()=>{S=null,D()},f))}},u.onerror=()=>{p||M!==u||u.close()}};return{send(s,t,o){p||(v=(0,n.sendOrQueueWsMessage)(A?M:null,v,s,t,Date.now(),o))},discardUnfinishedGestures(s){v=(0,n.discardUnfinishedQueuedGestures)(v,s)},discardQueued(n){v=v.filter(s=>s.tag!==n)},trySend:(s,t)=>A&&(0,n.trySendWsMessage)(M,s,t),takePending(){const n=v;return v=[],n},start:D,dispose(){p=!0,S&&clearTimeout(S),_&&clearTimeout(_),h&&clearTimeout(h),M?.close(),M=null,v=[]}}};var n=r(d[0]),s=r(d[1])},225,[226,227]);
|
|
292
292
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WS_OPEN_READY_STATE",{enumerable:!0,get:function(){return t}}),e.encodeWsMessage=c,e.trySendWsMessage=function(n,s,o){if(n?.readyState!==t)return!1;try{return n.send(c(s,o).buffer),!0}catch{return!1}},e.enqueueWsMessage=u,e.flushWsMessageQueue=f,e.sendOrQueueWsMessage=function(n,s,c,l,y=Date.now(),h){const p=f(n,s,y);if(n?.readyState===t&&0===p.length)try{return o(n,{tag:c,payload:l,onSent:h}),p}catch{}return u(p,Object.assign({tag:c,payload:l,createdAt:y},h?{onSent:h}:{}))},e.discardUnfinishedQueuedGestures=function(t,n){const s=new Set;let o=[];for(const c of t){if(c.tag!==n)continue;const t=c.payload.type;if("begin"===t)o=[c];else if(o.length&&(o.push(c),"end"===t)){for(const t of o)s.add(t);o=[]}}return t.filter(t=>t.tag!==n||s.has(t))};const t=1,n=32,s=1500;function o(t,n){const s="function"==typeof n.payload?n.payload():n.payload;t.send(c(n.tag,s).buffer),n.sent=!0,n.onSent?.(s)}function c(t,n){const s=(new TextEncoder).encode(JSON.stringify(n)),o=new Uint8Array(1+s.length);return o[0]=t,o.set(s,1),o}function u(t,s,o=n){const c=[...t,s];return c.length>o?c.slice(c.length-o):c}function f(n,c,u=Date.now(),f=s){const l=c.filter(t=>!t.sent&&u-t.createdAt<=f);if(!n||n.readyState!==t)return l;for(let t=0;t<l.length;t++){const s=l[t];try{o(n,s)}catch{return l.slice(t)}}return[]}},226,[]);
|
|
293
293
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WS_MSG_CONFIG",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"WS_MSG_INPUT_ADMITTED",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"WS_REASON_INPUT_UNAVAILABLE",{enumerable:!0,get:function(){return u}});const t=130,n=131,u="Simulator input unavailable; retry after other clients disconnect"},227,[]);
|
|
294
294
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDeviceClient=function(){const s=(0,t.useContext)(n.DeviceClientStoreContext);if(!s)throw new Error("useDeviceClient requires a DeviceClientProvider. Wrap this component in a provider to share its device connection.");const c=(0,t.useMemo)(()=>o(s),[s]),u=(0,t.useSyncExternalStore)(c.subscribe,s.getSnapshot,s.getServerSnapshot);return(0,t.useMemo)(()=>c.track(u),[c,u])};var t=r(d[0]),n=r(d[1]);function o(t){const n=new Set,o=new Set,s=new Set;let c=!1;function u(n,o){const s=t.getSnapshot();return"function"==typeof Reflect.get(n,o)||"function"==typeof Reflect.get(s,o)?s:n}return{subscribe(u){let f=t.getSnapshot();return t.subscribe(()=>{const p=t.getSnapshot(),l=c||[...n].some(t=>!Object.is(f[t],p[t]))||[...o].some(t=>Reflect.has(f,t)!==Reflect.has(p,t))||[...s].some(t=>Object.hasOwn(f,t)!==Object.hasOwn(p,t));f=p,l&&u()})},track:f=>new Proxy(f,{get(o,s,c){"string"==typeof s&&n.add(s);const u=Reflect.get(o,s,c),f=Reflect.get(t.getSnapshot(),s);return"function"==typeof u||"function"==typeof f?f:u},has:(t,n)=>(o.add(n),Reflect.has(u(t,n),n)),getOwnPropertyDescriptor:(t,n)=>(s.add(n),Reflect.getOwnPropertyDescriptor(u(t,n),n)),ownKeys:t=>(c=!0,Reflect.ownKeys(t))})}}},228,[38,161]);
|
|
295
295
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDeviceScreenClient=function(){return(0,n.useDeviceClientSelector)(t,c)};var n=r(d[0]);function t(n){const{videoKind:t,attachVideo:c,sendTouch:u,sendMultiTouch:o,cancelInput:s,sendScroll:l,sendKey:v,screen:h,status:f,error:p,inputError:y}=n;return{videoKind:t,attachVideo:c,sendTouch:u,sendMultiTouch:o,cancelInput:s,sendScroll:l,sendKey:v,screen:h,status:f,error:p,inputError:y}}function c(n,t){return Object.keys(n).every(c=>Object.is(n[c],t[c]))}},229,[161]);
|
|
296
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.KeyboardCapture=function({open:o,onKeys:c,inputRef:f}){const p=(0,t.useRef)(null),v=f??p,l=(0,t.useRef)(c);l.current=c;const E=(0,t.useRef)(o);E.current=o;const y=(0,t.useRef)(
|
|
297
|
-
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.keyEventsForInputType=c,e.keyEventsForBeforeInput=function(t){switch(t){case
|
|
298
|
-
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"US_KEYBOARD_MAP",{enumerable:!0,get:function(){return s}}),e.textToKeyEventsLenient=function(n){const u=[],o=[];for(const f of n){if(
|
|
299
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"KEYBOARD_VIEWPORT_SHRINK_PX",{enumerable:!0,get:function(){return n}}),e.isVisualViewportKeyboardRaised=t,e.readNativeKeyboardRaised=function(){if(
|
|
300
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useActiveDeviceClient=function(s,u,{token:c=null}={}){const v=
|
|
301
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCoarsePointer=function(){const[o,c]=(0,t.useState)(()=>
|
|
296
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.KeyboardCapture=function({open:o,onKeys:c,inputRef:f}){const p=(0,t.useRef)(null),v=f??p,l=(0,t.useRef)(c);l.current=c;const E=(0,t.useRef)(o);E.current=o;const y=(0,t.useRef)("");return(0,t.useEffect)(()=>{const e=v.current;e&&(o?(e.value="",y.current="",e.focus()):e.blur())},[o,v]),(0,t.useEffect)(()=>{const e=v.current;if(!e)return;const t=e=>{e.length&&l.current(e)},s=e=>{const u=e;t((0,n.keyEventsForBeforeInput)(u.inputType)),"insertLineBreak"!==u.inputType&&"insertParagraph"!==u.inputType||u.preventDefault()},o=()=>{t((0,n.keyEventsForTextChange)(y.current,e.value)),y.current=e.value},c=()=>{E.current&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{E.current&&document.activeElement!==e&&(0,u.readNativeKeyboardRaised)()&&e.focus()})})};return e.addEventListener("beforeinput",s),e.addEventListener("input",o),e.addEventListener("focusout",c),()=>{e.removeEventListener("beforeinput",s),e.removeEventListener("input",o),e.removeEventListener("focusout",c)}},[v]),(0,e.jsx)("input",Object.assign({ref:v,style:s,"aria-hidden":!0,tabIndex:-1,defaultValue:""},n.KEYBOARD_CAPTURE_ATTRIBUTES))};var e=r(d[0]),t=r(d[1]),n=r(d[2]),u=r(d[3]);const s={position:"fixed",top:0,left:0,width:1,height:1,opacity:0,border:"none",padding:0,margin:0,background:"transparent"}},230,[153,38,231,233]);
|
|
297
|
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.keyEventsForInputType=c,e.keyEventsForBeforeInput=function(t){switch(t){case"insertLineBreak":case"insertParagraph":return c(t,null);default:return[]}},e.keyEventsForTextChange=function(t,s){const c=Array.from(t),i=Array.from(s);let l=0;const p=Math.min(c.length,i.length);for(;l<p&&c[l]===i[l];)l++;const f=c.slice(l).join(""),h=i.slice(l).join(""),y=c.length-l-(0,n.textToKeyEventsLenient)(f).skipped.length,k=[];for(let t=0;t<y;t++)k.push(...u(o));return k.push(...(0,n.textToKeyEventsLenient)(h).events),k},e.keydownForward=function(n,o){if(o.keyboardOpen)return"Backspace"===n&&o.captureInputEmpty?(0,t.hidUsageForCode)(n):null;return o.simFocused?(0,t.hidUsageForCode)(n):null},Object.defineProperty(e,"KEYBOARD_CAPTURE_ATTRIBUTES",{enumerable:!0,get:function(){return i}});var t=r(d[0]),n=r(d[1]);const o=(0,t.hidUsageForCode)("Backspace"),s=(0,t.hidUsageForCode)("Enter");function u(t){return[{type:"down",usage:t},{type:"up",usage:t}]}function c(t,c){switch(t){case"insertText":case"insertFromPaste":return null!=c&&""!==c?(0,n.textToKeyEventsLenient)(c).events:[];case"insertLineBreak":case"insertParagraph":return u(s);case"deleteContentBackward":case"deleteWordBackward":return u(o);default:return[]}}const i={autoCapitalize:"none",autoCorrect:"on",autoComplete:"off",spellCheck:!0}},231,[187,232]);
|
|
298
|
+
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"US_KEYBOARD_MAP",{enumerable:!0,get:function(){return s}}),e.textToKeyEventsLenient=function(n){const u=[],o=[];for(const f of n){if("\r"===f)continue;const n=s[f];n?(n.shift&&u.push({type:"down",usage:t}),u.push({type:"down",usage:n.usage}),u.push({type:"up",usage:n.usage}),n.shift&&u.push({type:"up",usage:t})):o.push(f)}return{events:u,skipped:o}};const t=225;const s=(function(){const t={};for(let s=0;s<26;s++){const n=4+s;t[String.fromCharCode(97+s)]={usage:n,shift:!1},t[String.fromCharCode(65+s)]={usage:n,shift:!0}}for(let s=0;s<10;s++){const n=30+s;t["1234567890"[s]]={usage:n,shift:!1},t["!@#$%^&*()"[s]]={usage:n,shift:!0}}const s=[["-","_",45],["=","+",46],["[","{",47],["]","}",48],["\\","|",49],[";",":",51],["'",'"',52],["`","~",53],[",","<",54],[".",">",55],["/","?",56]];for(const[n,u,o]of s)t[n]={usage:o,shift:!1},t[u]={usage:o,shift:!0};return t[" "]={usage:44,shift:!1},t["\n"]={usage:40,shift:!1},t["\t"]={usage:43,shift:!1},t})()},232,[]);
|
|
299
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"KEYBOARD_VIEWPORT_SHRINK_PX",{enumerable:!0,get:function(){return n}}),e.isVisualViewportKeyboardRaised=t,e.readNativeKeyboardRaised=function(){if("undefined"==typeof window)return!1;const n=window.visualViewport;return t(window.innerHeight,n?.height??window.innerHeight)};const n=120;function t(t,o){return t>0&&o>0&&t-o>=n}},233,[]);
|
|
300
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useActiveDeviceClient=function(s,u,{token:c=null}={}){const v="ios"===s?.platform,_="android"===s?.platform,b=(0,o.useIosDeviceClient)({enabled:v,baseUrl:v?(0,n.endpointFor)("ios",u):null,device:v?s?.device??null:null,streamMode:s?.streamMode,token:c}),f=(0,l.useAndroidDeviceClient)({enabled:_,baseUrl:_?(0,n.endpointFor)("android",u):null,device:_?s?.device??null:null,streamMode:s?.streamMode,token:c});return v?b:_?f:t.NOOP_DEVICE_CLIENT};var n=r(d[0]),l=r(d[1]),o=r(d[2]),t=r(d[3])},234,[215,168,211,165]);
|
|
301
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCoarsePointer=function(){const[o,c]=(0,t.useState)(()=>"undefined"!=typeof window&&!0===window.matchMedia?.(n).matches);return(0,t.useEffect)(()=>{const t=window.matchMedia?.(n);if(!t)return;const o=()=>c(t.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),o};var t=r(d[0]);const n="(pointer: coarse)"},235,[38]);
|
|
302
302
|
__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 c.DialogRoot}}),Object.defineProperty(e,"DialogContent",{enumerable:!0,get:function(){return c.DialogContent}}),Object.defineProperty(e,"DialogTitle",{enumerable:!0,get:function(){return c.DialogTitle}}),Object.defineProperty(e,"DialogContentContainer",{enumerable:!0,get:function(){return c.DialogContentContainer}}),Object.defineProperty(e,"DialogFooter",{enumerable:!0,get:function(){return c.DialogFooter}}),Object.defineProperty(e,"DialogClose",{enumerable:!0,get:function(){return c.DialogClose}}),Object.defineProperty(e,"Dropdown",{enumerable:!0,get:function(){return u.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,"PillButton",{enumerable:!0,get:function(){return l.PillButton}}),Object.defineProperty(e,"ResizeHandle",{enumerable:!0,get:function(){return O.ResizeHandle}}),Object.defineProperty(e,"SegmentedControl",{enumerable:!0,get:function(){return p.SegmentedControl}}),Object.defineProperty(e,"Select",{enumerable:!0,get:function(){return y.Select}}),Object.defineProperty(e,"SidebarToggle",{enumerable:!0,get:function(){return P.SidebarToggle}}),Object.defineProperty(e,"Switch",{enumerable:!0,get:function(){return S.Switch}}),Object.defineProperty(e,"cx",{enumerable:!0,get:function(){return j.cx}}),Object.defineProperty(e,"usePrefersReducedMotion",{enumerable:!0,get:function(){return s.usePrefersReducedMotion}}),Object.defineProperty(e,"Sidebar",{enumerable:!0,get:function(){return E.Sidebar}}),Object.defineProperty(e,"LogSidebar",{enumerable:!0,get:function(){return R.LogSidebar}}),Object.defineProperty(e,"StreamPanel",{enumerable:!0,get:function(){return v.StreamPanel}}),Object.defineProperty(e,"ScreenshotToast",{enumerable:!0,get:function(){return L.ScreenshotToast}}),Object.defineProperty(e,"ScreenshotToaster",{enumerable:!0,get:function(){return L.ScreenshotToaster}}),Object.defineProperty(e,"useScreenshotToast",{enumerable:!0,get:function(){return L.useScreenshotToast}}),Object.defineProperty(e,"DeviceTitle",{enumerable:!0,get:function(){return _.DeviceTitle}}),Object.defineProperty(e,"EmptyState",{enumerable:!0,get:function(){return h.EmptyState}}),Object.defineProperty(e,"DeviceSection",{enumerable:!0,get:function(){return A.DeviceSection}}),Object.defineProperty(e,"OutputSection",{enumerable:!0,get:function(){return I.OutputSection}}),Object.defineProperty(e,"CurrentAppSection",{enumerable:!0,get:function(){return T.CurrentAppSection}}),Object.defineProperty(e,"DeviceOptionsSection",{enumerable:!0,get:function(){return N.DeviceOptionsSection}}),Object.defineProperty(e,"NO_DEVICE_FRAME_DESCRIPTION",{enumerable:!0,get:function(){return N.NO_DEVICE_FRAME_DESCRIPTION}}),Object.defineProperty(e,"NO_HARDWARE_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return N.NO_HARDWARE_KEYBOARD_DESCRIPTION}}),Object.defineProperty(e,"ONSCREEN_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return N.ONSCREEN_KEYBOARD_DESCRIPTION}}),Object.defineProperty(e,"ActivityCharts",{enumerable:!0,get:function(){return B.ActivityCharts}}),Object.defineProperty(e,"ActivitySection",{enumerable:!0,get:function(){return B.ActivitySection}}),Object.defineProperty(e,"AccessibilitySection",{enumerable:!0,get:function(){return w.AccessibilitySection}}),Object.defineProperty(e,"CameraSection",{enumerable:!0,get:function(){return F.CameraSection}}),Object.defineProperty(e,"LocationSection",{enumerable:!0,get:function(){return M.LocationSection}}),Object.defineProperty(e,"PermissionsSection",{enumerable:!0,get:function(){return K.PermissionsSection}}),Object.defineProperty(e,"EventsSection",{enumerable:!0,get:function(){return H.EventsSection}}),Object.defineProperty(e,"LogsSection",{enumerable:!0,get:function(){return Y.LogsSection}}),Object.defineProperty(e,"CollapsibleSection",{enumerable:!0,get:function(){return k.CollapsibleSection}}),Object.defineProperty(e,"KeyboardSection",{enumerable:!0,get:function(){return x.KeyboardSection}}),Object.defineProperty(e,"PhoneFrame",{enumerable:!0,get:function(){return z.PhoneFrame}}),Object.defineProperty(e,"deviceFrameLayout",{enumerable:!0,get:function(){return V.deviceFrameLayout}}),Object.defineProperty(e,"deviceFrameRotation",{enumerable:!0,get:function(){return V.deviceFrameRotation}}),Object.defineProperty(e,"LogControls",{enumerable:!0,get:function(){return W.LogControls}}),Object.defineProperty(e,"LogList",{enumerable:!0,get:function(){return q.LogList}}),Object.defineProperty(e,"LogRow",{enumerable:!0,get:function(){return G.LogRow}}),Object.defineProperty(e,"StreamControls",{enumerable:!0,get:function(){return J.StreamControls}}),Object.defineProperty(e,"StreamSection",{enumerable:!0,get:function(){return Q.StreamSection}}),Object.defineProperty(e,"StreamOptionsSection",{enumerable:!0,get:function(){return U.StreamOptionsSection}}),Object.defineProperty(e,"RecentDevicesModal",{enumerable:!0,get:function(){return X.RecentDevicesModal}}),Object.defineProperty(e,"BootErrorModal",{enumerable:!0,get:function(){return Z.BootErrorModal}}),Object.defineProperty(e,"ServerConnectionOverlay",{enumerable:!0,get:function(){return $.ServerConnectionOverlay}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),u=r(d[4]),b=r(d[5]),f=r(d[6]),l=r(d[7]),O=r(d[8]),p=r(d[9]),y=r(d[10]),P=r(d[11]),S=r(d[12]),j=r(d[13]),s=r(d[14]),D=r(d[15]);Object.keys(D).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return D[t]}})});var C=r(d[16]);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 E=r(d[17]),R=r(d[18]),v=r(d[19]),L=r(d[20]),_=r(d[21]),h=r(d[22]),A=r(d[23]),I=r(d[24]),T=r(d[25]),N=r(d[26]),B=r(d[27]),w=r(d[28]),F=r(d[29]),M=r(d[30]),K=r(d[31]),H=r(d[32]),Y=r(d[33]),k=r(d[34]),x=r(d[35]),z=r(d[36]),V=r(d[37]),W=r(d[38]),q=r(d[39]),G=r(d[40]),J=r(d[41]),Q=r(d[42]),U=r(d[43]),X=r(d[44]),Z=r(d[45]),$=r(d[46]),ee=r(d[47]);Object.keys(ee).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return ee[t]}})})},236,[237,239,241,245,304,319,320,321,323,324,325,351,352,303,353,242,238,354,358,382,388,383,391,356,392,366,369,367,359,364,375,365,371,378,360,370,384,386,372,373,374,390,393,379,357,394,395,381]);
|
|
303
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"BUTTON_HEIGHTS",{enumerable:!0,get:function(){return c}}),e.Button=function({children:n,theme:l="primary",size:c="sm",leftSlot:b,rightSlot:x,block:h=!1,disabled:y=!1,type:p="button",href:v,target:f,onClick:j,className:O,style:S}){const[k,I]=(0,s.useState)(!1),[z,R]=(0,s.useState)(!1),B=o[l],C=Object.assign({display:
|
|
304
|
-
__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:
|
|
305
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["icon","label","tooltip","style","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onFocus","onBlur"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CONTROL_BUTTON_SIZE",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"ControlButton",{enumerable:!0,get:function(){return b}});var o,n=r(d[0]),t=(o=n)&&o.__esModule?o:{default:o},s=r(d[1]),l=r(d[2]),u=r(d[3]),c=r(d[4]);const p=44,b=(0,l.forwardRef)(function(o,n){let{icon:b,label:f,tooltip:x,style:y,onMouseEnter:M,onMouseLeave:h,onMouseDown:j,onMouseUp:v,onFocus:O,onBlur:w}=o,S=(0,t.default)(o,e);const[_,B]=(0,l.useState)(!1),[C,E]=(0,l.useState)(!1),[F,k]=(0,l.useState)(!1),L=_||F;return(0,s.jsxs)("span",{style:{position:
|
|
306
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isFocusVisible=function(t){try{return t.currentTarget.matches(
|
|
307
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceListItem=function({name:c,version:f,unsupported:p=!1,usedByAgent:x=!1,selected:b=!1,onClick:h}){const[v,y]=(0,n.useState)(!1),[w,j]=(0,n.useState)(!1),R=(0,n.useRef)(null),S=(0,n.useRef)(null),W=(0,n.useRef)(null),k=(0,n.useRef)(null),C=(0,u.useCompactAgentDeviceStatus)({buttonRef:R,nameRef:S,statusLabelRef:W,versionRef:k}),M={display:
|
|
303
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"BUTTON_HEIGHTS",{enumerable:!0,get:function(){return c}}),e.Button=function({children:n,theme:l="primary",size:c="sm",leftSlot:b,rightSlot:x,block:h=!1,disabled:y=!1,type:p="button",href:v,target:f,onClick:j,className:O,style:S}){const[k,I]=(0,s.useState)(!1),[z,R]=(0,s.useState)(!1),B=o[l],C=Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"2xs"===c?4:"xs"===c?6:8,border:"1px solid",fontWeight:500,whiteSpace:"nowrap",cursor:y?"default":"pointer",textDecoration:"none",transition:"background-color 150ms ease, transform 100ms ease, opacity 150ms ease",width:h?"100%":void 0,transform:!y&&z?"scale(0.98)":void 0},u[c],{backgroundColor:y?B.disabledBackground:k?B.hover:B.background,borderColor:y?B.disabledBorder:B.border,color:y?B.disabledText:B.text,opacity:y?.8:1,pointerEvents:y?"none":void 0},S),M=(0,t.jsxs)(t.Fragment,{children:[b,null!=n&&(0,t.jsx)("span",{style:{display:"flex",lineHeight:1},children:n}),x]}),T={onMouseEnter:()=>I(!0),onMouseLeave:()=>{I(!1),R(!1)},onMouseDown:()=>R(!0),onMouseUp:()=>R(!1)};if(v)return(0,t.jsx)("a",Object.assign({href:y?void 0:v,target:f,className:O,style:C,onClick:y?void 0:j},T,{children:M}));return(0,t.jsx)("button",Object.assign({type:p,className:O,style:C,disabled:y,onClick:y?void 0:j},T,{children:M}))};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"),"agent-overlay":l("agent-overlay")};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":28,xs:32,sm:36,md:40,lg:44,xl:48,"2xl":60},u={"2xs":Object.assign({height:c["2xs"],paddingInline:8,borderRadius:n.radius.lg},n.textSize.xs),xs:Object.assign({height:c.xs,paddingInline:12,borderRadius:n.radius.lg},n.textSize.xs),sm:Object.assign({height:c.sm,paddingInline:16,borderRadius:n.radius.lg},n.textSize.sm),md:Object.assign({height:c.md,paddingInline:16,borderRadius:n.radius.lg},n.textSize.sm),lg:Object.assign({height:c.lg,paddingInline:24,borderRadius:n.radius.lg},n.textSize.base),xl:Object.assign({height:c.xl,paddingInline:24,borderRadius:n.radius.lg},n.textSize.base),"2xl":Object.assign({height:c["2xl"],paddingInline:24,borderRadius:n.radius.lg},n.textSize.lg)}},237,[153,38,238]);
|
|
304
|
+
__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}},238,[]);
|
|
305
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["icon","label","tooltip","style","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onFocus","onBlur"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CONTROL_BUTTON_SIZE",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"ControlButton",{enumerable:!0,get:function(){return b}});var o,n=r(d[0]),t=(o=n)&&o.__esModule?o:{default:o},s=r(d[1]),l=r(d[2]),u=r(d[3]),c=r(d[4]);const p=44,b=(0,l.forwardRef)(function(o,n){let{icon:b,label:f,tooltip:x,style:y,onMouseEnter:M,onMouseLeave:h,onMouseDown:j,onMouseUp:v,onFocus:O,onBlur:w}=o,S=(0,t.default)(o,e);const[_,B]=(0,l.useState)(!1),[C,E]=(0,l.useState)(!1),[F,k]=(0,l.useState)(!1),L=_||F;return(0,s.jsxs)("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[(0,s.jsx)("button",Object.assign({ref:n,type:"button","aria-label":f,"aria-description":x,onMouseEnter:e=>{B(!0),M?.(e)},onMouseLeave:e=>{B(!1),E(!1),h?.(e)},onMouseDown:e=>{E(!0),j?.(e)},onMouseUp:e=>{E(!1),v?.(e)},onFocus:e=>{k((0,c.isFocusVisible)(e)),O?.(e)},onBlur:e=>{k(!1),w?.(e)},style:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",width:p,height:p,padding:0,border:"none",borderRadius:`calc(${u.radius.xl} - 4px)`,outline:"none",backgroundColor:_?u.bg.hover:"transparent",boxShadow:F?`0 0 0 2px ${u.border.secondary}`:"none",color:u.icon.default,cursor:"pointer",fontFamily:"inherit",transition:"background-color 150ms ease, transform 100ms ease",transform:C?"scale(0.96)":void 0},y)},S,{children:b})),(0,s.jsx)("span",{role:"tooltip","aria-hidden":"true",style:Object.assign({},u.textSize.xs,{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",zIndex:1,padding:"3px 8px",borderRadius:u.radius.md,backgroundColor:u.text.default,color:u.bg.default,whiteSpace:"nowrap",pointerEvents:"none",opacity:L?1:0,transform:"translateX(-50%)",transition:"opacity 120ms ease"}),children:x??f})]})})},239,[131,153,38,238,240]);
|
|
306
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isFocusVisible=function(t){try{return t.currentTarget.matches(":focus-visible")}catch{return!0}}},240,[]);
|
|
307
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DeviceListItem=function({name:c,version:f,unsupported:p=!1,usedByAgent:x=!1,selected:b=!1,onClick:h}){const[v,y]=(0,n.useState)(!1),[w,j]=(0,n.useState)(!1),R=(0,n.useRef)(null),S=(0,n.useRef)(null),W=(0,n.useRef)(null),k=(0,n.useRef)(null),C=(0,u.useCompactAgentDeviceStatus)({buttonRef:R,nameRef:S,statusLabelRef:W,versionRef:k}),M={display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box",padding:16,overflow:"hidden",border:"none",borderRadius:o.radius.xl,backgroundColor:b?o.bg.hover:v?o.bg.element:"transparent",cursor:"pointer",textAlign:"left",fontFamily:"inherit",transition:"background-color 150ms ease, transform 100ms ease",transform:w?"scale(0.98)":void 0};return(0,t.jsxs)("button",{ref:R,type:"button",style:M,onClick:h,"aria-pressed":b,"aria-label":`${c}, ${f}${x?", used by agent":""}`,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),j(!1)},onMouseDown:()=>j(!0),onMouseUp:()=>j(!1),children:[(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,flex:"1 1 auto",minWidth:0,overflow:"hidden"},children:[p&&(0,t.jsx)("span",{role:"img","aria-label":"Unsupported or untested device",title:"This device type is unsupported or untested.",style:{display:"flex",flex:"0 0 auto",color:o.icon.warning},children:(0,t.jsx)(s.WarningIcon,{size:16})}),(0,t.jsx)("span",{ref:S,title:c,style:Object.assign({},o.textSize.sm,{minWidth:0,flex:"1 1 auto",fontWeight:500,color:o.text.default,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),children:c}),(0,t.jsx)(l.AgentDeviceStatus,{active:x,compact:C,labelRef:W})]}),(0,t.jsx)("span",{ref:k,style:Object.assign({},o.textSize.sm,{fontWeight:500,color:o.text.secondary,whiteSpace:"nowrap",flexShrink:0}),children:f})]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),u=r(d[5])},241,[153,38,242,238,243,244]);
|
|
308
308
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PlusIcon=function({size:t=18,color:n="currentColor",strokeWidth:s=1.5,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M12 5v14M5 12h14",stroke:n,strokeWidth:s,strokeLinecap:"round"})})},e.CloseIcon=function({size:t=18,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M18 6 6 18M6 6l12 12",stroke:n,strokeWidth:s,strokeLinecap:"round"})})},e.PhoneIcon=function({size:t=28,color:n="currentColor",strokeWidth:s=1.5,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("rect",{x:"6",y:"2",width:"12",height:"20",rx:"3",stroke:n,strokeWidth:s}),(0,o.jsx)("path",{d:"M10 18.5h4",stroke:n,strokeWidth:s,strokeLinecap:"round"})]})},e.RefreshIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.5,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M21 12A9 9 0 1 1 18.36 5.64L20.72 8M17.12 8H20.72V4.4",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.HomeIcon=function({size:t=20,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M3 9.5 12 3l9 6.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1V9.5Z",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.BackIcon=function({size:t=18,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M19 12H5M12 19l-7-7 7-7",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.RecentsIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("rect",{x:"5",y:"5",width:"14",height:"14",rx:"2",stroke:n,strokeWidth:s})})},e.ThemeIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.5,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:n,strokeWidth:s}),(0,o.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18Z",fill:n})]})},e.CameraIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.33,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("path",{d:"M3 8a2 2 0 0 1 2-2h1.5L8 4h8l1.5 2H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8Z",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("circle",{cx:"12",cy:"13",r:"3.25",stroke:n,strokeWidth:s})]})},e.DotsIcon=function({size:t=16,color:n="currentColor",style:s}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:n,style:s,children:[(0,o.jsx)("circle",{cx:"5",cy:"12",r:"1.5"}),(0,o.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,o.jsx)("circle",{cx:"19",cy:"12",r:"1.5"})]})},e.SidebarIcon=function({size:t=20,color:n="currentColor",strokeWidth:s=1.5,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:n,strokeWidth:s}),(0,o.jsx)("path",{d:"M9 3v18",stroke:n,strokeWidth:s,strokeLinecap:"round"})]})},e.RotateIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("rect",{x:"4.1",y:"8",width:"9",height:"11.6",rx:"2.3",stroke:n,strokeWidth:s}),(0,o.jsx)("path",{d:"M8.6 4.1A9.7 9.7 0 0 1 18.3 13.8M16.18 11.68 18.3 13.8 20.42 11.68",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})]})},e.PowerIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("path",{d:"M12 2v10",stroke:n,strokeWidth:s,strokeLinecap:"round"}),(0,o.jsx)("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0",stroke:n,strokeWidth:s,strokeLinecap:"round"})]})}
|
|
309
309
|
/**
|
|
310
310
|
* Vendored Lucide `unplug` icon, rendered locally to keep this package dependency-free.
|
|
@@ -321,9 +321,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
321
321
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
322
322
|
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
323
323
|
*/,e.CableDisconnectIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("path",{d:"m19 5 3-3",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"m2 22 3-3",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M7.5 13.5 10 11",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M10.5 16.5 13 14",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})]})},e.TrashIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=1.67,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.SmartphoneIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=2,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2.5",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M12 18h.01",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})]})},e.WarningIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=2,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",style:h,children:[(0,o.jsx)("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M12 9v4M12 17h.01",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})]})},e.CheckIcon=function({size:t=17,color:n="currentColor",strokeWidth:s=2.5,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("polyline",{points:"20 6 9 17 4 12",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.ChevronDownIcon=function({size:t=14,color:n="currentColor",strokeWidth:s=2,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("polyline",{points:"6 9 12 15 18 9",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.ChevronRightIcon=function({size:t=16,color:n="currentColor",strokeWidth:s=2.25,style:h}){return(0,o.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:(0,o.jsx)("polyline",{points:"9 18 15 12 9 6",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})})},e.ChevronsUpDownIcon=function({size:t=14,color:n="currentColor",strokeWidth:s=2,style:h}){return(0,o.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:h,children:[(0,o.jsx)("polyline",{points:"7 15 12 20 17 15",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("polyline",{points:"7 9 12 4 17 9",stroke:n,strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round"})]})};var o=r(d[0])},242,[153]);
|
|
324
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentDeviceStatus=function({active:l,compact:s=!1,labelRef:c}){return(0,t.jsxs)("span",{"aria-hidden":!l,"data-agent-device-status":l?
|
|
325
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldCompactAgentDeviceStatus=c,e.useCompactAgentDeviceStatus=function({buttonRef:n,nameRef:o,statusLabelRef:s,versionRef:u}){const[l,f]=(0,t.useState)(!1);return(0,t.useLayoutEffect)(()=>{const t=n.current,l=o.current,b=s.current,v=u.current,h=t?.querySelector(
|
|
326
|
-
__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)(
|
|
324
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentDeviceStatus=function({active:l,compact:s=!1,labelRef:c}){return(0,t.jsxs)("span",{"aria-hidden":!l,"data-agent-device-status":l?"active":"inactive",style:Object.assign({display:"inline-flex",alignItems:"center",gap:s?0:5,flexShrink:0,visibility:l?"visible":"hidden",color:n.text.info},n.textSize["2xs"]),children:[(0,t.jsx)("span",{"data-agent-device-badge":!0,style:{width:7,height:7,flexShrink:0,borderRadius:n.radius.full,backgroundColor:n.icon.info}}),(0,t.jsx)("span",{ref:c,"data-agent-device-label":!0,style:{display:"inline-block",maxWidth:s?0:void 0,overflow:"hidden",whiteSpace:"nowrap"},children:"Used by agent"})]})};var t=r(d[0]),n=r(d[1])},243,[153,238]);
|
|
325
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldCompactAgentDeviceStatus=c,e.useCompactAgentDeviceStatus=function({buttonRef:n,nameRef:o,statusLabelRef:s,versionRef:u}){const[l,f]=(0,t.useState)(!1);return(0,t.useLayoutEffect)(()=>{const t=n.current,l=o.current,b=s.current,v=u.current,h=t?.querySelector("[data-agent-device-badge]");if(!(t&&l&&b&&v&&h))return;const p=()=>{const n=window.getComputedStyle(t),o=t.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight);f(c({available:o,name:l.scrollWidth,version:v.scrollWidth,badge:h.offsetWidth,label:b.scrollWidth}))};let R=!1;p();const y=new ResizeObserver(p);return y.observe(t),document.fonts?.ready.then(()=>{R||p()}),()=>{R=!0,y.disconnect()}},[n,o,s,u]),l};var t=r(d[0]);const n=16,o=8,s=5;function c(t){return t.name+o+t.badge+s+t.label+n+t.version>t.available}},244,[38]);
|
|
326
|
+
__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})}},245,[131,153,246,299,238,303,242]);
|
|
327
327
|
__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"}},246,[131,38,247,248,249,250,252,254,258,259,260,255,261,262,298,256,153]);
|
|
328
328
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canUseDOM",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"composeEventHandlers",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"getActiveElement",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"getOwnerDocument",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"getOwnerWindow",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"isFrame",{enumerable:!0,get:function(){return f}});var n=!("undefined"==typeof window||!window.document||!window.document.createElement);function t(n,t,{checkForDefaultPrevented:o=!0}={}){return function(u){if(n?.(u),!1===o||!u||!u.defaultPrevented)return t?.(u)}}function o(t){if(!n)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}function u(t){if(!n)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}function c(n,t=!1){const{activeElement:o}=u(n);if(!o?.nodeName)return null;if(f(o)&&o.contentDocument)return c(o.contentDocument.body,t);if(t){const n=o.getAttribute("aria-activedescendant");if(n){const t=u(o).getElementById(n);if(t)return t}}return o}function f(n){return"IFRAME"===n.tagName}},247,[]);
|
|
329
329
|
__d(function(g,r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"composeRefs",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"useComposedRefs",{enumerable:!0,get:function(){return u}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0]));function t(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return n=>{let u=!1;const o=e.map(e=>{const o=t(e,n);return u||"function"!=typeof o||(u=!0),o});if(u)return()=>{for(let n=0;n<o.length;n++){const u=o[n];"function"==typeof u?u():t(e[n],null)}}}}function u(...t){return e.useCallback(n(...t),t)}},248,[38]);
|
|
@@ -381,8 +381,8 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule'
|
|
|
381
381
|
__d(function(g,r,i,a,m,_e,_d){"use strict";const e=["asChild"];function t(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Primitive",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"dispatchDiscreteCustomEvent",{enumerable:!0,get:function(){return p}});var n,u=r(_d[0]),o=(n=u)&&n.__esModule?n:{default:n},c=t(r(_d[1])),s=t(r(_d[2])),f=r(_d[3]),d=r(_d[4]),l=Object.defineProperty,b=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const u=(0,f.createSlot)(`Primitive.${n}`),s=c.forwardRef((t,c)=>{const{asChild:s}=t,f=(0,o.default)(t,e),l=s?u:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(l,Object.assign({},f,{ref:c}))});return s.displayName=`Primitive.${n}`,Object.assign({},t,{[n]:s})},{});function p(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}l(p,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var v=b},300,[131,38,40,301,153]);
|
|
382
382
|
__d(function(g,r,i,a,m,_e,_d){"use strict";const e=["children"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"Slot",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"Slottable",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"createSlot",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"createSlottable",{enumerable:!0,get:function(){return b}});var t,n=r(_d[0]),o=(t=n)&&t.__esModule?t:{default:t},l=(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])),c=r(_d[2]),s=Object.defineProperty,u=(e,t)=>s(e,"name",{value:t,configurable:!0});function f(t){const n=l.forwardRef((n,s)=>{let{children:u}=n,f=(0,o.default)(n,e),p=null,d=!1;const b=[];E(u)&&"function"==typeof $&&(u=$(u._payload)),l.Children.forEach(u,e=>{if(O(e)){d=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;E(n)&&"function"==typeof $&&(n=$(n._payload)),p=h(t,n),b.push(p?.props?.children)}else b.push(e)}),p?p=l.cloneElement(p,void 0,b):!d&&1===l.Children.count(u)&&l.isValidElement(u)&&(p=u);const y=p?j(p):void 0,_=(0,c.useComposedRefs)(s,y);if(!p){if(u||0===u)throw new Error(d?R(t):P(t));return u}const v=S(f,p.props??{});return p.type!==l.Fragment&&(v.ref=s?_:y),l.cloneElement(p,v)});return n.displayName=`${t}.Slot`,n}u(f,"createSlot");var p=f("Slot"),d=Symbol.for("radix.slottable");function b(e){const t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=d,t}u(b,"createSlottable");var y=b("Slottable"),h=u((e,t)=>{if("child"in e.props){const t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function S(e,t){const n=Object.assign({},t);for(const o in t){const l=e[o],c=t[o];/^on[A-Z]/.test(o)?l&&c?n[o]=(...e)=>{const t=c(...e);return l(...e),t}:l&&(n[o]=l):"style"===o?n[o]=Object.assign({},l,c):"className"===o&&(n[o]=[l,c].filter(Boolean).join(" "))}return Object.assign({},e,n)}function j(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function O(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===d}u(S,"mergeProps"),u(j,"getElementRef"),u(O,"isSlottable");var _=Symbol.for("react.lazy");function E(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===_&&"_payload"in e&&v(e._payload)}function v(e){return"object"==typeof e&&null!==e&&"then"in e}u(E,"isLazyComponent"),u(v,"isPromiseLike");var P=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),R=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),$=l[" use ".trim().toString()]},301,[131,38,302]);
|
|
383
383
|
__d(function(g,r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"composeRefs",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"useComposedRefs",{enumerable:!0,get:function(){return f}});var e=(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[0])),t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0});function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let n=!1;const u=e.map(e=>{const u=o(e,t);return n||"function"!=typeof u||(n=!0),u});if(n)return()=>{for(let t=0;t<u.length;t++){const n=u[t];"function"==typeof n?n():o(e[t],null)}}}}function f(...t){return e.useCallback(u(...t),t)}n(o,"setRef"),n(u,"composeRefs"),n(f,"useComposedRefs")},302,[38]);
|
|
384
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.cx=function(...n){return n.filter(Boolean).join(
|
|
385
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","trigger","className","sideOffset","collisionPadding","side","disabled"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.Dropdown=function(s){let{children:t,trigger:f,className:b,sideOffset:h=8,collisionPadding:u={left:16,right:16},side:x="bottom",disabled:j=!1}=s,p=(0,l.default)(s,e);return(0,o.jsxs)(n.Root,{children:[(0,o.jsx)(n.Trigger,{disabled:j,asChild:!0,children:f}),(0,o.jsx)(n.Portal,{children:(0,o.jsxs)(n.Content,Object.assign({className:(0,c.cx)(
|
|
384
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.cx=function(...n){return n.filter(Boolean).join(" ")}},303,[]);
|
|
385
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","trigger","className","sideOffset","collisionPadding","side","disabled"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.Dropdown=function(s){let{children:t,trigger:f,className:b,sideOffset:h=8,collisionPadding:u={left:16,right:16},side:x="bottom",disabled:j=!1}=s,p=(0,l.default)(s,e);return(0,o.jsxs)(n.Root,{children:[(0,o.jsx)(n.Trigger,{disabled:j,asChild:!0,children:f}),(0,o.jsx)(n.Portal,{children:(0,o.jsxs)(n.Content,Object.assign({className:(0,c.cx)("z-overDialog-605 flex min-w-55 flex-col gap-1 rounded-xl border border-secondary bg-default p-2 shadow-md","will-change-[opacity,transform]","data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade",b),side:x,sideOffset:h,collisionPadding:u},p,{children:[(0,o.jsx)(n.Arrow,{asChild:!0,children:(0,o.jsx)("div",{className:"relative -top-1 size-2.5 rotate-45 border-r border-b border-secondary bg-default"})}),t]}))})]})};var s,t=r(d[0]),l=(s=t)&&s.__esModule?s:{default:s},o=r(d[1]),n=r(d[2]),c=r(d[3])},304,[131,153,305,303]);
|
|
386
386
|
__d(function(g,r,i,a,m,_e,_d){"use strict";const e=["__scopeDropdownMenu","disabled"],n=["__scopeDropdownMenu"],o=["__scopeDropdownMenu"],t=["__scopeDropdownMenu"],u=["__scopeDropdownMenu"],d=["__scopeDropdownMenu"],p=["__scopeDropdownMenu"],c=["__scopeDropdownMenu"],s=["__scopeDropdownMenu"],l=["__scopeDropdownMenu"],f=["__scopeDropdownMenu"],b=["__scopeDropdownMenu"],w=["__scopeDropdownMenu"],j=["__scopeDropdownMenu"];function D(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}),n.default=e,n}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Arrow",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"CheckboxItem",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"Content",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"DropdownMenu",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"DropdownMenuArrow",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"DropdownMenuCheckboxItem",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"DropdownMenuContent",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"DropdownMenuGroup",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"DropdownMenuItem",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"DropdownMenuItemIndicator",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(_e,"DropdownMenuLabel",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"DropdownMenuPortal",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"DropdownMenuRadioGroup",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"DropdownMenuRadioItem",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"DropdownMenuSeparator",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_e,"DropdownMenuSub",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"DropdownMenuSubContent",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"DropdownMenuSubTrigger",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"DropdownMenuTrigger",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"Group",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"Item",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"ItemIndicator",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"Label",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"Portal",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"RadioGroup",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"RadioItem",{enumerable:!0,get:function(){return le}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(_e,"Separator",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"Sub",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"SubContent",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"SubTrigger",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"Trigger",{enumerable:!0,get:function(){return te}}),Object.defineProperty(_e,"createDropdownMenuScope",{enumerable:!0,get:function(){return A}});var O,M=r(_d[0]),_=(O=M)&&O.__esModule?O:{default:O},y=D(r(_d[1])),h=r(_d[2]),v=r(_d[3]),P=r(_d[4]),x=r(_d[5]),I=r(_d[6]),R=r(_d[7]),C=D(R),S=r(_d[8]),N=r(_d[9]),T="DropdownMenu",[k,A]=(0,P.createContextScope)(T,[R.createMenuScope]),E=(0,R.createMenuScope)(),[G,H]=k(T),K=e=>{const{__scopeDropdownMenu:n,children:o,dir:t,open:u,defaultOpen:d,onOpenChange:p,modal:c=!0}=e,s=E(n),l=y.useRef(null),[f,b]=(0,x.useControllableState)({prop:u,defaultProp:d??!1,onChange:p,caller:T});return(0,N.jsx)(G,{scope:n,triggerId:(0,S.useId)(),triggerRef:l,contentId:(0,S.useId)(),open:f,onOpenChange:b,onOpenToggle:y.useCallback(()=>b(e=>!e),[b]),modal:c,children:(0,N.jsx)(C.Root,Object.assign({},s,{open:f,onOpenChange:b,dir:t,modal:c,children:o}))})};K.displayName=T;var L="DropdownMenuTrigger",F=y.forwardRef((n,o)=>{const{__scopeDropdownMenu:t,disabled:u=!1}=n,d=(0,_.default)(n,e),p=H(L,t),c=E(t),s=(0,v.useComposedRefs)(o,p.triggerRef);return(0,N.jsx)(C.Anchor,Object.assign({asChild:!0},c,{children:(0,N.jsx)(I.Primitive.button,Object.assign({type:"button",id:p.triggerId,"aria-haspopup":"menu","aria-expanded":p.open,"aria-controls":p.open?p.contentId:void 0,"data-state":p.open?"open":"closed","data-disabled":u?"":void 0,disabled:u},d,{ref:s,onPointerDown:(0,h.composeEventHandlers)(n.onPointerDown,e=>{u||0!==e.button||!1!==e.ctrlKey||(p.onOpenToggle(),p.open||e.preventDefault())}),onKeyDown:(0,h.composeEventHandlers)(n.onKeyDown,e=>{u||(["Enter"," "].includes(e.key)&&p.onOpenToggle(),"ArrowDown"===e.key&&p.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})}))}))});F.displayName=L;var q=e=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,n),u=E(o);return(0,N.jsx)(C.Portal,Object.assign({},u,t))};q.displayName="DropdownMenuPortal";var z="DropdownMenuContent",B=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:t}=e,u=(0,_.default)(e,o),d=H(z,t),p=E(t),c=y.useRef(!1);return(0,N.jsx)(C.Content,Object.assign({id:d.contentId,"aria-labelledby":d.triggerId},p,u,{ref:n,onCloseAutoFocus:(0,h.composeEventHandlers)(e.onCloseAutoFocus,e=>{c.current||d.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:(0,h.composeEventHandlers)(e.onInteractOutside,e=>{const n=e.detail.originalEvent,o=0===n.button&&!0===n.ctrlKey,t=2===n.button||o;d.modal&&!t||(c.current=!0)}),style:Object.assign({},e.style,{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"})}))});B.displayName=z;var J=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,u=(0,_.default)(e,t),d=E(o);return(0,N.jsx)(C.Group,Object.assign({},d,u,{ref:n}))});J.displayName="DropdownMenuGroup";var Q=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,u),d=E(o);return(0,N.jsx)(C.Label,Object.assign({},d,t,{ref:n}))});Q.displayName="DropdownMenuLabel";var U=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,d),u=E(o);return(0,N.jsx)(C.Item,Object.assign({},u,t,{ref:n}))});U.displayName="DropdownMenuItem";var V=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,p),u=E(o);return(0,N.jsx)(C.CheckboxItem,Object.assign({},u,t,{ref:n}))});V.displayName="DropdownMenuCheckboxItem";var W=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,c),u=E(o);return(0,N.jsx)(C.RadioGroup,Object.assign({},u,t,{ref:n}))});W.displayName="DropdownMenuRadioGroup";var X=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,s),u=E(o);return(0,N.jsx)(C.RadioItem,Object.assign({},u,t,{ref:n}))});X.displayName="DropdownMenuRadioItem";var Y=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,l),u=E(o);return(0,N.jsx)(C.ItemIndicator,Object.assign({},u,t,{ref:n}))});Y.displayName="DropdownMenuItemIndicator";var Z=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,f),u=E(o);return(0,N.jsx)(C.Separator,Object.assign({},u,t,{ref:n}))});Z.displayName="DropdownMenuSeparator";var $=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,b),u=E(o);return(0,N.jsx)(C.Arrow,Object.assign({},u,t,{ref:n}))});$.displayName="DropdownMenuArrow";var ee=e=>{const{__scopeDropdownMenu:n,children:o,open:t,onOpenChange:u,defaultOpen:d}=e,p=E(n),[c,s]=(0,x.useControllableState)({prop:t,defaultProp:d??!1,onChange:u,caller:"DropdownMenuSub"});return(0,N.jsx)(C.Sub,Object.assign({},p,{open:c,onOpenChange:s,children:o}))},ne=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,w),u=E(o);return(0,N.jsx)(C.SubTrigger,Object.assign({},u,t,{ref:n}))});ne.displayName="DropdownMenuSubTrigger";var re=y.forwardRef((e,n)=>{const{__scopeDropdownMenu:o}=e,t=(0,_.default)(e,j),u=E(o);return(0,N.jsx)(C.SubContent,Object.assign({},u,t,{ref:n,style:Object.assign({},e.style,{"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"})}))});re.displayName="DropdownMenuSubContent";var oe=K,te=F,ae=q,ue=B,de=J,pe=Q,ie=U,ce=V,se=W,le=X,fe=Y,be=Z,ge=$,we=ee,me=ne,je=re},305,[131,38,247,248,249,252,255,306,250,153]);
|
|
387
387
|
__d(function(g,r,_i,a,m,_e,_d){"use strict";const e=["__scopeMenu"],n=["forceMount"],t=["__scopeMenu","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll"],o=["__scopeMenu"],u=["__scopeMenu"],c=["disabled","onSelect"],s=["__scopeMenu","disabled","textValue"],i=["checked","onCheckedChange"],l=["value","onValueChange"],d=["value"],f=["__scopeMenu","forceMount"],p=["__scopeMenu"],b=["__scopeMenu"],v=["forceMount","align"];function h(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Anchor",{enumerable:!0,get:function(){return on}}),Object.defineProperty(_e,"Arrow",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(_e,"CheckboxItem",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(_e,"Content",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(_e,"Group",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(_e,"Item",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(_e,"ItemIndicator",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(_e,"Label",{enumerable:!0,get:function(){return an}}),Object.defineProperty(_e,"Menu",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"MenuAnchor",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"MenuArrow",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(_e,"MenuCheckboxItem",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"MenuContent",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"MenuGroup",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"MenuItem",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"MenuItemIndicator",{enumerable:!0,get:function(){return He}}),Object.defineProperty(_e,"MenuLabel",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"MenuPortal",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"MenuRadioGroup",{enumerable:!0,get:function(){return De}}),Object.defineProperty(_e,"MenuRadioItem",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"MenuSeparator",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(_e,"MenuSub",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(_e,"MenuSubContent",{enumerable:!0,get:function(){return We}}),Object.defineProperty(_e,"MenuSubTrigger",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"Portal",{enumerable:!0,get:function(){return un}}),Object.defineProperty(_e,"RadioGroup",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(_e,"RadioItem",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(_e,"Separator",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(_e,"Sub",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(_e,"SubContent",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(_e,"SubTrigger",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(_e,"createMenuScope",{enumerable:!0,get:function(){return ee}});var j,y=r(_d[0]),O=(j=y)&&j.__esModule?j:{default:j},M=h(r(_d[1])),P=r(_d[2]),_=r(_d[3]),C=r(_d[4]),w=r(_d[5]),x=r(_d[6]),E=r(_d[7]),R=r(_d[8]),k=r(_d[9]),S=r(_d[10]),D=r(_d[11]),I=h(D),F=r(_d[12]),T=r(_d[13]),L=r(_d[14]),A=r(_d[15]),H=h(A),K=r(_d[16]),G=r(_d[17]),N=r(_d[18]),V=r(_d[19]),U=r(_d[20]),B=["Enter"," "],X=["ArrowUp","PageDown","End"],Y=["ArrowDown","PageUp","Home",...X],z={ltr:[...B,"ArrowRight"],rtl:[...B,"ArrowLeft"]},W={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Z="Menu",[q,J,Q]=(0,_.createCollection)(Z),[$,ee]=(0,w.createContextScope)(Z,[Q,D.createPopperScope,A.createRovingFocusGroupScope]),ne=(0,D.createPopperScope)(),te=(0,A.createRovingFocusGroupScope)(),[re,oe]=$(Z),[ue,ce]=$(Z),se=e=>{const{__scopeMenu:n,open:t=!1,children:o,dir:u,onOpenChange:c,modal:s=!0}=e,i=ne(n),[l,d]=M.useState(null),f=M.useRef(!1),p=(0,G.useCallbackRef)(c),b=(0,x.useDirection)(u);return M.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",n,{capture:!0,once:!0}),document.addEventListener("pointermove",n,{capture:!0,once:!0})},n=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",n,{capture:!0}),document.removeEventListener("pointermove",n,{capture:!0})}},[]),M.useEffect(()=>{if(!t)return;const e=()=>p(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[t,p]),(0,U.jsx)(I.Root,Object.assign({},i,{children:(0,U.jsx)(re,{scope:n,open:t,onOpenChange:p,content:l,onContentChange:d,children:(0,U.jsx)(ue,{scope:n,onClose:M.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:b,modal:s,children:o})})}))};se.displayName=Z;var ae=M.forwardRef((n,t)=>{const{__scopeMenu:o}=n,u=(0,O.default)(n,e),c=ne(o);return(0,U.jsx)(I.Anchor,Object.assign({},c,u,{ref:t}))});ae.displayName="MenuAnchor";var ie="MenuPortal",[le,de]=$(ie,{forceMount:void 0}),fe=e=>{const{__scopeMenu:n,forceMount:t,children:o,container:u}=e,c=oe(ie,n);return(0,U.jsx)(le,{scope:n,forceMount:t,children:(0,U.jsx)(T.Presence,{present:t||c.open,children:(0,U.jsx)(F.Portal,{asChild:!0,container:u,children:o})})})};fe.displayName=ie;var pe="MenuContent",[me,ge]=$(pe),be=M.forwardRef((e,t)=>{const o=de(pe,e.__scopeMenu),{forceMount:u=o.forceMount}=e,c=(0,O.default)(e,n),s=oe(pe,e.__scopeMenu),i=ce(pe,e.__scopeMenu);return(0,U.jsx)(q.Provider,{scope:e.__scopeMenu,children:(0,U.jsx)(T.Presence,{present:u||s.open,children:(0,U.jsx)(q.Slot,{scope:e.__scopeMenu,children:i.modal?(0,U.jsx)(ve,Object.assign({},c,{ref:t})):(0,U.jsx)(he,Object.assign({},c,{ref:t}))})})})}),ve=M.forwardRef((e,n)=>{const t=oe(pe,e.__scopeMenu),o=M.useRef(null),u=(0,C.useComposedRefs)(n,o);return M.useEffect(()=>{const e=o.current;if(e)return(0,N.hideOthers)(e)},[]),(0,U.jsx)(ye,Object.assign({},e,{ref:u,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:(0,P.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)}))}),he=M.forwardRef((e,n)=>{const t=oe(pe,e.__scopeMenu);return(0,U.jsx)(ye,Object.assign({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)}))}),je=(0,K.createSlot)("MenuContent.ScrollLock"),ye=M.forwardRef((e,n)=>{const{__scopeMenu:o,loop:u=!1,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:b,onInteractOutside:v,onDismiss:h,disableOutsideScroll:j}=e,y=(0,O.default)(e,t),_=oe(pe,o),w=ce(pe,o),x=ne(o),S=te(o),D=J(o),[F,T]=M.useState(null),L=M.useRef(null),A=(0,C.useComposedRefs)(n,L,_.onContentChange),K=M.useRef(0),G=M.useRef(""),N=M.useRef(0),B=M.useRef(null),z=M.useRef("right"),W=M.useRef(0),Z=j?V.RemoveScroll:M.Fragment,q=j?{as:je,allowPinchZoom:!0}:void 0,Q=e=>{const n=G.current+e,t=D().filter(e=>!e.disabled),o=document.activeElement,u=t.find(e=>e.ref.current===o)?.textValue,c=$e(t.map(e=>e.textValue),n,u),s=t.find(e=>e.textValue===c)?.ref.current;!(function e(n){G.current=n,window.clearTimeout(K.current),""!==n&&(K.current=window.setTimeout(()=>e(""),1e3))})(n),s&&setTimeout(()=>s.focus())};M.useEffect(()=>()=>window.clearTimeout(K.current),[]),(0,R.useFocusGuards)();const $=M.useCallback(e=>z.current===B.current?.side&&nn(e,B.current?.area),[]);return(0,U.jsx)(me,{scope:o,searchRef:G,onItemEnter:M.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:M.useCallback(e=>{$(e)||(L.current?.focus(),T(null))},[$]),onTriggerLeave:M.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:N,onPointerGraceIntentChange:M.useCallback(e=>{B.current=e},[]),children:(0,U.jsx)(Z,Object.assign({},q,{children:(0,U.jsx)(k.FocusScope,{asChild:!0,trapped:c,onMountAutoFocus:(0,P.composeEventHandlers)(s,e=>{e.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,U.jsx)(E.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:b,onInteractOutside:v,onDismiss:h,children:(0,U.jsx)(H.Root,Object.assign({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:u,currentTabStopId:F,onCurrentTabStopIdChange:T,onEntryFocus:(0,P.composeEventHandlers)(d,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,U.jsx)(I.Content,Object.assign({role:"menu","aria-orientation":"vertical","data-state":Ze(_.open),"data-radix-menu-content":"",dir:w.dir},x,y,{ref:A,style:Object.assign({outline:"none"},y.style),onKeyDown:(0,P.composeEventHandlers)(y.onKeyDown,e=>{const n=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!t&&o&&Q(e.key));const u=L.current;if(e.target!==u)return;if(!Y.includes(e.key))return;e.preventDefault();const c=D().filter(e=>!e.disabled).map(e=>e.ref.current);X.includes(e.key)&&c.reverse(),Qe(c)}),onBlur:(0,P.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(K.current),G.current="")}),onPointerMove:(0,P.composeEventHandlers)(e.onPointerMove,tn(e=>{const n=e.target,t=W.current!==e.clientX;if(e.currentTarget.contains(n)&&t){const n=e.clientX>W.current?"right":"left";z.current=n,W.current=e.clientX}}))}))}))})})}))})});be.displayName=pe;var Oe=M.forwardRef((e,n)=>{const t=(0,O.default)(e,o);return(0,U.jsx)(L.Primitive.div,Object.assign({role:"group"},t,{ref:n}))});Oe.displayName="MenuGroup";var Me=M.forwardRef((e,n)=>{const t=(0,O.default)(e,u);return(0,U.jsx)(L.Primitive.div,Object.assign({},t,{ref:n}))});Me.displayName="MenuLabel";var Pe="MenuItem",Ce="menu.itemSelect",we=M.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:o}=e,u=(0,O.default)(e,c),s=M.useRef(null),i=ce(Pe,e.__scopeMenu),l=ge(Pe,e.__scopeMenu),d=(0,C.useComposedRefs)(n,s),f=M.useRef(!1);return(0,U.jsx)(xe,Object.assign({},u,{ref:d,disabled:t,onClick:(0,P.composeEventHandlers)(e.onClick,()=>{const e=s.current;if(!t&&e){const n=new CustomEvent(Ce,{bubbles:!0,cancelable:!0});e.addEventListener(Ce,e=>o?.(e),{once:!0}),(0,L.dispatchDiscreteCustomEvent)(e,n),n.defaultPrevented?f.current=!1:i.onClose()}}),onPointerDown:n=>{e.onPointerDown?.(n),f.current=!0},onPointerUp:(0,P.composeEventHandlers)(e.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:(0,P.composeEventHandlers)(e.onKeyDown,e=>{if(t||e.target!==e.currentTarget)return;""!==l.searchRef.current&&" "===e.key||B.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})}))});we.displayName=Pe;var xe=M.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:o=!1,textValue:u}=e,c=(0,O.default)(e,s),i=ge(Pe,t),l=te(t),d=M.useRef(null),f=(0,C.useComposedRefs)(n,d),[p,b]=M.useState(!1),[v,h]=M.useState("");return M.useEffect(()=>{const e=d.current;e&&h((e.textContent??"").trim())},[c.children]),(0,U.jsx)(q.ItemSlot,{scope:t,disabled:o,textValue:u??v,children:(0,U.jsx)(H.Item,Object.assign({asChild:!0},l,{focusable:!o,children:(0,U.jsx)(L.Primitive.div,Object.assign({role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0},c,{ref:f,onPointerMove:(0,P.composeEventHandlers)(e.onPointerMove,tn(e=>{if(o)i.onItemLeave(e);else if(i.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:(0,P.composeEventHandlers)(e.onPointerLeave,tn(e=>i.onItemLeave(e))),onFocus:(0,P.composeEventHandlers)(e.onFocus,()=>b(!0)),onBlur:(0,P.composeEventHandlers)(e.onBlur,()=>b(!1))}))}))})}),Ee=M.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:o}=e,u=(0,O.default)(e,i);return(0,U.jsx)(Le,{scope:e.__scopeMenu,checked:t,children:(0,U.jsx)(we,Object.assign({role:"menuitemcheckbox","aria-checked":qe(t)?"mixed":t},u,{ref:n,"data-state":Je(t),onSelect:(0,P.composeEventHandlers)(u.onSelect,()=>o?.(!!qe(t)||!t),{checkForDefaultPrevented:!1})}))})});Ee.displayName="MenuCheckboxItem";var Re="MenuRadioGroup",[ke,Se]=$(Re,{value:void 0,onValueChange:()=>{}}),De=M.forwardRef((e,n)=>{const{value:t,onValueChange:o}=e,u=(0,O.default)(e,l),c=(0,G.useCallbackRef)(o);return(0,U.jsx)(ke,{scope:e.__scopeMenu,value:t,onValueChange:c,children:(0,U.jsx)(Oe,Object.assign({},u,{ref:n}))})});De.displayName=Re;var Ie="MenuRadioItem",Fe=M.forwardRef((e,n)=>{const{value:t}=e,o=(0,O.default)(e,d),u=Se(Ie,e.__scopeMenu),c=t===u.value;return(0,U.jsx)(Le,{scope:e.__scopeMenu,checked:c,children:(0,U.jsx)(we,Object.assign({role:"menuitemradio","aria-checked":c},o,{ref:n,"data-state":Je(c),onSelect:(0,P.composeEventHandlers)(o.onSelect,()=>u.onValueChange?.(t),{checkForDefaultPrevented:!1})}))})});Fe.displayName=Ie;var Te="MenuItemIndicator",[Le,Ae]=$(Te,{checked:!1}),He=M.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:o}=e,u=(0,O.default)(e,f),c=Ae(Te,t);return(0,U.jsx)(T.Presence,{present:o||qe(c.checked)||!0===c.checked,children:(0,U.jsx)(L.Primitive.span,Object.assign({},u,{ref:n,"data-state":Je(c.checked)}))})});He.displayName=Te;var Ke=M.forwardRef((e,n)=>{const t=(0,O.default)(e,p);return(0,U.jsx)(L.Primitive.div,Object.assign({role:"separator","aria-orientation":"horizontal"},t,{ref:n}))});Ke.displayName="MenuSeparator";var Ge=M.forwardRef((e,n)=>{const{__scopeMenu:t}=e,o=(0,O.default)(e,b),u=ne(t);return(0,U.jsx)(I.Arrow,Object.assign({},u,o,{ref:n}))});Ge.displayName="MenuArrow";var Ne="MenuSub",[Ve,Ue]=$(Ne),Be=e=>{const{__scopeMenu:n,children:t,open:o=!1,onOpenChange:u}=e,c=oe(Ne,n),s=ne(n),[i,l]=M.useState(null),[d,f]=M.useState(null),p=(0,G.useCallbackRef)(u);return M.useEffect(()=>(!1===c.open&&p(!1),()=>p(!1)),[c.open,p]),(0,U.jsx)(I.Root,Object.assign({},s,{children:(0,U.jsx)(re,{scope:n,open:o,onOpenChange:p,content:d,onContentChange:f,children:(0,U.jsx)(Ve,{scope:n,contentId:(0,S.useId)(),triggerId:(0,S.useId)(),trigger:i,onTriggerChange:l,children:t})})}))};Be.displayName=Ne;var Xe="MenuSubTrigger",Ye=M.forwardRef((e,n)=>{const t=oe(Xe,e.__scopeMenu),o=ce(Xe,e.__scopeMenu),u=Ue(Xe,e.__scopeMenu),c=ge(Xe,e.__scopeMenu),s=M.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=c,d={__scopeMenu:e.__scopeMenu},f=M.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);M.useEffect(()=>f,[f]),M.useEffect(()=>{const e=i.current;return()=>{window.clearTimeout(e),l(null)}},[i,l]);const p=(0,C.useComposedRefs)(n,u.onTriggerChange);return(0,U.jsx)(ae,Object.assign({asChild:!0},d,{children:(0,U.jsx)(xe,Object.assign({id:u.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":t.open?u.contentId:void 0,"data-state":Ze(t.open)},e,{ref:p,onClick:n=>{e.onClick?.(n),e.disabled||n.defaultPrevented||(n.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:(0,P.composeEventHandlers)(e.onPointerMove,tn(n=>{c.onItemEnter(n),n.defaultPrevented||e.disabled||t.open||s.current||(c.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:(0,P.composeEventHandlers)(e.onPointerLeave,tn(e=>{f();const n=t.content?.getBoundingClientRect();if(n){const o=t.content?.dataset.side,u="right"===o,s=u?-5:5,l=n[u?"left":"right"],d=n[u?"right":"left"];c.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:n.top},{x:d,y:n.top},{x:d,y:n.bottom},{x:l,y:n.bottom}],side:o}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(e),e.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:(0,P.composeEventHandlers)(e.onKeyDown,n=>{if(e.disabled||n.target!==n.currentTarget)return;""!==c.searchRef.current&&" "===n.key||z[o.dir].includes(n.key)&&(t.onOpenChange(!0),t.content?.focus(),n.preventDefault())})}))}))});Ye.displayName=Xe;var ze="MenuSubContent",We=M.forwardRef((e,n)=>{const t=de(pe,e.__scopeMenu),{forceMount:o=t.forceMount,align:u="start"}=e,c=(0,O.default)(e,v),s=oe(pe,e.__scopeMenu),i=ce(pe,e.__scopeMenu),l=Ue(ze,e.__scopeMenu),d=M.useRef(null),f=(0,C.useComposedRefs)(n,d);return(0,U.jsx)(q.Provider,{scope:e.__scopeMenu,children:(0,U.jsx)(T.Presence,{present:o||s.open,children:(0,U.jsx)(q.Slot,{scope:e.__scopeMenu,children:(0,U.jsx)(ye,Object.assign({id:l.contentId,"aria-labelledby":l.triggerId},c,{ref:f,align:u,side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,P.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:(0,P.composeEventHandlers)(e.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:(0,P.composeEventHandlers)(e.onKeyDown,e=>{const n=e.currentTarget.contains(e.target),t=W[i.dir].includes(e.key);n&&t&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})}))})})})});function Ze(e){return e?"open":"closed"}function qe(e){return"indeterminate"===e}function Je(e){return qe(e)?"indeterminate":e?"checked":"unchecked"}function Qe(e){const n=document.activeElement;for(const t of e){if(t===n)return;if(t.focus(),document.activeElement!==n)return}}function $e(e,n,t){const o=n.length>1&&Array.from(n).every(e=>e===n[0])?n[0]:n,u=t?e.indexOf(t):-1;let c=(s=e,i=Math.max(u,0),s.map((e,n)=>s[(i+n)%s.length]));var s,i;1===o.length&&(c=c.filter(e=>e!==t));const l=c.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==t?l:void 0}function en(e,n){const{x:t,y:o}=e;let u=!1;for(let e=0,c=n.length-1;e<n.length;c=e++){const s=n[e],i=n[c],l=s.x,d=s.y,f=i.x,p=i.y;d>o!=p>o&&t<(f-l)*(o-d)/(p-d)+l&&(u=!u)}return u}function nn(e,n){if(!n)return!1;return en({x:e.clientX,y:e.clientY},n)}function tn(e){return n=>"mouse"===n.pointerType?e(n):void 0}We.displayName=ze;var rn=se,on=ae,un=fe,cn=be,sn=Oe,an=Me,ln=we,dn=Ee,fn=De,pn=Fe,mn=He,gn=Ke,bn=Ge,vn=Be,hn=Ye,jn=We},306,[131,38,247,307,248,249,308,254,261,258,250,309,259,260,255,317,256,257,298,262,153]);
|
|
388
388
|
__d(function(g,r,_i,_a,m,_e,_d){"use strict";const e=["scope","children"],t=["state"],s=["scope","children"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"createCollection",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"unstable_createCollection",{enumerable:!0,get:function(){return b}});var n,i=r(_d[0]),o=(n=i)&&n.__esModule?n:{default:n},c=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(r(_d[1])),l=r(_d[2]),u=r(_d[3]),f=r(_d[4]),a=r(_d[5]);function h(t){const s=t+"CollectionProvider",[n,i]=(0,l.createContextScope)(s),[h,d]=n(s,{collectionRef:{current:null},itemMap:new Map}),p=e=>{const{scope:t,children:s}=e,n=c.useRef(null),i=c.useRef(new Map).current;return(0,a.jsx)(h,{scope:t,itemMap:i,collectionRef:n,children:s})};p.displayName=s;const y=t+"CollectionSlot",O=(0,f.createSlot)(y),R=c.forwardRef((e,t)=>{const{scope:s,children:n}=e,i=d(y,s),o=(0,u.useComposedRefs)(t,i.collectionRef);return(0,a.jsx)(O,{ref:o,children:n})});R.displayName=y;const b=t+"CollectionItemSlot",j="data-radix-collection-item",k=(0,f.createSlot)(b),x=c.forwardRef((t,s)=>{const{scope:n,children:i}=t,l=(0,o.default)(t,e),f=c.useRef(null),h=(0,u.useComposedRefs)(s,f),p=d(b,n);return c.useEffect(()=>(p.itemMap.set(f,Object.assign({ref:f},l)),()=>{p.itemMap.delete(f)})),(0,a.jsx)(k,Object.assign({},{[j]:""},{ref:h,children:i}))});return x.displayName=b,[{Provider:p,Slot:R,ItemSlot:x},function(e){const s=d(t+"CollectionConsumer",e);return c.useCallback(()=>{const e=s.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${j}]`));return Array.from(s.itemMap.values()).sort((e,s)=>t.indexOf(e.ref.current)-t.indexOf(s.ref.current))},[s.collectionRef,s.itemMap])},i]}var d=new WeakMap,p=class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],d.set(this,!0)}set(e,t){return d.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,s){const n=this.has(t),i=this.#e.length,o=R(e);let c=o>=0?o:i+o;const l=c<0||c>=i?-1:c;if(l===this.size||n&&l===this.size-1||-1===l)return this.set(t,s),this;const u=this.size+(n?0:1);o<0&&c++;const f=[...this.#e];let a,h=!1;for(let e=c;e<u;e++)if(c===e){let i=f[e];f[e]===t&&(i=f[e+1]),n&&this.delete(t),a=this.get(i),this.set(t,s)}else{h||f[e-1]!==t||(h=!0);const s=f[h?e:e-1],n=a;a=this.get(s),this.delete(s),this.set(s,n)}return this}with(t,s,n){const i=new e(this);return i.insert(t,s,n),i}before(e){const t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,s){const n=this.#e.indexOf(e);return-1===n?this:this.insert(n,t,s)}after(e){let t=this.#e.indexOf(e);if(t=-1===t||t===this.size-1?-1:t+1,-1!==t)return this.entryAt(t)}setAfter(e,t,s){const n=this.#e.indexOf(e);return-1===n?this:this.insert(n+1,t,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){const t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){const t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){const t=y(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){const t=y(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return y(this.#e,e)}from(e,t){const s=this.indexOf(e);if(-1===s)return;let n=s+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){const s=this.indexOf(e);if(-1===s)return;let n=s+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let s=0;for(const n of this){if(Reflect.apply(e,t,[n,s,this]))return n;s++}}findIndex(e,t){let s=0;for(const n of this){if(Reflect.apply(e,t,[n,s,this]))return s;s++}return-1}filter(t,s){const n=[];let i=0;for(const e of this)Reflect.apply(t,s,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,s){const n=[];let i=0;for(const e of this)n.push([e[0],Reflect.apply(t,s,[e,i,this])]),i++;return new e(n)}reduce(...e){const[t,s]=e;let n=0,i=s??this.at(0);for(const s of this)i=0===n&&1===e.length?s:Reflect.apply(t,this,[i,s,n,this]),n++;return i}reduceRight(...e){const[t,s]=e;let n=s??this.at(-1);for(let s=this.size-1;s>=0;s--){const i=this.at(s);n=s===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,s,this])}return n}toSorted(t){const s=[...this.entries()].sort(t);return new e(s)}toReversed(){const t=new e;for(let e=this.size-1;e>=0;e--){const s=this.keyAt(e),n=this.get(s);t.set(s,n)}return t}toSpliced(...t){const s=[...this.entries()];return s.splice(...t),new e(s)}slice(t,s){const n=new e;let i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==s&&s>0&&(i=s-1);for(let e=t;e<=i;e++){const t=this.keyAt(e),s=this.get(t);n.set(t,s)}return n}every(e,t){let s=0;for(const n of this){if(!Reflect.apply(e,t,[n,s,this]))return!1;s++}return!0}some(e,t){let s=0;for(const n of this){if(Reflect.apply(e,t,[n,s,this]))return!0;s++}return!1}};function y(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const s=O(e,t);return-1===s?void 0:e[s]}function O(e,t){const s=e.length,n=R(t),i=n>=0?n:s+n;return i<0||i>=s?-1:i}function R(e){return e!=e||0===e?0:Math.trunc(e)}function b(e){const n=e+"CollectionProvider",[i,h]=(0,l.createContextScope)(n),[d,y]=i(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new p,setItemMap:()=>{}}),O=e=>{let{state:s}=e,n=(0,o.default)(e,t);return s?(0,a.jsx)(b,Object.assign({},n,{state:s})):(0,a.jsx)(R,Object.assign({},n))};O.displayName=n;const R=e=>{const t=z();return(0,a.jsx)(b,Object.assign({},e,{state:t}))};R.displayName=n+"Init";const b=e=>{const{scope:t,children:s,state:n}=e,i=c.useRef(null),[o,l]=c.useState(null),f=(0,u.useComposedRefs)(i,l),[h,p]=n;return c.useEffect(()=>{if(!o)return;const e=C(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,a.jsx)(d,{scope:t,itemMap:h,setItemMap:p,collectionRef:f,collectionRefObject:i,collectionElement:o,children:s})};b.displayName=n+"Impl";const k=e+"CollectionSlot",S=(0,f.createSlot)(k),M=c.forwardRef((e,t)=>{const{scope:s,children:n}=e,i=y(k,s),o=(0,u.useComposedRefs)(t,i.collectionRef);return(0,a.jsx)(S,{ref:o,children:n})});M.displayName=k;const v=e+"CollectionItemSlot",w="data-radix-collection-item",A=(0,f.createSlot)(v),I=c.forwardRef((e,t)=>{const{scope:n,children:i}=e,l=(0,o.default)(e,s),f=c.useRef(null),[h,d]=c.useState(null),O=(0,u.useComposedRefs)(t,f,d),R=y(v,n),{setItemMap:b}=R,k=c.useRef(l);j(k.current,l)||(k.current=l);const C=k.current;return c.useEffect(()=>{const e=C;return b(t=>h?t.has(h)?t.set(h,Object.assign({},e,{element:h})).toSorted(x):(t.set(h,Object.assign({},e,{element:h})),t.toSorted(x)):t),()=>{b(e=>h&&e.has(h)?(e.delete(h),new p(e)):e)}},[h,C,b]),(0,a.jsx)(A,Object.assign({},{[w]:""},{ref:O,children:i}))});function z(){return c.useState(new p)}I.displayName=v;return[{Provider:O,Slot:M,ItemSlot:I},{createCollectionScope:h,useCollection:function(t){const{itemMap:s}=y(e+"CollectionConsumer",t);return s},useInitCollection:z}]}function j(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t)return!1;if(null==e||null==t)return!1;const s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(const n of s){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(e[n]!==t[n])return!1}return!0}function k(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function x(e,t){return e[1].element&&t[1].element?k(e[1].element,t[1].element)?-1:1:0}function C(e){return new MutationObserver(t=>{for(const s of t)if("childList"===s.type)return void e()})}},307,[131,38,249,248,256,153]);
|
|
@@ -397,13 +397,13 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";const e=["children","width","height"]
|
|
|
397
397
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useSize",{enumerable:!0,get:function(){return n}});var e=(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[0])),t=r(_d[1]);function n(n){const[o,f]=e.useState(void 0);return(0,t.useLayoutEffect)(()=>{if(n){f({width:n.offsetWidth,height:n.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const t=e[0];let o,u;if("borderBoxSize"in t){const e=t.borderBoxSize,n=Array.isArray(e)?e[0]:e;o=n.inlineSize,u=n.blockSize}else o=n.offsetWidth,u=n.offsetHeight;f({width:o,height:u})});return e.observe(n,{box:"border-box"}),()=>e.unobserve(n)}f(void 0)},[n]),o}},316,[38,251]);
|
|
398
398
|
__d(function(g,r,i,a,m,_e,_d){"use strict";const e=["__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus"],t=["__scopeRovingFocusGroup","focusable","active","tabStopId","children"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Item",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"RovingFocusGroup",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"RovingFocusGroupItem",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"createRovingFocusGroupScope",{enumerable:!0,get:function(){return O}});var o,n=r(_d[0]),u=(o=n)&&o.__esModule?o:{default:o},c=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[1])),s=r(_d[2]),l=r(_d[3]),f=r(_d[4]),d=r(_d[5]),p=r(_d[6]),v=r(_d[7]),b=r(_d[8]),y=r(_d[9]),F=r(_d[10]),I=r(_d[11]),w=r(_d[12]),R=r(_d[13]),S="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[j,_,T]=(0,l.createCollection)(E),[C,O]=(0,d.createContextScope)(E,[T]),[P,x]=C(E),A=c.forwardRef((e,t)=>(0,R.jsx)(j.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(j.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(D,Object.assign({},e,{ref:t}))})}));A.displayName=E;var D=c.forwardRef((t,o)=>{const{__scopeRovingFocusGroup:n,orientation:l,loop:d=!1,dir:p,currentTabStopId:I,defaultCurrentTabStopId:w,onCurrentTabStopIdChange:j,onEntryFocus:T,preventScrollOnEntryFocus:C=!1}=t,O=(0,u.default)(t,e),x=c.useRef(null),A=(0,f.useComposedRefs)(o,x),D=(0,F.useDirection)(p),[G,k]=(0,y.useControllableState)({prop:I,defaultProp:w??null,onChange:j,caller:E}),[H,K]=c.useState(!1),L=(0,b.useCallbackRef)(T),B=_(n),U=c.useRef(!1),[N,z]=c.useState(0);return c.useEffect(()=>{const e=x.current;if(e)return e.addEventListener(S,L),()=>e.removeEventListener(S,L)},[L]),(0,R.jsx)(P,{scope:n,orientation:l,dir:D,loop:d,currentTabStopId:G,onItemFocus:c.useCallback(e=>k(e),[k]),onItemShiftTab:c.useCallback(()=>K(!0),[]),onFocusableItemAdd:c.useCallback(()=>z(e=>e+1),[]),onFocusableItemRemove:c.useCallback(()=>z(e=>e-1),[]),children:(0,R.jsx)(v.Primitive.div,Object.assign({tabIndex:H||0===N?-1:0,"data-orientation":l},O,{ref:A,style:Object.assign({outline:"none"},t.style),onMouseDown:(0,s.composeEventHandlers)(t.onMouseDown,()=>{U.current=!0}),onFocus:(0,s.composeEventHandlers)(t.onFocus,e=>{const t=!U.current;if(e.target===e.currentTarget&&t&&!H){const t=new CustomEvent(S,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=B().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===G),...e].filter(Boolean).map(e=>e.ref.current),C)}}U.current=!1}),onBlur:(0,s.composeEventHandlers)(t.onBlur,()=>K(!1))}))})}),G="RovingFocusGroupItem",k=c.forwardRef((e,o)=>{const{__scopeRovingFocusGroup:n,focusable:l=!0,active:f=!1,tabStopId:d,children:b}=e,y=(0,u.default)(e,t),F=(0,p.useId)(),S=d||F,h=x(G,n),E=h.currentTabStopId===S,T=_(n),{onFocusableItemAdd:C,onFocusableItemRemove:O,currentTabStopId:P}=h,A=(0,w.useIsHydrated)();return(0,I.useLayoutEffect)(()=>{if(A&&l)return C(),()=>O()},[A,l,C,O]),c.useEffect(()=>{if(!A&&l)return C(),()=>O()},[A,l,C,O]),(0,R.jsx)(j.ItemSlot,{scope:n,id:S,focusable:l,active:f,children:(0,R.jsx)(v.Primitive.span,Object.assign({tabIndex:E?0:-1,"data-orientation":h.orientation},y,{ref:o,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{l?h.onItemFocus(S):e.preventDefault()}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>h.onItemFocus(S)),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=L(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let u=T().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)u.reverse();else if("prev"===t||"next"===t){"prev"===t&&u.reverse();const c=u.indexOf(e.currentTarget);u=h.loop?(n=c+1,(o=u).map((e,t)=>o[(n+t)%o.length])):u.slice(c+1)}setTimeout(()=>M(u))}var o,n}),children:"function"==typeof b?b({isCurrentTabStop:E,hasTabStop:null!=P}):b}))})});k.displayName=G;var H={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function K(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function L(e,t,o){const n=K(e.key,o);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return H[n]}function M(e,t=!1){const o=document.activeElement;for(const n of e){if(n===o)return;if(n.focus({preventScroll:t}),document.activeElement!==o)return}}var B=A,U=k},317,[131,38,247,307,248,249,250,255,257,252,308,251,318,153]);
|
|
399
399
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useIsHydrated",{enumerable:!0,get:function(){return o}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t=!1;var n=e[" useSyncExternalStore ".trim().toString()];function u(){return()=>{}}var o="function"==typeof n?function(){return n(u,()=>!0,()=>!1)}:function(){const[n,u]=e.useState(t);return e.useEffect(()=>{t||(t=!0,u(!0))},[]),n}},318,[38]);
|
|
400
|
-
__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)(
|
|
401
|
-
__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:
|
|
402
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["destructive","disabled","style","children","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onKeyDown","onKeyUp","onFocus","onBlur"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PillButton",{enumerable:!0,get:function(){return f}});var o,n=r(d[0]),t=(o=n)&&o.__esModule?o:{default:o},s=r(d[1]),u=r(d[2]),l=r(d[3]),c=r(d[4]),y=r(d[5]);const f=(0,u.forwardRef)(function(o,n){let{destructive:f=!1,disabled:M=!1,style:b,children:p,onMouseEnter:v,onMouseLeave:w,onMouseDown:D,onMouseUp:K,onKeyDown:U,onKeyUp:_,onFocus:j,onBlur:h}=o,B=(0,t.default)(o,e);const[E,F]=(0,u.useState)(!1),[O,S]=(0,u.useState)(!1),[k,x]=(0,u.useState)(!1);return(0,s.jsx)("button",Object.assign({ref:n,type:"button",disabled:M,onMouseEnter:e=>{F(!0),v?.(e)},onMouseLeave:e=>{F(!1),x(!1),w?.(e)},onMouseDown:e=>{x(!0),D?.(e)},onMouseUp:e=>{x(!1),K?.(e)},onKeyDown:e=>{
|
|
403
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PILL_CONTROL_HEIGHT",{enumerable:!0,get:function(){return t}}),e.pillControlStyle=function({hovered:n=!1,focused:l=!1,disabled:s=!1}={}){return Object.assign({},o.textSize.sm,{fontWeight:500,display:
|
|
404
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ResizeHandle=function({side:s,offset:c,onResize:u,onResizeStart:l,onResizeEnd:f}){const[p,b]=(0,n.useState)(!1),[P,y]=(0,n.useState)(!1),v=(0,n.useRef)(0),z=(0,n.useRef)(!1);function R(t){z.current&&(z.current=!1,y(!1),t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId),f?.())}const h=p||P;return(0,t.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",onPointerDown:function(t){0===t.button&&(t.preventDefault(),v.current=t.clientX,z.current=!0,y(!0),t.currentTarget.setPointerCapture(t.pointerId),l?.())},onPointerMove:function(t){if(!z.current)return;const n=t.clientX-v.current;u(
|
|
405
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SegmentedControl=function({ariaLabel:c,ariaDescribedBy:f,options:h,value:p,onChange:x}){const v=h.findIndex(t=>t.value===p),y=(0,o.useRef)([]),[w,z]=(0,o.useState)(null),S=(0,o.useCallback)(()=>{const t=y.current[v];if(!t)return void z(null);const o={left:t.offsetLeft,width:t.offsetWidth};z(t=>t?.left===o.left&&t.width===o.width?t:o)},[v]);return(0,o.useLayoutEffect)(()=>{if(S(),
|
|
406
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Select=function({ariaLabel:p,ariaDescribedBy:v,value:w,options:j,disabled:y=!1,disabledReason:S,onChange:C}){const[I,R]=(0,l.useState)(!1),[F,O]=(0,l.useState)(!1),[k,z]=(0,l.useState)(!1),W=j.find(t=>t.value===w)?.label??w,D=(0,l.useRef)(null),V=(0,l.useRef)({trigger:null,disabled:y,open:()=>R(!0)});return(0,l.useEffect)(()=>{V.current.disabled=y,y&&R(!1)},[y]),(0,l.useEffect)(()=>{const t=V.current;return t.trigger=D.current,f.add(t),()=>{f.delete(t)}},[]),(0,t.jsxs)(n.Root,{value:w,open:I&&!y,onOpenChange:t=>R(t&&!y),disabled:y,onValueChange:t=>{y||C(t)},children:[(0,t.jsx)(h.DisabledControlHint,{reason:y?S:void 0,label:`${p}: ${W}`,children:(0,t.jsxs)(n.Trigger,{ref:D,"aria-label":p,"aria-describedby":v,"data-test-options":j.map(t=>t.label).join(
|
|
400
|
+
__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])},319,[131,153,305,303]);
|
|
401
|
+
__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])},320,[153,238]);
|
|
402
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["destructive","disabled","style","children","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onKeyDown","onKeyUp","onFocus","onBlur"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PillButton",{enumerable:!0,get:function(){return f}});var o,n=r(d[0]),t=(o=n)&&o.__esModule?o:{default:o},s=r(d[1]),u=r(d[2]),l=r(d[3]),c=r(d[4]),y=r(d[5]);const f=(0,u.forwardRef)(function(o,n){let{destructive:f=!1,disabled:M=!1,style:b,children:p,onMouseEnter:v,onMouseLeave:w,onMouseDown:D,onMouseUp:K,onKeyDown:U,onKeyUp:_,onFocus:j,onBlur:h}=o,B=(0,t.default)(o,e);const[E,F]=(0,u.useState)(!1),[O,S]=(0,u.useState)(!1),[k,x]=(0,u.useState)(!1);return(0,s.jsx)("button",Object.assign({ref:n,type:"button",disabled:M,onMouseEnter:e=>{F(!0),v?.(e)},onMouseLeave:e=>{F(!1),x(!1),w?.(e)},onMouseDown:e=>{x(!0),D?.(e)},onMouseUp:e=>{x(!1),K?.(e)},onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||x(!0),U?.(e)},onKeyUp:e=>{x(!1),_?.(e)},onFocus:e=>{S((0,c.isFocusVisible)(e)),j?.(e)},onBlur:e=>{S(!1),x(!1),h?.(e)},style:Object.assign({},(0,y.pillControlStyle)({hovered:E,focused:O,disabled:M}),{color:f?l.text.danger:l.text.default,transform:k&&!M?"scale(0.96)":void 0,transition:"background-color 120ms ease, transform 100ms ease"},b)},B,{children:p}))})},321,[131,153,38,238,240,322]);
|
|
403
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PILL_CONTROL_HEIGHT",{enumerable:!0,get:function(){return t}}),e.pillControlStyle=function({hovered:n=!1,focused:l=!1,disabled:s=!1}={}){return Object.assign({},o.textSize.sm,{fontWeight:500,display:"inline-flex",height:t,flexShrink:0,alignItems:"center",justifyContent:"center",gap:6,boxSizing:"border-box",padding:"0 10px",border:`1px solid ${o.border.default}`,borderRadius:o.radius.lg,outline:"none",backgroundColor:n&&!s?o.bg.hover:o.bg.element,boxShadow:l?`0 0 0 2px ${o.border.secondary}`:o.shadow.none,color:o.text.default,fontFamily:"inherit",cursor:s?"default":"pointer",opacity:s?.5:1,transition:"background-color 120ms ease"})};var o=r(d[0]);const t=28},322,[238]);
|
|
404
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ResizeHandle=function({side:s,offset:c,onResize:u,onResizeStart:l,onResizeEnd:f}){const[p,b]=(0,n.useState)(!1),[P,y]=(0,n.useState)(!1),v=(0,n.useRef)(0),z=(0,n.useRef)(!1);function R(t){z.current&&(z.current=!1,y(!1),t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId),f?.())}const h=p||P;return(0,t.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",onPointerDown:function(t){0===t.button&&(t.preventDefault(),v.current=t.clientX,z.current=!0,y(!0),t.currentTarget.setPointerCapture(t.pointerId),l?.())},onPointerMove:function(t){if(!z.current)return;const n=t.clientX-v.current;u("left"===s?n:-n)},onPointerUp:R,onPointerCancel:R,onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),style:{position:"absolute",top:0,bottom:0,[s]:c,transform:"left"===s?"translateX(-50%)":"translateX(50%)",width:12,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",cursor:"col-resize",touchAction:"none",zIndex:5},children:(0,t.jsx)("div",{style:{width:4,height:40,borderRadius:999,backgroundColor:P?o.icon.secondary:o.icon.tertiary,opacity:h?1:0,transition:"opacity 120ms ease, background-color 120ms ease"}})})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},323,[153,38,238]);
|
|
405
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SegmentedControl=function({ariaLabel:c,ariaDescribedBy:f,options:h,value:p,onChange:x}){const v=h.findIndex(t=>t.value===p),y=(0,o.useRef)([]),[w,z]=(0,o.useState)(null),S=(0,o.useCallback)(()=>{const t=y.current[v];if(!t)return void z(null);const o={left:t.offsetLeft,width:t.offsetWidth};z(t=>t?.left===o.left&&t.width===o.width?t:o)},[v]);return(0,o.useLayoutEffect)(()=>{if(S(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(S);return y.current.forEach(o=>{o&&t.observe(o)}),()=>t.disconnect()},[S,h.length]),(0,t.jsxs)("div",{role:"group","aria-label":c,"aria-describedby":f,style:{display:"flex",position:"relative",flexShrink:0,marginLeft:"auto",gap:u,height:l,padding:u,boxSizing:"border-box",border:`1px solid ${n.border.default}`,borderRadius:n.radius.full,backgroundColor:n.bg.subtle},children:[w&&(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:u,left:w.left,width:w.width,height:s,borderRadius:n.radius.full,backgroundColor:n.text.default,transition:"left 180ms cubic-bezier(.4, 0, .2, 1), width 180ms cubic-bezier(.4, 0, .2, 1)"}}),h.map((o,l)=>{const u=p===o.value;return(0,t.jsx)("button",{ref:t=>{y.current[l]=t},type:"button",disabled:o.disabled,"aria-pressed":u,onClick:()=>x(o.value),style:Object.assign({},n.textSize.xs,{position:"relative",zIndex:1,width:"auto",height:s,flexShrink:0,boxSizing:"border-box",padding:`0 ${b}px`,border:0,borderRadius:n.radius.full,backgroundColor:"transparent",color:u?n.bg.default:n.text.secondary,fontFamily:"inherit",fontWeight:500,whiteSpace:"nowrap",cursor:o.disabled?"default":"pointer",opacity:o.disabled?.5:1,transition:"color 120ms cubic-bezier(.4, 0, .2, 1)"}),children:o.label},o.value)})]})};var t=r(d[0]),o=r(d[1]),n=r(d[2]);const l=28,s=22,u=2,b=8},324,[153,38,238]);
|
|
406
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Select=function({ariaLabel:p,ariaDescribedBy:v,value:w,options:j,disabled:y=!1,disabledReason:S,onChange:C}){const[I,R]=(0,l.useState)(!1),[F,O]=(0,l.useState)(!1),[k,z]=(0,l.useState)(!1),W=j.find(t=>t.value===w)?.label??w,D=(0,l.useRef)(null),V=(0,l.useRef)({trigger:null,disabled:y,open:()=>R(!0)});return(0,l.useEffect)(()=>{V.current.disabled=y,y&&R(!1)},[y]),(0,l.useEffect)(()=>{const t=V.current;return t.trigger=D.current,f.add(t),()=>{f.delete(t)}},[]),(0,t.jsxs)(n.Root,{value:w,open:I&&!y,onOpenChange:t=>R(t&&!y),disabled:y,onValueChange:t=>{y||C(t)},children:[(0,t.jsx)(h.DisabledControlHint,{reason:y?S:void 0,label:`${p}: ${W}`,children:(0,t.jsxs)(n.Trigger,{ref:D,"aria-label":p,"aria-describedby":v,"data-test-options":j.map(t=>t.label).join("\n"),onFocus:t=>O((0,c.isFocusVisible)(t)),onBlur:()=>O(!1),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),style:Object.assign({},(0,u.pillControlStyle)({hovered:k,focused:F,disabled:y}),{width:"max-content",maxWidth:"100%",justifyContent:"space-between",padding:"0 8px 0 10px"}),children:[(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,t.jsx)(n.Value,{children:W})}),(0,t.jsx)(n.Icon,{"aria-hidden":"true",style:{display:"flex",flexShrink:0,color:o.icon.default,transform:I?"rotate(180deg)":void 0,transition:"transform 120ms ease"},children:(0,t.jsx)(s.ChevronDownIcon,{size:16,strokeWidth:1.5})})]})}),(0,t.jsx)(n.Portal,{children:(0,t.jsx)(n.Content,{position:"popper",align:"end",sideOffset:4,collisionPadding:8,onPointerDownOutside:t=>{const{clientX:n,clientY:l}=t.detail.originalEvent,o=x(n,l,V.current);o&&setTimeout(o.open,0)},className:"will-change-[opacity,transform] data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade",style:Object.assign({},o.textSize.sm,{fontWeight:500,zIndex:605,width:"max-content",minWidth:"var(--radix-select-trigger-width)",maxWidth:"var(--radix-select-content-available-width)",maxHeight:"var(--radix-select-content-available-height)",boxSizing:"border-box",overflow:"hidden",padding:4,border:`1px solid ${o.border.default}`,borderRadius:o.radius.lg,outline:"none",backgroundColor:o.bg.default,boxShadow:o.shadow.md,color:o.text.default,fontFamily:"inherit"}),children:(0,t.jsx)(n.Viewport,{children:j.map(l=>(0,t.jsxs)(n.Item,{value:l.value,textValue:l.label,disabled:l.disabled,className:"data-[highlighted]:bg-hover data-[state=checked]:bg-element",style:{display:"flex",width:"100%",height:b,alignItems:"center",justifyContent:"space-between",gap:8,boxSizing:"border-box",padding:"0 6px",borderRadius:o.radius.md,outline:"none",color:o.text.default,cursor:l.disabled?"default":"pointer",opacity:l.disabled?.5:1,userSelect:"none",whiteSpace:"nowrap"},children:[(0,t.jsx)(n.ItemText,{children:l.label}),(0,t.jsx)("span",{"aria-hidden":"true",style:{display:"flex",width:14,flexShrink:0,alignItems:"center",justifyContent:"center",color:o.icon.default},children:(0,t.jsx)(n.ItemIndicator,{children:(0,t.jsx)(s.CheckIcon,{size:12})})})]},l.value))})})})]})};var t=r(d[0]),n=r(d[1]),l=r(d[2]),o=r(d[3]),s=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]);const b=28,f=new Set;function x(t,n,l){for(const o of f){if(o===l||o.disabled||!o.trigger)continue;const s=o.trigger.getBoundingClientRect();if(t>=s.left&&t<=s.right&&n>=s.top&&n<=s.bottom)return o}return null}},325,[153,326,38,238,242,240,322,349]);
|
|
407
407
|
__d(function(g,r,i,a,m,_e,_d){"use strict";const e=["__scopeSelect","children"],t=["__scopeSelect","disabled"],n=["__scopeSelect","className","style","children","placeholder"],o=["__scopeSelect","children"],l=["__scopeSelect","forceMount"],c=["forceMount"],s=["position","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions"],u=["__scopeSelect","onPlaced"],d=["__scopeSelect","align","collisionPadding"],f=["__scopeSelect","nonce"],p=["__scopeSelect"],b=["__scopeSelect"],h=["__scopeSelect","value","disabled","textValue"],v=["__scopeSelect","className","style"],S=["__scopeSelect"],w=["__scopeSelect","onAutoScroll"],y=["__scopeSelect"],x=["__scopeSelect"],j=["__scopeSelect"];function P(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}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Arrow",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"Content",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"Group",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"Icon",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"Item",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(_e,"ItemIndicator",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"ItemText",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(_e,"Label",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"Portal",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"ScrollDownButton",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(_e,"ScrollUpButton",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(_e,"Select",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"SelectArrow",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"SelectContent",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"SelectGroup",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"SelectIcon",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"SelectItem",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(_e,"SelectItemIndicator",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"SelectItemText",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(_e,"SelectLabel",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"SelectPortal",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"SelectScrollDownButton",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(_e,"SelectScrollUpButton",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(_e,"SelectSeparator",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"SelectTrigger",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"SelectValue",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"SelectViewport",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"Separator",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"Trigger",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"Value",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"Viewport",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"createSelectScope",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"unstable_BubbleInput",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(_e,"unstable_Provider",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"unstable_SelectBubbleInput",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(_e,"unstable_SelectProvider",{enumerable:!0,get:function(){return ge}});var _,C=r(_d[0]),O=(_=C)&&_.__esModule?_:{default:_},E=P(r(_d[1])),I=P(r(_d[2])),R=r(_d[3]),T=r(_d[4]),D=r(_d[5]),k=r(_d[6]),L=r(_d[7]),H=r(_d[8]),M=r(_d[9]),A=r(_d[10]),B=r(_d[11]),V=r(_d[12]),F=r(_d[13]),N=P(F),K=r(_d[14]),W=r(_d[15]),U=r(_d[16]),q=r(_d[17]),z=r(_d[18]),G=r(_d[19]),Y=r(_d[20]),X=r(_d[21]),Z=r(_d[22]),$=r(_d[23]),J=r(_d[24]),Q=r(_d[25]),ee=Object.defineProperty,te=(e,t)=>ee(e,"name",{value:t,configurable:!0}),ne=[" ","Enter","ArrowUp","ArrowDown"],oe=[" ","Enter"],re="Select",[le,ce,ie]=(0,D.createCollection)(re),[se,ae]=(0,L.createContextScope)(re,[ie,F.createPopperScope]),ue=(0,F.createPopperScope)(),[de,fe]=se(re),[pe,me]=se(re);function ge(e){const{__scopeSelect:t,children:n,open:o,defaultOpen:l,onOpenChange:c,value:s,defaultValue:u,onValueChange:d,dir:f,name:p,autoComplete:b,disabled:h,required:v,form:S,internal_do_not_use_render:w}=e,y=ue(t),[x,j]=E.useState(null),[P,_]=E.useState(null),[C,O]=E.useState(!1),I=(0,H.useDirection)(f),[R,T]=(0,G.useControllableState)({prop:o,defaultProp:l??!1,onChange:c,caller:re}),[D,k]=(0,G.useControllableState)({prop:s,defaultProp:u,onChange:d,caller:re}),L=E.useRef(null),M=E.useRef(D);E.useEffect(()=>{const e=S?x?.ownerDocument.getElementById(S):x?.form;if(e instanceof HTMLFormElement){const t=te(()=>k(M.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[S,x,k]);const A=!x||(!!S||!!x.closest("form")),[B,F]=E.useState(new Set),K=(0,V.useId)(),W=Array.from(B).map(e=>e.props.value).join(";"),U=E.useCallback(e=>{F(t=>new Set(t).add(e))},[]),q=E.useCallback(e=>{F(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:v,trigger:x,onTriggerChange:j,valueNode:P,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:O,contentId:K,value:D,onValueChange:k,open:R,onOpenChange:T,dir:I,triggerPointerDownPosRef:L,disabled:h,name:p,autoComplete:b,form:S,nativeOptions:B,nativeSelectKey:W,isFormControl:A};return(0,Q.jsx)(N.Root,Object.assign({},y,{children:(0,Q.jsx)(de,Object.assign({scope:t},z,{children:(0,Q.jsx)(le.Provider,{scope:t,children:(0,Q.jsx)(pe,{scope:t,onNativeOptionAdd:U,onNativeOptionRemove:q,children:ot(w)?w(z):n})})}))}))}te(ge,"SelectProvider");var be=te(t=>{const{__scopeSelect:n,children:o}=t,l=(0,O.default)(t,e);return(0,Q.jsx)(ge,Object.assign({__scopeSelect:n},l,{internal_do_not_use_render:({isFormControl:e})=>(0,Q.jsxs)(Q.Fragment,{children:[o,e?(0,Q.jsx)(nt,{__scopeSelect:n}):null]})}))},"Select"),he=E.forwardRef(te(function(e,n){const{__scopeSelect:o,disabled:l=!1}=e,c=(0,O.default)(e,t),s=ue(o),u=fe("SelectTrigger",o),d=u.disabled||l,f=(0,k.useComposedRefs)(n,u.onTriggerChange),p=ce(o),b=E.useRef("touch"),[h,v,S]=lt(e=>{const t=p().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),o=ct(t,e,n);void 0!==o&&u.onValueChange(o.value)}),w=te(e=>{d||(u.onOpenChange(!0),S()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,Q.jsx)(N.Anchor,Object.assign({asChild:!0},s,{children:(0,Q.jsx)(U.Primitive.button,Object.assign({type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":rt(u.value)?"":void 0},c,{ref:f,onClick:(0,T.composeEventHandlers)(c.onClick,e=>{e.currentTarget.focus(),"mouse"!==b.current&&w(e)}),onPointerDown:(0,T.composeEventHandlers)(c.onPointerDown,e=>{b.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(w(e),e.preventDefault())}),onKeyDown:(0,T.composeEventHandlers)(c.onKeyDown,e=>{const t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||v(e.key),t&&" "===e.key||ne.includes(e.key)&&(w(),e.preventDefault())})}))}))},"SelectTrigger")),ve=E.forwardRef(te(function(e,t){const{__scopeSelect:o,children:l,placeholder:c=""}=e,s=(0,O.default)(e,n),u=fe("SelectValue",o),{onValueNodeHasChildrenChange:d}=u,f=void 0!==l,p=(0,k.useComposedRefs)(t,u.onValueNodeChange);(0,Y.useLayoutEffect)(()=>{d(f)},[d,f]);const b=rt(u.value);return(0,Q.jsx)(U.Primitive.span,Object.assign({},s,{asChild:!b&&s.asChild,ref:p,style:{pointerEvents:"none"},children:(0,Q.jsx)(E.Fragment,{children:b?c:l},b?"placeholder":"value")}))},"SelectValue")),Se=E.forwardRef(te(function(e,t){const{children:n}=e,l=(0,O.default)(e,o);return(0,Q.jsx)(U.Primitive.span,Object.assign({"aria-hidden":!0},l,{ref:t,children:n||"\u25bc"}))},"SelectIcon")),[we,ye]=se("SelectPortal",{forceMount:void 0}),xe=te(e=>{const{forceMount:t}=e,n=(0,O.default)(e,l);return(0,Q.jsx)(we,{scope:e.__scopeSelect,forceMount:t,children:(0,Q.jsx)(K.Portal,Object.assign({asChild:!0},n))})},"SelectPortal"),je="SelectContent",Pe=E.forwardRef(te(function(e,t){const n=ye(je,e.__scopeSelect),{forceMount:o=n.forceMount}=e,l=(0,O.default)(e,c),s=fe(je,e.__scopeSelect),[u,d]=E.useState();return(0,Y.useLayoutEffect)(()=>{d(new DocumentFragment)},[]),(0,Q.jsx)(W.Presence,{present:o||s.open,children:({present:e})=>e?(0,Q.jsx)(Te,Object.assign({},l,{ref:t})):(0,Q.jsx)(Ce,Object.assign({},l,{fragment:u}))})},"SelectContent")),Ce=E.forwardRef(te(function(e,t){const{__scopeSelect:n,children:o,fragment:l}=e;return l?I.createPortal((0,Q.jsx)(Ee,{scope:n,children:(0,Q.jsx)(le.Slot,{scope:n,children:(0,Q.jsx)("div",{ref:t,children:o})})}),l):null},"SelectContentFragment")),Oe=10,[Ee,Ie]=se(je),Re=(0,q.createSlot)("SelectContent.RemoveScroll"),Te=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,{position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,side:d,sideOffset:f,align:p,alignOffset:b,arrowPadding:h,collisionBoundary:v,collisionPadding:S,sticky:w,hideWhenDetached:y,avoidCollisions:x}=e,j=(0,O.default)(e,s),P=fe(je,n),[_,C]=E.useState(null),[I,R]=E.useState(null),D=(0,k.useComposedRefs)(t,C),[L,H]=E.useState(null),[V,F]=E.useState(null),N=ce(n),[K,W]=E.useState(!1),U=E.useRef(!1);E.useEffect(()=>{if(_)return(0,$.hideOthers)(_)},[_]),(0,A.useFocusGuards)();const q=E.useCallback(e=>{const[t,...n]=N().map(e=>e.ref.current),[o]=n.slice(-1),l=document.activeElement;for(const n of e){if(n===l)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&I&&(I.scrollTop=0),n===o&&I&&(I.scrollTop=I.scrollHeight),n?.focus(),document.activeElement!==l)return}},[N,I]),z=E.useCallback(()=>q([L,_]),[q,L,_]);E.useEffect(()=>{K&&z()},[K,z]);const{onOpenChange:G,triggerPointerDownPosRef:Y}=P;E.useEffect(()=>{if(_){let e={x:0,y:0};const t=te(t=>{e={x:Math.abs(Math.round(t.pageX)-(Y.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(Y.current?.y??0))}},"handlePointerMove"),n=te(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(_)||G(!1),document.removeEventListener("pointermove",t),Y.current=null},"handlePointerUp");return null!==Y.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[_,G,Y]),E.useEffect(()=>{const e=te(()=>G(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[G]);const[X,Z]=lt(e=>{const t=N().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=ct(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),ee=E.useCallback((e,t,n)=>{const o=!U.current&&!n;(void 0!==P.value&&P.value===t||o)&&(H(e),o&&(U.current=!0))},[P.value]),ne=E.useCallback(()=>_?.focus(),[_]),oe=E.useCallback((e,t,n)=>{const o=!U.current&&!n;(void 0!==P.value&&P.value===t||o)&&F(e)},[P.value]),re="popper"===o?ke:De,le=re===ke?{side:d,sideOffset:f,align:p,alignOffset:b,arrowPadding:h,collisionBoundary:v,collisionPadding:S,sticky:w,hideWhenDetached:y,avoidCollisions:x}:{};return(0,Q.jsx)(Ee,{scope:n,content:_,viewport:I,onViewportChange:R,itemRefCallback:ee,selectedItem:L,onItemLeave:ne,itemTextRefCallback:oe,focusSelectedItem:z,selectedItemText:V,position:o,isPositioned:K,searchRef:X,children:(0,Q.jsx)(J.RemoveScroll,{as:Re,allowPinchZoom:!0,children:(0,Q.jsx)(B.FocusScope,{asChild:!0,trapped:P.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,T.composeEventHandlers)(l,e=>{P.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,Q.jsx)(M.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:(0,Q.jsx)(re,Object.assign({role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:e=>e.preventDefault()},j,le,{onPlaced:()=>W(!0),ref:D,style:Object.assign({display:"flex",flexDirection:"column",outline:"none"},j.style),onKeyDown:(0,T.composeEventHandlers)(j.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>q(t)),e.preventDefault()}})}))})})})})},"SelectContentImpl")),De=E.forwardRef(te(function(e,t){const{__scopeSelect:n,onPlaced:o}=e,l=(0,O.default)(e,u),c=fe(je,n),s=Ie(je,n),[d,f]=E.useState(null),[p,b]=E.useState(null),h=(0,k.useComposedRefs)(t,b),v=ce(n),S=E.useRef(!1),w=E.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:j,focusSelectedItem:P}=s,_=E.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&p&&y&&x&&j){const e=c.trigger.getBoundingClientRect(),t=p.getBoundingClientRect(),n=c.valueNode.getBoundingClientRect(),l=j.getBoundingClientRect();if("rtl"!==c.dir){const o=l.left-t.left,c=n.left-o,s=e.left-c,u=e.width+s,f=Math.max(u,t.width),p=window.innerWidth-Oe,b=(0,R.clamp)(c,[Oe,Math.max(Oe,p-f)]);d.style.minWidth=u+"px",d.style.left=b+"px"}else{const o=t.right-l.right,c=window.innerWidth-n.right-o,s=window.innerWidth-e.right-c,u=e.width+s,f=Math.max(u,t.width),p=window.innerWidth-Oe,b=(0,R.clamp)(c,[Oe,Math.max(Oe,p-f)]);d.style.minWidth=u+"px",d.style.right=b+"px"}const s=v(),u=window.innerHeight-20,f=y.scrollHeight,b=window.getComputedStyle(p),h=parseInt(b.borderTopWidth,10),w=parseInt(b.paddingTop,10),P=parseInt(b.borderBottomWidth,10),_=h+w+f+parseInt(b.paddingBottom,10)+P,C=Math.min(5*x.offsetHeight,_),O=window.getComputedStyle(y),E=parseInt(O.paddingTop,10),I=parseInt(O.paddingBottom,10),T=e.top+e.height/2-Oe,D=u-T,k=x.offsetHeight/2,L=h+w+(x.offsetTop+k),H=_-L;if(L<=T){const e=s.length>0&&x===s[s.length-1].ref.current;d.style.bottom="0px";const t=p.clientHeight-y.offsetTop-y.offsetHeight,n=L+Math.max(D,k+(e?I:0)+t+P);d.style.height=n+"px"}else{const e=s.length>0&&x===s[0].ref.current;d.style.top="0px";const t=Math.max(T,h+y.offsetTop+(e?E:0)+k)+H;d.style.height=t+"px",y.scrollTop=L-T+y.offsetTop}d.style.margin=`${Oe}px 0`,d.style.minHeight=C+"px",d.style.maxHeight=u+"px",o?.(),requestAnimationFrame(()=>S.current=!0)}},[v,c.trigger,c.valueNode,d,p,y,x,j,c.dir,o]);(0,Y.useLayoutEffect)(()=>_(),[_]);const[C,I]=E.useState();(0,Y.useLayoutEffect)(()=>{p&&I(window.getComputedStyle(p).zIndex)},[p]);const T=E.useCallback(e=>{e&&!0===w.current&&(_(),P?.(),w.current=!1)},[_,P]);return(0,Q.jsx)(Le,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:T,children:(0,Q.jsx)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,Q.jsx)(U.Primitive.div,Object.assign({},l,{ref:h,style:Object.assign({boxSizing:"border-box",maxHeight:"100%"},l.style)}))})})},"SelectItemAlignedPosition")),ke=E.forwardRef(te(function(e,t){const{__scopeSelect:n,align:o="start",collisionPadding:l=Oe}=e,c=(0,O.default)(e,d),s=ue(n);return(0,Q.jsx)(N.Content,Object.assign({},s,c,{ref:t,align:o,collisionPadding:l,style:Object.assign({boxSizing:"border-box"},c.style,{"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"})}))},"SelectPopperPosition")),[Le,He]=se(je,{}),Me="SelectViewport",Ae=E.forwardRef(te(function(e,t){const{__scopeSelect:n,nonce:o}=e,l=(0,O.default)(e,f),c=Ie(Me,n),s=He(Me,n),u=(0,k.useComposedRefs)(t,c.onViewportChange),d=E.useRef(0);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,Q.jsx)(le.Slot,{scope:n,children:(0,Q.jsx)(U.Primitive.div,Object.assign({"data-radix-select-viewport":"",role:"presentation"},l,{ref:u,style:Object.assign({position:"relative",flex:1,overflow:"hidden auto"},l.style),onScroll:(0,T.composeEventHandlers)(l.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if(o?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const o=window.innerHeight-20,l=parseFloat(n.style.minHeight),c=parseFloat(n.style.height),s=Math.max(l,c);if(s<o){const l=s+e,c=Math.min(o,l),u=l-c;n.style.height=c+"px","0px"===n.style.bottom&&(t.scrollTop=u>0?u:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})}))})]})},"SelectViewport")),[Be,Ve]=se("SelectGroup"),Fe=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,o=(0,O.default)(e,p),l=(0,V.useId)();return(0,Q.jsx)(Be,{scope:n,id:l,children:(0,Q.jsx)(U.Primitive.div,Object.assign({role:"group","aria-labelledby":l},o,{ref:t}))})},"SelectGroup")),Ne=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,o=(0,O.default)(e,b),l=Ve("SelectLabel",n);return(0,Q.jsx)(U.Primitive.div,Object.assign({id:l.id},o,{ref:t}))},"SelectLabel")),Ke="SelectItem",[We,Ue]=se(Ke),qe=E.forwardRef(te(function(e,t){const{__scopeSelect:n,value:o,disabled:l=!1,textValue:c}=e,s=(0,O.default)(e,h),u=fe(Ke,n),d=Ie(Ke,n),f=u.value===o,[p,b]=E.useState(c??""),[v,S]=E.useState(!1),w=(0,z.useCallbackRef)(e=>d.itemRefCallback?.(e,o,l)),y=(0,k.useComposedRefs)(t,w),x=(0,V.useId)(),j=E.useRef("touch"),P=te(()=>{l||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return(0,Q.jsx)(We,{scope:n,value:o,disabled:l,textId:x,isSelected:f,onItemTextChange:E.useCallback(e=>{b(t=>t||(e?.textContent??"").trim())},[]),children:(0,Q.jsx)(le.ItemSlot,{scope:n,value:o,disabled:l,textValue:p,children:(0,Q.jsx)(U.Primitive.div,Object.assign({role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":f&&v,"data-state":f?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1},s,{ref:y,onFocus:(0,T.composeEventHandlers)(s.onFocus,()=>S(!0)),onBlur:(0,T.composeEventHandlers)(s.onBlur,()=>S(!1)),onClick:(0,T.composeEventHandlers)(s.onClick,()=>{"mouse"!==j.current&&P()}),onPointerUp:(0,T.composeEventHandlers)(s.onPointerUp,()=>{"mouse"===j.current&&P()}),onPointerDown:(0,T.composeEventHandlers)(s.onPointerDown,e=>{j.current=e.pointerType}),onPointerMove:(0,T.composeEventHandlers)(s.onPointerMove,e=>{j.current=e.pointerType,l?d.onItemLeave?.():"mouse"===j.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,T.composeEventHandlers)(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:(0,T.composeEventHandlers)(s.onKeyDown,e=>{if(l||e.target!==e.currentTarget)return;""!==d.searchRef?.current&&" "===e.key||(oe.includes(e.key)&&P()," "===e.key&&e.preventDefault())})}))})})},"SelectItem")),ze="SelectItemText",Ge=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,o=(0,O.default)(e,v),l=fe(ze,n),c=Ie(ze,n),s=Ue(ze,n),u=me(ze,n),[d,f]=E.useState(null),p=(0,z.useCallbackRef)(e=>c.itemTextRefCallback?.(e,s.value,s.disabled)),b=(0,k.useComposedRefs)(t,f,s.onItemTextChange,p),h=d?.textContent,S=E.useMemo(()=>(0,Q.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:w,onNativeOptionRemove:y}=u;return(0,Y.useLayoutEffect)(()=>(w(S),()=>y(S)),[w,y,S]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U.Primitive.span,Object.assign({id:s.textId},o,{ref:b})),s.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!rt(l.value)?I.createPortal(o.children,l.valueNode):null]})},"SelectItemText")),Ye=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,o=(0,O.default)(e,S);return Ue("SelectItemIndicator",n).isSelected?(0,Q.jsx)(U.Primitive.span,Object.assign({"aria-hidden":!0},o,{ref:t})):null},"SelectItemIndicator")),Xe="SelectScrollUpButton",Ze=E.forwardRef(te(function(e,t){const n=Ie(Xe,e.__scopeSelect),o=He(Xe,e.__scopeSelect),[l,c]=E.useState(!1),s=(0,k.useComposedRefs)(t,o.onScrollButtonChange);return(0,Y.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;c(e)};te(e,"handleScroll");const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),l?(0,Q.jsx)(Qe,Object.assign({},e,{ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}})):null},"SelectScrollUpButton")),$e="SelectScrollDownButton",Je=E.forwardRef(te(function(e,t){const n=Ie($e,e.__scopeSelect),o=He($e,e.__scopeSelect),[l,c]=E.useState(!1),s=(0,k.useComposedRefs)(t,o.onScrollButtonChange);return(0,Y.useLayoutEffect)(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;c(n)};te(e,"handleScroll");const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),l?(0,Q.jsx)(Qe,Object.assign({},e,{ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}})):null},"SelectScrollDownButton")),Qe=E.forwardRef(te(function(e,t){const{__scopeSelect:n,onAutoScroll:o}=e,l=(0,O.default)(e,w),c=Ie("SelectScrollButton",n),s=E.useRef(null),u=ce(n),d=E.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>d(),[d]),(0,Y.useLayoutEffect)(()=>{const e=u().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[u]),(0,Q.jsx)(U.Primitive.div,Object.assign({"aria-hidden":!0},l,{ref:t,style:Object.assign({flexShrink:0},l.style),onPointerDown:(0,T.composeEventHandlers)(l.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:(0,T.composeEventHandlers)(l.onPointerMove,()=>{c.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:(0,T.composeEventHandlers)(l.onPointerLeave,()=>{d()})}))},"SelectScrollButtonImpl")),et=E.forwardRef(te(function(e,t){const n=(0,O.default)(e,y);return(0,Q.jsx)(U.Primitive.div,Object.assign({"aria-hidden":!0},n,{ref:t}))},"SelectSeparator")),tt=E.forwardRef(te(function(e,t){const{__scopeSelect:n}=e,o=(0,O.default)(e,x),l=ue(n);return"popper"===Ie("SelectArrow",n).position?(0,Q.jsx)(N.Arrow,Object.assign({},l,o,{ref:t})):null},"SelectArrow")),nt=E.forwardRef(te(function(e,t){let{__scopeSelect:n}=e,o=(0,O.default)(e,j);const l=fe("SelectBubbleInput",n),{value:c,onValueChange:s,required:u,disabled:d,name:f,autoComplete:p,form:b}=l,{nativeOptions:h,nativeSelectKey:v}=l,S=E.useRef(null),w=(0,k.useComposedRefs)(t,S),y=c??"",x=(0,X.usePrevious)(y),P=Array.from(h).some(e=>""===(e.props.value??""));return E.useEffect(()=>{const e=S.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(x!==y&&n){const t=new Event("change",{bubbles:!0});n.call(e,y),e.dispatchEvent(t)}},[x,y]),(0,Q.jsxs)(U.Primitive.select,Object.assign({"aria-hidden":!0,required:u,tabIndex:-1,name:f,autoComplete:p,disabled:d,form:b,onChange:e=>s(e.target.value)},o,{style:Object.assign({},Z.VISUALLY_HIDDEN_STYLES,o.style),ref:w,defaultValue:y,children:[rt(c)&&!P?(0,Q.jsx)("option",{value:""}):null,Array.from(h)]}),v)},"SelectBubbleInput"));function ot(e){return"function"==typeof e}function rt(e){return""===e||void 0===e}function lt(e){const t=(0,z.useCallbackRef)(e),n=E.useRef(""),o=E.useRef(0),l=E.useCallback(e=>{const l=n.current+e;t(l),te(function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))},"updateSearch")(l)},[t]),c=E.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,l,c]}function ct(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=it(e,Math.max(l,0));1===o.length&&(c=c.filter(e=>e!==n));const s=c.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}function it(e,t){return e.map((n,o)=>e[(t+o)%e.length])}te(ot,"isFunction"),te(rt,"shouldShowPlaceholder"),te(lt,"useTypeaheadSearch"),te(ct,"findNextItem"),te(it,"wrapArray")},326,[131,38,40,327,328,329,302,332,333,334,336,337,338,340,343,344,300,301,335,345,339,348,299,298,262,153]);
|
|
408
408
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return t}});function t(t,[n,u]){return Math.min(u,Math.max(n,t))}(0,Object.defineProperty)(t,"name",{value:"clamp",configurable:!0})},327,[]);
|
|
409
409
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canUseDOM",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"composeEventHandlers",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"getActiveElement",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"getOwnerDocument",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"getOwnerWindow",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isFrame",{enumerable:!0,get:function(){return w}});var n=Object.defineProperty,t=(t,o)=>n(t,"name",{value:o,configurable:!0}),o=!("undefined"==typeof window||!window.document||!window.document.createElement);function u(n,o,{checkForDefaultPrevented:u=!0}={}){return t(function(t){if(n?.(t),!1===u||!t||!t.defaultPrevented)return o?.(t)},"handleEvent")}function c(n){if(!o)throw new Error("Cannot access window outside of the DOM");return n?.ownerDocument?.defaultView??window}function f(n){if(!o)throw new Error("Cannot access document outside of the DOM");return n?.ownerDocument??document}function l(n,t=!1){const{activeElement:o}=f(n);if(!o?.nodeName)return null;if(w(o)&&o.contentDocument)return l(o.contentDocument.body,t);if(t){const n=o.getAttribute("aria-activedescendant");if(n){const t=f(o).getElementById(n);if(t)return t}}return o}function w(n){return"IFRAME"===n.tagName}t(u,"composeEventHandlers"),t(c,"getOwnerWindow"),t(f,"getOwnerDocument"),t(l,"getActiveElement"),t(w,"isFrame")},328,[]);
|
|
@@ -427,81 +427,81 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule'
|
|
|
427
427
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_DEVELOPMENT",{enumerable:!0,get:function(){return t}});var t=!1},346,[]);
|
|
428
428
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useEffectEvent",{enumerable:!0,get:function(){return o}});var e=r(_d[0]),t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),n=Object.defineProperty,u=t[" useEffectEvent ".trim().toString()],f=t[" useInsertionEffect ".trim().toString()];function o(n){if("function"==typeof u)return u(n);const o=t.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return"function"==typeof f?f(()=>{o.current=n}):(0,e.useLayoutEffect)(()=>{o.current=n}),t.useMemo(()=>(...e)=>o.current?.(...e),[])}n(o,"name",{value:"useEffectEvent",configurable:!0})},347,[339,38]);
|
|
429
429
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"usePrevious",{enumerable:!0,get:function(){return u}});var e=(function(e){if(e&&e.__esModule)return e;var u={};return e&&Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(u,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),u.default=e,u})(r(_d[0]));function u(u){const t=e.useRef({value:u,previous:u});return e.useMemo(()=>(t.current.value!==u&&(t.current.previous=t.current.value,t.current.value=u),t.current.previous),[u])}(0,Object.defineProperty)(u,"name",{value:"usePrevious",configurable:!0})},348,[38]);
|
|
430
|
-
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisabledControlHint=function({reason:s,label:l,children:c}){const[u,x]=(0,o.useState)(!1);return s?(0,e.jsx)(n.Provider,{delayDuration:200,children:(0,e.jsxs)(n.Root,{children:[(0,e.jsx)(n.Trigger,{asChild:!0,children:(0,e.jsx)("span",{tabIndex:0,role:"group","aria-label":l,"aria-description":s,"aria-disabled":!0,onFocus:e=>x((0,d.isFocusVisible)(e)),onBlur:()=>x(!1),style:{display:
|
|
430
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisabledControlHint=function({reason:s,label:l,children:c}){const[u,x]=(0,o.useState)(!1);return s?(0,e.jsx)(n.Provider,{delayDuration:200,children:(0,e.jsxs)(n.Root,{children:[(0,e.jsx)(n.Trigger,{asChild:!0,children:(0,e.jsx)("span",{tabIndex:0,role:"group","aria-label":l,"aria-description":s,"aria-disabled":!0,onFocus:e=>x((0,d.isFocusVisible)(e)),onBlur:()=>x(!1),style:{display:"inline-flex",maxWidth:"100%",borderRadius:t.radius.lg,outline:"none",boxShadow:u?`0 0 0 2px ${t.border.secondary}`:t.shadow.none,cursor:"not-allowed"},children:(0,e.jsx)("span",{style:{display:"inline-flex",maxWidth:"100%",pointerEvents:"none"},children:c})})}),(0,e.jsx)(n.Portal,{children:(0,e.jsx)(n.Content,{side:"top",align:"end",sideOffset:6,collisionPadding:8,style:Object.assign({},t.textSize.xs,{zIndex:610,maxWidth:"min(260px, calc(100vw - 16px))",padding:"6px 10px",borderRadius:t.radius.md,backgroundColor:t.text.default,color:t.bg.default,boxShadow:t.shadow.md}),children:s})})]})}):c};var e=r(_d[0]),n=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}),n.default=e,n})(r(_d[1])),o=r(_d[2]),t=r(_d[3]),d=r(_d[4])},349,[153,350,38,238,240]);
|
|
431
431
|
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";const e=["__scopeTooltip"],t=["forceMount","side"],n=["__scopeTooltip","children","aria-label","id","onEscapeKeyDown","onPointerDownOutside"],o=["__scopeTooltip"];function r(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}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Arrow",{enumerable:!0,get:function(){return le}}),Object.defineProperty(_e,"Content",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"Portal",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"Provider",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"Root",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"Tooltip",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"TooltipArrow",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"TooltipContent",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"TooltipPortal",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"TooltipProvider",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"TooltipTrigger",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"Trigger",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"createTooltipScope",{enumerable:!0,get:function(){return R}});var i,c=_r(_d[0]),s=(i=c)&&i.__esModule?i:{default:i},a=r(_r(_d[1])),l=_r(_d[2]),u=_r(_d[3]),p=_r(_d[4]),d=_r(_d[5]),f=_r(_d[6]),b=_r(_d[7]),h=r(b),y=_r(_d[8]),v=_r(_d[9]),x=_r(_d[10]),T=_r(_d[11]),C=_r(_d[12]),P=_r(_d[13]),w=r(_r(_d[14])),j=_r(_d[15]),O=Object.defineProperty,E=(e,t)=>O(e,"name",{value:t,configurable:!0}),[_,R]=(0,p.createContextScope)("Tooltip",[b.createPopperScope]),k=(0,b.createPopperScope)(),D=700,L="tooltip.open",[M,H]=_("TooltipProvider"),I=E(e=>{const{__scopeTooltip:t,delayDuration:n=D,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,c=a.useRef(!0),s=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const e=l.current;return()=>window.clearTimeout(e)},[]),(0,j.jsx)(M,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:a.useCallback(()=>{o<=0||(window.clearTimeout(l.current),c.current=!1)},[o]),onClose:a.useCallback(()=>{o<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>c.current=!0,o))},[o]),isPointerInTransitRef:s,onPointerInTransitChange:a.useCallback(e=>{s.current=e},[]),disableHoverableContent:r,children:i})},"TooltipProvider"),S="Tooltip",[A,F]=_(S),B=E(e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:c,delayDuration:s}=e,l=H(S,e.__scopeTooltip),u=k(t),[p,d]=a.useState(null),[b,y]=a.useState(void 0),v=(0,f.useId)(),x=a.useRef(0),T=c??l.disableHoverableContent,P=s??l.delayDuration,w=a.useRef(!1),[O,_]=(0,C.useControllableState)({prop:o,defaultProp:r??!1,onChange:E(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(L))):l.onClose(),i?.(e)},"onChange"),caller:S}),R=a.useMemo(()=>O?w.current?"delayed-open":"instant-open":"closed",[O]),D=a.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,_(!0)},[_]),M=a.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_(!1)},[_]),I=a.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,_(!0),x.current=0},P)},[P,_]);a.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]);const F=b??v;return(0,j.jsx)(h.Root,Object.assign({},u,{children:(0,j.jsx)(A,{scope:t,contentId:F,setContentId:y,open:O,stateAttribute:R,trigger:p,onTriggerChange:d,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?I():D()},[l.isOpenDelayedRef,I,D]),onTriggerLeave:a.useCallback(()=>{T?M():(window.clearTimeout(x.current),x.current=0)},[M,T]),onOpen:D,onClose:M,disableHoverableContent:T,children:n})}))},"Tooltip"),K="TooltipTrigger",X=a.forwardRef(E(function(t,n){const{__scopeTooltip:o}=t,r=(0,s.default)(t,e),i=F(K,o),c=H(K,o),p=k(o),d=a.useRef(null),f=(0,u.useComposedRefs)(n,d,i.onTriggerChange),b=a.useRef(!1),y=a.useRef(!1),v=a.useCallback(()=>b.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),(0,j.jsx)(h.Anchor,Object.assign({asChild:!0},p,{children:(0,j.jsx)(x.Primitive.button,Object.assign({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:f,onPointerMove:(0,l.composeEventHandlers)(t.onPointerMove,e=>{"touch"!==e.pointerType&&(y.current||c.isPointerInTransitRef.current||(i.onTriggerEnter(),y.current=!0))}),onPointerLeave:(0,l.composeEventHandlers)(t.onPointerLeave,()=>{i.onTriggerLeave(),y.current=!1}),onPointerDown:(0,l.composeEventHandlers)(t.onPointerDown,()=>{i.open&&i.onClose(),b.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:(0,l.composeEventHandlers)(t.onFocus,()=>{b.current||i.onOpen()}),onBlur:(0,l.composeEventHandlers)(t.onBlur,i.onClose),onClick:(0,l.composeEventHandlers)(t.onClick,i.onClose)}))}))},"TooltipTrigger")),Y="TooltipPortal",[G,N]=_(Y,{forceMount:void 0}),q=E(e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=F(Y,t);return(0,j.jsx)(G,{scope:t,forceMount:n,children:(0,j.jsx)(v.Presence,{present:n||i.open,children:(0,j.jsx)(y.Portal,{asChild:!0,container:r,children:o})})})},"TooltipPortal"),z="TooltipContent",J=a.forwardRef(E(function(e,n){const o=N(z,e.__scopeTooltip),{forceMount:r=o.forceMount,side:i="top"}=e,c=(0,s.default)(e,t),a=F(z,e.__scopeTooltip);return(0,j.jsx)(v.Presence,{present:r||a.open,children:a.disableHoverableContent?(0,j.jsx)(V,Object.assign({side:i},c,{ref:n})):(0,j.jsx)(Q,Object.assign({side:i},c,{ref:n}))})},"TooltipContent")),Q=a.forwardRef(E(function(e,t){const n=F(z,e.__scopeTooltip),o=H(z,e.__scopeTooltip),r=a.useRef(null),i=(0,u.useComposedRefs)(t,r),[c,s]=a.useState(null),{trigger:l,onClose:p}=n,d=r.current,{onPointerInTransitChange:f}=o,b=a.useCallback(()=>{s(null),f(!1)},[f]),h=a.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=ne([...$(o,Z(o,n.getBoundingClientRect())),...ee(t.getBoundingClientRect())]);s(r),f(!0)},[f]);return a.useEffect(()=>()=>b(),[b]),a.useEffect(()=>{if(l&&d){const e=E(e=>h(e,d),"handleTriggerLeave"),t=E(e=>h(e,l),"handleContentLeave");return l.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[l,d,h,b]),a.useEffect(()=>{if(c){const e=E(e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=l?.contains(t)||d?.contains(t),r=!te(n,c);o?b():r&&(b(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[l,d,c,p,b]),(0,j.jsx)(V,Object.assign({},e,{ref:i}))},"TooltipContentHoverable")),U=(0,T.createSlottable)("TooltipContent"),V=a.forwardRef(E(function(e,t){const{__scopeTooltip:o,children:r,"aria-label":i,id:c,onEscapeKeyDown:l,onPointerDownOutside:u}=e,p=(0,s.default)(e,n),f=F(z,o),b=k(o),{onClose:y}=f;a.useEffect(()=>(document.addEventListener(L,y),()=>document.removeEventListener(L,y)),[y]),a.useEffect(()=>{if(f.trigger){const e=E(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&y()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[f.trigger,y]);const{setContentId:v}=f;return(0,P.useLayoutEffect)(()=>(v(c),()=>{v(void 0)}),[c,v]),(0,j.jsx)(d.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:y,children:(0,j.jsxs)(h.Content,Object.assign({"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId},b,p,{ref:t,style:Object.assign({},p.style,{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}),children:[(0,j.jsx)(U,{children:r}),i?(0,j.jsx)(w.Root,{id:f.contentId,role:"tooltip",children:i}):null]}))})},"TooltipContentImpl")),W=a.forwardRef(E(function(e,t){const{__scopeTooltip:n}=e,r=(0,s.default)(e,o),i=k(n);return(0,j.jsx)(h.Arrow,Object.assign({},i,r,{ref:t}))},"TooltipArrow"));function Z(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function $(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}function ee(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function te(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const c=t[e],s=t[i],a=c.x,l=c.y,u=s.x,p=s.y;l>o!=p>o&&n<(u-a)*(o-l)/(p-l)+a&&(r=!r)}return r}function ne(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),oe(t)}function oe(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}E(Z,"getExitSideFromRect"),E($,"getPaddedExitPoints"),E(ee,"getPointsFromRect"),E(te,"isPointInPolygon"),E(ne,"getHull"),E(oe,"getHullPresorted");var re=I,ie=B,ce=X,se=q,ae=J,le=W},350,[131,38,328,302,332,334,338,340,343,344,300,301,345,339,299,153]);
|
|
432
|
-
__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:
|
|
433
|
-
__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:
|
|
434
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.usePrefersReducedMotion=function(){const[c,o]=(0,t.useState)(()=>
|
|
435
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Sidebar=function({simulators:l,emulators:n,recentSimulators:c,recentEmulators:u,simulatorOptions:b,emulatorOptions:p,agentDeviceIds:v=[],selectedId:x,onSelect:f,onAddDevice:h,onToggle:S,platform:j,width:y=400}){return(0,o.jsxs)("aside",{style:{display:
|
|
432
|
+
__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])},351,[153,38,238,242]);
|
|
433
|
+
__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])},352,[153,38,238]);
|
|
434
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.usePrefersReducedMotion=function(){const[c,o]=(0,t.useState)(()=>"undefined"!=typeof window&&!0===window.matchMedia?.(n).matches);return(0,t.useEffect)(()=>{const t=window.matchMedia?.(n);if(!t)return;const c=()=>o(t.matches);return t.addEventListener("change",c),()=>t.removeEventListener("change",c)},[]),c};var t=r(d[0]);const n="(prefers-reduced-motion: reduce)"},353,[38]);
|
|
435
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Sidebar=function({simulators:l,emulators:n,recentSimulators:c,recentEmulators:u,simulatorOptions:b,emulatorOptions:p,agentDeviceIds:v=[],selectedId:x,onSelect:f,onAddDevice:h,onToggle:S,platform:j,width:y=400}){return(0,o.jsxs)("aside",{style:{display:"flex",flexDirection:"column",gap:32,width:`min(${y}px, 100vw)`,flexShrink:0,height:"100vh",boxSizing:"border-box",padding:"32px 24px",backgroundColor:t.bg.default,overflow:"hidden"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,o.jsx)(t.Logo,{}),S&&(0,o.jsx)(t.SidebarToggle,{onClick:S})]}),"android"!==j&&(0,o.jsx)(s.DeviceSection,{title:"Simulators",addLabel:"Add simulator",kind:"simulator",emptyLabel:h?"No booted simulators. Use the + button to add one.":"No booted simulators.",devices:l,recent:c,options:b,agentDeviceIds:v,selectedId:x,onSelect:f,onAdd:h}),"ios"!==j&&(0,o.jsx)(s.DeviceSection,{title:"Emulators",addLabel:"Add emulator",kind:"emulator",emptyLabel:h?"No booted emulators or devices. Use the + button to add one.":"No booted emulators or devices.",devices:n,recent:u,options:p,agentDeviceIds:v,selectedId:x,onSelect:f,onAdd:h})]})};var o=r(d[0]),t=r(d[1]),s=r(d[2])},354,[153,355,356]);
|
|
436
436
|
__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]}})});var s=r(d[12]);Object.keys(s).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})});var P=r(d[13]);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 h=r(d[14]);Object.keys(h).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}})});var v=r(d[15]);Object.keys(v).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return v[t]}})});var k=r(d[16]);Object.keys(k).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return k[t]}})});var w=r(d[17]);Object.keys(w).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return w[t]}})});var E=r(d[18]);Object.keys(E).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return E[t]}})})},355,[237,239,241,245,304,319,320,321,323,324,325,351,352,303,240,322,353,242,238]);
|
|
437
|
-
__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:y,agentDeviceIds:v=[],selectedId:f,onSelect:h,onAdd:j}){const[k,S]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[I,M]=(0,s.useState)(!1),L=new Set(b.map(t=>t.id)),_=x.filter(t=>!L.has(t.id));return(0,t.jsxs)("section",{style:{display:
|
|
438
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.RecentDevicesModal=function({open:h,onClose:f,kind:b,devices:v,options:y,onAdd:j}){const w=
|
|
439
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogSidebar=function({onToggle:C,client:j,device:u,showDeviceFrame:y=!0,onShowDeviceFrameChange:w,streamMode:D,httpCodec:M,streamModeAvailability:_,onStreamModeChange:A,onHttpCodecChange:F,onShutdown:I,onRemove:E,width:O=400}){const T=u?{available:(0,f.isDeviceFrameProfileId)(u.deviceFrame),visible:y,onVisibleChange:w??(()=>{})}:void 0,k=u?.physical?void 0:E;return(0,t.jsxs)("aside",{style:{display:
|
|
440
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AccessibilitySection=function({client:o,defaultOpen:f=!1}){const[p,y]=(0,n.useState)(f),{accessibility:j,accessibilityPending:S,refreshAccessibility:w}=o;(0,n.useEffect)(()=>{p&&w()},[p,w]);const C=j?.nodes??[];return(0,t.jsxs)(s.CollapsibleSection,{title:"Accessibility",open:p,onOpenChange:y,children:[(0,t.jsx)(b.SidebarRow,{label:"Elements",children:(0,t.jsx)(c.SidebarActionButton,{disabled:S,onClick:w,children:"Refresh"})}),(0,t.jsx)(x,{client:o}),C.length>0&&(0,t.jsx)("div",{style:{display:
|
|
441
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SIDEBAR_SECTION_INSET",{enumerable:!0,get:function(){return s}}),e.CollapsibleSection=function({title:p,open:f,onOpenChange:b,divider:h=!0,children:x}){const y=(0,n.useId)(),v=(0,o.usePrefersReducedMotion)(),j=u(f,v);return(0,t.jsxs)("section",{"aria-label":p,style:{minWidth:0,boxSizing:
|
|
437
|
+
__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:y,agentDeviceIds:v=[],selectedId:f,onSelect:h,onAdd:j}){const[k,S]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[I,M]=(0,s.useState)(!1),L=new Set(b.map(t=>t.id)),_=x.filter(t=>!L.has(t.id));return(0,t.jsxs)("section",{style:{display:"grid",gap:12,minWidth:0},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}),!!j&&(0,t.jsx)("button",{type:"button","aria-label":c,onClick:()=>M(!0),onMouseEnter:()=>S(!0),onMouseLeave:()=>{S(!1),D(!1)},onMouseDown:()=>D(!0),onMouseUp:()=>D(!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:k?n.bg.hover:n.bg.default,cursor:"pointer",transition:"background-color 150ms ease, transform 100ms ease",transform:C?"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,minWidth:0},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,unsupported:!s.supported,usedByAgent:v.includes(s.id),selected:s.id===f,onClick:()=>h(s.id)},s.id))}),(0,t.jsx)(o.RecentDevicesModal,{open:I,onClose:()=>M(!1),kind:u,devices:_,options:y,onAdd:j||(async()=>({ok:!1,error:"Device actions are unavailable."}))})]})};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3])},356,[153,38,355,357]);
|
|
438
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.RecentDevicesModal=function({open:h,onClose:f,kind:b,devices:v,options:y,onAdd:j}){const w="simulator"===b?"ios":"android",C=b,S=`Add a${"emulator"===b?"n":""} ${C}`,$=(0,t.useMemo)(()=>[...v].sort((n,t)=>(t.lastUsedAt??0)-(n.lastUsedAt??0)),[v]),[k,z]=(0,t.useState)({kind:"new"}),[F,A]=(0,t.useState)(""),[D,M]=(0,t.useState)(""),[_,I]=(0,t.useState)(""),[R,B]=(0,t.useState)(!1),[N,T]=(0,t.useState)(!1),[O,U]=(0,t.useState)(!1),[E,W]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!h)return;const n=y.runtimes[0],t=n?.models[0];A(n?.value??""),M(t?.value??""),I(x(t?.label??"",$,w)),B(!1),T(!1),U(!1),W(null),z($.length?{kind:"recent",id:$[0].id}:{kind:"new"})},[h,y]);const Z="new"===k.kind,H="recent"===k.kind?$.find(n=>n.id===k.id):void 0,q=(0,t.useMemo)(()=>{const n=new Map;for(const t of y.runtimes)for(const o of t.models)n.has(o.value)||n.set(o.value,o);return[...n.values()].sort((n,t)=>n.label.localeCompare(t.label,void 0,{numeric:!0}))},[y.runtimes]),L="android"===w?y.runtimes.filter(n=>n.models.some(n=>n.value===D)):y.runtimes,P=L.find(n=>n.value===F),V="android"===w?q:P?.models??[],Y=P?.models.find(n=>n.value===D),G=()=>{z({kind:"new"}),W(null)};function J(n){const t=y.runtimes.find(t=>t.value===n);if(A(n),G(),"ios"===w){const n=t?.models[0];M(n?.value??""),R||I(x(n?.label??"",$,w))}}function K(n){M(n),G();const t=V.find(t=>t.value===n);if("android"===w){const t=y.runtimes.find(t=>t.models.some(t=>t.value===n));A(t?.value??"")}R||I(x(t?.label??"",$,w))}const Q=_.trim(),X=Q.length>0&&("android"!==w||l.test(Q)),ee="android"===w&&R&&Q.length>0&&!l.test(Q),ne=`new-${w}-device-name-hint`,te=Z?X&&F.length>0&&D.length>0:!!H;return(0,n.jsx)(o.DialogRoot,{open:h,onOpenChange:n=>{n||f()},children:(0,n.jsxs)(o.DialogContent,{children:[(0,n.jsx)(o.DialogTitle,{title:S}),(0,n.jsxs)("form",{onSubmit:async function(n){if(n.preventDefault(),te&&!O){U(!0),W(null);try{const n=Z&&P&&Y?{kind:"new",device:{platform:w,name:Q,runtime:P.value,deviceType:Y.value,version:P.label,supported:Y.supported,deviceFrame:Y.deviceFrame}}:{kind:"recent",device:H},t=await j(n);t.ok?f():W(t.error)}catch(n){W(n instanceof Error?n.message:String(n))}finally{U(!1)}}},children:[(0,n.jsxs)(o.DialogContentContainer,{children:[(0,n.jsx)(s,{children:"Recents"}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:0===$.length?(0,n.jsxs)("p",{style:{margin:0,padding:"2px 2px 6px 2px",fontSize:13,color:o.text.tertiary},children:["No recent ",C,"s."]}):$.map(t=>(0,n.jsx)(c,{device:t,selected:"recent"===k.kind&&k.id===t.id,onSelect:()=>{z({kind:"recent",id:t.id}),W(null)}},t.id))}),(0,n.jsxs)("div",{style:{marginTop:10},children:[(0,n.jsxs)(s,{active:Z,children:["New ",C]}),(0,n.jsx)("div",{onClick:G,style:{borderRadius:o.radius.lg,overflow:"hidden",backgroundColor:o.bg.subtle,border:`1px solid ${Z?o.border.default:o.border.secondary}`,transition:"border-color 150ms ease"},children:0===y.runtimes.length?(0,n.jsxs)("p",{style:{margin:0,padding:13,color:o.text.tertiary,fontSize:13},children:["No usable ","ios"===w?"iOS runtimes":"Android system images"," were found on this host."]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:"Name"}),"android"===w&&(0,n.jsx)("span",{id:ne,style:{color:ee?o.text.danger:o.text.tertiary,fontSize:11,lineHeight:1.3},children:a})]}),htmlFor:`new-${w}-device-name`,last:!1,children:(0,n.jsx)("div",{style:{flex:"0 0 58%"},children:(0,n.jsx)("input",{id:`new-${w}-device-name`,type:"text",value:_,placeholder:Y?.label||`New ${C}`,autoComplete:"off",spellCheck:!1,pattern:"android"===w?"[A-Za-z0-9._-]+":void 0,title:"android"===w?a:void 0,"aria-invalid":!!ee||void 0,"aria-describedby":"android"===w?ne:void 0,disabled:O,onChange:n=>{return t=n.currentTarget.value,I(t),B(!0),void G();var t},onFocus:()=>{T(!0),G()},onBlur:()=>T(!1),style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",border:`1px solid ${ee?o.border.danger:o.border.default}`,borderRadius:o.radius.md,backgroundColor:o.bg.default,color:Z?o.text.default:o.text.tertiary,caretColor:o.text.default,fontSize:16,fontFamily:"inherit",outline:"none",boxShadow:N?`0 0 0 3px ${o.bg.element}`:"none"}})})}),"android"===w?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{label:"Model",htmlFor:`new-${w}-model`,last:!1,children:(0,n.jsx)(p,{id:`new-${w}-model`,value:D,options:V,disabled:O,onChange:K,onActivate:G,trailing:(0,n.jsx)(o.ChevronsUpDownIcon,{size:14,color:o.icon.secondary})})}),(0,n.jsx)(u,{label:"OS version",htmlFor:`new-${w}-runtime`,last:!0,children:(0,n.jsx)(p,{id:`new-${w}-runtime`,value:F,options:L,disabled:O,onChange:J,onActivate:G,trailing:(0,n.jsx)(o.ChevronDownIcon,{size:14,color:o.icon.secondary})})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{label:"OS version",htmlFor:`new-${w}-runtime`,last:!1,children:(0,n.jsx)(p,{id:`new-${w}-runtime`,value:F,options:L,disabled:O,onChange:J,onActivate:G,trailing:(0,n.jsx)(o.ChevronDownIcon,{size:14,color:o.icon.secondary})})}),(0,n.jsx)(u,{label:"Model",htmlFor:`new-${w}-model`,last:!0,children:(0,n.jsx)(p,{id:`new-${w}-model`,value:D,options:V,disabled:O,onChange:K,onActivate:G,trailing:(0,n.jsx)(o.ChevronsUpDownIcon,{size:14,color:o.icon.secondary})})})]})]})})]}),E&&(0,n.jsx)("p",{role:"alert",style:{margin:"12px 0 0",padding:"9px 11px",border:`1px solid ${o.border.danger}`,borderRadius:o.radius.lg,backgroundColor:o.bg.danger,color:o.text.danger,fontSize:13,whiteSpace:"pre-wrap"},children:E})]}),(0,n.jsxs)(o.DialogFooter,{children:[(0,n.jsx)(o.Button,{type:"button",theme:"quaternary",disabled:O,onClick:f,children:"Cancel"}),(0,n.jsx)(o.Button,{type:"submit",theme:"primary",disabled:!te||O,children:O?Z?"Creating\u2026":"Booting\u2026":Z?"Create & Boot":"Boot"})]})]})]})})};var n=r(d[0]),t=r(d[1]),o=r(d[2]);const l=/^[A-Za-z0-9._-]+$/,a="Allowed: a-z A-Z 0-9 . _ -";function s({children:t,active:l=!1}){return(0,n.jsx)("span",{style:{display:"block",marginBottom:4,fontFamily:o.font.mono,fontSize:11,fontWeight:l?600:400,letterSpacing:"0.06em",textTransform:"uppercase",color:l?o.text.default:o.text.tertiary},children:t})}function c({device:l,selected:a,onSelect:s}){const[c,u]=(0,t.useState)(!1);return(0,n.jsxs)("button",{type:"button","aria-pressed":a,onClick:s,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!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:c?o.bg.element:"transparent",transition:"background-color 150ms ease"},children:[(0,n.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,n.jsx)(o.CheckIcon,{size:16}):(0,n.jsx)(o.SmartphoneIcon,{size:16})}),(0,n.jsxs)("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[(0,n.jsx)("span",{style:{fontSize:14,fontWeight:a?600:500,color:o.text.default,lineHeight:1.25},children:l.name}),(0,n.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:o.text.tertiary,lineHeight:1.25},children:[(0,n.jsx)("span",{style:{width:6,height:6,flex:"0 0 auto",borderRadius:"50%",backgroundColor:l.booted?o.icon.success:o.icon.quaternary}}),l.booted?"Booted \xb7 now":h(l.lastUsedAt)]})]}),(0,n.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:l.version})]})}function u({label:t,htmlFor:l,last:a,children:s}){return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"11px 13px",borderBottom:a?void 0:`1px solid ${o.border.secondary}`},children:[(0,n.jsx)("label",{htmlFor:l,style:{display:"flex",flexDirection:"column",gap:2,fontSize:13,color:o.text.secondary,cursor:"pointer"},children:t}),s]})}function p({id:l,value:a,options:s,disabled:c,onChange:u,onActivate:p,trailing:x}){const[h,f]=(0,t.useState)(!1),b={width:"100%",boxSizing:"border-box",padding:"6px 28px 6px 10px",border:`1px solid ${o.border.default}`,borderRadius:o.radius.md,backgroundColor:o.bg.default,color:o.text.default,fontSize:16,fontFamily:"inherit",appearance:"none",WebkitAppearance:"none",MozAppearance:"none",outline:"none",cursor:"pointer",boxShadow:h?`0 0 0 3px ${o.bg.element}`:"none"};return(0,n.jsxs)("div",{style:{position:"relative",flex:"0 0 58%"},children:[(0,n.jsx)("select",{id:l,value:a,disabled:c,onChange:n=>u(n.currentTarget.value),onMouseDown:p,onFocus:()=>{f(!0),p()},onBlur:()=>f(!1),style:b,children:0===s.length?(0,n.jsx)("option",{value:"",children:"\u2014"}):s.map(t=>(0,n.jsx)("option",{value:t.value,children:t.label},t.value))}),(0,n.jsx)("span",{style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",color:o.icon.secondary},children:x})]})}function x(n,t,o){const l="android"===o?n.trim().replace(/[^A-Za-z0-9._-]+/g,"_").replace(/^_+|_+$/g,""):n;if(!l)return"";const a=new Set(t.map(n=>n.name));if(!a.has(l))return l;let s=2;const c="android"===o?"_":" ";for(;a.has(`${l}${c}${s}`);)s++;return`${l}${c}${s}`}function h(n){if(!n)return"Idle";const t=Date.now()-n,o=Math.round(t/6e4);if(o<1)return"now";if(o<60)return`${o}m ago`;const l=Math.round(o/60);if(l<24)return`${l}h ago`;const a=Math.round(l/24);if(a<7)return`${a} day${1===a?"":"s"} ago`;const s=Math.round(a/7);if(s<5)return`${s} week${1===s?"":"s"} ago`;const c=Math.round(a/30);return`${c} month${1===c?"":"s"} ago`}},357,[153,38,355]);
|
|
439
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogSidebar=function({onToggle:C,client:j,device:u,showDeviceFrame:y=!0,onShowDeviceFrameChange:w,streamMode:D,httpCodec:M,streamModeAvailability:_,onStreamModeChange:A,onHttpCodecChange:F,onShutdown:I,onRemove:E,width:O=400}){const T=u?{available:(0,f.isDeviceFrameProfileId)(u.deviceFrame),visible:y,onVisibleChange:w??(()=>{})}:void 0,k=u?.physical?void 0:E;return(0,t.jsxs)("aside",{style:{display:"flex",flexDirection:"column",width:`min(${O}px, 100vw)`,flexShrink:0,height:"100vh",boxSizing:"border-box",padding:"32px 0 0",backgroundColor:n.bg.default,overflow:"hidden"},children:[C&&(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",padding:`0 ${l.SIDEBAR_SECTION_INSET}px 12px`},children:(0,t.jsx)(n.SidebarToggle,{side:"right",onClick:C})}),(0,t.jsxs)("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:"column",overflowX:"hidden",overflowY:"auto"},children:[(0,t.jsx)(p.CurrentAppSection,{client:j}),(j?.capabilities.deviceSettings||"android"===j?.platform||T||j&&(I||k))&&(0,t.jsx)(v.DeviceOptionsSection,{client:j,deviceFrame:T,showDeviceSettings:j?.capabilities.deviceSettings??!1,onShutdown:I,onRemove:k}),j?.streamCapabilities&&(0,t.jsx)(b.StreamOptionsSection,{client:j,streamMode:D,httpCodec:M,streamModeAvailability:_,onStreamModeChange:A,onHttpCodecChange:F}),j?.capabilities.camera&&(0,t.jsx)(s.CameraSection,{client:j}),j?.capabilities.accessibility&&(0,t.jsx)(o.AccessibilitySection,{client:j}),j?.capabilities.location&&(0,t.jsx)(x.LocationSection,{client:j},u?.id),j?.capabilities.permissions&&(0,t.jsx)(c.PermissionsSection,{client:j}),j?.capabilities.events&&(0,t.jsx)(h.EventsSection,{client:j}),(0,t.jsx)(S.LogsSection,{client:j})]})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]),p=r(d[6]),v=r(d[7]),h=r(d[8]),x=r(d[9]),S=r(d[10]),b=r(d[11]),f=r(d[12])},358,[153,355,359,364,365,360,366,369,371,375,378,379,381]);
|
|
440
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AccessibilitySection=function({client:o,defaultOpen:f=!1}){const[p,y]=(0,n.useState)(f),{accessibility:j,accessibilityPending:S,refreshAccessibility:w}=o;(0,n.useEffect)(()=>{p&&w()},[p,w]);const C=j?.nodes??[];return(0,t.jsxs)(s.CollapsibleSection,{title:"Accessibility",open:p,onOpenChange:y,children:[(0,t.jsx)(b.SidebarRow,{label:"Elements",children:(0,t.jsx)(c.SidebarActionButton,{disabled:S,onClick:w,children:"Refresh"})}),(0,t.jsx)(x,{client:o}),C.length>0&&(0,t.jsx)("div",{style:{display:"flex",maxHeight:u,flexDirection:"column",overflowY:"auto",padding:4,boxSizing:"border-box",border:`1px solid ${l.border.default}`,borderRadius:l.radius.lg,backgroundColor:l.bg.subtle},children:C.map((n,s)=>{const c=[n.role,n.clickable?"tappable":""].filter(Boolean).join(" \xb7 ");return(0,t.jsxs)("button",{type:"button","aria-label":`Tap ${n.label}`,disabled:!n.enabled,onClick:()=>h(o,n),style:{display:"flex",width:"100%",minWidth:0,flexDirection:"column",alignItems:"flex-start",gap:2,padding:"6px 8px",boxSizing:"border-box",border:0,borderRadius:l.radius.md,backgroundColor:"transparent",fontFamily:"inherit",textAlign:"left",cursor:n.enabled?"pointer":"default",opacity:n.enabled?1:.5},children:[(0,t.jsx)("span",{style:Object.assign({},l.textSize.sm,{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:l.text.default}),children:n.label}),c&&(0,t.jsx)("span",{style:Object.assign({},l.textSize.xs,{color:l.text.tertiary}),children:c})]},`${n.id}-${s}`)})})]})};var t=r(d[0]),n=r(d[1]),l=r(d[2]),s=r(d[3]),o=r(d[4]),c=r(d[5]),b=r(d[6]);const u=320;function x({client:n}){if(n.accessibilityPending)return(0,t.jsx)(o.SectionNote,{role:"status",children:"Reading the screen\u2026"});if(n.accessibilityError)return(0,t.jsx)(o.SectionNote,{role:"alert",children:n.accessibilityError});const l=n.accessibility;return l?0===l.nodes.length?(0,t.jsx)(o.SectionNote,{children:"No accessible elements on this screen."}):(0,t.jsx)(o.SectionNote,{children:`Captured ${new Date(l.capturedAt).toLocaleTimeString()}`}):null}function h(t,n){const l=n.frame.x+n.frame.width/2,s=n.frame.y+n.frame.height/2;t.sendTouch({phase:"begin",x:l,y:s,edgeGestures:!1}),t.sendTouch({phase:"end",x:l,y:s})}},359,[153,38,355,360,361,362,363]);
|
|
441
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SIDEBAR_SECTION_INSET",{enumerable:!0,get:function(){return s}}),e.CollapsibleSection=function({title:p,open:f,onOpenChange:b,divider:h=!0,children:x}){const y=(0,n.useId)(),v=(0,o.usePrefersReducedMotion)(),j=u(f,v);return(0,t.jsxs)("section",{"aria-label":p,style:{minWidth:0,boxSizing:"border-box",padding:`0 ${s}px`,borderTop:h?`1px solid ${o.border.default}`:void 0},children:[(0,t.jsxs)("button",{type:"button","aria-expanded":f,"aria-controls":y,onClick:()=>b(!f),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",gap:12,padding:"18px 0",boxSizing:"border-box",border:0,backgroundColor:"transparent",color:o.text.default,fontFamily:"inherit",textAlign:"left",cursor:"pointer"},children:[(0,t.jsx)("span",{style:Object.assign({},o.heading.sm,{minWidth:0,color:o.text.default}),children:p}),(0,t.jsx)(o.ChevronDownIcon,{size:16,strokeWidth:1.5,color:o.icon.default,style:{flexShrink:0,transform:f?"rotate(0deg)":"rotate(-90deg)",transition:v?void 0:`transform ${l}ms ${c}`}})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateRows:f?"1fr":"0fr",transition:v?void 0:`grid-template-rows ${l}ms ${c}`},children:(0,t.jsx)("div",{id:y,"aria-hidden":!f||void 0,style:{minWidth:0,minHeight:0,overflow:"clip",overflowClipMargin:4,opacity:f?1:0,transition:v?void 0:`opacity ${l}ms ease`},children:j&&(0,t.jsx)("div",{style:{minWidth:0,paddingBottom:12},children:x})})})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2]);const s=16,l=200,c="cubic-bezier(0.16, 1, 0.3, 1)";function u(t,o){const[s,c]=(0,n.useState)(t),[u,p]=(0,n.useState)(!1);return s!==t&&(c(t),p(!t&&!o)),(0,n.useEffect)(()=>{if(!u)return;const t=window.setTimeout(()=>p(!1),l);return()=>window.clearTimeout(t)},[u]),t||u}},360,[153,38,355]);
|
|
442
442
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SectionNote=function({children:n,role:o,id:s}){return(0,t.jsx)("span",{id:s,role:o,"aria-live":"status"===o?"polite":void 0,style:Object.assign({},l.textSize.xs,{display:"block",padding:"0 0 8px",color:"alert"===o?l.text.danger:l.text.tertiary}),children:n})};var t=r(d[0]),l=r(d[1])},361,[153,355]);
|
|
443
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarActionButton=function({children:l,disabled:s=!1,destructive:c=!1,descriptionId:u,disabledReason:b,onClick:v}){return(0,t.jsx)(o.DisabledControlHint,{reason:s?b:void 0,label:
|
|
443
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarActionButton=function({children:l,disabled:s=!1,destructive:c=!1,descriptionId:u,disabledReason:b,onClick:v}){return(0,t.jsx)(o.DisabledControlHint,{reason:s?b:void 0,label:"string"==typeof l?l:void 0,children:(0,t.jsx)(n.PillButton,{disabled:s,"aria-describedby":u,destructive:c,onClick:v,children:l})})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},362,[153,355,349]);
|
|
444
444
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarRow=function({label:o,children:s,description:l,descriptionId:c}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,minHeight:28,boxSizing:"border-box",padding:"12px 0"},children:[(0,t.jsxs)("span",{style:{display:"flex",flex:1,minWidth:0,flexDirection:"column",gap:2},children:[(0,t.jsx)("span",{style:Object.assign({},n.textSize.sm,{fontWeight:500,color:n.text.secondary}),children:o}),l&&(0,t.jsx)("span",{id:c,style:Object.assign({},n.textSize.xs,{color:n.text.tertiary}),children:l})]}),s]})},e.SidebarSwitch=function({checked:b,disabled:u=!1,label:x,descriptionId:h,onChange:p}){return(0,t.jsx)("button",{type:"button",role:"switch","aria-checked":b,"aria-label":x,"aria-describedby":h,disabled:u,onClick:()=>p(!b),style:{width:o,height:s,padding:1,boxSizing:"border-box",flexShrink:0,border:`1px solid ${b?"transparent":n.border.default}`,borderRadius:n.radius.full,backgroundColor:b?n.text.default:n.bg.hover,cursor:u?"default":"pointer",opacity:u?.5:1,transition:`background-color ${c}, border-color ${c}`},children:(0,t.jsx)("span",{style:{display:"block",width:l,height:l,borderRadius:n.radius.full,backgroundColor:n.bg.default,boxShadow:n.shadow.xs,transform:`translateX(${b?16:0}px)`,transition:`transform ${c}`}})})};var t=r(d[0]),n=r(d[1]);const o=36,s=20,l=16,c="180ms cubic-bezier(.4, 0, .2, 1)"},363,[153,355]);
|
|
445
445
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CameraSection=function({client:x,defaultOpen:b=!1}){const[y,j]=(0,n.useState)(b),v=(0,n.useRef)({back:null,front:null}),C=x.camera,k=C?.wiredAtLaunch??!1;function S(t){v.current[t]?.click()}return(0,t.jsx)(o.CollapsibleSection,{title:"Camera",open:y,onOpenChange:j,children:null===C?(0,t.jsx)(l.SectionNote,{children:"Reading camera feeds\u2026"}):(0,t.jsxs)(t.Fragment,{children:[!k&&(0,t.jsx)(l.SectionNote,{children:h}),c.map(n=>{const o=C.feeds.find(t=>t.facing===n);if(!o)return null;const c=u[n],h=x.cameraPending.has(n),p=h||!k,b=p?{}:{onDragOver:t=>t.preventDefault(),onDrop:t=>{t.preventDefault();const s=t.dataTransfer.files[0];s&&x.setCameraImage(n,s)},onClick:()=>S(n),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),S(n))}};return(0,t.jsxs)("div",{style:{padding:"0 0 12px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"0 0 6px"},children:[(0,t.jsx)("span",{style:Object.assign({},s.textSize.sm,{fontWeight:500,color:s.text.secondary}),children:c}),(0,t.jsx)("span",{style:Object.assign({},s.textSize.xs,{color:s.text.tertiary}),children:f(o)})]}),(0,t.jsx)("div",Object.assign({role:"button",tabIndex:p?-1:0,"aria-disabled":p||void 0,"aria-label":`Choose a PNG for the ${n} camera`},b,{style:{aspectRatio:"4 / 3",width:"100%",boxSizing:"border-box",backgroundColor:s.bg.subtle,border:`1px solid ${s.border.default}`,borderRadius:s.radius.md,overflow:"hidden",cursor:p?"default":"pointer"},children:o.imageUrl&&(0,t.jsx)("img",{src:o.imageUrl,alt:`${c} image`,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})})),(0,t.jsxs)("div",{style:{display:"flex",gap:8,padding:"8px 0 0"},children:[(0,t.jsx)(s.Button,{theme:"secondary",size:"xs",disabled:p,onClick:()=>S(n),children:"Choose PNG\u2026"}),(0,t.jsx)(s.Button,{theme:"tertiary",size:"xs",disabled:p||o.placeholder,onClick:()=>x.clearCameraImage(n),children:"Reset"})]}),h&&(0,t.jsx)(l.SectionNote,{role:"status",children:`Updating ${n} camera\u2026`}),(0,t.jsx)("input",{ref:t=>{v.current[n]=t},type:"file",accept:"image/png",onChange:t=>{const s=t.target.files?.[0];s&&x.setCameraImage(n,s),t.target.value=""},style:{display:"none"}})]},n)}),x.cameraError&&(0,t.jsx)(l.SectionNote,{role:"alert",children:x.cameraError}),(0,t.jsx)(l.SectionNote,{children:p})]})})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]);const c=["back","front"],u={back:"Back camera",front:"Front camera"},h="This emulator started without camera feeds. Shut it down and boot it from Hub to attach them.",p="PNG only. The app sees a new image after it reopens the camera.";function f(t){if(null===t.imageUrl)return"No image";const n=[];var s;return null!==t.width&&null!==t.height&&n.push(`${t.width}\xd7${t.height}`),t.placeholder?n.push("Test card"):null!==t.bytes&&n.push((s=t.bytes)<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`),n.join(" \xb7 ")||"Image set"}},364,[153,38,355,360,361]);
|
|
446
446
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PermissionsSection=function({client:h,defaultOpen:x=!1}){const[u,j]=(0,n.useState)(x),{permissions:f,permissionsPending:y,permissionsError:S,refreshPermissions:b}=h,k=h.foregroundApp?.id??null;return(0,n.useEffect)(()=>{u&&k&&b()},[u,k,b]),(0,s.jsxs)(o.CollapsibleSection,{title:"Permissions",open:u,onOpenChange:j,children:[null===k?(0,s.jsx)(l.SectionNote,{children:"No app is in the foreground."}):null===f?S?(0,s.jsx)("div",{style:{padding:"0 0 12px"},children:(0,s.jsx)(t.Button,{theme:"secondary",size:"xs",onClick:b,children:"Retry"})}):(0,s.jsx)(l.SectionNote,{children:"Reading permissions\u2026"}):0===f.length?(0,s.jsx)(l.SectionNote,{children:"This app declares no runtime permissions."}):(0,s.jsxs)(s.Fragment,{children:[f.map(n=>{const o=y.has(n.id);return(0,s.jsx)(c.SidebarRow,{label:n.label,description:o?"Updating\u2026":p[n.state],children:(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexShrink:0},children:[(0,s.jsx)(t.Button,{theme:"secondary",size:"xs",disabled:o||"granted"===n.state,onClick:()=>h.setPermission(n.id,"grant"),children:"Grant"}),(0,s.jsx)(t.Button,{theme:"tertiary",size:"xs",disabled:o||"denied"===n.state,onClick:()=>h.setPermission(n.id,"revoke"),children:"Revoke"})]})},n.id)}),(0,s.jsx)("div",{style:{padding:"4px 0 12px"},children:(0,s.jsx)(t.Button,{theme:"tertiary",size:"xs",disabled:y.size>0,onClick:h.resetPermissions,children:"Reset all"})})]}),S&&(0,s.jsx)(l.SectionNote,{role:"alert",children:S})]})};var s=r(d[0]),n=r(d[1]),t=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]);const p={granted:"Granted",denied:"Denied",limited:"Limited",undetermined:"Not asked"}},365,[153,38,355,360,361,363]);
|
|
447
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CurrentAppSection=function({client:c}){const[b,f]=(0,l.useState)(!0),j=c?.foregroundApp??null,y=j?j.label??j.id:x,v=[{label:
|
|
448
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ActivityCharts=h,e.ActivitySection=function({client:s}){const[o,c]=(0,n.useState)(!1);return(0,t.jsx)(l.CollapsibleSection,{title:"Activity",open:o,onOpenChange:c,children:(0,t.jsx)(h,{client:s})})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),l=r(d[3]),o=r(d[4]);const c=100;function u(t){const n=Number.isFinite(t)?Math.max(0,t):0;return n<1024?`${Math.round(n)} B`:n<1048576?`${(n/1024).toFixed(n<10240?1:0)} KB`:n<1073741824?`${(n/1048576).toFixed(n<10485760?1:0)} MB`:`${(n/1073741824).toFixed(1)} GB`}function p(t){return t.at(-1)??null}function h({client:n}){const l=n?.activity??null,h=l?.samples.slice(-60)??[],x=p(h),v=[{label:
|
|
449
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.maxChartValue=function(t,s=1){return Math.max(s,...t.flatMap(t=>t.values))},e.MetricChart=function({title:x,value:f,description:b,series:y,maxValue:j}){const $=(0,n.useId)(),v=b?`${$}-description`:void 0,k=y.filter(t=>t.values.length>0).map((t,s)=>Object.assign({},t,{points:p(t.values,j),index:s})),M=k.length>1?` (${k.map(t=>t.label).join(
|
|
450
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NO_DEVICE_FRAME_DESCRIPTION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"NO_HARDWARE_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"ONSCREEN_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return D}}),e.DeviceOptionsSection=function({client:O,deviceFrame:I,showDeviceSettings:B=!0,onShutdown:L,onRemove:A}){const[_,z]=(0,n.useState)(!0),E=(0,o.areRecordingControlsLocked)(O?.screenRecording??null),P=E?
|
|
447
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CurrentAppSection=function({client:c}){const[b,f]=(0,l.useState)(!0),j=c?.foregroundApp??null,y=j?j.label??j.id:x,v=[{label:"App ID",value:j?.id??x},{label:"Version",value:j?.version??x},{label:"Build number",value:j?.build??x}];return(0,t.jsxs)(o.CollapsibleSection,{title:"Current app",open:b,onOpenChange:f,divider:!1,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"4px 0 12px"},children:[(0,t.jsxs)("div",{style:{display:"flex",minWidth:0,flexDirection:"column",gap:4},children:[(0,t.jsx)("span",{title:y,style:Object.assign({},n.heading.base,{color:j?n.text.default:n.text.tertiary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),children:y}),(j?.isReactNative||j?.debuggable)&&(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[j?.isReactNative&&(0,t.jsx)(p,{color:"info",children:"React Native"}),j?.debuggable&&(0,t.jsx)(p,{color:"warning",children:"debuggable"})]})]}),(0,t.jsx)(h,{iconDataUrl:j?.iconDataUrl})]}),(0,t.jsx)("dl",{style:{margin:0},children:v.map(l=>(0,t.jsx)(u,{detail:l},l.label))}),c?.capabilities.activity&&(0,t.jsx)(s.ActivityCharts,{client:c})]})};var t=r(d[0]),l=r(d[1]),n=r(d[2]),s=r(d[3]),o=r(d[4]);const c=40,x="unknown";function h({iconDataUrl:l}){return(0,t.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"center",width:c,height:c,flexShrink:0,boxSizing:"border-box",overflow:"hidden",border:l?void 0:`1px solid ${n.border.default}`,borderRadius:n.radius.lg,backgroundColor:n.bg.element},children:l?(0,t.jsx)("img",{src:l,alt:"",width:c,height:c,style:{display:"block",width:"100%",height:"100%",objectFit:"cover"}}):(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:n.icon.quaternary}),(0,t.jsx)("path",{d:"M10 4v4h12",stroke:n.icon.quaternary})]})})}function u({detail:l}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"8px 0"},children:[(0,t.jsx)("dt",{style:Object.assign({},n.textSize.sm,{fontWeight:500,flexShrink:0,margin:0,color:n.text.secondary}),children:l.label}),(0,t.jsx)("dd",{title:l.value,style:Object.assign({},n.textSize.sm,{minWidth:0,margin:0,color:n.text.default,fontFamily:n.font.mono,textAlign:"right",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"}),children:l.value})]})}function p({color:l,children:s}){return(0,t.jsx)("span",{style:Object.assign({},n.textSize.xs,{color:n.text[l],background:n.bg[l],borderRadius:n.radius.full,padding:"0 8px",fontWeight:500,flexShrink:0}),children:s})}},366,[153,38,355,367,360]);
|
|
448
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ActivityCharts=h,e.ActivitySection=function({client:s}){const[o,c]=(0,n.useState)(!1);return(0,t.jsx)(l.CollapsibleSection,{title:"Activity",open:o,onOpenChange:c,children:(0,t.jsx)(h,{client:s})})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),l=r(d[3]),o=r(d[4]);const c=100;function u(t){const n=Number.isFinite(t)?Math.max(0,t):0;return n<1024?`${Math.round(n)} B`:n<1048576?`${(n/1024).toFixed(n<10240?1:0)} KB`:n<1073741824?`${(n/1048576).toFixed(n<10485760?1:0)} MB`:`${(n/1073741824).toFixed(1)} GB`}function p(t){return t.at(-1)??null}function h({client:n}){const l=n?.activity??null,h=l?.samples.slice(-60)??[],x=p(h),v=[{label:"CPU",color:s.icon.success,values:h.map(t=>t.cpuPct)}],y=[{label:"Memory",color:s.icon.info,values:h.map(t=>t.memBytes)}],b=[{label:"Inbound",color:s.icon.preview,values:h.map(t=>t.netInBytesPerSec)},{label:"Outbound",color:s.icon.preview,dashed:!0,values:h.map(t=>t.netOutBytesPerSec)}],f=l?.hostCores??null,C=f?`Percent of one core. The host has ${f} cores, so the app can reach ${100*f}%.`:void 0;let j=null;return l?.errored?j="Activity data is unavailable for this app.":x?l?.stale&&(j="Activity data is paused. Showing the most recent samples."):j="Waiting for activity data\u2026",(0,t.jsxs)("div",{"data-testid":"activity-charts",style:{minWidth:0,paddingTop:8},children:[j&&(0,t.jsx)("span",{role:l?.errored?"alert":void 0,style:Object.assign({},s.textSize.xs,{display:"block",padding:"2px 0 8px",color:s.text.tertiary}),children:j}),x&&(0,t.jsxs)("div",{style:{display:"flex",minWidth:0,flexDirection:"column",gap:4,paddingTop:j?0:4},children:[(0,t.jsx)(o.MetricChart,{title:"CPU",value:`${Math.round(x.cpuPct)}%`,description:C,series:v,maxValue:(0,o.maxChartValue)(v,c)}),(0,t.jsx)(o.MetricChart,{title:"Memory",value:u(x.memBytes),series:y,maxValue:(0,o.maxChartValue)(y)}),(0,t.jsx)(o.MetricChart,{title:"Network",value:`\u2191 ${u(x.netOutBytesPerSec)}/s \xb7 \u2193 ${u(x.netInBytesPerSec)}/s`,description:"Solid line: inbound. Dashed line: outbound.",series:b,maxValue:(0,o.maxChartValue)(b)})]})]})}},367,[153,38,355,360,368]);
|
|
449
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.maxChartValue=function(t,s=1){return Math.max(s,...t.flatMap(t=>t.values))},e.MetricChart=function({title:x,value:f,description:b,series:y,maxValue:j}){const $=(0,n.useId)(),v=b?`${$}-description`:void 0,k=y.filter(t=>t.values.length>0).map((t,s)=>Object.assign({},t,{points:p(t.values,j),index:s})),M=k.length>1?` (${k.map(t=>t.label).join(", ")})`:"";return(0,t.jsxs)("div",{title:b,style:{minWidth:0,overflow:"hidden",borderRadius:o.radius.lg,backgroundColor:o.bg.subtle},children:[(0,t.jsxs)("svg",{role:"img","aria-label":`${x}: ${f}${M}`,"aria-describedby":v,viewBox:`0 0 ${l} ${c}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:c,overflow:"visible"},children:[(0,t.jsx)("defs",{children:k.slice(0,1).map(s=>(0,t.jsxs)("linearGradient",{id:`${$}-${s.index}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0",stopColor:s.color,stopOpacity:"0.55"}),(0,t.jsx)("stop",{offset:"1",stopColor:s.color,stopOpacity:"0"})]},s.label))}),k.slice(0,1).map(s=>(0,t.jsx)("path",{d:h(s.points),fill:`url(#${$}-${s.index})`,stroke:"none"},`${s.label}-area`)),k.map(s=>(0,t.jsx)("path",{d:u(s.points),fill:"none",stroke:s.color,strokeWidth:"2",strokeDasharray:s.dashed?"4 3":void 0,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},s.label))]}),(0,t.jsxs)("div",{style:{display:"flex",minWidth:0,alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 10px"},children:[(0,t.jsx)("span",{style:Object.assign({},o.textSize.xs,{minWidth:0,color:o.text.secondary}),children:x}),(0,t.jsx)("span",{style:Object.assign({},o.textSize.xs,{flexShrink:0,color:o.text.default,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}),children:f})]}),b&&(0,t.jsx)(s.VisuallyHidden,{id:v,children:b})]})};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]);const l=100,c=48,x=47;function p(t,s){const n=Math.max(s,1),o=t=>{const s=Number.isFinite(t)?Math.max(0,t):0,o=Math.min(1,s/n);return x-45*o};if(1===t.length){const s=o(t[0]);return[{x:0,y:s},{x:l,y:s}]}return t.map((s,n)=>({x:n/(t.length-1)*l,y:o(s)}))}function u(t){return t.map((t,s)=>`${0===s?"M":"L"} ${t.x.toFixed(2)} ${t.y.toFixed(2)}`).join(" ")}function h(t){const s=t[0],n=t.at(-1);return`${u(t)} L ${n.x.toFixed(2)} ${c} L ${s.x.toFixed(2)} ${c} Z`}},368,[153,299,38,355]);
|
|
450
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NO_DEVICE_FRAME_DESCRIPTION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"NO_HARDWARE_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"ONSCREEN_KEYBOARD_DESCRIPTION",{enumerable:!0,get:function(){return D}}),e.DeviceOptionsSection=function({client:O,deviceFrame:I,showDeviceSettings:B=!0,onShutdown:L,onRemove:A}){const[_,z]=(0,n.useState)(!0),E=(0,o.areRecordingControlsLocked)(O?.screenRecording??null),P=E?"unknown"===O?.screenRecording?"Unavailable until recording status is known.":"Unavailable because this would interrupt the recording.":void 0,N=(0,n.useId)(),K=(0,n.useId)(),T=(0,n.useId)(),X=O?.deviceSettings??null,F="ready"===O?.deviceSettingsStatus,M=!1===O?.hardwareKeyboardConnected,q=O?.deviceSettingsPending??R,V=O?.platform,G=O?.displayWidthDp??null;function U(l){return null===X?"appearance"===l||"ios"===V:void 0!==X[l]&&"unsupported"!==X[l]}function W(l){return X?.[l]??v[l]}function Y(l){return!F||null===X||q.has(l)}function H(l,n){Y(l)||O?.setDeviceSetting(l,n)}function $(n,o,s){return(0,l.jsx)(u.SidebarRow,{label:o,children:(0,l.jsx)(t.Select,{ariaLabel:o,options:s,value:W(n),disabled:Y(n),onChange:l=>H(n,l)})})}const J=B&&"ios"===O?.platform;return(0,l.jsxs)(s.CollapsibleSection,{title:"Device options",open:_,onOpenChange:z,children:[B&&U("appearance")&&$("appearance","Appearance",h),B&&"ios"===V&&U("liquid-glass")&&$("liquid-glass","Liquid glass",S),B&&"ios"===V&&U("color-filter")&&$("color-filter","Color filter",f),B&&"android"===V&&U("network")&&$("network","Network",p),B&&("ios"===V||"android"===V)&&U("text-size")&&$("text-size","Text size","android"===V?w:y),B&&"android"===V&&U("display-size")&&(0,l.jsx)(u.SidebarRow,{label:"Display size",description:null===G?void 0:`sw${G}dp`,descriptionId:null===G?void 0:K,children:(0,l.jsx)(t.Select,{ariaLabel:"Display size",ariaDescribedBy:null===G?void 0:K,options:k,value:W("display-size"),disabled:Y("display-size"),onChange:l=>H("display-size",l)})}),B&&x.map(({key:n,label:o})=>U(n)?(0,l.jsx)(u.SidebarRow,{label:o,children:(0,l.jsx)(u.SidebarSwitch,{checked:"on"===W(n),disabled:Y(n),label:o,onChange:l=>H(n,l?"on":"off")})},n):null),B&&"android"===V&&U("onscreen-keyboard")&&(0,l.jsx)(u.SidebarRow,{label:"Force on-screen keyboard",description:M?C:D,descriptionId:T,children:(0,l.jsx)(u.SidebarSwitch,{checked:"on"===W("onscreen-keyboard"),disabled:M||Y("onscreen-keyboard"),label:"Force on-screen keyboard",descriptionId:T,onChange:l=>H("onscreen-keyboard",l?"on":"off")})}),I&&(0,l.jsx)(u.SidebarRow,{label:"Show device frame",description:I.available?void 0:j,descriptionId:I.available?void 0:N,children:(0,l.jsx)(u.SidebarSwitch,{checked:I.available&&I.visible,disabled:!I.available,label:"Show device frame",descriptionId:I.available?void 0:N,onChange:I.onVisibleChange})}),J&&O&&(0,l.jsx)(c.KeyboardSection,{client:O}),O&&"android"===V&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.SidebarRow,{label:"Back button",children:(0,l.jsx)(b.SidebarActionButton,{onClick:()=>O.pressButton("back"),children:"Press"})}),(0,l.jsx)(u.SidebarRow,{label:"Recents button",children:(0,l.jsx)(b.SidebarActionButton,{onClick:()=>O.pressButton("recents"),children:"Press"})}),(0,l.jsx)(u.SidebarRow,{label:"Dismiss on-screen keyboard",children:(0,l.jsx)(b.SidebarActionButton,{onClick:()=>O.pressButton("hideKeyboard"),children:"Press"})})]}),O&&L&&(0,l.jsx)(u.SidebarRow,{label:"Shut down device",children:(0,l.jsx)(b.SidebarActionButton,{disabled:E,disabledReason:P,onClick:L,children:"Shut down"})}),O&&A&&(0,l.jsx)(u.SidebarRow,{label:"Remove device",children:(0,l.jsx)(b.SidebarActionButton,{destructive:!0,disabled:E,disabledReason:P,onClick:A,children:"Remove"})})]})};var l=r(d[0]),n=r(d[1]),o=r(d[2]),t=r(d[3]),s=r(d[4]),c=r(d[5]),b=r(d[6]),u=r(d[7]);const v={appearance:"light",network:"on","liquid-glass":"clear","color-filter":"none","text-size":"large","display-size":"medium","reduce-motion":"off","bold-text":"off","increase-contrast":"off","onscreen-keyboard":"off","show-borders":"off","reduce-transparency":"off",voiceover:"off"},h=[{value:"light",label:"Light"},{value:"dark",label:"Dark"}],p=[{value:"on",label:"On"},{value:"off",label:"Off"}],S=[{value:"clear",label:"Clear"},{value:"tinted",label:"Tinted"}],f=[{value:"none",label:"None"},{value:"grayscale",label:"Grayscale"},{value:"red-green",label:"Red-green"},{value:"green-red",label:"Green-red"},{value:"blue-yellow",label:"Blue-yellow"}],y=[{value:"extra-small",label:"XS"},{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"extra-large",label:"XL"},{value:"extra-extra-large",label:"2XL"},{value:"extra-extra-extra-large",label:"3XL"}],w=[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"extra-large",label:"XL"}],k=[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"extra-large",label:"XL"}],x=[{key:"reduce-motion",label:"Reduce motion"},{key:"bold-text",label:"Bold text"},{key:"increase-contrast",label:"Increase contrast"},{key:"show-borders",label:"Show borders"},{key:"reduce-transparency",label:"Reduce transparency"},{key:"voiceover",label:"VoiceOver"}],R=new Set,j="No device frame for selected device.",C="This device has no hardware keyboard, so the on-screen keyboard always shows.",D="Keeps the on-screen keyboard visible while a hardware keyboard is attached. A device with no hardware keyboard always shows it."},369,[153,38,148,355,360,370,362,363]);
|
|
451
451
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.KeyboardSection=function({client:t}){const c=t.hardwareKeyboardConnected;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.SidebarRow,{label:"Hardware keyboard",children:(0,n.jsx)(o.SidebarActionButton,{disabled:null===c,onClick:()=>t.setHardwareKeyboardConnected(!c),children:"Toggle"})}),(0,n.jsx)(l.SidebarRow,{label:"Software keyboard",children:(0,n.jsx)(o.SidebarActionButton,{disabled:null===c,onClick:()=>t.toggleSoftwareKeyboard(),children:"Toggle"})})]})};var n=r(d[0]),o=r(d[1]),l=r(d[2])},370,[153,362,363]);
|
|
452
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EventsSection=function({client:v}){const[u,l]=(0,n.useState)(!1),h=v?.events,E=v?.eventsEnabled??!1,p=v?.attachEvents,S=v?.detachEvents,b=(0,n.useMemo)(()=>(h??[]).map(t=>({id:t.id,source:t.source,message:t.message})),[h]);return(0,n.useEffect)(()=>(u?p?.():S?.(),()=>S?.()),[p,S,u]),(0,t.jsxs)(s.CollapsibleSection,{title:"Events",open:u,onOpenChange:l,children:[(0,t.jsx)(o.LogControls,{count:h?.length??0,running:E,unit:"event",onClear:()=>v?.clearEvents(),onStart:()=>v?.attachEvents(),onStop:()=>v?.detachEvents()}),(0,t.jsx)(c.LogList,{logs:b,enabled:E,emptyMessage:E?
|
|
453
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogControls=function({count:l,running:s,unit:c="line",onClear:x,onStart:u,onStop:f}){return(0,t.jsxs)("div",{style:{display:
|
|
454
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogList=function({logs:u=[],enabled:b=!1,emptyMessage:h}){const x=(0,l.useRef)(null);(0,l.useEffect)(()=>{const o=x.current;o&&(o.scrollTop=o.scrollHeight)},[u]);const p=h??(b?
|
|
455
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogRow=function({entry:n}){const o=n.message.length>68?`${n.message.slice(0,68)}\u2026`:n.message;return(0,s.jsxs)("div",{style:{display:
|
|
452
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EventsSection=function({client:v}){const[u,l]=(0,n.useState)(!1),h=v?.events,E=v?.eventsEnabled??!1,p=v?.attachEvents,S=v?.detachEvents,b=(0,n.useMemo)(()=>(h??[]).map(t=>({id:t.id,source:t.source,message:t.message})),[h]);return(0,n.useEffect)(()=>(u?p?.():S?.(),()=>S?.()),[p,S,u]),(0,t.jsxs)(s.CollapsibleSection,{title:"Events",open:u,onOpenChange:l,children:[(0,t.jsx)(o.LogControls,{count:h?.length??0,running:E,unit:"event",onClear:()=>v?.clearEvents(),onStart:()=>v?.attachEvents(),onStop:()=>v?.detachEvents()}),(0,t.jsx)(c.LogList,{logs:b,enabled:E,emptyMessage:E?"No events yet. Touch or interact with the device to see them here.":"Events are paused. Press Start to observe device events."})]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=r(d[4])},371,[153,38,360,372,373]);
|
|
453
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogControls=function({count:l,running:s,unit:c="line",onClear:x,onStart:u,onStop:f}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,width:"100%",minWidth:0,boxSizing:"border-box"},children:[(0,t.jsxs)("span",{style:Object.assign({},n.textSize["2xs"],{flex:1,minWidth:0,fontFamily:n.font.mono,fontWeight:400,color:n.text.tertiary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),children:[l," ",1===l?c:`${c}s`]}),(0,t.jsx)(o.SidebarActionButton,{onClick:s?f:u,children:s?"Stop":"Start"}),(0,t.jsx)(o.SidebarActionButton,{disabled:0===l,onClick:x,children:"Clear"})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2])},372,[153,355,362]);
|
|
454
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogList=function({logs:u=[],enabled:b=!1,emptyMessage:h}){const x=(0,l.useRef)(null);(0,l.useEffect)(()=>{const o=x.current;o&&(o.scrollTop=o.scrollHeight)},[u]);const p=h??(b?"No logs. The stream resumes on the next event.":"Logs are paused. Press Start to stream device logs.");return(0,o.jsxs)("div",{ref:x,className:"hub-log-scroll",style:c,children:[(0,o.jsx)("style",{children:s}),0===u.length?(0,o.jsx)("div",{style:{display:"flex",flex:1,alignItems:"center",justifyContent:"center",padding:"40px 24px",textAlign:"center"},children:(0,o.jsx)("span",{style:Object.assign({},n.textSize.xs,{color:n.text.secondary}),children:p})}):u.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={height:200,flexShrink:0,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",overflowAnchor:"none"}},373,[153,38,355,374]);
|
|
455
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogRow=function({entry:n}){const o=n.message.length>68?`${n.message.slice(0,68)}\u2026`:n.message;return(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:"8px 0",borderBottom:`1px solid ${t.border.secondary}`},children:[(0,s.jsx)("span",{style:Object.assign({},t.textSize["2xs"],{padding:"1px 5px",borderRadius:t.radius.sm,backgroundColor:t.bg.element,fontFamily:t.font.mono,color:t.text.tertiary,flexShrink:0,marginTop:1}),children:n.source}),(0,s.jsx)("span",{title:n.message,style:Object.assign({},t.textSize.xs,{flex:1,minWidth:0,color:t.text.secondary,overflowWrap:"anywhere"}),children:o})]})};var s=r(d[0]),t=r(d[1])},374,[153,355]);
|
|
456
456
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LocationSection=function({client:b,defaultOpen:p=!1}){const[S,f]=(0,n.useState)(p),[h,j]=(0,n.useState)(null),[L,v]=(0,n.useState)(null),C=(0,n.useId)(),F=b.capabilities.location;if(!1===F)return null;const P=h??(0,x.draftFromFix)(b.location),y=b.locationPending;function N(t,n){v(null),j(Object.assign({},P,{[t]:n}))}function O(t){const n=(0,x.pastedPair)(t);return!!n&&(v(null),j(n),!0)}function T(t){v(null),b.setLocation(t)}function I(){const t=(0,x.parseGeoFixInput)(P);t.ok?T(t.fix):v(t.error)}return(0,t.jsxs)(l.CollapsibleSection,{title:"Location",open:S,onOpenChange:f,children:[(0,t.jsx)(c.SidebarRow,{label:"Preset",children:(0,t.jsx)(o.Select,{ariaLabel:"Location preset",value:(0,x.presetFor)(P),options:x.PRESET_OPTIONS,disabled:y,onChange:t=>{const n=(0,x.presetFix)(t);n&&(j((0,x.draftFromFix)(n)),T(n))}})}),(0,t.jsx)(c.SidebarRow,{label:"Latitude",children:(0,t.jsx)(u.SidebarTextInput,{ariaLabel:"Latitude",value:P.latitude,disabled:y,invalid:"latitude"===L?.field,describedBy:"latitude"===L?.field?C:void 0,onChange:t=>N("latitude",t),onPasteText:O,onSubmit:I})}),(0,t.jsx)(c.SidebarRow,{label:"Longitude",children:(0,t.jsx)(u.SidebarTextInput,{ariaLabel:"Longitude",value:P.longitude,disabled:y,invalid:"longitude"===L?.field,describedBy:"longitude"===L?.field?C:void 0,onChange:t=>N("longitude",t),onPasteText:O,onSubmit:I})}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,padding:"4px 0 8px"},children:[(0,t.jsx)(o.Button,{theme:"secondary",size:"xs",disabled:y,onClick:I,children:"Set location"}),F.clear&&(0,t.jsx)(o.Button,{theme:"tertiary",size:"xs",disabled:y,onClick:()=>b.clearLocation(),children:"Clear"})]}),y&&(0,t.jsx)(s.SectionNote,{role:"status",children:"Updating location\u2026"}),L&&(0,t.jsx)(s.SectionNote,{id:C,role:"alert",children:L.message}),b.locationError&&(0,t.jsx)(s.SectionNote,{role:"alert",children:b.locationError}),(0,t.jsx)(s.SectionNote,{children:b.location?`Last set: ${(0,x.formatFix)(b.location)}`:"No fix set in this session."})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]),c=r(d[5]),u=r(d[6]),x=r(d[7])},375,[153,38,355,360,361,363,376,377]);
|
|
457
457
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarTextInput=function({ariaLabel:s,value:u,disabled:c=!1,invalid:b=!1,describedBy:f,onChange:p,onSubmit:y,onPasteText:v}){const[x,C]=(0,o.useState)(!1);return(0,t.jsx)("input",{type:"text",inputMode:"decimal","aria-label":s,"aria-invalid":b||void 0,"aria-describedby":f,value:u,disabled:c,autoComplete:"off",spellCheck:!1,onChange:t=>p(t.currentTarget.value),onPaste:t=>{v?.(t.clipboardData.getData("text"))&&t.preventDefault()},onFocus:t=>C((0,l.isFocusVisible)(t)),onBlur:()=>C(!1),onKeyDown:t=>{"Enter"===t.key&&y()},style:Object.assign({},(0,l.pillControlStyle)({focused:x,disabled:c}),{display:"inline-block",width:n,border:`1px solid ${b?l.border.danger:l.border.default}`,textAlign:"right",fontFamily:l.font.mono,caretColor:l.text.default,cursor:c?"default":"text"})})};var t=r(d[0]),o=r(d[1]),l=r(d[2]);const n=128},376,[153,38,355]);
|
|
458
458
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CUSTOM_PRESET",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"LOCATION_PRESETS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"PRESET_OPTIONS",{enumerable:!0,get:function(){return u}}),e.parseGeoFixInput=s,e.pastedPair=function(t){const n=t.split(",");if(2!==n.length)return null;const l=n[0].trim(),u=n[1].trim();return""===l||""===u?null:{latitude:l,longitude:u}},e.draftFromFix=function(t){return t?{latitude:x(t.latitude),longitude:x(t.longitude)}:{latitude:"",longitude:""}},e.formatFix=function(t){return`${t.latitude.toFixed(4)}, ${t.longitude.toFixed(4)}`},e.presetFor=function(t){const u=s(t);if(!u.ok)return n;const o=l.find(({fix:t})=>t.latitude===u.fix.latitude&&t.longitude===u.fix.longitude);return o?o.value:n},e.presetFix=function(t){const n=l.find(n=>n.value===t);return n?n.fix:null};const t={latitude:{min:-90,max:90,label:"Latitude"},longitude:{min:-180,max:180,label:"Longitude"}},n="custom",l=[{value:"apple-park",label:"Apple Park",fix:{latitude:37.3349,longitude:-122.009}},{value:"googleplex",label:"Googleplex",fix:{latitude:37.422,longitude:-122.0841}},{value:"london",label:"London",fix:{latitude:51.5072,longitude:-.1276}},{value:"tokyo",label:"Tokyo",fix:{latitude:35.6762,longitude:139.6503}},{value:"sydney",label:"Sydney",fix:{latitude:-33.8688,longitude:151.2093}}],u=[{value:n,label:"Custom",disabled:!0},...l.map(({value:t,label:n})=>({value:t,label:n}))],o=/^[+-]?(\d+\.?\d*|\.\d+)$/;function f(n,l){const{min:u,max:f}=t[n],c=l.trim();if(!o.test(c))return null;const s=Number(c);return s>=u&&s<=f?s:null}function c(n){const{min:l,max:u,label:o}=t[n];return{field:n,message:`${o} must be a number from ${l} to ${u}`}}function s(t){const n=f("latitude",t.latitude);if(null===n)return{ok:!1,error:c("latitude")};const l=f("longitude",t.longitude);return null===l?{ok:!1,error:c("longitude")}:{ok:!0,fix:{latitude:n,longitude:l}}}function x(t){return t.toFixed(7).replace(/0+$/,"").replace(/\.$/,"")}},377,[]);
|
|
459
459
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.LogsSection=function({client:c}){const[u,L]=(0,t.useState)(!1),h=c?.logs??[],f=c?.logsEnabled??!1,p=c?.attachLogs,S=c?.detachLogs;return(0,t.useEffect)(()=>(u?p?.():S?.(),()=>S?.()),[p,S,u]),(0,o.jsxs)(n.CollapsibleSection,{title:"Logs",open:u,onOpenChange:L,children:[(0,o.jsx)(s.LogControls,{count:h.length,running:f,onClear:()=>c?.clearLogs(),onStart:()=>c?.attachLogs(),onStop:()=>c?.detachLogs()}),(0,o.jsx)(l.LogList,{logs:h,enabled:f})]})};var o=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]),l=r(d[4])},378,[153,38,360,372,373]);
|
|
460
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamOptionsSection=function({client:T,defaultOpen:E=!1,streamMode:L="mjpeg",httpCodec:A,streamModeAvailability:N=h,onStreamModeChange:G,onHttpCodecChange:H}){const[W,$]=(0,t.useState)(E),B=(0,n.areRecordingControlsLocked)(T.screenRecording),D=B?
|
|
461
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamStatistics=function({stats:P,platform:M}){const w=P?.samples.slice(-60)??[],B=w.at(-1)??null,$=P?.encoder??null,R=P?.capture??null,T=R?.grpc??null,k=w.some(l=>null!==l.clientFps||null!==l.clientBitrateBps),N=[{label:
|
|
462
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_FRAME_PROFILE_IDS",{enumerable:!0,get:function(){return n}}),e.isDeviceFrameProfileId=function(o){return n.some(n=>n===o)};const n=[
|
|
463
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamPanel=function({device:v,client:h,agentInteraction:f,DeviceScreen:u,displayScreen:S,framed:b=!0,showDeviceFrame:y=!0,deviceFrameAssets:j}){const T=(0,c.useScreenshotToast)(h,v.name),D=h.deviceSettings?.appearance,w=
|
|
464
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_TITLE_HEIGHT",{enumerable:!0,get:function(){return b}}),e.DeviceTitle=function({device:b,status:u,recording:f=null}){const[x,C]=(0,n.useState)(null),h=x===b.id,p=h?b.id:b.name,S=s[u];return(0,o.jsx)(l.Button,{theme:"tertiary",size:c,onClick:()=>C(h?null:b.id),leftSlot:(0,o.jsx)("span",{title:p,style:{display:
|
|
460
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamOptionsSection=function({client:T,defaultOpen:E=!1,streamMode:L="mjpeg",httpCodec:A,streamModeAvailability:N=h,onStreamModeChange:G,onHttpCodecChange:H}){const[W,$]=(0,t.useState)(E),B=(0,n.areRecordingControlsLocked)(T.screenRecording),D=B?"unknown"===T.screenRecording?"Unavailable until recording status is known.":"Unavailable until recording finishes.":void 0,I=T.streamCapabilities??v,J={mjpeg:N.mjpeg&&I.modeAvailability.mjpeg,h264:N.h264&&I.modeAvailability.h264,webrtc:N.webrtc&&I.modeAvailability.webrtc},O=(0,n.resolveDeviceStreamMode)(L,J),V="android"===T.platform?"websocket":"http",k="android"===T.platform?"WebSocket":"HTTP",Q=R.filter(l=>I.httpCodecs.includes(l.value)),q=C.filter(l=>I.webRtcCodecs.includes(l.value)),_=T.streamSettings??p,z=T.capabilities.streamSettings,U=T.streamSource,K=T.streamSourceError??("grpc-screenshot"===U?.mode?U.hardwareEncoderError:void 0),X=S.filter(l=>U?.availableModes.includes(l.value)),Y=x.filter(l=>U?.availableInputSources.includes(l.value)),Z=null!==T.streamSettings,ee=B||!Z||T.streamSettingsPending,ae="webrtc"===O?"webrtc":V,le=T.setStreamStatsEnabled,te=J.mjpeg||J.h264,ie=[{value:V,label:k,disabled:!te},{value:"webrtc",label:"WebRTC",disabled:!J.webrtc}];function re(l){return"h264"===l?J.h264:"mjpeg"===l?J.mjpeg:te}(0,t.useEffect)(()=>(le(W&&"webrtc"===ae),()=>le(!1)),[W,le,ae]);const ne=A??("mjpeg"===O?"mjpeg":"h264"===O?"h264":"auto"),oe="mjpeg"===O||"h264"===O?O:null,se=(oe&&I.httpCodecs.includes(oe)&&re(oe)?oe:void 0)??Q.find(l=>re(l.value))?.value,de=I.httpCodecs.includes(ne)&&re(ne)?ne:se??ne,ce=I.webRtcCodecs.includes(T.webRtcCodec)?T.webRtcCodec:q[0]?.value??T.webRtcCodec,be="webrtc"===ae||J.h264&&"mjpeg"!==de;function ue(l){return"mjpeg"===l?"mjpeg":J.h264?"h264":"mjpeg"}function pe(l,t){ee||T.updateStreamSettings({[l]:t})}const me=I.modeAvailability.h264&&!N.h264||I.modeAvailability.webrtc&&!N.webrtc,ge="android"===T.platform&&!I.modeAvailability.webrtc;return(0,l.jsxs)(s.CollapsibleSection,{title:"Stream options",open:W,onOpenChange:$,children:[U&&X.length>1&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(b.SidebarRow,{label:"Source",children:(0,l.jsx)(o.Select,{ariaLabel:"Stream source",options:X,value:U.mode,disabled:B||T.streamSourcePending,disabledReason:D,onChange:T.setStreamSource})})}),"grpc-screenshot"===U?.mode&&(0,l.jsxs)(l.Fragment,{children:[Y.length>1&&(0,l.jsx)(b.SidebarRow,{label:"Input",children:(0,l.jsx)(o.Select,{ariaLabel:"Input source",options:Y,value:U.inputSource,disabled:B||T.streamSourcePending,disabledReason:D,onChange:T.setGrpcInputSource})}),(0,l.jsx)(b.SidebarRow,{label:"gRPC frames",children:(0,l.jsx)(o.Select,{ariaLabel:"gRPC image mode",options:j,value:U.grpcImageMode,disabled:B||T.streamSourcePending,disabledReason:D,onChange:T.setGrpcImageMode})}),(0,l.jsx)(b.SidebarRow,{label:"Encoder",children:(0,l.jsx)(o.Select,{ariaLabel:"gRPC encoder",options:w.map(l=>Object.assign({},l,{disabled:!U.availableEncoders.includes(l.value)})),value:U.encoder,disabled:B||T.streamSourcePending,disabledReason:D,onChange:T.setGrpcEncoder})}),U.encoderName&&(0,l.jsx)(c.SectionNote,{children:`Active encoder: ${U.encoderName}`})]}),U&&K&&(0,l.jsx)(c.SectionNote,{role:"alert",children:K}),(0,l.jsx)(b.SidebarRow,{label:"Transport",children:(0,l.jsx)(o.Select,{ariaLabel:"Stream transport",options:ie,value:ae,disabled:!G,onChange:function(l){G?.("webrtc"===l?"webrtc":ue(de))}})}),Q.length>0&&(0,l.jsx)(b.SidebarRow,{label:`${k} codec`,children:(0,l.jsx)(o.Select,{ariaLabel:`${k} codec`,options:Q.map(l=>Object.assign({},l,{disabled:!re(l.value)})),value:de,disabled:"webrtc"===ae||!H,onChange:function(l){H?.(l),"webrtc"!==ae&&G?.(ue(l))}})}),q.length>0&&(0,l.jsx)(b.SidebarRow,{label:"WebRTC codec",children:(0,l.jsx)(o.Select,{ariaLabel:"WebRTC codec",options:q,value:ce,disabled:"webrtc"!==ae||!J.webrtc,onChange:l=>T.setWebRtcCodec(l)})}),me&&(0,l.jsx)(c.SectionNote,{children:"android"!==T.platform&&I.modeAvailability.mjpeg?"H.264 and WebRTC require localhost or HTTPS. MJPEG remains available on insecure HTTP.":"WebRTC requires localhost or HTTPS."}),ge&&(0,l.jsx)(c.SectionNote,{children:"Start the standalone server with --transport webrtc to enable WebRTC."}),z&&(0,l.jsxs)(l.Fragment,{children:[z.maxDimension&&(0,l.jsx)(b.SidebarRow,{label:"Max size",children:(0,l.jsx)(o.Select,{ariaLabel:"Max size",value:String(_.maxDimension),options:y(_.maxDimension,P,l=>0===l?"Full":`${l} px`),disabled:ee,disabledReason:D,onChange:l=>pe("maxDimension",Number(l))})}),z.mjpegFps&&(0,l.jsx)(b.SidebarRow,{label:"MJPEG FPS",children:(0,l.jsx)(o.Select,{ariaLabel:"MJPEG FPS",value:String(_.mjpegFps),options:y(_.mjpegFps,f,l=>`${l} FPS`),disabled:ee||"http"!==ae,disabledReason:D,onChange:l=>pe("mjpegFps",Number(l))})}),z.mjpegQuality&&(0,l.jsx)(b.SidebarRow,{label:"MJPEG quality",children:(0,l.jsx)(o.Select,{ariaLabel:"MJPEG quality",value:String(_.mjpegQuality),options:y(_.mjpegQuality,M,l=>`${Math.round(100*l)}%`),disabled:ee||"http"!==ae,disabledReason:D,onChange:l=>pe("mjpegQuality",Number(l))})}),z.h264Fps&&(0,l.jsx)(b.SidebarRow,{label:"Video FPS",children:(0,l.jsx)(o.Select,{ariaLabel:"Video FPS",value:String(_.h264Fps),options:y(_.h264Fps,f,l=>`${l} FPS`),disabled:ee||!be,disabledReason:D,onChange:l=>pe("h264Fps",Number(l))})}),z.h264Bitrate&&(0,l.jsx)(b.SidebarRow,{label:"Video bitrate",children:(0,l.jsx)(o.Select,{ariaLabel:"Video bitrate",value:String(_.h264Bitrate),options:y(_.h264Bitrate,F,l=>l/1e6+" Mbps"),disabled:ee||!be,disabledReason:D,onChange:l=>pe("h264Bitrate",Number(l))})})]}),"webrtc"===ae&&(0,l.jsx)(u.StreamStatistics,{stats:T.streamStats,platform:T.platform})]})};var l=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),c=r(d[5]),b=r(d[6]),u=r(d[7]);const p={mjpegFps:30,mjpegQuality:.7,maxDimension:0,h264Bitrate:6e6,h264Fps:30},h={mjpeg:!0,h264:!0,webrtc:!0},v={modeAvailability:h,httpCodecs:["auto","h264","mjpeg"],webRtcCodecs:["h264","vp9","vp8"]},S=[{value:"scrcpy",label:"scrcpy"},{value:"grpc-screenshot",label:"gRPC"}],j=[{value:"png",label:"PNG"},{value:"mmap",label:"MMAP"},{value:"rgb888",label:"RGB888"}],w=[{value:"software",label:"Software"},{value:"hardware",label:"Hardware"}],x=[{value:"scrcpy",label:"scrcpy"},{value:"grpc",label:"gRPC"}],R=[{value:"auto",label:"Auto"},{value:"h264",label:"H.264"},{value:"mjpeg",label:"MJPEG"}],C=[{value:"h264",label:"H.264"},{value:"vp9",label:"VP9"},{value:"vp8",label:"VP8"}],P=[{value:"0",label:"Full"},{value:"1920",label:"1920 px"},{value:"1600",label:"1600 px"},{value:"1280",label:"1280 px"},{value:"960",label:"960 px"},{value:"720",label:"720 px"}],f=["60","30","20","15","10","5"].map(l=>({value:l,label:`${l} FPS`})),M=[{value:"0.45",label:"45%"},{value:"0.55",label:"55%"},{value:"0.7",label:"70%"},{value:"0.85",label:"85%"},{value:"1",label:"100%"}],F=[{value:"1500000",label:"1.5 Mbps"},{value:"3000000",label:"3 Mbps"},{value:"6000000",label:"6 Mbps"},{value:"10000000",label:"10 Mbps"},{value:"16000000",label:"16 Mbps"}];function y(l,t,n){const o=String(l);return t.some(l=>l.value===o)?t:[{value:o,label:n(l)},...t]}},379,[153,38,148,355,360,361,363,380]);
|
|
461
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamStatistics=function({stats:P,platform:M}){const w=P?.samples.slice(-60)??[],B=w.at(-1)??null,$=P?.encoder??null,R=P?.capture??null,T=R?.grpc??null,k=w.some(l=>null!==l.clientFps||null!==l.clientBitrateBps),N=[{label:"Client FPS",color:t.icon.info,values:w.flatMap(l=>null===l.clientFps?[]:[l.clientFps])}],D=[{label:"Client bitrate",color:t.icon.preview,values:w.flatMap(l=>null===l.clientBitrateBps?[]:[l.clientBitrateBps])}],E=P?.stale&&P.serverStale?"Client and server stream statistics are paused. Showing the most recent samples.":P?.stale?"Client stream statistics are paused. Showing the most recent samples.":P?.serverStale?"Server stream statistics are paused. Showing the most recent values.":null,L=!k&&!P?.stale,V=null===$?[]:"android"===M?[{label:"Codec",value:y($.codec)},{label:"Configured bitrate",value:c($.targetBitrateBps)},{label:"Output frames",value:v($.framesEncoded)},{label:"Publisher FPS",value:u($.publisherFps)},{label:"Payload bitrate",value:c($.payloadBitrateBps)},{label:"Publisher submissions",value:v($.publisherSubmittedFrames)},{label:"Publisher drops",value:v($.publisherDroppedFrames)}]:[{label:"Codec",value:y($.codec)},{label:"Encode FPS",value:u($.encodeFps)},{label:"Target bitrate",value:c($.targetBitrateBps)},{label:"Encode time / frame",value:b($.encodeMsPerFrame,1)},{label:"Frames encoded",value:v($.framesEncoded)},{label:"Frames sent",value:v($.framesSent)},{label:"Frames dropped",value:v($.framesDropped)},{label:"Packet loss",value:p($.packetLossRatio)},{label:"Limitation",value:S($.qualityLimitationReason)}],W=null===R?[]:"android"===M?[{label:"Publisher offers",value:v(R.offeredFrames)},{label:"Publisher forwards",value:v(R.forwardedFrames)},...T?[{label:"gRPC image mode",value:T.imageMode?.toUpperCase()??n},{label:"Emulator producer FPS",value:u(T.producerFps)},{label:"Host receive FPS",value:u(T.receiveFps)},{label:"Usable image FPS",value:u(T.usableImageFps)},{label:"Encoder input FPS",value:u(T.encoderInputFps)},{label:"gRPC notifications",value:v(T.messagesReceived)},{label:"rgb888"===T.imageMode?"Decoded responses":"Selected notifications",value:v(T.messagesEmitted)},{label:"rgb888"===T.imageMode?"Predecode coalescing":"Coalesced notifications",value:v(T.messagesCoalesced)},{label:"Sequence gaps",value:v(T.sequenceGaps)},{label:"Latest image payload",value:x(T.imagePayloadBytes)},{label:"Logical transport bytes",value:x(T.transportBytes)},{label:"gRPC message bytes",value:x(T.messageBytesReceived)},{label:"Produce\u2192receive p50 / p95",value:f(T.productionToReceiveLatencyMs)},{label:"Produce\u2192usable p50 / p95",value:f(T.productionToUsableLatencyMs)},{label:"Protobuf decode p50 / p95",value:f(T.protobufDecodeTimeMs)},..."mmap"===T.imageMode?[{label:"MMAP bytes read",value:x(T.mmapFileBytesRead)},{label:"MMAP read p50 / p95",value:f(T.mmapReadCopyTimeMs)},{label:"MMAP read retries",value:v(T.mmapReadRetries)},{label:"Torn frames dropped",value:v(T.mmapTornFramesDropped)}]:[]]:[]]:[{label:"Screen frames",value:v(R.screenFrames)},{label:"Idle frames",value:v(R.idleFrames)},{label:"Capture deliveries",value:v(R.offeredFrames)},{label:"Pacer submissions",value:v(R.forwardedFrames)},{label:"Pump restarts",value:v(R.pumpRestarts)}];return(0,l.jsxs)("div",{style:{display:"flex",minWidth:0,flexDirection:"column",gap:8,paddingTop:8},children:[E&&(0,l.jsx)("span",{role:"status",style:Object.assign({},t.textSize.xs,{color:t.text.warning}),children:E}),L&&(0,l.jsx)("span",{role:"status",style:Object.assign({},t.textSize.xs,{color:t.text.tertiary}),children:"Measuring WebRTC stream\u2026"}),(0,l.jsxs)("div",{role:"table","aria-label":"WebRTC stream statistics","aria-colcount":2,style:{width:"100%",overflow:"visible",borderRadius:t.radius.lg,backgroundColor:t.bg.subtle},children:[(0,l.jsxs)("div",{role:"rowgroup","aria-label":"Stream statistics","data-receiver-stale":P?.stale||void 0,"data-server-stale":P?.serverStale||void 0,style:{display:"grid",gridTemplateColumns:o},children:[(0,l.jsx)(C,{label:"Stream",first:!0}),(0,l.jsx)(j,{label:"Server FPS",value:u(B?.serverFps??null),stale:P?.serverStale}),(0,l.jsx)(j,{label:"Client FPS",value:u(B?.clientFps??null),stale:P?.stale}),(0,l.jsx)(j,{label:"Client bitrate",value:c(B?.clientBitrateBps??null),stale:P?.stale})]}),(0,l.jsxs)("div",{role:"rowgroup","aria-label":"Client statistics","data-stale":P?.stale||void 0,style:{display:"grid",gridTemplateColumns:o},children:[(0,l.jsx)(C,{label:"Client"}),(0,l.jsx)(j,{label:"Packet loss",value:p(B?.clientPacketLossRatio??null),stale:P?.stale}),(0,l.jsx)(j,{label:"Jitter",value:b(B?.clientJitterMs??null,1),stale:P?.stale}),(0,l.jsx)(j,{label:"Jitter buffer",value:b(B?.clientJitterBufferMs??null,0),stale:P?.stale}),(0,l.jsx)(j,{label:"Dropped frames",value:v(B?.clientDroppedFrames??null),stale:P?.stale}),(0,l.jsx)(j,{label:"Freezes",value:F(B?.clientFreezeCount??null,B?.clientFreezeDurationMs??null),stale:P?.stale}),(0,l.jsx)(j,{label:"RTT",value:b(B?.clientRoundTripMs??null,0),stale:P?.stale}),(0,l.jsx)(j,{label:"ICE path",value:h(B?.clientIcePath),stale:P?.stale})]}),V.length>0&&(0,l.jsxs)("div",{role:"rowgroup","aria-label":"Encoder statistics","data-stale":P?.serverStale||void 0,style:{display:"grid",gridTemplateColumns:o},children:[(0,l.jsx)(C,{label:"Encoder"}),V.map(t=>(0,l.jsx)(j,{label:t.label,value:t.value,stale:P?.serverStale},t.label))]}),W.length>0&&(0,l.jsxs)("div",{role:"rowgroup","aria-label":"Capture statistics","data-stale":P?.serverStale||void 0,style:{display:"grid",gridTemplateColumns:o},children:[(0,l.jsx)(C,{label:"Capture"}),W.map(t=>(0,l.jsx)(j,{label:t.label,value:t.value,stale:P?.serverStale},t.label))]})]}),B&&k&&(0,l.jsxs)("div",{"data-stale":P?.stale||void 0,style:{display:"grid",minWidth:0,gridTemplateColumns:o,gap:8,opacity:P?.stale?.55:1},children:[(0,l.jsx)(s.MetricChart,{title:"Client FPS",value:u(B.clientFps),description:"Last 60 samples",series:N,maxValue:(0,s.maxChartValue)(N)}),(0,l.jsx)(s.MetricChart,{title:"Client bitrate",value:c(B.clientBitrateBps),description:"Last 60 samples",series:D,maxValue:(0,s.maxChartValue)(D)})]})]})};var l=r(d[0]),t=r(d[1]),s=r(d[2]);const n="\u2014",o="repeat(auto-fit, minmax(150px, 1fr))";function u(l){if(null===l||!Number.isFinite(l))return n;const t=Math.max(0,l);return`${t<10?t.toFixed(1):t.toFixed(0)} FPS`}function c(l){if(null===l||!Number.isFinite(l))return n;const t=Math.max(0,l);return t<1e6?`${(t/1e3).toFixed(0)} kbps`:`${(t/1e6).toFixed(2)} Mbps`}function p(l){return null!==l&&Number.isFinite(l)?`${(100*Math.max(0,l)).toFixed(1)}%`:n}function b(l,t){return null!==l&&Number.isFinite(l)?`${Math.max(0,l).toFixed(t)} ms`:n}function v(l){if(null===l||!Number.isFinite(l))return n;const t=Math.max(0,l);return t<1e3?String(Math.round(t)):t<999950?`${(t/1e3).toFixed(1)}k`:`${(t/1e6).toFixed(2)}M`}function x(l){if(null===l||!Number.isFinite(l))return n;const t=Math.max(0,l);return t<1024?`${Math.round(t)} B`:t<1048576?`${(t/1024).toFixed(1)} KiB`:`${(t/1048576).toFixed(2)} MiB`}function f({p50:l,p95:t}){return null===l&&null===t?n:`${null===l?n:l.toFixed(1)} / ${null===t?n:t.toFixed(1)} ms`}function F(l,t){const s=v(l);if(null===l||!Number.isFinite(l)||l<=0||null===t||!Number.isFinite(t)||t<=0)return s;const n=Math.max(0,t);return`${s} \xb7 ${n<1e3?`${n.toFixed(0)} ms`:`${(n/1e3).toFixed(1)} s`}`}function h(l){return"direct"===l?"Direct":"relay"===l?"Via relay":n}function y(l){if(null===l||0===l.length)return n;const t=l.replace(/^video\//i,"");return/^h\.?264$/i.test(t)?"H.264":/^vp8$/i.test(t)?"VP8":/^vp9$/i.test(t)?"VP9":/^av1$/i.test(t)?"AV1":t}function S(l){switch(l){case"none":return"None";case"cpu":return"CPU";case"bandwidth":return"Network";case null:return n;default:return"Unknown"}}function C({label:s,first:n=!1}){return(0,l.jsx)("div",{role:"row",style:{gridColumn:"1 / -1"},children:(0,l.jsx)("span",{role:"columnheader","aria-colspan":2,style:Object.assign({},t.textSize["2xs"],{display:"block",padding:n?"7px 8px 5px":"14px 8px 5px",color:t.text.secondary,fontWeight:500,letterSpacing:"0.04em",textAlign:"left",textTransform:"uppercase"}),children:s})})}function j({label:s,value:n,stale:o=!1}){return(0,l.jsxs)("div",{role:"row","data-stream-statistic":s,style:{display:"flex",minWidth:0,alignItems:"baseline",justifyContent:"space-between",gap:4,padding:"5px 8px",opacity:o?.55:1},children:[(0,l.jsx)("span",{role:"rowheader",style:Object.assign({},t.textSize["2xs"],{minWidth:0,color:t.text.secondary,fontWeight:400}),children:s}),(0,l.jsx)("span",{role:"cell",style:Object.assign({},t.textSize["2xs"],{flexShrink:0,color:t.text.default,fontWeight:500,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}),children:n})]})}},380,[153,355,368]);
|
|
462
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_FRAME_PROFILE_IDS",{enumerable:!0,get:function(){return n}}),e.isDeviceFrameProfileId=function(o){return n.some(n=>n===o)};const n=["ios:iphone-17-pro","android:pixel-9","android:pixel-10-pro"]},381,[]);
|
|
463
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamPanel=function({device:v,client:h,agentInteraction:f,DeviceScreen:u,displayScreen:S,framed:b=!0,showDeviceFrame:y=!0,deviceFrameAssets:j}){const T=(0,c.useScreenshotToast)(h,v.name),D=h.deviceSettings?.appearance,w="dark"===D||"light"===D?D:null,_=null===w||"ready"!==h.deviceSettingsStatus||h.deviceSettingsPending.has("appearance");return(0,t.jsxs)("section",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",padding:40,boxSizing:"border-box",backgroundColor:n.bg.subtle,borderLeft:b?`1px solid ${n.border.default}`:"none",borderRight:b?`1px solid ${n.border.default}`:"none",overflow:"hidden"},children:[(0,t.jsx)("div",{"data-testid":"device-frame-viewport",style:{flex:1,minWidth:0,minHeight:0,width:"100%",boxSizing:"border-box",padding:`${o.DEVICE_TITLE_HEIGHT+p}px 0 ${l.STREAM_CONTROLS_HEIGHT+x}px`,containerType:"size",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,t.jsxs)("div",{"data-testid":"device-frame-anchor",style:{position:"relative",display:"flex",flexShrink:0},children:[(0,t.jsx)(s.PhoneFrame,{device:v,client:h,agentInteraction:f,DeviceScreen:u,displayScreen:S,showDeviceFrame:y,deviceFrameAssets:j}),(0,t.jsx)("div",{style:{position:"absolute",left:"50%",bottom:`calc(100% + ${p}px)`,display:"flex",justifyContent:"center",width:"max-content",maxWidth:"100cqw",transform:"translateX(-50%)"},children:(0,t.jsx)(o.DeviceTitle,{device:v,status:h.status,recording:h.screenRecording},v.id)}),(0,t.jsx)("div",{style:{position:"absolute",left:"50%",top:`calc(100% + ${x}px)`,width:"max-content",transform:"translateX(-50%)"},children:(0,t.jsx)(l.StreamControls,{recording:h.screenRecording,appearance:w,appearanceDisabled:_,onToggleAppearance:()=>{_||h.setDeviceSetting("appearance","dark"===w?"light":"dark")},onHome:()=>h.pressButton("home"),onReload:()=>h.reload(),onRotate:()=>h.rotate(),onSave:T})})]})}),(0,t.jsx)(c.ScreenshotToaster,{})]})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]);const p=32,x=32},382,[153,355,383,384,388,390]);
|
|
464
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_TITLE_HEIGHT",{enumerable:!0,get:function(){return b}}),e.DeviceTitle=function({device:b,status:u,recording:f=null}){const[x,C]=(0,n.useState)(null),h=x===b.id,p=h?b.id:b.name,S=s[u];return(0,o.jsx)(l.Button,{theme:"tertiary",size:c,onClick:()=>C(h?null:b.id),leftSlot:(0,o.jsx)("span",{title:p,style:{display:"block",flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:h?l.font.mono:l.font.sans},children:p}),rightSlot:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{"aria-hidden":!0,style:{width:6,height:6,flexShrink:0,boxSizing:"content-box",border:`2px solid ${S.ringColor}`,borderRadius:l.radius.full,backgroundColor:S.dotColor}}),(0,o.jsx)("span",{"aria-live":"polite",style:{flexShrink:0,color:S.labelColor},children:S.label}),f&&(0,o.jsx)("span",{role:"status",style:{flexShrink:0,color:"recording"===f||"failed"===f?l.text.danger:l.text.secondary},children:t[f]})]}),style:{maxWidth:"min(100%, 320px)",minWidth:0,flexShrink:0,boxSizing:"border-box",gap:6,paddingInline:12,borderWidth:.5,borderColor:l.border.default,borderRadius:l.radius.full,fontSize:l.textSize.sm.fontSize,fontWeight:500,backgroundColor:l.bg.default}})};var o=r(d[0]),n=r(d[1]),l=r(d[2]);const t={unknown:"Checking recording status",waiting:"Starting recording",recording:"Recording",finalizing:"Finishing recording",complete:"Recording complete",failed:"Recording failed"},s={idle:{label:"Offline",dotColor:l.icon.danger,ringColor:l.border.danger,labelColor:l.text.secondary},connecting:{label:"Starting",dotColor:l.icon.warning,ringColor:l.border.warning,labelColor:l.text.secondary},reconnecting:{label:"Reconnecting",dotColor:l.icon.warning,ringColor:l.border.warning,labelColor:l.text.secondary},streaming:{label:"Live",dotColor:l.text.success,ringColor:l.border.success,labelColor:l.text.success},error:{label:"Error",dotColor:l.icon.danger,ringColor:l.border.danger,labelColor:l.text.secondary}},c="xs",b=l.BUTTON_HEIGHTS[c]},383,[153,38,355]);
|
|
465
465
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PhoneFrame=function({device:b,client:h,agentInteraction:y,DeviceScreen:x,displayScreen:S,showDeviceFrame:j=!0,deviceFrameAssets:f}){const[F,k]=(0,n.useState)(!1),[w,O]=(0,n.useState)(null),{ratio:P,radiusFraction:E,squircle:q}=p[b.platform],z=h?S(h.screen):null,C=z&&z.height>0?z.width/z.height:P,I=Object.assign({},(0,c.deviceViewportStyle)({maxShortSide:u,ratio:C}),{containerType:"inline-size"}),_=E/Math.max(C,1)*100,D=`${_.toFixed(3)}cqw`,T=h&&"idle"!==h.status,A=!!y&&F&&w!==y.id,M=T?(0,t.jsx)(x,{client:h,agentInteraction:y}):(0,t.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:s.bg.element}}),R=(0,t.jsx)("div",{"data-testid":"agent-device-overlay-clip",style:{position:"absolute",inset:0,zIndex:2,pointerEvents:A?"auto":"none"},children:(0,t.jsx)(o.AgentDeviceOverlay,{visible:A,onTakeOver:()=>O(y?.id??null)})}),L=j&&b.deviceFrame?f?.[b.deviceFrame]:void 0,V=L?(0,c.deviceFramePresentation)({asset:L,orientation:h?.screen?.orientation,displayRatio:C,maxScreenShortSide:u}):null,$=V?Object.assign({},V.screenStyle,{backgroundColor:s.bg.element}):{position:"absolute",inset:0,clipPath:(0,l.deviceScreenClipPath)(_,q)};return(0,t.jsxs)("div",{"data-testid":"device-screen-frame","data-device-frame-kind":V?b.deviceFrame:"none","data-agent-active":y?"true":"false",style:V?V.frameStyle:Object.assign({},I,{borderRadius:D}),onPointerEnter:t=>{"mouse"===t.pointerType&&k(!0)},onPointerLeave:()=>k(!1),children:[(0,t.jsxs)("div",{"data-testid":"device-screen-clip","data-device-frame-screen":V?"true":void 0,style:$,children:[(0,t.jsx)("div",{"data-testid":"device-frame-stream-cover",style:V?V.streamStyle:{position:"absolute",inset:0},children:M}),T&&h.inputError&&(0,t.jsx)("div",{role:"status","aria-live":"polite",style:Object.assign({},s.textSize.xs,{position:"absolute",bottom:0,left:0,right:0,zIndex:1,padding:12,backgroundColor:s.bg.danger,color:s.text.danger,pointerEvents:"none"}),children:h.inputError}),R]}),f?Object.keys(f).map(n=>{const s=f[n],o=!!V&&b.deviceFrame===n;return(0,t.jsx)("img",{"data-testid":o?"device-frame-artwork":void 0,"data-device-frame-artwork-kind":n,src:s.src,alt:"","aria-hidden":"true",draggable:!1,decoding:"async",loading:"eager",style:o?V.artworkStyle:v},n)}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=r(d[4]),l=r(d[5]);const v={position:"absolute",inset:0,width:1,height:1,opacity:0,pointerEvents:"none"},u=480,p={ios:{ratio:.460431654676259,radiusFraction:.14066496163682865,squircle:!0},android:{ratio:.450070323488045,radiusFraction:.02564102564102564,squircle:!1}}},384,[153,38,355,385,386,387]);
|
|
466
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentDeviceOverlay=function({visible:c,onTakeOver:h}){return(0,t.jsx)("div",{hidden:!c,"aria-hidden":!c,role:"dialog","aria-label":"Agent device activity","data-testid":"agent-device-overlay",style:{position:
|
|
467
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceViewportStyle=h,e.deviceFrameRotation=c,e.deviceFrameLayout=s,e.deviceFramePresentation=function({asset:w,orientation:l,displayRatio:u,maxScreenShortSide:x}){const p=c(l,u),$=s(w,p),f=$.width/$.height,y=w.screen.width/w.width,S=x/y,b=`${(w.screenRadius/$.width*100).toFixed(4)}cqw`,F=`${(w.screenRadius/$.height*100).toFixed(4)}cqh`;return{frameStyle:Object.assign({},h({maxShortSide:S,ratio:f}),{containerType:
|
|
468
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceScreenClipPath=function($,f){const u=n($),l=n($*(f?o:t)),s=`-${c}`,h=`calc(${u} - ${c})`,v=`calc(100% - ${u} + ${c})`;return[`shape(from ${u} ${s}`,`hline to calc(100% - ${u})`,`curve to 100% ${h} with ${l} 0 from start / 0 -${l} from end`,`vline to ${v}`,`curve to calc(100% - ${u}) calc(100% + ${c}) with 0 ${l} from start / ${l} 0 from end`,`hline to ${u}`,`curve to 0 ${v} with -${l} 0 from start / 0 ${l} from end`,`vline to ${h}`,`curve to ${u} ${s} with 0 -${l} from start / -${l} 0 from end`,
|
|
469
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.artifactNotice=u,e.ScreenshotToaster=function(){return(0,t.jsx)(o.Toaster,{id:p,position:"bottom-right",offset:16,gap:8,toastOptions:{unstyled:!0},hotkey:[
|
|
466
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AgentDeviceOverlay=function({visible:c,onTakeOver:h}){return(0,t.jsx)("div",{hidden:!c,"aria-hidden":!c,role:"dialog","aria-label":"Agent device activity","data-testid":"agent-device-overlay",style:{position:"absolute",inset:0,zIndex:2,display:c?"flex":"none",alignItems:"center",justifyContent:"center",padding:24,boxSizing:"border-box",pointerEvents:"auto",textAlign:"center",backgroundColor:s},children:(0,t.jsxs)("div",{style:{display:"flex",width:"100%",maxWidth:300,flexDirection:"column",alignItems:"center",gap:12},children:[(0,t.jsx)("div",{style:Object.assign({color:o},n.textSize.sm,{fontWeight:600}),children:"Agent is using this device"}),(0,t.jsx)("div",{style:Object.assign({maxWidth:260,color:l},n.textSize.xs),children:"Taking over might collide with what the agent is doing."}),(0,t.jsx)(n.Button,{theme:"agent-overlay",size:"sm",onClick:h,style:{fontFamily:"inherit"},children:(0,t.jsx)("span",{style:Object.assign({},n.textSize.xs,{fontWeight:500}),children:"Take over anyway"})})]})})};var t=r(d[0]),n=r(d[1]);const s="rgba(0, 0, 0, 0.55)",l="rgba(255, 255, 255, 0.7)",o="rgba(218, 233, 255, 0.74)"},385,[153,355]);
|
|
467
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceViewportStyle=h,e.deviceFrameRotation=c,e.deviceFrameLayout=s,e.deviceFramePresentation=function({asset:w,orientation:l,displayRatio:u,maxScreenShortSide:x}){const p=c(l,u),$=s(w,p),f=$.width/$.height,y=w.screen.width/w.width,S=x/y,b=`${(w.screenRadius/$.width*100).toFixed(4)}cqw`,F=`${(w.screenRadius/$.height*100).toFixed(4)}cqh`;return{frameStyle:Object.assign({},h({maxShortSide:S,ratio:f}),{containerType:"size"}),screenStyle:{position:"absolute",left:`calc(${n($.screen.x,$.width)} - ${t}px)`,top:`calc(${n($.screen.y,$.height)} - ${t}px)`,width:`calc(${n($.screen.width,$.width)} + 2px)`,height:`calc(${n($.screen.height,$.height)} + 2px)`,containerType:"size",zIndex:1,overflow:"hidden",borderRadius:`calc(${b} + ${t}px) / calc(${F} + ${t}px)`},streamStyle:{position:"absolute",top:"50%",left:"50%",width:`max(100cqw, ${(100*u).toFixed(6)}cqh)`,height:`max(100cqh, ${(100/u).toFixed(6)}cqw)`,aspectRatio:`${u}`,transform:"translate(-50%, -50%)"},artworkStyle:o(w,$)}};const t=1;function h({maxShortSide:t,ratio:h}){return{width:`min(${t*Math.max(h,1)}px, 100cqw, ${(100*h).toFixed(6)}cqh)`,aspectRatio:`${h}`,flexShrink:0,position:"relative",isolation:"isolate"}}function n(t,h){return`${(t/h*100).toFixed(4)}%`}function o(t,h){const o={position:"absolute",left:"50%",top:"50%",userSelect:"none",pointerEvents:"none",zIndex:2};return 90===Math.abs(h.rotation)?Object.assign({},o,{width:n(t.width,h.width),height:n(t.height,h.height),transform:`translate(-50%, -50%) rotate(${h.rotation}deg)`}):Object.assign({},o,{width:"100%",height:"100%",transform:`translate(-50%, -50%) rotate(${h.rotation}deg)`})}function c(t,h){switch(t){case"landscape_left":return 90;case"landscape_right":return-90;case"portrait_upside_down":return 180;default:return h>1?90:0}}function s(t,h){const{width:n,height:o,screen:c}=t;switch(h){case 90:return{width:o,height:n,rotation:h,screen:{x:o-c.y-c.height,y:c.x,width:c.height,height:c.width}};case-90:return{width:o,height:n,rotation:h,screen:{x:c.y,y:n-c.x-c.width,width:c.height,height:c.width}};case 180:return{width:n,height:o,rotation:h,screen:{x:n-c.x-c.width,y:o-c.y-c.height,width:c.width,height:c.height}};default:return{width:n,height:o,rotation:h,screen:c}}}},386,[]);
|
|
468
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceScreenClipPath=function($,f){const u=n($),l=n($*(f?o:t)),s=`-${c}`,h=`calc(${u} - ${c})`,v=`calc(100% - ${u} + ${c})`;return[`shape(from ${u} ${s}`,`hline to calc(100% - ${u})`,`curve to 100% ${h} with ${l} 0 from start / 0 -${l} from end`,`vline to ${v}`,`curve to calc(100% - ${u}) calc(100% + ${c}) with 0 ${l} from start / ${l} 0 from end`,`hline to ${u}`,`curve to 0 ${v} with -${l} 0 from start / 0 ${l} from end`,`vline to ${h}`,`curve to ${u} ${s} with 0 -${l} from start / -${l} 0 from end`,"close)"].join(", ")};const t=$(1),o=$(1.1),c="0.5px";function $(t){return(Math.pow(.5,Math.pow(.5,t))-.5)/.375}function n(t){return`${t.toFixed(3)}cqw`}},387,[]);
|
|
469
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.artifactNotice=u,e.ScreenshotToaster=function(){return(0,t.jsx)(o.Toaster,{id:p,position:"bottom-right",offset:16,gap:8,toastOptions:{unstyled:!0},hotkey:[" "],containerAriaLabel:"Screenshot notifications"})},e.useScreenshotToast=function(n,a){const c=(0,s.useRef)(!1),x=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>()=>{for(const[t,s]of x.current)o.toast.dismiss(t),s&&URL.revokeObjectURL(s);x.current.clear()},[]),(0,s.useCallback)(async()=>{if(c.current)return;c.current=!0;const s=o.toast.custom(()=>(0,t.jsx)(b,{toast:{phase:"capturing"}}),{toasterId:p,duration:1/0});x.current.set(s,null);const y=()=>{const t=x.current.get(s);t&&URL.revokeObjectURL(t),x.current.delete(s)};try{const c=await n.screenshot();if(!x.current.has(s))return;if(!c)return void o.toast.custom(()=>(0,t.jsx)(b,{toast:{phase:"capture-failed"}}),{id:s,toasterId:p,duration:l,onDismiss:y,onAutoClose:y});const j=URL.createObjectURL(c.blob);x.current.set(s,j);const v=h(a);f(j,v);const{dismissMs:w}=u(c.artifact),S=n=>o.toast.custom(()=>(0,t.jsx)(b,{toast:{phase:"saved",url:j,artifact:c.artifact},onDownloadAgain:()=>f(j,v),onFocusChange:t=>S(t?1/0:w)}),{id:s,toasterId:p,duration:n,onDismiss:y,onAutoClose:y});S(w)}finally{c.current=!1}},[n,a])},e.ScreenshotToast=b;var t=r(d[0]),s=r(d[1]),o=r(d[2]),n=r(d[3]);const a=3500,c=12e3,l=4e3;function u(t){return"saved"===t?.status?{message:"Saved to session artifacts",dismissMs:a}:"failed"===t?.status?{message:"Downloaded. Not saved to session artifacts"+(t.error?`: ${t.error}`:""),dismissMs:c}:{dismissMs:a}}function h(t){return`${t.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"device"}-${(new Date).toISOString().replace(/[:.]/g,"-").replace(/Z$/,"")}.png`}function f(t,s){const o=document.createElement("a");o.href=t,o.download=s,document.body.appendChild(o),o.click(),o.remove()}const p="hub-screenshot";const x={display:"flex",alignItems:"center",gap:12,width:320,maxWidth:"100%",boxSizing:"border-box",padding:"8px 14px 8px 8px",backgroundColor:n.bg.default,border:`1px solid ${n.border.default}`,borderRadius:n.radius.lg,boxShadow:n.shadow.lg,color:n.text.default,fontFamily:"inherit",textAlign:"left"};function b({toast:o,onDownloadAgain:a,onFocusChange:c}){const[l,u]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!1),p="capturing"===o.phase?"Capturing screenshot\u2026":"saved"===o.phase?"Screenshot saved":"Screenshot failed",b=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{style:{width:36,height:36,flexShrink:0,display:"block",overflow:"hidden",borderRadius:n.radius.md,backgroundColor:n.bg.element},children:"saved"===o.phase&&(0,t.jsx)("img",{src:o.url,alt:"",draggable:!1,style:{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}),(0,t.jsxs)("span",{style:{display:"flex",flexDirection:"column",minWidth:0,lineHeight:1.3},children:[(0,t.jsx)("span",{style:Object.assign({},n.textSize.sm,{lineHeight:1.3,fontWeight:600}),children:p}),"saved"===o.phase&&(0,t.jsx)(y,{artifact:o.artifact})]})]});return"saved"!==o.phase?(0,t.jsx)("div",{"data-testid":"screenshot-toast",style:x,children:b}):(0,t.jsxs)("button",{type:"button","data-testid":"screenshot-toast","aria-label":"Download screenshot again",onClick:a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onFocus:t=>{f((0,n.isFocusVisible)(t)),c?.(!0)},onBlur:()=>{f(!1),c?.(!1)},style:Object.assign({},x,{backgroundColor:l?n.bg.hover:n.bg.default,boxShadow:h?`0 0 0 2px ${n.border.secondary}, ${n.shadow.lg}`:n.shadow.lg,outline:"none",cursor:"pointer",transition:"background-color 120ms ease"}),children:[b,(0,t.jsx)(n.ChevronRightIcon,{style:{marginLeft:"auto",flexShrink:0,color:n.text.secondary}})]})}function y({artifact:s}){const{message:o}=u(s);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{style:Object.assign({},n.textSize.xs,{lineHeight:1.3,color:n.text.secondary}),children:"Download again"}),o&&(0,t.jsx)("span",{style:Object.assign({},n.textSize.xs,{lineHeight:1.3,marginTop:4,overflowWrap:"anywhere",color:"failed"===s?.status?n.text.warning:n.text.tertiary}),children:o})]})}},388,[153,38,389,355]);
|
|
470
470
|
__d(function(g,r,_i,a,m,_e,d){"use strict";const t=["message"];function e(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Toaster",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"toast",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"useSonner",{enumerable:!0,get:function(){return z}});var o=e(r(d[0])),n=e(r(d[1])),s=e(r(d[2]));const i=t=>{switch(t){case'success':return u;case'info':return p;case'warning':return f;case'error':return h;default:return null}},l=Array(12).fill(0),c=({visible:t,className:e})=>n.default.createElement("div",{className:['sonner-loading-wrapper',e].filter(Boolean).join(' '),"data-visible":t},n.default.createElement("div",{className:"sonner-spinner"},l.map((t,e)=>n.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${e}`})))),u=n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),f=n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p=n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),h=n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),b=n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),v=()=>{const[t,e]=n.default.useState(document.hidden);return n.default.useEffect(()=>{const t=()=>{e(document.hidden)};return document.addEventListener('visibilitychange',t),()=>window.removeEventListener('visibilitychange',t)},[]),t};let y=1;const w=new class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=e=>{var n;const{message:s}=e,i=(0,o.default)(e,t),l='number'==typeof(null==e?void 0:e.id)||(null==(n=e.id)?void 0:n.length)>0?e.id:y++,c=this.toasts.find(t=>t.id===l),u=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(t=>t.id===l?(this.publish(Object.assign({},t,e,{id:l,title:s})),Object.assign({},t,e,{id:l,dismissible:u,title:s})):t):this.addToast(Object.assign({title:s},i,{dismissible:u,id:l})),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(e=>e({id:t.id,dismiss:!0}))}),t),this.message=(t,e)=>this.create(Object.assign({},e,{message:t})),this.error=(t,e)=>this.create(Object.assign({},e,{message:t,type:'error'})),this.success=(t,e)=>this.create(Object.assign({},e,{type:'success',message:t})),this.info=(t,e)=>this.create(Object.assign({},e,{type:'info',message:t})),this.warning=(t,e)=>this.create(Object.assign({},e,{type:'warning',message:t})),this.loading=(t,e)=>this.create(Object.assign({},e,{type:'loading',message:t})),this.promise=(t,e)=>{if(!e)return;let o;void 0!==e.loading&&(o=this.create(Object.assign({},e,{promise:t,type:'loading',message:e.loading,description:'function'!=typeof e.description?e.description:void 0})));const s=Promise.resolve(t instanceof Function?t():t);let i,l=void 0!==o;const c=s.then(async t=>{i=['resolve',t];if(n.default.isValidElement(t))l=!1,this.create({id:o,type:'default',message:t});else if(x(t)&&!t.ok){l=!1;const s='function'==typeof e.error?await e.error(`HTTP error! status: ${t.status}`):e.error,i='function'==typeof e.description?await e.description(`HTTP error! status: ${t.status}`):e.description,c='object'==typeof s&&!n.default.isValidElement(s)?s:{message:s};this.create(Object.assign({id:o,type:'error',description:i},c))}else if(t instanceof Error){l=!1;const s='function'==typeof e.error?await e.error(t):e.error,i='function'==typeof e.description?await e.description(t):e.description,c='object'==typeof s&&!n.default.isValidElement(s)?s:{message:s};this.create(Object.assign({id:o,type:'error',description:i},c))}else if(void 0!==e.success){l=!1;const s='function'==typeof e.success?await e.success(t):e.success,i='function'==typeof e.description?await e.description(t):e.description,c='object'==typeof s&&!n.default.isValidElement(s)?s:{message:s};this.create(Object.assign({id:o,type:'success',description:i},c))}}).catch(async t=>{if(i=['reject',t],void 0!==e.error){l=!1;const s='function'==typeof e.error?await e.error(t):e.error,i='function'==typeof e.description?await e.description(t):e.description,c='object'==typeof s&&!n.default.isValidElement(s)?s:{message:s};this.create(Object.assign({id:o,type:'error',description:i},c))}}).finally(()=>{l&&(this.dismiss(o),o=void 0),null==e.finally||e.finally.call(e)}),u=()=>new Promise((t,e)=>c.then(()=>'reject'===i[0]?e(i[1]):t(i[1])).catch(e));return'string'!=typeof o&&'number'!=typeof o?{unwrap:u}:Object.assign(o,{unwrap:u})},this.custom=(t,e)=>{const o=(null==e?void 0:e.id)||y++;return this.create(Object.assign({jsx:t(o),id:o},e)),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},x=t=>t&&'object'==typeof t&&'ok'in t&&'boolean'==typeof t.ok&&'status'in t&&'number'==typeof t.status,E=(t,e)=>{const o=(null==e?void 0:e.id)||y++;return w.addToast(Object.assign({title:t},e,{id:o})),o},k=Object.assign(E,{success:w.success,info:w.info,warning:w.warning,error:w.error,custom:w.custom,message:w.message,promise:w.promise,dismiss:w.dismiss,loading:w.loading},{getHistory:()=>w.toasts,getToasts:()=>w.getActiveToasts()});function j(t){return void 0!==t.label}!(function(t){if(!t||'undefined'==typeof document)return;let e=document.head||document.getElementsByTagName('head')[0],o=document.createElement('style');o.type='text/css',e.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))})("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const N=3,S=14;function T(...t){return t.filter(Boolean).join(' ')}function B(t){const[e,o]=t.split('-'),n=[];return e&&n.push(e),o&&n.push(o),n}const M=t=>{var e,o,s,l,u,f,p,h,y;const{invert:w,toast:x,unstyled:E,interacting:k,setHeights:N,visibleToasts:S,heights:M,index:C,toasts:O,expanded:z,removeToast:R,defaultRichColors:D,closeButton:P,style:Y,cancelButtonStyle:I,actionButtonStyle:$,className:A="",descriptionClassName:L="",duration:H,position:V,gap:X,expandByDefault:U,classNames:_,icons:F,closeButtonAriaLabel:K="Close toast"}=t,[q,W]=n.default.useState(null),[G,J]=n.default.useState(null),[Q,Z]=n.default.useState(!1),[tt,et]=n.default.useState(!1),[at,ot]=n.default.useState(!1),[nt,st]=n.default.useState(!1),[rt,it]=n.default.useState(!1),[lt,dt]=n.default.useState(0),[ct,ut]=n.default.useState(0),ft=n.default.useRef(x.duration||H||4e3),mt=n.default.useRef(null),pt=n.default.useRef(null),gt=0===C,ht=C+1<=S,bt=x.type,vt=!1!==x.dismissible,yt=x.className||'',wt=x.descriptionClassName||'',xt=n.default.useMemo(()=>M.findIndex(t=>t.toastId===x.id)||0,[M,x.id]),Et=n.default.useMemo(()=>{var t;return null!=(t=x.closeButton)?t:P},[x.closeButton,P]),kt=n.default.useMemo(()=>x.duration||H||4e3,[x.duration,H]),jt=n.default.useRef(0),Nt=n.default.useRef(0),St=n.default.useRef(0),Tt=n.default.useRef(null),[Bt,Mt]=V.split('-'),Ct=n.default.useMemo(()=>M.reduce((t,e,o)=>o>=xt?t:t+e.height,0),[M,xt]),Ot=v(),zt=x.invert||w,Rt='loading'===bt;Nt.current=n.default.useMemo(()=>xt*X+Ct,[xt,Ct]),n.default.useEffect(()=>{ft.current=kt},[kt]),n.default.useEffect(()=>{Z(!0)},[]),n.default.useEffect(()=>{const t=pt.current;if(t){const e=t.getBoundingClientRect().height;return ut(e),N(t=>[{toastId:x.id,height:e,position:x.position},...t]),()=>N(t=>t.filter(t=>t.toastId!==x.id))}},[N,x.id]),n.default.useLayoutEffect(()=>{if(!Q)return;const t=pt.current,e=t.style.height;t.style.height='auto';const o=t.getBoundingClientRect().height;t.style.height=e,ut(o),N(t=>t.find(t=>t.toastId===x.id)?t.map(t=>t.toastId===x.id?Object.assign({},t,{height:o}):t):[{toastId:x.id,height:o,position:x.position},...t])},[Q,x.title,x.description,N,x.id,x.jsx,x.action,x.cancel]);const Dt=n.default.useCallback(()=>{et(!0),dt(Nt.current),N(t=>t.filter(t=>t.toastId!==x.id)),setTimeout(()=>{R(x)},200)},[x,R,N,Nt]);n.default.useEffect(()=>{if(x.promise&&'loading'===bt||x.duration===1/0||'loading'===x.type)return;let t;return z||k||Ot?(()=>{if(St.current<jt.current){const t=(new Date).getTime()-jt.current;ft.current=ft.current-t}St.current=(new Date).getTime()})():ft.current!==1/0&&(jt.current=(new Date).getTime(),t=setTimeout(()=>{null==x.onAutoClose||x.onAutoClose.call(x,x),Dt()},ft.current)),()=>clearTimeout(t)},[z,k,x,bt,Ot,Dt]),n.default.useEffect(()=>{x.delete&&(Dt(),null==x.onDismiss||x.onDismiss.call(x,x))},[Dt,x.delete]);const Pt=x.icon||(null==F?void 0:F[bt])||i(bt);var Yt,It;return n.default.createElement("li",{tabIndex:0,ref:pt,className:T(A,yt,null==_?void 0:_.toast,null==x||null==(e=x.classNames)?void 0:e.toast,null==_?void 0:_.default,null==_?void 0:_[bt],null==x||null==(o=x.classNames)?void 0:o[bt]),"data-sonner-toast":"","data-rich-colors":null!=(Yt=x.richColors)?Yt:D,"data-styled":!Boolean(x.jsx||x.unstyled||E),"data-mounted":Q,"data-promise":Boolean(x.promise),"data-swiped":rt,"data-removed":tt,"data-visible":ht,"data-y-position":Bt,"data-x-position":Mt,"data-index":C,"data-front":gt,"data-swiping":at,"data-dismissible":vt,"data-type":bt,"data-invert":zt,"data-swipe-out":nt,"data-swipe-direction":G,"data-expanded":Boolean(z||U&&Q),"data-testid":x.testId,style:Object.assign({'--index':C,'--toasts-before':C,'--z-index':O.length-C,'--offset':`${tt?lt:Nt.current}px`,'--initial-height':U?'auto':`${ct}px`},Y,x.style),onDragEnd:()=>{ot(!1),W(null),Tt.current=null},onPointerDown:t=>{2!==t.button&&!Rt&&vt&&(mt.current=new Date,dt(Nt.current),t.target.setPointerCapture(t.pointerId),'BUTTON'!==t.target.tagName&&(ot(!0),Tt.current={x:t.clientX,y:t.clientY}))},onPointerUp:()=>{var t,e,o;if(nt||!vt)return;Tt.current=null;const n=Number((null==(t=pt.current)?void 0:t.style.getPropertyValue('--swipe-amount-x').replace('px',''))||0),s=Number((null==(e=pt.current)?void 0:e.style.getPropertyValue('--swipe-amount-y').replace('px',''))||0),i=(new Date).getTime()-(null==(o=mt.current)?void 0:o.getTime()),l='x'===q?n:s,c=Math.abs(l)/i;if(Math.abs(l)>=45||c>.11)return dt(Nt.current),null==x.onDismiss||x.onDismiss.call(x,x),J('x'===q?n>0?'right':'left':s>0?'down':'up'),Dt(),void st(!0);var u,f;null==(u=pt.current)||u.style.setProperty('--swipe-amount-x',"0px"),null==(f=pt.current)||f.style.setProperty('--swipe-amount-y',"0px"),it(!1),ot(!1),W(null)},onPointerMove:e=>{var o,n,s;if(!Tt.current||!vt)return;if((null==(o=window.getSelection())?void 0:o.toString().length)>0)return;const i=e.clientY-Tt.current.y,l=e.clientX-Tt.current.x;var c;const u=null!=(c=t.swipeDirections)?c:B(V);!q&&(Math.abs(l)>1||Math.abs(i)>1)&&W(Math.abs(l)>Math.abs(i)?'x':'y');let f={x:0,y:0};const p=t=>1/(1.5+Math.abs(t)/20);if('y'===q){if(u.includes('top')||u.includes('bottom'))if(u.includes('top')&&i<0||u.includes('bottom')&&i>0)f.y=i;else{const t=i*p(i);f.y=Math.abs(t)<Math.abs(i)?t:i}}else if('x'===q&&(u.includes('left')||u.includes('right')))if(u.includes('left')&&l<0||u.includes('right')&&l>0)f.x=l;else{const t=l*p(l);f.x=Math.abs(t)<Math.abs(l)?t:l}(Math.abs(f.x)>0||Math.abs(f.y)>0)&&it(!0),null==(n=pt.current)||n.style.setProperty('--swipe-amount-x',`${f.x}px`),null==(s=pt.current)||s.style.setProperty('--swipe-amount-y',`${f.y}px`)}},Et&&!x.jsx&&'loading'!==bt?n.default.createElement("button",{"aria-label":K,"data-disabled":Rt,"data-close-button":!0,onClick:Rt||!vt?()=>{}:()=>{Dt(),null==x.onDismiss||x.onDismiss.call(x,x)},className:T(null==_?void 0:_.closeButton,null==x||null==(s=x.classNames)?void 0:s.closeButton)},null!=(It=null==F?void 0:F.close)?It:b):null,(bt||x.icon||x.promise)&&null!==x.icon&&(null!==(null==F?void 0:F[bt])||x.icon)?n.default.createElement("div",{"data-icon":"",className:T(null==_?void 0:_.icon,null==x||null==(l=x.classNames)?void 0:l.icon)},x.promise||'loading'===x.type&&!x.icon?x.icon||(function(){var t,e;return(null==F?void 0:F.loading)?n.default.createElement("div",{className:T(null==_?void 0:_.loader,null==x||null==(e=x.classNames)?void 0:e.loader,'sonner-loader'),"data-visible":'loading'===bt},F.loading):n.default.createElement(c,{className:T(null==_?void 0:_.loader,null==x||null==(t=x.classNames)?void 0:t.loader),visible:'loading'===bt})})():null,'loading'!==x.type?Pt:null):null,n.default.createElement("div",{"data-content":"",className:T(null==_?void 0:_.content,null==x||null==(u=x.classNames)?void 0:u.content)},n.default.createElement("div",{"data-title":"",className:T(null==_?void 0:_.title,null==x||null==(f=x.classNames)?void 0:f.title)},x.jsx?x.jsx:'function'==typeof x.title?x.title():x.title),x.description?n.default.createElement("div",{"data-description":"",className:T(L,wt,null==_?void 0:_.description,null==x||null==(p=x.classNames)?void 0:p.description)},'function'==typeof x.description?x.description():x.description):null),n.default.isValidElement(x.cancel)?x.cancel:x.cancel&&j(x.cancel)?n.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||I,onClick:t=>{j(x.cancel)&&vt&&(null==x.cancel.onClick||x.cancel.onClick.call(x.cancel,t),Dt())},className:T(null==_?void 0:_.cancelButton,null==x||null==(h=x.classNames)?void 0:h.cancelButton)},x.cancel.label):null,n.default.isValidElement(x.action)?x.action:x.action&&j(x.action)?n.default.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||$,onClick:t=>{j(x.action)&&(null==x.action.onClick||x.action.onClick.call(x.action,t),t.defaultPrevented||Dt())},className:T(null==_?void 0:_.actionButton,null==x||null==(y=x.classNames)?void 0:y.actionButton)},x.action.label):null)};function C(){if('undefined'==typeof window)return'ltr';if('undefined'==typeof document)return'ltr';const t=document.documentElement.getAttribute('dir');return'auto'!==t&&t?t:window.getComputedStyle(document.documentElement).direction}function O(t,e){const o={};return[t,e].forEach((t,e)=>{const n=1===e,s=n?'--mobile-offset':'--offset',i=n?"16px":"24px";function l(t){['top','right','bottom','left'].forEach(e=>{o[`${s}-${e}`]='number'==typeof t?`${t}px`:t})}'number'==typeof t||'string'==typeof t?l(t):'object'==typeof t?['top','right','bottom','left'].forEach(e=>{void 0===t[e]?o[`${s}-${e}`]=i:o[`${s}-${e}`]='number'==typeof t[e]?`${t[e]}px`:t[e]}):l(i)}),o}function z(){const[t,e]=n.default.useState([]);return n.default.useEffect(()=>w.subscribe(t=>{t.dismiss?setTimeout(()=>{s.default.flushSync(()=>{e(e=>e.filter(e=>e.id!==t.id))})}):setTimeout(()=>{s.default.flushSync(()=>{e(e=>{const o=e.findIndex(e=>e.id===t.id);return-1!==o?[...e.slice(0,o),Object.assign({},e[o],t),...e.slice(o+1)]:[t,...e]})})})}),[]),{toasts:t}}const R=n.default.forwardRef(function(t,e){const{id:o,invert:i,position:l="bottom-right",hotkey:c=['altKey','KeyT'],expand:u,closeButton:f,className:p,offset:h,mobileOffset:b,theme:v="light",richColors:y,duration:x,style:E,visibleToasts:k=N,toastOptions:j,dir:T=C(),gap:B=S,icons:z,containerAriaLabel:R="Notifications"}=t,[D,P]=n.default.useState([]),Y=n.default.useMemo(()=>o?D.filter(t=>t.toasterId===o):D.filter(t=>!t.toasterId),[D,o]),I=n.default.useMemo(()=>Array.from(new Set([l].concat(Y.filter(t=>t.position).map(t=>t.position)))),[Y,l]),[$,A]=n.default.useState([]),[L,H]=n.default.useState(!1),[V,X]=n.default.useState(!1),[U,_]=n.default.useState('system'!==v?v:'undefined'!=typeof window&&window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'),F=n.default.useRef(null),K=c.join('+').replace(/Key/g,'').replace(/Digit/g,''),q=n.default.useRef(null),W=n.default.useRef(!1),G=n.default.useCallback(t=>{P(e=>{var o;return(null==(o=e.find(e=>e.id===t.id))?void 0:o.delete)||w.dismiss(t.id),e.filter(({id:e})=>e!==t.id)})},[]);return n.default.useEffect(()=>w.subscribe(t=>{t.dismiss?requestAnimationFrame(()=>{P(e=>e.map(e=>e.id===t.id?Object.assign({},e,{delete:!0}):e))}):setTimeout(()=>{s.default.flushSync(()=>{P(e=>{const o=e.findIndex(e=>e.id===t.id);return-1!==o?[...e.slice(0,o),Object.assign({},e[o],t),...e.slice(o+1)]:[t,...e]})})})}),[D]),n.default.useEffect(()=>{if('system'!==v)return void _(v);if('system'===v&&(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?_('dark'):_('light')),'undefined'==typeof window)return;const t=window.matchMedia('(prefers-color-scheme: dark)');try{t.addEventListener('change',({matches:t})=>{_(t?'dark':'light')})}catch(e){t.addListener(({matches:t})=>{try{_(t?'dark':'light')}catch(t){console.error(t)}})}},[v]),n.default.useEffect(()=>{D.length<=1&&H(!1)},[D]),n.default.useEffect(()=>{const t=t=>{var e;var o;c.every(e=>t[e]||t.code===e)&&(H(!0),null==(o=F.current)||o.focus());'Escape'!==t.code||document.activeElement!==F.current&&!(null==(e=F.current)?void 0:e.contains(document.activeElement))||H(!1)};return document.addEventListener('keydown',t),()=>document.removeEventListener('keydown',t)},[c]),n.default.useEffect(()=>{if(F.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,W.current=!1)}},[F.current]),n.default.createElement("section",{ref:e,"aria-label":`${R} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((e,o)=>{var s;const[l,c]=e.split('-');return Y.length?n.default.createElement("ol",{key:e,dir:'auto'===T?C():T,tabIndex:-1,ref:F,className:p,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":l,"data-x-position":c,style:Object.assign({'--front-toast-height':`${(null==(s=$[0])?void 0:s.height)||0}px`,'--width':"356px",'--gap':`${B}px`},E,O(h,b)),onBlur:t=>{W.current&&!t.currentTarget.contains(t.relatedTarget)&&(W.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:t=>{t.target instanceof HTMLElement&&'false'===t.target.dataset.dismissible||W.current||(W.current=!0,q.current=t.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{V||H(!1)},onDragEnd:()=>H(!1),onPointerDown:t=>{t.target instanceof HTMLElement&&'false'===t.target.dataset.dismissible||X(!0)},onPointerUp:()=>X(!1)},Y.filter(t=>!t.position&&0===o||t.position===e).map((o,s)=>{var l,c;return n.default.createElement(M,{key:o.id,icons:z,index:s,toast:o,defaultRichColors:y,duration:null!=(l=null==j?void 0:j.duration)?l:x,className:null==j?void 0:j.className,descriptionClassName:null==j?void 0:j.descriptionClassName,invert:i,visibleToasts:k,closeButton:null!=(c=null==j?void 0:j.closeButton)?c:f,interacting:V,position:e,style:null==j?void 0:j.style,unstyled:null==j?void 0:j.unstyled,classNames:null==j?void 0:j.classNames,cancelButtonStyle:null==j?void 0:j.cancelButtonStyle,actionButtonStyle:null==j?void 0:j.actionButtonStyle,closeButtonAriaLabel:null==j?void 0:j.closeButtonAriaLabel,removeToast:G,toasts:Y.filter(t=>t.position==o.position),heights:$.filter(t=>t.position==o.position),setHeights:A,expandByDefault:u,gap:B,expanded:L,swipeDirections:t.swipeDirections})})):null}))})},389,[131,38,40]);
|
|
471
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STREAM_CONTROLS_HEIGHT",{enumerable:!0,get:function(){return b}}),e.StreamControls=function({appearance:l,appearanceDisabled:b=!1,onToggleAppearance:h,onHome:j,onReload:k,onRotate:C,onSave:v,recording:p=null}){const R=(0,n.areRecordingControlsLocked)(p),f=b||null===l;return(0,o.jsxs)("div",{role:"toolbar","aria-label":"Device controls",style:{display:
|
|
472
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EmptyState=function({platform:n,framed:s=!0}){const l=
|
|
471
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STREAM_CONTROLS_HEIGHT",{enumerable:!0,get:function(){return b}}),e.StreamControls=function({appearance:l,appearanceDisabled:b=!1,onToggleAppearance:h,onHome:j,onReload:k,onRotate:C,onSave:v,recording:p=null}){const R=(0,n.areRecordingControlsLocked)(p),f=b||null===l;return(0,o.jsxs)("div",{role:"toolbar","aria-label":"Device controls",style:{display:"flex",alignItems:"center",gap:s},children:[(0,o.jsxs)(x,{children:[(0,o.jsx)(t.ControlButton,{icon:(0,o.jsx)(t.CameraIcon,{size:c,strokeWidth:u}),label:"Save",onClick:v}),(0,o.jsx)(t.ControlButton,{icon:(0,o.jsx)(t.ThemeIcon,{size:c,strokeWidth:u}),label:"Theme",role:"switch","aria-checked":"dark"===l,disabled:f,onClick:f?void 0:h,style:f?{color:t.text.tertiary,cursor:"not-allowed"}:void 0}),(0,o.jsx)(t.ControlButton,{icon:(0,o.jsx)(t.HomeIcon,{size:c,strokeWidth:u}),label:"Home",onClick:j}),(0,o.jsx)(t.ControlButton,{icon:(0,o.jsx)(t.RefreshIcon,{size:c,strokeWidth:u}),label:"Reload",onClick:k})]}),(0,o.jsx)(x,{children:(0,o.jsx)(t.ControlButton,{icon:(0,o.jsx)(t.RotateIcon,{size:c,strokeWidth:u}),label:"Rotate",tooltip:"unknown"===p?"Rotation is unavailable until recording status is known.":R?"Rotation is unavailable while recording.":void 0,"aria-disabled":R||void 0,onClick:R?void 0:C,style:R?{color:t.text.tertiary,cursor:"not-allowed"}:void 0})})]})};var o=r(d[0]),n=r(d[1]),t=r(d[2]);const l=4,s=24,c=20,u=1.67,b=t.CONTROL_BUTTON_SIZE+8+2;function x({children:n}){return(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",padding:l,boxSizing:"border-box",border:`1px solid ${t.border.default}`,borderRadius:t.radius.xl,backgroundColor:t.bg.element},children:n})}},390,[153,148,355]);
|
|
472
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.EmptyState=function({platform:n,framed:s=!0}){const l="ios"===n?"No booted simulators":"android"===n?"No booted emulators":"No booted devices",c="ios"===n?"There are no booted simulators. Use the + button to add one.":"android"===n?"There are no booted emulators or connected devices. Use the + button to add one.":"There are no booted simulators, emulators, or connected devices. Use the + button to add a simulator or emulator.";return(0,o.jsxs)("section",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16,padding:40,boxSizing:"border-box",backgroundColor:t.bg.subtle,borderLeft:s?`1px solid ${t.border.default}`:"none",borderRight:s?`1px solid ${t.border.default}`:"none",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.default},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:l}),(0,o.jsx)("p",{style:Object.assign({},t.textSize.sm,{color:t.text.secondary,margin:0,maxWidth:320}),children:c})]})};var o=r(d[0]),t=r(d[1])},391,[153,355]);
|
|
473
473
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OutputSection=function({client:c}){return(0,t.jsx)(n.LogsSection,{client:c})};var t=r(d[0]),n=r(d[1])},392,[153,378]);
|
|
474
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamSection=function({mode:b,availability:u,onChange:v}){const h=(0,t.useId)(),j=!u.h264||!u.webrtc,p=c.map(l=>Object.assign({},l,{disabled:!u[l.value]}));return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.SidebarRow,{label:"Stream",children:(0,l.jsx)(s.Select,{ariaLabel:"Stream mode",ariaDescribedBy:j?h:void 0,options:p,value:b,onChange:v})}),j&&(0,l.jsx)("span",{id:h,style:Object.assign({},n.textSize.xs,{display:
|
|
475
|
-
__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:
|
|
476
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.temporarilyInertElement=l,e.ServerConnectionOverlay=function({status:c,onReload:u}){const f=
|
|
474
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.StreamSection=function({mode:b,availability:u,onChange:v}){const h=(0,t.useId)(),j=!u.h264||!u.webrtc,p=c.map(l=>Object.assign({},l,{disabled:!u[l.value]}));return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.SidebarRow,{label:"Stream",children:(0,l.jsx)(s.Select,{ariaLabel:"Stream mode",ariaDescribedBy:j?h:void 0,options:p,value:b,onChange:v})}),j&&(0,l.jsx)("span",{id:h,style:Object.assign({},n.textSize.xs,{display:"block",padding:"0 0 11px",color:n.text.tertiary}),children:"H.264 and WebRTC require localhost or HTTPS. MJPEG is used on insecure HTTP."})]})};var l=r(d[0]),t=r(d[1]),s=r(d[2]),n=r(d[3]),o=r(d[4]);const c=[{value:"mjpeg",label:"MJPEG"},{value:"h264",label:"H.264"},{value:"webrtc",label:"WebRTC"}]},393,[153,38,325,355,363]);
|
|
475
|
+
__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])},394,[153,355]);
|
|
476
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.temporarilyInertElement=l,e.ServerConnectionOverlay=function({status:c,onReload:u}){const f="connecting"===c,[x,b]=(0,n.useState)(!1),h=!f||x,y=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!f)return;const t=setTimeout(()=>b(!0),s);return()=>clearTimeout(t)},[f]),(0,n.useEffect)(()=>{if(!h)return;const t=y.current;if(!t)return;const n=new Map,o=o=>{if(!(o instanceof HTMLElement)||o===t||o.contains(t))return;const s=l(o);s&&n.set(o,s)};for(const t of document.body.children)o(t);const s=new MutationObserver(t=>{for(const n of t)for(const t of n.addedNodes)o(t)});return s.observe(document.body,{childList:!0}),t.focus({preventScroll:!0}),()=>{s.disconnect();for(const t of n.values())t()}},[h]),h?(0,t.jsx)("main",{ref:y,role:"alertdialog","aria-modal":"true","aria-labelledby":"server-connection-overlay-title","aria-describedby":"server-connection-overlay-description","aria-busy":f,tabIndex:-1,style:{position:"fixed",inset:0,zIndex:610,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",minWidth:0,minHeight:"100vh",padding:24,backgroundColor:`color-mix(in srgb, ${o.bg.screen} 68%, transparent)`,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:o.text.default,fontFamily:o.font.sans,outline:"none",pointerEvents:"auto"},children:(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",maxWidth:440,padding:"40px 32px",boxSizing:"border-box",backgroundColor:`color-mix(in srgb, ${o.bg.default} 92%, transparent)`,border:`1px solid ${o.border.secondary}`,borderRadius:o.radius.xl,boxShadow:o.shadow.sm,textAlign:"center"},children:[(0,t.jsx)(o.Logo,{style:{marginBottom:32}}),(0,t.jsx)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,marginBottom:20,border:`1px solid ${o.border.secondary}`,borderRadius:o.radius.full,backgroundColor:f?o.bg.subtle:o.bg.default},children:f?(0,t.jsx)(o.RefreshIcon,{size:24,color:o.icon.secondary}):(0,t.jsx)(o.CableDisconnectIcon,{size:24,color:o.icon.default})}),(0,t.jsxs)("div",{"aria-live":"assertive",children:[(0,t.jsx)("h1",{id:"server-connection-overlay-title",style:Object.assign({},o.heading["2xl"],{margin:0,color:o.text.default}),children:f?"Connecting to the Expo dev server":"Server disconnected"}),(0,t.jsx)("p",{id:"server-connection-overlay-description",style:Object.assign({},o.textSize.sm,{maxWidth:360,margin:"12px 0 0",color:o.text.secondary}),children:f?"If this takes more than a few seconds, restart the Expo dev server in your terminal. Once it is running, reload this page.":(0,t.jsxs)(t.Fragment,{children:["Restart the server in your terminal.",(0,t.jsx)("br",{}),"Once started reload this page if necessary."]})})]}),(0,t.jsx)(o.Button,{theme:"primary",size:"lg",leftSlot:(0,t.jsx)(o.RefreshIcon,{size:18}),onClick:u,style:{marginTop:24},children:"Reload page"})]})}):null};var t=r(d[0]),n=r(d[1]),o=r(d[2]);const s=1e3;function l(t){return t.inert?null:(t.inert=!0,()=>{t.inert=!1})}},395,[153,38,355]);
|
|
477
477
|
__d(function(e,t,i,s,r,o,c){r.exports={uri:"./assets/assets/device-frames/google-pixel-10-pro.4be4305b71cc5ee280c371ad2940d668.png",width:1250,height:2631,toString(){return this.uri}}},396,[]);
|
|
478
478
|
__d(function(e,i,s,t,r,c,n){r.exports={uri:"./assets/assets/device-frames/pixel_9_obsidian.b1a3bf1092470cc90ec0bc9f38358e30.png",width:1935,height:4096,toString(){return this.uri}}},397,[]);
|
|
479
479
|
__d(function(e,i,s,t,r,a,d){r.exports={uri:"./assets/assets/device-frames/iphone-17-pro-silver.d76ae8bc19f9a6f4ab4d64c630ed0627.png",width:2620,height:5420,toString(){return this.uri}}},398,[]);
|
|
480
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AnimatedDockedSidebar=function({side:s,width:o,open:l,sidebarOpen:h,resizing:S=!1,children:c}){const{present:I,reducedMotion:_,visible:v}=(0,t.useSidebarPresence)(l,!h);if(!I)return null;const A=_||S?void 0:`width ${t.SIDEBAR_TRANSITION_MS}ms ${t.SIDEBAR_TRANSITION_EASING}`,f=_?void 0:`transform ${t.SIDEBAR_TRANSITION_MS}ms ${t.SIDEBAR_TRANSITION_EASING}`;return(0,n.jsx)("div",{"aria-hidden":!v||void 0,"data-sidebar-docked":s,"data-state":v?
|
|
481
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SIDEBAR_TRANSITION_MS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SIDEBAR_TRANSITION_EASING",{enumerable:!0,get:function(){return c}}),e.useSidebarPresence=function(c,o){const s=(0,t.usePrefersReducedMotion)(),[f,b]=(0,n.useState)(c),[l,A]=(0,n.useState)(c),S=(0,n.useRef)(c);return(0,n.useEffect)(()=>{if(c){const t=S.current;if(S.current=!0,b(!0),s||t)return void A(!0);let n=0;const u=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>A(!0))});return()=>{cancelAnimationFrame(u),cancelAnimationFrame(n)}}if(A(!1),!o||s)return S.current=!1,void b(!1);const t=window.setTimeout(()=>{S.current=!1,b(!1)},u);return()=>window.clearTimeout(t)},[o,c,s]),{present:f,reducedMotion:s,visible:c&&l}};var t=r(d[0]),n=r(d[1]);const u=200,c=
|
|
482
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.dashboardHideBootDevice=function(){return
|
|
483
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.basePath=function(){if(window.__DEV__)return
|
|
484
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.trimTrailingSlash=function(t){return t.replace(/\/+$/,
|
|
485
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shutdownDevice=function(t){return u(o(),t)},e.removeDevice=function(t){return u(c(),t)},e.bootDevice=async function(t){return p(s(),{platform:t.platform,id:t.id,name:t.name})},e.createDevice=async function(t){return p(l(),{platform:t.platform,name:t.name,runtime:t.runtime,deviceType:t.deviceType})};var t=r(d[0]),n=r(d[1]);const o=()=>`${(0,t.basePath)()}/api/devices/shutdown`,c=()=>`${(0,t.basePath)()}/api/devices/remove`,s=()=>`${(0,t.basePath)()}/api/devices/boot`,l=()=>`${(0,t.basePath)()}/api/devices/create`;async function u(t,o){try{const c=await fetch(t,{method:
|
|
486
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){if(!t||
|
|
487
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEFAULT_SIDEBAR_WIDTH",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY",{enumerable:!0,get:function(){return u}}),e.readHideUnsupportedDevices=D,e.persistHideUnsupportedDevicesDefault=function(t){try{null===t.getItem(u)&&t.setItem(u,
|
|
480
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AnimatedDockedSidebar=function({side:s,width:o,open:l,sidebarOpen:h,resizing:S=!1,children:c}){const{present:I,reducedMotion:_,visible:v}=(0,t.useSidebarPresence)(l,!h);if(!I)return null;const A=_||S?void 0:`width ${t.SIDEBAR_TRANSITION_MS}ms ${t.SIDEBAR_TRANSITION_EASING}`,f=_?void 0:`transform ${t.SIDEBAR_TRANSITION_MS}ms ${t.SIDEBAR_TRANSITION_EASING}`;return(0,n.jsx)("div",{"aria-hidden":!v||void 0,"data-sidebar-docked":s,"data-state":v?"open":"closed",style:{width:v?o:0,height:"100%",flexShrink:0,overflow:"hidden",pointerEvents:v?void 0:"none",transition:A},children:(0,n.jsx)("div",{style:{width:o,height:"100%",transform:v?"translateX(0)":`translateX(${"left"===s?"-100%":"100%"})`,transition:f,willChange:"transform"},children:c})})};var t=r(d[0]),n=r(d[1])},399,[400,153]);
|
|
481
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SIDEBAR_TRANSITION_MS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SIDEBAR_TRANSITION_EASING",{enumerable:!0,get:function(){return c}}),e.useSidebarPresence=function(c,o){const s=(0,t.usePrefersReducedMotion)(),[f,b]=(0,n.useState)(c),[l,A]=(0,n.useState)(c),S=(0,n.useRef)(c);return(0,n.useEffect)(()=>{if(c){const t=S.current;if(S.current=!0,b(!0),s||t)return void A(!0);let n=0;const u=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>A(!0))});return()=>{cancelAnimationFrame(u),cancelAnimationFrame(n)}}if(A(!1),!o||s)return S.current=!1,void b(!1);const t=window.setTimeout(()=>{S.current=!1,b(!1)},u);return()=>window.clearTimeout(t)},[o,c,s]),{present:f,reducedMotion:s,visible:c&&l}};var t=r(d[0]),n=r(d[1]);const u=200,c="cubic-bezier(0.16, 1, 0.3, 1)"},400,[236,38]);
|
|
482
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.dashboardHideBootDevice=function(){return"undefined"!=typeof window&&!0===window.__EXPO_DEVICE_HUB_HIDE_BOOT_DEVICE__}},401,[]);
|
|
483
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.basePath=function(){if(window.__DEV__)return"/_expo/plugins/expo-device-hub";const n=window.__EXPO_DEVICE_HUB_BASE_PATH__;if(null==n)throw new Error("window.__EXPO_DEVICE_HUB_BASE_PATH__ is not defined");return(0,_.trimTrailingSlash)(n)};var _=r(d[0])},402,[403]);
|
|
484
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.trimTrailingSlash=function(t){return t.replace(/\/+$/,"")}},403,[]);
|
|
485
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shutdownDevice=function(t){return u(o(),t)},e.removeDevice=function(t){return u(c(),t)},e.bootDevice=async function(t){return p(s(),{platform:t.platform,id:t.id,name:t.name})},e.createDevice=async function(t){return p(l(),{platform:t.platform,name:t.name,runtime:t.runtime,deviceType:t.deviceType})};var t=r(d[0]),n=r(d[1]);const o=()=>`${(0,t.basePath)()}/api/devices/shutdown`,c=()=>`${(0,t.basePath)()}/api/devices/remove`,s=()=>`${(0,t.basePath)()}/api/devices/boot`,l=()=>`${(0,t.basePath)()}/api/devices/create`;async function u(t,o){try{const c=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})});if(!c.ok)throw new Error(`Unexpected ${c.status}`);const s=await c.json();return(0,n.logUtilityErrors)(s.errors),!0===s.ok}catch(t){return console.warn("[expo-device-hub] Device action failed:",t),!1}}async function p(t,o){try{const c=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o),signal:AbortSignal.timeout(2e5)}),s=await c.json();if((0,n.logUtilityErrors)(s.errors),!c.ok)return{id:null,error:s.error??`Unexpected ${c.status}`};const l=s.id??s.serial;return s.ok&&l?{id:l,error:null}:{id:null,error:s.error??"The device did not come online."}}catch(t){return console.warn("[expo-device-hub] Device start failed:",t),{id:null,error:t instanceof Error?t.message:String(t)}}}},404,[402,405]);
|
|
486
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){if(!t||"object"!=typeof t)return!1;const o=t;return"string"==typeof o.id&&"string"==typeof o.message&&"string"==typeof o.error}Object.defineProperty(e,'__esModule',{value:!0}),e.isUtilityError=t,e.logUtilityErrors=function(o,n=new Set){const s=new Set;if(!Array.isArray(o))return s;for(const f of o)t(f)&&!s.has(f.id)&&(s.add(f.id),n.has(f.id)||console.error(f.message,f.error));return s}},405,[]);
|
|
487
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEFAULT_SIDEBAR_WIDTH",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY",{enumerable:!0,get:function(){return u}}),e.readHideUnsupportedDevices=D,e.persistHideUnsupportedDevicesDefault=function(t){try{null===t.getItem(u)&&t.setItem(u,"true")}catch{}},e.createDashboardStore=v,Object.defineProperty(e,"useDashboardStore",{enumerable:!0,get:function(){return f}});var t=r(d[0]),s=r(d[1]),c=r(d[2]),n=r(d[3]);const o=400,u="expo-device-hub.hideUnsupportedDevices";function D(t){try{return"false"!==t.getItem(u)}catch{return!0}}function l(){if("undefined"==typeof window)return!0;try{return D(window.localStorage)}catch{return!0}}function b(){const t=(0,n.browserStreamModeAvailability)();return{selectedDeviceId:"",addedDevices:[],streamMode:(0,n.resolveStreamMode)((0,c.dashboardTransport)(),t),sidebarWidths:{left:o,right:o},sidebarPreferences:{left:(0,s.dashboardHideSidebar)()?"hidden":"auto",right:"auto"},lastOpenedSidebar:"right",hideUnsupportedDevices:l(),showDeviceFrame:!0}}function v(s={}){return(0,t.create)()(t=>Object.assign({},b(),s,{selectDevice:s=>t({selectedDeviceId:s}),reconcileSelectedDevice:s=>t(t=>s.includes(t.selectedDeviceId)?t:{selectedDeviceId:s[0]??""}),trackAddedDevice:(s,c)=>t(t=>{const n=new Set([...c,s.id]);return{addedDevices:[...t.addedDevices.filter(t=>!n.has(t.id)),s],selectedDeviceId:s.id}}),dismissDevice:s=>t(t=>({addedDevices:t.addedDevices.filter(t=>t.id!==s),selectedDeviceId:t.selectedDeviceId===s?"":t.selectedDeviceId})),chooseStreamMode:(s,c)=>t({streamMode:(0,n.resolveStreamMode)(s,c)}),resizeSidebar:(s,c)=>t(t=>({sidebarWidths:Object.assign({},t.sidebarWidths,{[s]:c})})),openSidebar:(s,c)=>t(t=>({sidebarPreferences:Object.assign({},t.sidebarPreferences,{[s]:c?"auto":"open"}),lastOpenedSidebar:s})),closeSidebar:s=>t(t=>({sidebarPreferences:Object.assign({},t.sidebarPreferences,{[s]:"hidden"})})),setHideUnsupportedDevices:s=>t({hideUnsupportedDevices:s}),setShowDeviceFrame:s=>t({showDeviceFrame:s})}))}const f=v()},406,[407,410,411,412]);
|
|
488
488
|
__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]}})})},407,[408,409]);
|
|
489
489
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"createStore",{enumerable:!0,get:function(){return n}});const t=t=>{let n;const c=new Set,o=(t,o)=>{const s="function"==typeof t?t(n):t;if(!Object.is(s,n)){const t=n;n=(null!=o?o:"object"!=typeof s||null===s)?s:Object.assign({},n,s),c.forEach(c=>c(n,t))}},s=()=>n,u={setState:o,getState:s,getInitialState:()=>l,subscribe:t=>(c.add(t),()=>c.delete(t))},l=n=t(o,s,u);return u},n=n=>n?t(n):t},408,[]);
|
|
490
490
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"create",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]);const c=e=>e;function l(e,t=c){const n=u.default.useSyncExternalStore(e.subscribe,u.default.useCallback(()=>t(e.getState()),[e,t]),u.default.useCallback(()=>t(e.getInitialState()),[e,t]));return u.default.useDebugValue(n),n}const s=e=>{const t=(0,n.createStore)(e),u=e=>l(t,e);return Object.assign(u,t),u},o=e=>e?s(e):s},409,[38,408]);
|
|
491
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.dashboardHideSidebar=function(){return
|
|
492
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEFAULT_TRANSPORT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"TRANSPORTS",{enumerable:!0,get:function(){return t}}),e.parseTransport=o,e.dashboardTransport=function(){return
|
|
493
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return{mjpeg:!0,h264:t.secureContext&&t.h264Decoder,webrtc:t.secureContext&&t.webRtc}}Object.defineProperty(e,'__esModule',{value:!0}),e.streamModeAvailability=t,e.browserStreamModeAvailability=function(){if(
|
|
494
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY",{enumerable:!0,get:function(){return n.HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY}}),Object.defineProperty(e,"persistHideUnsupportedDevicesDefault",{enumerable:!0,get:function(){return n.persistHideUnsupportedDevicesDefault}}),Object.defineProperty(e,"readHideUnsupportedDevices",{enumerable:!0,get:function(){return n.readHideUnsupportedDevices}}),e.useHideUnsupportedDevices=function(){const s=(0,n.useDashboardStore)(t=>t.hideUnsupportedDevices),o=(0,n.useDashboardStore)(t=>t.setHideUnsupportedDevices);return(0,t.useEffect)(()=>{(0,n.persistHideUnsupportedDevicesDefault)(window.localStorage);const t=t=>{t&&null!==t.key&&t.key!==n.HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY||o((0,n.readHideUnsupportedDevices)(window.localStorage))};return t(),window.addEventListener(
|
|
495
|
-
__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)(
|
|
496
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["errors"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.devicesWebSocketUrl=E,_e.subscribeToDeviceList=y,_e.parseDeviceListSocketMessage=T,_e.parseDeviceListMessage=function(e){const t=T(e);return t?.type===c.DEVICE_LIST_MESSAGE_TYPE?t.devices:null},_e.splitDeviceList=M,_e.useDeviceLists=function(){const{devices:e,connectionStatus:t}=p(),s=(0,o.useMemo)(()=>M(e),[e]);return Object.assign({},s,{connectionStatus:t})};var t,s=r(d[0]),n=(t=s)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),u=r(d[3]),l=r(d[4]);function E(e=window.location.href){const t=new URL(`${(0,u.basePath)()}/api/devices/ws`,e);return t.protocol=
|
|
497
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_LIST_MESSAGE_TYPE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HEARTBEAT_MESSAGE_TYPE",{enumerable:!0,get:function(){return n}});const t=
|
|
498
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.floatingSidebarToggleInset=function(t,n,c){return t&&n<c+s?l:o},e.FloatingSidebarToggle=function({side:l,inset:s=o,onClick:c}){return(0,n.jsx)("div",{"data-floating-sidebar-toggle":l,style:{position:
|
|
499
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.argentInteractionsWebSocketUrl=l,e.useArgentInteractions=f,e.useArgentInteraction=function(t){const n=f();return t?n[t]??null:null},e.parseArgentInteractionMessage=y;var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);const c=500,u=1e4;function l(t=window.location.href){const n=new URL(`${(0,s.basePath)()}/api/argent-interactions/ws`,t);return n.protocol=
|
|
500
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARGENT_INTERACTION_MESSAGE_TYPE",{enumerable:!0,get:function(){return t}}),e.argentInteractionMessage=function(n){return{type:t,interaction:n}};const t=
|
|
491
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.dashboardHideSidebar=function(){return"undefined"!=typeof window&&!0===window.__EXPO_DEVICE_HUB_HIDE_SIDEBAR__}},410,[]);
|
|
492
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEFAULT_TRANSPORT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"TRANSPORTS",{enumerable:!0,get:function(){return t}}),e.parseTransport=o,e.dashboardTransport=function(){return"undefined"==typeof window?n:o(window.__EXPO_DEVICE_HUB_TRANSPORT__)??n};const n="mjpeg",t=["mjpeg","h264","webrtc"];function o(n){return t.includes(n)?n:void 0}},411,[]);
|
|
493
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return{mjpeg:!0,h264:t.secureContext&&t.h264Decoder,webrtc:t.secureContext&&t.webRtc}}Object.defineProperty(e,'__esModule',{value:!0}),e.streamModeAvailability=t,e.browserStreamModeAvailability=function(){if("undefined"==typeof window)return{mjpeg:!0,h264:!1,webrtc:!1};return t({secureContext:window.isSecureContext,h264Decoder:void 0!==window.VideoDecoder,webRtc:void 0!==window.RTCPeerConnection&&void 0!==window.RTCRtpReceiver})},e.androidStreamModeAvailability=function(t,o){return Object.assign({},t,{h264:t.h264||o})},e.resolveStreamMode=function(t,o){return o[t]?t:"mjpeg"}},412,[]);
|
|
494
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY",{enumerable:!0,get:function(){return n.HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY}}),Object.defineProperty(e,"persistHideUnsupportedDevicesDefault",{enumerable:!0,get:function(){return n.persistHideUnsupportedDevicesDefault}}),Object.defineProperty(e,"readHideUnsupportedDevices",{enumerable:!0,get:function(){return n.readHideUnsupportedDevices}}),e.useHideUnsupportedDevices=function(){const s=(0,n.useDashboardStore)(t=>t.hideUnsupportedDevices),o=(0,n.useDashboardStore)(t=>t.setHideUnsupportedDevices);return(0,t.useEffect)(()=>{(0,n.persistHideUnsupportedDevicesDefault)(window.localStorage);const t=t=>{t&&null!==t.key&&t.key!==n.HIDE_UNSUPPORTED_DEVICES_STORAGE_KEY||o((0,n.readHideUnsupportedDevices)(window.localStorage))};return t(),window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[o]),s},e.visibleDevices=function(t,n){return n?t.filter(t=>t.supported):t},e.visibleNewDeviceOptions=function(t,n){return n?{runtimes:t.runtimes.map(t=>Object.assign({},t,{models:t.models.filter(t=>t.supported)})).filter(t=>t.models.length>0)}:t};var t=r(d[0]),n=r(d[1])},413,[38,406]);
|
|
495
|
+
__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])},414,[38]);
|
|
496
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["errors"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.devicesWebSocketUrl=E,_e.subscribeToDeviceList=y,_e.parseDeviceListSocketMessage=T,_e.parseDeviceListMessage=function(e){const t=T(e);return t?.type===c.DEVICE_LIST_MESSAGE_TYPE?t.devices:null},_e.splitDeviceList=M,_e.useDeviceLists=function(){const{devices:e,connectionStatus:t}=p(),s=(0,o.useMemo)(()=>M(e),[e]);return Object.assign({},s,{connectionStatus:t})};var t,s=r(d[0]),n=(t=s)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),u=r(d[3]),l=r(d[4]);function E(e=window.location.href){const t=new URL(`${(0,u.basePath)()}/api/devices/ws`,e);return t.protocol="https:"===t.protocol?"wss:":"ws:",t.toString()}const S={simulators:[],emulators:[]},f=500,v=1e4,_=6e3;function y({url:e=E(),createSocket:t=e=>new WebSocket(e),schedule:s=setTimeout,cancelSchedule:n=clearTimeout,reconnectMinMs:o=f,reconnectMaxMs:u=v,heartbeatTimeoutMs:l=_,onSnapshot:S,onStatus:y}){let p=!1,M=null,A=null,h=null,b=o,L="connecting";const D=e=>{L!==e&&(L=e,y(e))},w=()=>{null!==h&&(n(h),h=null)},I=()=>{p||null!==A||(A=s(()=>{A=null,k()},b),b=Math.min(2*b,u))},P=e=>{if(!p&&M===e){M=null,w(),D("disconnected");try{e.close()}catch{}I()}},G=e=>{w(),h=s(()=>P(e),l)},Y=e=>{p||M!==e||(b=o,D("connected"),G(e))};function k(){if(p)return;let s;try{s=t(e)}catch{return D("disconnected"),void I()}M=s,G(s),s.onmessage=e=>{const t=T(e.data);t&&(Y(s),t.type===c.DEVICE_LIST_MESSAGE_TYPE&&S(t.devices))},s.onerror=()=>P(s),s.onclose=()=>P(s)}return y(L),k(),()=>{p=!0,null!==A&&n(A),w();const e=M;M=null;try{e?.close()}catch{}}}function p(){const[t,s]=(0,o.useState)(S),[c,u]=(0,o.useState)("connecting");return(0,o.useEffect)(()=>{let t=new Set;return y({onSnapshot:o=>{t=(0,l.logUtilityErrors)(o.errors,t);const c=(0,n.default)(o,e);s(c)},onStatus:u})},[]),{devices:t,connectionStatus:c}}function T(e){if("string"!=typeof e)return null;try{const t=JSON.parse(e);if(t.type===c.HEARTBEAT_MESSAGE_TYPE)return{type:c.HEARTBEAT_MESSAGE_TYPE};if(t.type!==c.DEVICE_LIST_MESSAGE_TYPE||!Array.isArray(t.devices?.simulators)||!Array.isArray(t.devices?.emulators)||void 0!==t.devices.errors&&!Array.isArray(t.devices.errors))return null;const s=t.devices.errors?.filter(l.isUtilityError);return{type:c.DEVICE_LIST_MESSAGE_TYPE,devices:Object.assign({simulators:t.devices.simulators,emulators:t.devices.emulators},s?{errors:s}:{})}}catch{return null}}function M(e){const t=t=>({simulators:e.simulators.filter(e=>e.booted===t),emulators:e.emulators.filter(e=>e.booted===t)});return{booted:t(!0),recent:t(!1)}}},415,[131,38,416,402,405]);
|
|
497
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEVICE_LIST_MESSAGE_TYPE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HEARTBEAT_MESSAGE_TYPE",{enumerable:!0,get:function(){return n}});const t="device-list",n="heartbeat"},416,[]);
|
|
498
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.floatingSidebarToggleInset=function(t,n,c){return t&&n<c+s?l:o},e.FloatingSidebarToggle=function({side:l,inset:s=o,onClick:c}){return(0,n.jsx)("div",{"data-floating-sidebar-toggle":l,style:{position:"absolute",top:28,[l]:s,zIndex:15},children:(0,n.jsx)(t.SidebarToggle,{floating:!0,side:l,onClick:c})})};var t=r(d[0]),n=r(d[1]);const o=24,l=80,s=40},417,[236,153]);
|
|
499
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.argentInteractionsWebSocketUrl=l,e.useArgentInteractions=f,e.useArgentInteraction=function(t){const n=f();return t?n[t]??null:null},e.parseArgentInteractionMessage=y;var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);const c=500,u=1e4;function l(t=window.location.href){const n=new URL(`${(0,s.basePath)()}/api/argent-interactions/ws`,t);return n.protocol="https:"===n.protocol?"wss:":"ws:",n.toString()}function f(){const[n,s]=(0,t.useState)({}),[f,p]=(0,t.useState)(()=>Date.now());(0,t.useEffect)(()=>{let t=!1,n=null,f=null,A=c;function w(){if(t)return;let u;try{u=new WebSocket(l())}catch{return void I()}n=u,u.onopen=()=>{A=c},u.onmessage=t=>{const n=y(t.data);if(!n)return;const c=Date.now(),u=(0,o.normalizeAgentInteractionTimestamp)(n.interaction,c);s(t=>Object.assign({},t,{[u.deviceId]:u})),p(c)},u.onerror=()=>u.close(),u.onclose=()=>{n===u&&(n=null,I())}}function I(){t||f||(f=setTimeout(()=>{f=null,w()},A),A=Math.min(2*A,u))}return w(),()=>{t=!0,f&&clearTimeout(f),n?.close()}},[]);const A=(0,t.useMemo)(()=>(0,o.activeAgentInteractions)(n,f),[n,f]);return(0,t.useEffect)(()=>{const t=(0,o.nextAgentInteractionExpiry)(A,f);if(null===t)return;const n=window.setTimeout(()=>p(Date.now()),Math.max(0,t-Date.now()));return()=>window.clearTimeout(n)},[A,f]),A}function y(t){if("string"!=typeof t)return null;try{const o=JSON.parse(t),s=o.interaction;return o.type===n.ARGENT_INTERACTION_MESSAGE_TYPE&&"string"==typeof s?.id&&"string"==typeof s.deviceId&&"string"==typeof s.timestamp&&Array.isArray(s.segments)&&s.segments.every(p)?o:null}catch{return null}}function p(t){return!!(A(t)&&w(t.startMs)&&Array.isArray(t.frames))&&t.frames.every(t=>A(t)&&w(t.atMs)&&Array.isArray(t.points)&&t.points.length>=1&&t.points.length<=2&&t.points.every(t=>A(t)&&w(t.x)&&w(t.y)))}function A(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function w(t){return"number"==typeof t&&Number.isFinite(t)}},418,[38,419,420,402]);
|
|
500
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARGENT_INTERACTION_MESSAGE_TYPE",{enumerable:!0,get:function(){return t}}),e.argentInteractionMessage=function(n){return{type:t,interaction:n}};const t="argent-interaction"},419,[]);
|
|
501
501
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.normalizeAgentInteractionTimestamp=function(t,n){return Number.isFinite(Date.parse(t.timestamp))?t:Object.assign({},t,{timestamp:new Date(n).toISOString()})},e.activeAgentInteractions=function(n,s){return Object.fromEntries(Object.entries(n).filter(([,n])=>(0,t.agentInteractionCursorExpiresAt)(n,s)>s))},e.nextAgentInteractionExpiry=function(n,s){let o=1/0;for(const c of Object.values(n)){const n=(0,t.agentInteractionCursorExpiresAt)(c,s);n>s&&(o=Math.min(o,n))}return Number.isFinite(o)?o:null};var t=r(d[0])},420,[148]);
|
|
502
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useNewDeviceOptions=function(){const[o,c]=(0,t.useState)(u);return(0,t.useEffect)(()=>{let t=!1;return(async()=>{try{const o=await fetch(s(),{headers:{Accept:
|
|
503
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarOverlay=function({side:s,open:l,sidebarOpen:c,topmost:b,onDismiss:u,children:p}){const{present:v,reducedMotion:f,visible:I}=(0,o.useSidebarPresence)(l,!c);if(!v)return null;const S=b?12:10,_=f?void 0:`opacity ${o.SIDEBAR_TRANSITION_MS}ms ease`,y=f?void 0:`transform ${o.SIDEBAR_TRANSITION_MS}ms ${o.SIDEBAR_TRANSITION_EASING}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"aria-hidden":"true","data-sidebar-backdrop":s,onClick:u,style:{position:
|
|
504
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveSidebarLayout=o,e.useSidebarLayout=function({leftWidth:s,rightWidth:c,minStreamWidth:h}){const f=(0,t.useRef)(null),[u,l]=(0,t.useState)(()=>
|
|
505
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function o(o){return
|
|
502
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useNewDeviceOptions=function(){const[o,c]=(0,t.useState)(u);return(0,t.useEffect)(()=>{let t=!1;return(async()=>{try{const o=await fetch(s(),{headers:{Accept:"application/json"}});if(!o.ok)throw new Error(`Unexpected ${o.status}`);const u=await o.json();(0,n.logUtilityErrors)(u.errors),t||c({ios:u.ios,android:u.android})}catch(t){console.warn("[expo-device-hub] No new-device-options endpoint, using empty options:",t)}})(),()=>{t=!0}},[]),o};var t=r(d[0]),o=r(d[1]),n=r(d[2]);const s=()=>`${(0,o.basePath)()}/api/new-device-options`,c={runtimes:[]},u={ios:c,android:c}},421,[38,402,405]);
|
|
503
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarOverlay=function({side:s,open:l,sidebarOpen:c,topmost:b,onDismiss:u,children:p}){const{present:v,reducedMotion:f,visible:I}=(0,o.useSidebarPresence)(l,!c);if(!v)return null;const S=b?12:10,_=f?void 0:`opacity ${o.SIDEBAR_TRANSITION_MS}ms ease`,y=f?void 0:`transform ${o.SIDEBAR_TRANSITION_MS}ms ${o.SIDEBAR_TRANSITION_EASING}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{"aria-hidden":"true","data-sidebar-backdrop":s,onClick:u,style:{position:"absolute",inset:0,backgroundColor:t.bg.overlay,opacity:I?.35:0,pointerEvents:I?void 0:"none",transition:_,zIndex:S}}),(0,n.jsx)("div",{"aria-hidden":!I||void 0,"data-sidebar-overlay":s,"data-state":I?"open":"closed",style:{position:"absolute",top:0,[s]:0,zIndex:S+1,backgroundColor:t.bg.default,["left"===s?"borderRight":"borderLeft"]:`1px solid ${t.border.default}`,pointerEvents:I?void 0:"none",transform:I?"translateX(0)":`translateX(${"left"===s?"-100%":"100%"})`,transition:y,willChange:"transform"},children:p})]})};var t=r(d[0]),o=r(d[1]),n=r(d[2])},422,[236,400,153]);
|
|
504
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveSidebarLayout=o,e.useSidebarLayout=function({leftWidth:s,rightWidth:c,minStreamWidth:h}){const f=(0,t.useRef)(null),[u,l]=(0,t.useState)(()=>"undefined"==typeof window?0:window.innerWidth),b=(0,n.useDashboardStore)(t=>t.sidebarPreferences.left),S=(0,n.useDashboardStore)(t=>t.sidebarPreferences.right),p=(0,n.useDashboardStore)(t=>t.lastOpenedSidebar),W=(0,n.useDashboardStore)(t=>t.openSidebar),O=(0,n.useDashboardStore)(t=>t.closeSidebar);(0,t.useEffect)(()=>{const t=f.current;if(!t)return;const n=()=>l(t.getBoundingClientRect().width);n();const o=new ResizeObserver(n);return o.observe(t),()=>o.disconnect()},[]);const D=o({leftPreference:b,rightPreference:S,containerWidth:u,leftWidth:s,rightWidth:c,minStreamWidth:h});return Object.assign({},D,{containerRef:f,containerWidth:u,leftOpen:D.leftOpen,lastOpened:p,openLeft:()=>{const t=u>=s+h+(D.rightDocked?c:0);W("left",t)},closeLeft:()=>O("left"),openRight:()=>{W("right",u>=c+h)},closeRight:()=>O("right")})};var t=r(d[0]),n=r(d[1]);function o({leftPreference:t,rightPreference:n,containerWidth:o,leftWidth:s,rightWidth:c,minStreamWidth:h}){const f=o>=c+h,u="open"===n||"auto"===n&&f,l=u&&f,b=o>=s+h+(l?c:0),S="open"===t||"auto"===t&&b,p=S&&b;return{leftOpen:S,leftDocked:p,leftOverlay:S&&!p,rightOpen:u,rightDocked:l,rightOverlay:u&&!l}}},423,[38,406]);
|
|
505
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function o(o){return"ios"===o||"android"===o?o:void 0}Object.defineProperty(e,'__esModule',{value:!0}),e.parsePlatformFilter=o,e.dashboardPlatformFilter=function(){return"undefined"==typeof window?void 0:o(window.__EXPO_DEVICE_HUB_PLATFORM__)}},424,[]);
|
|
506
506
|
__r(3);
|
|
507
507
|
__r(0);
|