openrtc 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{DelegatingRuntimeAdapter-B9j_lTDM.d.ts → DelegatingRuntimeAdapter-Cg3jFk1b.d.ts} +1 -1
  2. package/dist/{assembly-Ddq1o4NV.d.ts → assembly-CscFVHYK.d.ts} +2 -2
  3. package/dist/auth/index.js +1 -1
  4. package/dist/auth/internal.js +1 -1
  5. package/dist/chunk-2OQQ4I7Z.js +2 -0
  6. package/dist/chunk-3WD7QKIS.js +2 -0
  7. package/dist/chunk-5ZDGIHNB.js +1 -0
  8. package/dist/{chunk-VQT6275Z.js → chunk-5ZIXL6NU.js} +3 -3
  9. package/dist/{chunk-2QFNPBOZ.js → chunk-BW6OKBHV.js} +1 -1
  10. package/dist/{chunk-FGGDUGTK.js → chunk-D7Y72PSI.js} +1 -1
  11. package/dist/{chunk-EAQYAVIA.js → chunk-GOXGYBWD.js} +1 -1
  12. package/dist/chunk-OCSZA6PK.js +2 -0
  13. package/dist/index.d.ts +84 -8
  14. package/dist/index.js +1 -1
  15. package/dist/native.d.ts +5 -5
  16. package/dist/native.js +1 -1
  17. package/dist/openrtc_bg.wasm +0 -0
  18. package/dist/runtime/WasmRuntimeAdapter.d.ts +2 -2
  19. package/dist/runtime/WasmRuntimeAdapter.js +1 -1
  20. package/dist/runtime/device-status.d.ts +2 -2
  21. package/dist/runtime/index.d.ts +8 -8
  22. package/dist/runtime/index.js +1 -1
  23. package/dist/runtime/tauri.d.ts +3 -3
  24. package/dist/runtime/tauri.js +1 -1
  25. package/dist/{spaceTokens-DyOOxC7x.d.ts → spaceTokens-CiwcKKr2.d.ts} +3 -3
  26. package/dist/{tauri-DZJ_ZEfB.d.ts → tauri-BpsecNrp.d.ts} +2 -2
  27. package/dist/transport/index.d.ts +2 -2
  28. package/dist/{types-BAwo8biA.d.ts → types-BJU2GoVb.d.ts} +1 -1
  29. package/dist/{types-CL4Da0BR.d.ts → types-zT2QwuCv.d.ts} +21 -0
  30. package/package.json +1 -1
  31. package/dist/chunk-3TZAOOON.js +0 -1
  32. package/dist/chunk-S4NAEWOY.js +0 -2
  33. package/dist/chunk-SY6YGCXA.js +0 -2
  34. package/dist/chunk-VCJQWWOH.js +0 -2
@@ -1,2 +1,2 @@
1
- import {o,G}from'./chunk-SY6YGCXA.js';function A(t){let i=o({...t});if("auth"in t&&!t.authMode){let n=t.auth;i.authMode=n==="none"?"anonymous":n;}if("identity"in t){let n=t.identity,s=n==="temporary"?"ephemeral":n;!t.deviceIdPersistence&&!t.nodeIdPersistence&&(i.deviceIdPersistence=s),!t.endpointIdPersistence&&!t.nodeIdPersistence&&(i.endpointIdPersistence=s);}return "namespace"in t&&!t.storagePrefix&&(i.storagePrefix=t.namespace),"privacy"in t&&t.strictMode===void 0&&(i.strictMode=!!t.privacy),i}function N(t,i){let n=t.runtime,s=Object.create(n),r=async e=>{if(typeof e!="string")return e;let a=(await n.listDevices()).find(d=>d.deviceId===e);if(!a)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return a},c=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),m=async e=>{let{device:o,scope:a,...d}=e,h=d.deviceId??(typeof o=="string"?o:o?.deviceId)??null,v=d.ticket??(typeof o=="string"?void 0:o?.ticket);h&&!v&&(v=(await r(h).catch(()=>null))?.ticket);let P={...d,scope:a??"session"};return h&&(P.deviceId=h),v&&(P.ticket=v),P},u={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??i}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,o)=>n.connectDevice(await r(e),await c(o)),connectWithRetry:async(e,o,a)=>n.connectDeviceWithRetry(await r(e),o,a),disconnect:e=>n.disconnectDevice(e),update:(e,o)=>n.updateDevice(e,o),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},l={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,o)=>n.disconnectPeer(e,o),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,o)=>n.waitForConnectedPeer(e,o),readiness:(e,o)=>n.getPeerReadiness(e,o),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,o)=>n.addPeerScope(e,o),releaseScope:(e,o)=>n.releasePeerScope(e,o),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},g={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,o,a)=>n.openPeerBi(e,{...a,channelId:o}),openUni:(e,o,a)=>n.openPeerUni(e,{...a,channelId:o}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,o)=>n.onIncomingChannelStream(e,a=>{if(a.channel)return o(a)}),connect:async e=>n.connectScopedChannel(await m(e)),connectScoped:e=>n.connectScopedChannel(e)},p={create:e=>n.createRoom(e),join:(e,o)=>n.joinRoom(e,o),leave:e=>n.leaveRoom(e),watch:(e,o)=>n.watchRoom(e,o),members:e=>n.getRoomMembers(e)},R={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,o)=>n.getTicketWithToken(e,o?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},C={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},k={runtime:n,assembly:t,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,o)=>n.setAutoConnectExcluded(e,o),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(s,{devices:{get:()=>u,enumerable:true},peers:{get:()=>l,enumerable:true},channels:{get:()=>g,enumerable:true},rooms:{get:()=>p,enumerable:true},tickets:{get:()=>R,enumerable:true},diagnostics:{get:()=>C,enumerable:true},advanced:{get:()=>k,enumerable:true},setAuth:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>t.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>t.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>t.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>t.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>t,enumerable:false}}),s}var O="https://api.openrtc.app";function S(t){if(typeof globalThis.crypto?.randomUUID!="function")throw new Error(`Secure request identity is unavailable for ${t}.`);return `${t}:${globalThis.crypto.randomUUID()}`}async function E(t,i,n){let s=t.replace(/\/$/,""),r=await fetch(`${s}/v1/spaces/${encodeURIComponent(n)}/scoped-auth`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("enable-space-auth")},body:"{}"}),c=await r.json().catch(()=>({}));if(!r.ok){let m=typeof c?.error=="string"?c.error:`enableSpaceAuth failed (${r.status})`;throw new Error(m)}return c}async function L(t,i,n){let s=await fetch(t,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("mint-space-token")},body:JSON.stringify(n)}),r=await s.json().catch(()=>({}));if(!s.ok){let c=typeof r?.error=="string"?r.error:`mintSpaceToken failed (${s.status})`;throw new Error(c)}if(typeof r?.token!="string"||!r.token.trim())throw new Error("mintSpaceToken response missing token");return r}function f(t){let i=t.apiKey.trim(),n=(t.spaceKey??t.space??"").trim(),s=I(t.sandboxAppId),r=(t.endpointUrl??O).replace(/\/$/,""),c=t.memberIdStorageKey??`openrtc:space-member:${n}${s?`:sandbox:${s}`:""}`;return async()=>{if(!i||!n)throw new Error("spaceToken requires apiKey and space");let m=null;typeof sessionStorage<"u"?(m=sessionStorage.getItem(c),m||(m=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(c,m))):m=`member-${Date.now()}`;let u=await G().getAppCheckToken(),l=await fetch(`${r}/v1SpacePublicTokens`,{method:"POST",headers:{"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("mint-public-space-token"),...u?{"X-Firebase-AppCheck":u}:{}},body:JSON.stringify({apiKey:i,spaceKey:n,memberId:m,...s?{sandboxAppId:s}:{}})}),{text:g,payload:p}=await T(l);if(!l.ok){let C=typeof p?.error=="string"?p.error:g.trim()?g.trim().slice(0,240):`public space token mint failed (${l.status})`;throw new Error(C)}let R=typeof p?.token=="string"?p.token.trim():"";if(!R)throw new Error("public space token response missing token");return {customToken:R}}}function w(t){if(!t.trim())return {};try{let i=JSON.parse(t);return i&&typeof i=="object"?i:{}}catch{return {}}}async function T(t){let i=t.text;if(typeof i=="function"){let s=await i.call(t).catch(()=>"");return {text:s,payload:w(s)}}let n=await t.json().catch(()=>({}));return {text:JSON.stringify(n),payload:n&&typeof n=="object"?n:{}}}function I(t){let i=t?.trim().toLowerCase()??"";if(!i)return "";if(!/^[a-z0-9][a-z0-9-]{0,47}$/.test(i))throw new Error("sandboxAppId must be 1-48 lowercase letters, numbers, or dashes.");return i}function $(t,i){let n=t.trim(),s=I(i);return s?`${n}::sandbox::${s}`:n}var W=f,K=f;
1
+ import {o,G}from'./chunk-OCSZA6PK.js';function A(t){let i=o({...t});if("auth"in t&&!t.authMode){let n=t.auth;i.authMode=n==="none"?"anonymous":n;}if("identity"in t){let n=t.identity,s=n==="temporary"?"ephemeral":n;!t.deviceIdPersistence&&!t.nodeIdPersistence&&(i.deviceIdPersistence=s),!t.endpointIdPersistence&&!t.nodeIdPersistence&&(i.endpointIdPersistence=s);}return "namespace"in t&&!t.storagePrefix&&(i.storagePrefix=t.namespace),"privacy"in t&&t.strictMode===void 0&&(i.strictMode=!!t.privacy),i}function N(t,i){let n=t.runtime,s=Object.create(n),r=async e=>{if(typeof e!="string")return e;let a=(await n.listDevices()).find(d=>d.deviceId===e);if(!a)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return a},c=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),m=async e=>{let{device:o,scope:a,...d}=e,h=d.deviceId??(typeof o=="string"?o:o?.deviceId)??null,v=d.ticket??(typeof o=="string"?void 0:o?.ticket);h&&!v&&(v=(await r(h).catch(()=>null))?.ticket);let P={...d,scope:a??"session"};return h&&(P.deviceId=h),v&&(P.ticket=v),P},u={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??i}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,o)=>n.connectDevice(await r(e),await c(o)),connectWithRetry:async(e,o,a)=>n.connectDeviceWithRetry(await r(e),o,a),disconnect:e=>n.disconnectDevice(e),update:(e,o)=>n.updateDevice(e,o),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},l={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,o)=>n.disconnectPeer(e,o),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,o)=>n.waitForConnectedPeer(e,o),readiness:(e,o)=>n.getPeerReadiness(e,o),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,o)=>n.addPeerScope(e,o),releaseScope:(e,o)=>n.releasePeerScope(e,o),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},g={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,o,a)=>n.openPeerBi(e,{...a,channelId:o}),openUni:(e,o,a)=>n.openPeerUni(e,{...a,channelId:o}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,o)=>n.onIncomingChannelStream(e,a=>{if(a.channel)return o(a)}),connect:async e=>n.connectScopedChannel(await m(e)),connectScoped:e=>n.connectScopedChannel(e)},p={create:e=>n.createRoom(e),join:(e,o)=>n.joinRoom(e,o),leave:e=>n.leaveRoom(e),watch:(e,o)=>n.watchRoom(e,o),members:e=>n.getRoomMembers(e)},R={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,o)=>n.getTicketWithToken(e,o?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},C={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},k={runtime:n,assembly:t,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,o)=>n.setAutoConnectExcluded(e,o),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(s,{devices:{get:()=>u,enumerable:true},peers:{get:()=>l,enumerable:true},channels:{get:()=>g,enumerable:true},rooms:{get:()=>p,enumerable:true},tickets:{get:()=>R,enumerable:true},diagnostics:{get:()=>C,enumerable:true},advanced:{get:()=>k,enumerable:true},setAuth:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>t.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>t.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>t.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>t.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>t,enumerable:false}}),s}var O="https://api.openrtc.app";function S(t){if(typeof globalThis.crypto?.randomUUID!="function")throw new Error(`Secure request identity is unavailable for ${t}.`);return `${t}:${globalThis.crypto.randomUUID()}`}async function E(t,i,n){let s=t.replace(/\/$/,""),r=await fetch(`${s}/v1/spaces/${encodeURIComponent(n)}/scoped-auth`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("enable-space-auth")},body:"{}"}),c=await r.json().catch(()=>({}));if(!r.ok){let m=typeof c?.error=="string"?c.error:`enableSpaceAuth failed (${r.status})`;throw new Error(m)}return c}async function L(t,i,n){let s=await fetch(t,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("mint-space-token")},body:JSON.stringify(n)}),r=await s.json().catch(()=>({}));if(!s.ok){let c=typeof r?.error=="string"?r.error:`mintSpaceToken failed (${s.status})`;throw new Error(c)}if(typeof r?.token!="string"||!r.token.trim())throw new Error("mintSpaceToken response missing token");return r}function f(t){let i=t.apiKey.trim(),n=(t.spaceKey??t.space??"").trim(),s=I(t.sandboxAppId),r=(t.endpointUrl??O).replace(/\/$/,""),c=t.memberIdStorageKey??`openrtc:space-member:${n}${s?`:sandbox:${s}`:""}`;return async()=>{if(!i||!n)throw new Error("spaceToken requires apiKey and space");let m=null;typeof sessionStorage<"u"?(m=sessionStorage.getItem(c),m||(m=globalThis.crypto?.randomUUID?.()??`member-${Date.now()}`,sessionStorage.setItem(c,m))):m=`member-${Date.now()}`;let u=await G().getAppCheckToken(),l=await fetch(`${r}/v1SpacePublicTokens`,{method:"POST",headers:{"Content-Type":"application/json","X-OpenRTC-Idempotency-Key":S("mint-public-space-token"),...u?{"X-Firebase-AppCheck":u}:{}},body:JSON.stringify({apiKey:i,spaceKey:n,memberId:m,...s?{sandboxAppId:s}:{}})}),{text:g,payload:p}=await T(l);if(!l.ok){let C=typeof p?.error=="string"?p.error:g.trim()?g.trim().slice(0,240):`public space token mint failed (${l.status})`;throw new Error(C)}let R=typeof p?.token=="string"?p.token.trim():"";if(!R)throw new Error("public space token response missing token");return {customToken:R}}}function w(t){if(!t.trim())return {};try{let i=JSON.parse(t);return i&&typeof i=="object"?i:{}}catch{return {}}}async function T(t){let i=t.text;if(typeof i=="function"){let s=await i.call(t).catch(()=>"");return {text:s,payload:w(s)}}let n=await t.json().catch(()=>({}));return {text:JSON.stringify(n),payload:n&&typeof n=="object"?n:{}}}function I(t){let i=t?.trim().toLowerCase()??"";if(!i)return "";if(!/^[a-z0-9][a-z0-9-]{0,47}$/.test(i))throw new Error("sandboxAppId must be 1-48 lowercase letters, numbers, or dashes.");return i}function $(t,i){let n=t.trim(),s=I(i);return s?`${n}::sandbox::${s}`:n}var W=f,K=f;
2
2
  export{A as a,N as b,E as c,L as d,f as e,$ as f,W as g,K as h};
@@ -1 +1 @@
1
- import {g,h}from'./chunk-S4NAEWOY.js';function c(){return g()}var i=class extends h{constructor(r){super({...r,bridge:g(),allowWasmFallback:r.allowWasmFallback??false});}};export{c as a,i as b};
1
+ import {g,h}from'./chunk-3WD7QKIS.js';function c(){return g()}var i=class extends h{constructor(r){super({...r,bridge:g(),allowWasmFallback:r.allowWasmFallback??false});}};export{c as a,i as b};
@@ -1,2 +1,2 @@
1
- import {a as a$1,A}from'./chunk-VQT6275Z.js';import {a as a$2}from'./chunk-3TZAOOON.js';import {h}from'./chunk-S4NAEWOY.js';import {s}from'./chunk-SY6YGCXA.js';var B=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,tt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,tt.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_bistream_free(t,0);}get applicationCryptoWrapped(){return n.bistream_applicationCryptoWrapped(this.__wbg_ptr)!==0}get endpoint_id(){let t,e;try{let s=n.__wbindgen_add_to_stack_pointer(-16);n.bistream_endpoint_id(s,this.__wbg_ptr);var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);return t=_,e=r,v(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(t,e,1);}}finishSend(){let t=n.bistream_finishSend(this.__wbg_ptr);return p(t)}get recv(){let t=n.bistream_recv(this.__wbg_ptr);return p(t)}get send(){let t=n.bistream_send(this.__wbg_ptr);return p(t)}};Symbol.dispose&&(B.prototype[Symbol.dispose]=B.prototype.free);var N=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_intounderlyingsink_free(t,0);}abort(t){let e=this.__destroy_into_raw(),_=n.intounderlyingsink_abort(e,g(t));return p(_)}close(){let t=this.__destroy_into_raw(),e=n.intounderlyingsink_close(t);return p(e)}write(t){let e=n.intounderlyingsink_write(this.__wbg_ptr,g(t));return p(e)}};Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free);var q=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_intounderlyingsource_free(t,0);}cancel(){let t=this.__destroy_into_raw();n.intounderlyingsource_cancel(t);}pull(t){let e=n.intounderlyingsource_pull(this.__wbg_ptr,g(t));return p(e)}};Symbol.dispose&&(q.prototype[Symbol.dispose]=q.prototype.free);var L=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,_t.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_t.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_peerunistream_free(t,0);}get applicationCryptoWrapped(){return n.peerunistream_applicationCryptoWrapped(this.__wbg_ptr)!==0}finishSend(){let t=n.peerunistream_finishSend(this.__wbg_ptr);return p(t)}get writable(){let t=n.peerunistream_writable(this.__wbg_ptr);return p(t)}};Symbol.dispose&&(L.prototype[Symbol.dispose]=L.prototype.free);var C=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_wasmclient_free(t,0);}add_peer_scope(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_add_peer_scope(this.__wbg_ptr,_,r,s,b);return p(w)}bind_connection_device_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_bind_connection_device_id(this.__wbg_ptr,_,r,s,b);return p(w)}bind_node_device_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_bind_node_device_id(this.__wbg_ptr,_,r,s,b);return p(w)}clearConnectionApplicationCryptoKey(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;n.wasmclient_clearConnectionApplicationCryptoKey(this.__wbg_ptr,e,_);}clear_session_tokens(){n.wasmclient_clear_session_tokens(this.__wbg_ptr);}confirm_inline_reciprocal_session_admission(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;var k=f(b)?0:a(b,n.__wbindgen_export,n.__wbindgen_export2),I=i;let A=n.wasmclient_confirm_inline_reciprocal_session_admission(this.__wbg_ptr,w,d,e,m,l,y,h,s,k,I);return p(A)}connect(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_connect(this.__wbg_ptr,e,_);return p(r)}connect_device(t,e){var _=f(t)?0:a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;let s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_connect_device(this.__wbg_ptr,_,r,s,b);return p(w)}connection_state(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_connection_state(this.__wbg_ptr,e,_);return p(r)}connection_states(){let t=n.wasmclient_connection_states(this.__wbg_ptr);return p(t)}create_room(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i,k=a(r,n.__wbindgen_export,n.__wbindgen_export2),I=i,A=a(s,n.__wbindgen_export,n.__wbindgen_export2),O=i,V=n.wasmclient_create_room(this.__wbg_ptr,w,d,m,l,y,h,k,I,A,O,f(b)?Number.MAX_SAFE_INTEGER:b>>>0);return p(V)}create_session(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_create_session(this.__wbg_ptr,e,_);return p(r)}delete_device(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_delete_device(this.__wbg_ptr,_,r,s,b);return p(w)}devices_with_status(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_devices_with_status(this.__wbg_ptr,e,_);return p(r)}disconnect(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_disconnect(this.__wbg_ptr,e,_);return p(r)}disconnect_device(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;var s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_disconnect_device(this.__wbg_ptr,_,r,s,b);return p(w)}disconnect_transient(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_disconnect_transient(this.__wbg_ptr,e,_);return p(r)}endpoint_id_from_ticket(t){let e,_;try{let l=n.__wbindgen_add_to_stack_pointer(-16),y=a(t,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_endpoint_id_from_ticket(l,this.__wbg_ptr,y,h);var r=u().getInt32(l+0,!0),s=u().getInt32(l+4,!0),b=u().getInt32(l+8,!0),w=u().getInt32(l+12,!0),d=r,m=s;if(w)throw d=0,m=0,p(b);return e=d,_=m,v(d,m)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(e,_,1);}}endpoint_ticket(){let t=n.wasmclient_endpoint_ticket(this.__wbg_ptr);return p(t)}endpoint_ticket_with_token(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_endpoint_ticket_with_token(this.__wbg_ptr,_,r,e);return p(s)}force_reconnect_snapshot(){n.wasmclient_force_reconnect_snapshot(this.__wbg_ptr);}get_members(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_get_members(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}heartbeat_tick(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_heartbeat_tick(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}incoming_streams(){let t=n.wasmclient_incoming_streams(this.__wbg_ptr);return p(t)}initIrohWithTestRelay(t,e){var _=f(t)?0:W(t,n.__wbindgen_export),r=i,s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_initIrohWithTestRelay(this.__wbg_ptr,_,r,s,b);return p(w)}init_iroh(t){var e=f(t)?0:W(t,n.__wbindgen_export),_=i;let r=n.wasmclient_init_iroh(this.__wbg_ptr,e,_);return p(r)}iroh_path_kind(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_iroh_path_kind(this.__wbg_ptr,e,_);return p(r)}iroh_secret_key(){let t=n.wasmclient_iroh_secret_key(this.__wbg_ptr);return p(t)}iroh_transport_rtt_ms(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_iroh_transport_rtt_ms(this.__wbg_ptr,e,_);return p(r)}is_auto_connect_excluded(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;return n.wasmclient_is_auto_connect_excluded(this.__wbg_ptr,e,_)!==0}is_connected(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_is_connected(this.__wbg_ptr,e,_);return p(r)}is_current_transport_stable_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_is_current_transport_stable_id(this.__wbg_ptr,_,r,e);return p(s)}join_room(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i,h=a(r,n.__wbindgen_export,n.__wbindgen_export2),k=i,I=a(s,n.__wbindgen_export,n.__wbindgen_export2),A=i,O=n.wasmclient_join_room(this.__wbg_ptr,b,w,d,m,l,y,h,k,I,A);return p(O)}leave_room(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_leave_room(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}list_managed_connections(){let t=n.wasmclient_list_managed_connections(this.__wbg_ptr);return p(t)}constructor(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;n.wasmclient_new(b,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return this.__wbg_ptr=_,H.register(this,this.__wbg_ptr,this),this}finally{n.__wbindgen_add_to_stack_pointer(16);}}static newWithAppTag(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;n.wasmclient_newWithAppTag(b,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return c.__wrap(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}node_addr(){let t=n.wasmclient_node_addr(this.__wbg_ptr);return p(t)}open_bi(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_bi(this.__wbg_ptr,e,_);return p(r)}open_native_main_control_bi(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_native_main_control_bi(this.__wbg_ptr,e,_);return p(r)}open_peer_bi(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_bi_explicit_file_sender(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi_explicit_file_sender(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_bi_transport_only(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi_transport_only(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_native_bi(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=n.wasmclient_open_peer_native_bi(this.__wbg_ptr,r,s,b,w,f(_)?Number.MAX_SAFE_INTEGER:_>>>0);return p(d)}open_peer_uni(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_uni(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_uni(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_uni(this.__wbg_ptr,e,_);return p(r)}peer_scopes(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_scopes(this.__wbg_ptr,e,_);return p(r)}peer_session(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_session(this.__wbg_ptr,e,_);return p(r)}peer_sessions(){let t=n.wasmclient_peer_sessions(this.__wbg_ptr);return p(t)}peer_snapshot(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_snapshot(this.__wbg_ptr,e,_);return p(r)}prepare_inline_reciprocal_session_admission(t,e,_,r,s,b,w,d){let m=a(t,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i,k=a(r,n.__wbindgen_export,n.__wbindgen_export2),I=i,A=a(s,n.__wbindgen_export,n.__wbindgen_export2),O=i,V=a(b,n.__wbindgen_export,n.__wbindgen_export2),ct=i,at=a(w,n.__wbindgen_export,n.__wbindgen_export2),bt=i,pt=a(d,n.__wbindgen_export,n.__wbindgen_export2),wt=i,gt=n.wasmclient_prepare_inline_reciprocal_session_admission(this.__wbg_ptr,m,l,e,y,h,k,I,A,O,V,ct,at,bt,pt,wt);return p(gt)}present_session_token_to_host(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_present_session_token_to_host(this.__wbg_ptr,_,r,s,b);return p(w)}present_session_token_to_host_with_payload(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;var d=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i;let l=n.wasmclient_present_session_token_to_host_with_payload(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}present_session_token_to_host_with_payload_and_device_id(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_present_session_token_to_host_with_payload_and_device_id(this.__wbg_ptr,s,b,w,d,m,l,y,h);return p(k)}rankRoutes(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=ot(t,n.__wbindgen_export),d=i,m=ot(e,n.__wbindgen_export),l=i;n.wasmclient_rankRoutes(b,this.__wbg_ptr,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=Ct(_,r).slice();return n.__wbindgen_export4(_,r*4,4),s}finally{n.__wbindgen_add_to_stack_pointer(16);}}register_session_token(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;n.wasmclient_register_session_token(this.__wbg_ptr,r,s,b,w,_);}register_session_token_with_expiry_ms(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;n.wasmclient_register_session_token_with_expiry_ms(this.__wbg_ptr,s,b,w,d,_,r);}reject_connection_admission(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_reject_connection_admission(this.__wbg_ptr,_,r,s,b);return p(w)}release_peer_scope(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;var s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_release_peer_scope(this.__wbg_ptr,_,r,s,b);return p(w)}remote_session_admission_ready_for_ticket(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_remote_session_admission_ready_for_ticket(this.__wbg_ptr,e,_);return p(r)}report_managed_connection_settled(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i;let y=n.wasmclient_report_managed_connection_settled(this.__wbg_ptr,w,d,e,m,l,!f(r),f(r)?BigInt(0):r,!f(s),f(s)?BigInt(0):s,!f(b),f(b)?BigInt(0):b);return p(y)}report_transport_status(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;var y=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_report_transport_status(this.__wbg_ptr,w,d,m,l,y,h,!f(r),f(r)?BigInt(0):r,!f(s),f(s)?BigInt(0):s,!f(b),f(b)?BigInt(0):b);return p(k)}resolve_peer_connection_records(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_resolve_peer_connection_records(this.__wbg_ptr,e,_);return p(r)}revoke_session_token(t){try{let s=n.__wbindgen_add_to_stack_pointer(-16),b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i;n.wasmclient_revoke_session_token(s,this.__wbg_ptr,b,w);var e=u().getInt32(s+0,!0),_=u().getInt32(s+4,!0),r=u().getInt32(s+8,!0);if(r)throw p(_);return p(e)}finally{n.__wbindgen_add_to_stack_pointer(16);}}revoke_tokens_by_scope(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_revoke_tokens_by_scope(this.__wbg_ptr,e,_);return p(r)}runtime_policy(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.wasmclient_runtime_policy(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0),_=u().getInt32(r+8,!0);if(_)throw p(e);return p(t)}finally{n.__wbindgen_add_to_stack_pointer(16);}}same_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_same_peer(this.__wbg_ptr,_,r,s,b);return p(w)}search_devices(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_search_devices(this.__wbg_ptr,e,_);return p(r)}send_message(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_send_message(this.__wbg_ptr,s,b,w,d,m,l,y,h);return p(k)}send_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=W(e,n.__wbindgen_export),b=i,w=n.wasmclient_send_peer(this.__wbg_ptr,_,r,s,b);return p(w)}send_peer_application_frame(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=W(e,n.__wbindgen_export),w=i,d=n.wasmclient_send_peer_application_frame(this.__wbg_ptr,r,s,b,w,f(_)?Number.MAX_SAFE_INTEGER:_>>>0);return p(d)}setConnectionApplicationCryptoKey(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=W(e,n.__wbindgen_export),b=i,w=n.wasmclient_setConnectionApplicationCryptoKey(this.__wbg_ptr,_,r,s,b);return p(w)}setConnectionApplicationCryptoRequired(t){try{let r=n.__wbindgen_add_to_stack_pointer(-16),s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i;n.wasmclient_setConnectionApplicationCryptoRequired(r,this.__wbg_ptr,s,b);var e=u().getInt32(r+0,!0),_=u().getInt32(r+4,!0);if(_)throw p(e)}finally{n.__wbindgen_add_to_stack_pointer(16);}}set_auth_token(t){var e=f(t)?0:a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;n.wasmclient_set_auth_token(this.__wbg_ptr,e,_);}set_auto_connect_excluded(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_set_auto_connect_excluded(this.__wbg_ptr,_,r,e);return p(s)}set_offline(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_set_offline(this.__wbg_ptr,e,_);return p(r)}start_auto_connect(t,e){try{let s=n.__wbindgen_add_to_stack_pointer(-16),b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i;n.wasmclient_start_auto_connect(s,this.__wbg_ptr,b,w,d,m);var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);if(r)throw p(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}start_presence_loop(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i;var y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_start_presence_loop(this.__wbg_ptr,s,b,w,d,m,l,y,h);}stop_auth_scoped_activity(){n.wasmclient_stop_auth_scoped_activity(this.__wbg_ptr);}stop_auto_connect(){n.wasmclient_stop_auto_connect(this.__wbg_ptr);}stop_presence_loop(){n.wasmclient_stop_presence_loop(this.__wbg_ptr);}submit_browser_desired_peers(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;n.wasmclient_submit_browser_desired_peers(b,this.__wbg_ptr,t,w,d);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return _!==0}finally{n.__wbindgen_add_to_stack_pointer(16);}}update_device(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i;var l=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i,h=f(s)?0:a(s,n.__wbindgen_export,n.__wbindgen_export2),k=i;let I=n.wasmclient_update_device(this.__wbg_ptr,b,w,d,m,l,y,f(r)?0:g(r),h,k);return p(I)}update_presence(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i;var h=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),k=i;let I=n.wasmclient_update_presence(this.__wbg_ptr,b,w,d,m,l,y,h,k,!f(s),f(s)?BigInt(0):s);return p(I)}update_session(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_update_session(this.__wbg_ptr,_,r,s,b);return p(w)}validate_session_token(t){let e,_;try{let l=n.__wbindgen_add_to_stack_pointer(-16),y=a(t,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_validate_session_token(l,this.__wbg_ptr,y,h);var r=u().getInt32(l+0,!0),s=u().getInt32(l+4,!0),b=u().getInt32(l+8,!0),w=u().getInt32(l+12,!0),d=r,m=s;if(w)throw d=0,m=0,p(b);return e=d,_=m,v(d,m)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(e,_,1);}}validate_session_token_for_connection(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_validate_session_token_for_connection(this.__wbg_ptr,_,r,s,b);return p(w)}validate_session_token_for_connection_with_payload(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;var d=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i;let l=n.wasmclient_validate_session_token_for_connection_with_payload(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}wait_for_settled_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_wait_for_settled_peer(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}wake_browser_auto_connect(){return n.wasmclient_wake_browser_auto_connect(this.__wbg_ptr)!==0}};Symbol.dispose&&(C.prototype[Symbol.dispose]=C.prototype.free);function it(){n.start();}function dt(){return {__proto__:null,"./openrtc_bg.js":{__proto__:null,__wbg_Error_9dc85fe1bc224456:function(t,e){let _=Error(v(t,e));return g(_)},__wbg_String_8564e559799eccda:function(t,e){let _=String(o(e)),r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg___wbindgen_boolean_get_b131b2f36d6b2f55:function(t){let e=o(t),_=typeof e=="boolean"?e:void 0;return f(_)?16777215:_?1:0},__wbg___wbindgen_debug_string_56c147eb1a51f0c4:function(t,e){let _=J(o(e)),r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg___wbindgen_in_ce8569b2fc6f5088:function(t,e){return o(t)in o(e)},__wbg___wbindgen_is_function_147961669f068cd4:function(t){return typeof o(t)=="function"},__wbg___wbindgen_is_null_ced4761460071341:function(t){return o(t)===null},__wbg___wbindgen_is_object_3a2c414391dbf751:function(t){let e=o(t);return typeof e=="object"&&e!==null},__wbg___wbindgen_is_string_6541b0f6ecd4e8e5:function(t){return typeof o(t)=="string"},__wbg___wbindgen_is_undefined_4410e3c20a99fa97:function(t){return o(t)===void 0},__wbg___wbindgen_jsval_eq_174c93ec61bab0c5:function(t,e){return o(t)===o(e)},__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c:function(t,e){return o(t)==o(e)},__wbg___wbindgen_number_get_588ed6b97f0d7e14:function(t,e){let _=o(e),r=typeof _=="number"?_:void 0;u().setFloat64(t+8,f(r)?0:r,true),u().setInt32(t+0,!f(r),true);},__wbg___wbindgen_string_get_fa2687d531ed17a5:function(t,e){let _=o(e),r=typeof _=="string"?_:void 0;var s=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),b=i;u().setInt32(t+4,b,true),u().setInt32(t+0,s,true);},__wbg___wbindgen_throw_bbadd78c1bac3a77:function(t,e){throw new Error(v(t,e))},__wbg__wbg_cb_unref_c2301a3c9b78104b:function(t){o(t)._wbg_cb_unref();},__wbg_abort_56c00f462c9261d9:function(t,e){o(t).abort(o(e));},__wbg_abort_f2416f4a9852003e:function(t){o(t).abort();},__wbg_addEventListener_b635263c509aa7de:function(){return x(function(t,e,_,r){o(t).addEventListener(v(e,_),o(r));},arguments)},__wbg_append_c5a0c94a6a73b22e:function(){return x(function(t,e,_,r,s){o(t).append(v(e,_),v(r,s));},arguments)},__wbg_arrayBuffer_cc7704fa158b907a:function(){return x(function(t){let e=o(t).arrayBuffer();return g(e)},arguments)},__wbg_bistream_new:function(t){let e=B.__wrap(t);return g(e)},__wbg_body_442a47f02322d7b0:function(t){let e=o(t).body;return f(e)?0:g(e)},__wbg_buffer_8524b3453cde4918:function(t){let e=o(t).buffer;return g(e)},__wbg_byobRequest_cc72d210de793e64:function(t){let e=o(t).byobRequest;return f(e)?0:g(e)},__wbg_byteLength_96807b1d9ab24a4c:function(t){return o(t).byteLength},__wbg_byteOffset_a9c7002428843c41:function(t){return o(t).byteOffset},__wbg_call_ec09a4cf93377d3a:function(){return x(function(t,e,_){let r=o(t).call(o(e),o(_));return g(r)},arguments)},__wbg_cancel_f3a197b26dc88b39:function(t){let e=o(t).cancel();return g(e)},__wbg_catch_66060324c27be6f7:function(t,e){let _=o(t).catch(o(e));return g(_)},__wbg_clearTimeout_113b1cde814ec762:function(t){let e=clearTimeout(p(t));return g(e)},__wbg_clearTimeout_333bba87532ab9d3:function(t){let e=clearTimeout(p(t));return g(e)},__wbg_clearTimeout_47a40e3be01ed7a3:function(){return x(function(t,e){o(t).clearTimeout(p(e));},arguments)},__wbg_close_296263cfe1bb2999:function(){return x(function(t){o(t).close();},arguments)},__wbg_close_388d99468213b286:function(){return x(function(t){o(t).close();},arguments)},__wbg_close_4857e22d08b71356:function(){return x(function(t){o(t).close();},arguments)},__wbg_code_1cda2855fcd9b009:function(t){return o(t).code},__wbg_code_70beb7b22374d55e:function(t){return o(t).code},__wbg_createDataChannel_122bd3d8aacee49b:function(t,e,_){let r=o(t).createDataChannel(v(e,_));return g(r)},__wbg_crypto_38df2bab126b63dc:function(t){let e=o(t).crypto;return g(e)},__wbg_data_8a04443c1e5a8cd3:function(t){let e=o(t).data;return g(e)},__wbg_dispatchEvent_cc62a6a43d28b01c:function(){return x(function(t,e){return o(t).dispatchEvent(o(e))},arguments)},__wbg_done_6a8439e544ec6206:function(t){return o(t).done},__wbg_enqueue_bbeb09ba0b140f76:function(){return x(function(t,e){o(t).enqueue(o(e));},arguments)},__wbg_entries_4e00eefd3fd54cf1:function(t){let e=o(t).entries();return g(e)},__wbg_error_6651fee1c71e5da9:function(t){console.error(o(t));},__wbg_error_a6fa202b58aa1cd3:function(t,e){let _,r;try{_=t,r=e,console.error(v(t,e));}finally{n.__wbindgen_export4(_,r,1);}},__wbg_fetch_074561c3e313c86f:function(t){let e=fetch(o(t));return g(e)},__wbg_fetch_22858a12fcf93152:function(t,e){let _=o(t).fetch(o(e));return g(_)},__wbg_getRandomValues_76dfc69825c9c552:function(){return x(function(t,e){globalThis.crypto.getRandomValues(F(t,e));},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return x(function(t,e){o(t).getRandomValues(o(e));},arguments)},__wbg_getReader_9facd4f899beac89:function(){return x(function(t){let e=o(t).getReader();return g(e)},arguments)},__wbg_get_4b90d6d8c5deb5d5:function(t,e){let _=o(t)[e>>>0];return g(_)},__wbg_get_52a8a619f7b88df6:function(){return x(function(t,e){let _=Reflect.get(o(t),o(e));return g(_)},arguments)},__wbg_get_done_c21b9933fc9a9e9c:function(t){let e=o(t).done;return f(e)?16777215:e?1:0},__wbg_get_value_ad568c7d3db9073f:function(t){let e=o(t).value;return g(e)},__wbg_get_with_ref_key_6412cf3094599694:function(t,e){let _=o(t)[o(e)];return g(_)},__wbg_has_14676d88c1340d2c:function(){return x(function(t,e){return Reflect.has(o(t),o(e))},arguments)},__wbg_headers_5b19cf40627ae54d:function(t){let e=o(t).headers;return g(e)},__wbg_info_a2b5f8a5dae8b26c:function(t){console.info(o(t));},__wbg_instanceof_ArrayBuffer_a581da923203f29f:function(t){let e;try{e=o(t)instanceof ArrayBuffer;}catch{e=false;}return e},__wbg_instanceof_Blob_5c4e145be35f9b1e:function(t){let e;try{e=o(t)instanceof Blob;}catch{e=false;}return e},__wbg_instanceof_Response_36a65a969abaa7c6:function(t){let e;try{e=o(t)instanceof Response;}catch{e=false;}return e},__wbg_instanceof_Uint8Array_b6fe1ac89eba107e:function(t){let e;try{e=o(t)instanceof Uint8Array;}catch{e=false;}return e},__wbg_instanceof_Window_9e0fe7d3d1ff4342:function(t){let e;try{e=o(t)instanceof Window;}catch{e=false;}return e},__wbg_isArray_139f48e3c057ede8:function(t){return Array.isArray(o(t))},__wbg_length_68a9d5278d084f4f:function(t){return o(t).length},__wbg_log_6614a4effdb4e983:function(t){console.log(o(t));},__wbg_message_12958526424a887b:function(t,e){let _=o(e).message,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_msCrypto_bd5a034af96bcba6:function(t){let e=o(t).msCrypto;return g(e)},__wbg_new_0b303268aa395a38:function(){let t=new Array;return g(t)},__wbg_new_189262ff31890c23:function(){return x(function(){let t=new Headers;return g(t)},arguments)},__wbg_new_20b778a4c5c691c3:function(){let t=new Object;return g(t)},__wbg_new_227d7c05414eb861:function(){let t=new Error;return g(t)},__wbg_new_24739629d416f982:function(){return x(function(){let t=new AbortController;return g(t)},arguments)},__wbg_new_5fae30e6b23db8df:function(t,e){let _=new Error(v(t,e));return g(_)},__wbg_new_883c0db065f06efd:function(){return g(new Map)},__wbg_new_a3e5112401a82338:function(){return x(function(t,e){let _=new WebSocket(v(t,e));return g(_)},arguments)},__wbg_new_b06772b280cc6e52:function(t){let e=new Uint8Array(o(t));return g(e)},__wbg_new_from_slice_bb2d1778c0b87eb1:function(t,e){let _=new Uint8Array(F(t,e));return g(_)},__wbg_new_typed_90c3f6c29ba36d19:function(t,e){try{var _={a:t,b:e},r=(b,w)=>{let d=_.a;_.a=0;try{return kt(d,_.b,b,w)}finally{_.a=d;}};let s=new Promise(r);return g(s)}finally{_.a=0;}},__wbg_new_with_byte_offset_and_length_9e1e664fe1a5d385:function(t,e,_){let r=new Uint8Array(o(t),e>>>0,_>>>0);return g(r)},__wbg_new_with_configuration_3a96aa953ca17197:function(){return x(function(t){let e=new RTCPeerConnection(o(t));return g(e)},arguments)},__wbg_new_with_event_init_dict_bd850674488710b1:function(){return x(function(t,e,_){let r=new CustomEvent(v(t,e),o(_));return g(r)},arguments)},__wbg_new_with_into_underlying_sink_2596343f9b6c8e58:function(t){let e=new WritableStream(N.__wrap(t));return g(e)},__wbg_new_with_into_underlying_source_fd904252f385f59c:function(t,e){let _=new ReadableStream(q.__wrap(t),p(e));return g(_)},__wbg_new_with_length_4b57a7a5dc67221c:function(t){let e=new Uint8Array(t>>>0);return g(e)},__wbg_new_with_str_and_init_df876572184fe639:function(){return x(function(t,e,_){let r=new Request(v(t,e),o(_));return g(r)},arguments)},__wbg_new_with_str_sequence_505a4829cc247e79:function(){return x(function(t,e,_){let r=new WebSocket(v(t,e),o(_));return g(r)},arguments)},__wbg_next_8cb028b6ba50743f:function(){return x(function(t){let e=o(t).next();return g(e)},arguments)},__wbg_node_84ea875411254db1:function(t){let e=o(t).node;return g(e)},__wbg_now_bce4dc999095ea77:function(){return Date.now()},__wbg_now_e7c6795a7f81e10f:function(t){return o(t).now()},__wbg_parse_a5c06e19bc1187fd:function(t,e){return Date.parse(v(t,e))},__wbg_peerunistream_new:function(t){let e=L.__wrap(t);return g(e)},__wbg_performance_3fcf6e32a7e1ed0a:function(t){let e=o(t).performance;return g(e)},__wbg_process_44c7a14e11e9f69e:function(t){let e=o(t).process;return g(e)},__wbg_protocol_28aaef5ea42981d6:function(t,e){let _=o(e).protocol,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_prototypesetcall_956c7493c68e29b4:function(t,e,_){Uint8Array.prototype.set.call(F(t,e),o(_));},__wbg_push_ceb8ef046afb2041:function(t,e){return o(t).push(o(e))},__wbg_queueMicrotask_4698f900840e3286:function(t){queueMicrotask(o(t));},__wbg_queueMicrotask_477a5533c7100338:function(t){let e=o(t).queueMicrotask;return g(e)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return x(function(t,e){o(t).randomFillSync(p(e));},arguments)},__wbg_read_8426c146431f2905:function(t){let e=o(t).read();return g(e)},__wbg_readyState_25243ad6ce649774:function(t){return o(t).readyState},__wbg_reason_4ec455bac79b33ce:function(t,e){let _=o(e).reason,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_releaseLock_188846ef719acb10:function(t){o(t).releaseLock();},__wbg_removeEventListener_016c1d24523b4730:function(){return x(function(t,e,_,r){o(t).removeEventListener(v(e,_),o(r));},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return x(function(){let t=module.require;return g(t)},arguments)},__wbg_resolve_0183de2e8c6b1d54:function(t){let e=Promise.resolve(o(t));return g(e)},__wbg_respond_3cdb4cf32683fd79:function(){return x(function(t,e){o(t).respond(e>>>0);},arguments)},__wbg_send_99d049cae69c53cc:function(){return x(function(t,e,_){o(t).send(F(e,_));},arguments)},__wbg_send_bac9d3dc4f21ef28:function(){return x(function(t,e,_){o(t).send(v(e,_));},arguments)},__wbg_setTimeout_3a808dd861dd3c12:function(t,e){let _=setTimeout(o(t),e);return g(_)},__wbg_setTimeout_6613a51400c1bf9f:function(){return x(function(t,e,_){let r=o(t).setTimeout(p(e),_);return g(r)},arguments)},__wbg_setTimeout_ef24d2fc3ad97385:function(){return x(function(t,e){let _=setTimeout(o(t),e);return g(_)},arguments)},__wbg_set_5f806304fb633ab3:function(t,e,_){let r=o(t).set(o(e),o(_));return g(r)},__wbg_set_6be42768c690e380:function(t,e,_){o(t)[p(e)]=p(_);},__wbg_set_86698c227e5b9dad:function(t,e,_){o(t).set(F(e,_));},__wbg_set_a6ba3ac0e634b822:function(){return x(function(t,e,_){return Reflect.set(o(t),o(e),o(_))},arguments)},__wbg_set_binaryType_8c2dd2cf1cfc2e28:function(t,e){o(t).binaryType=It[e];},__wbg_set_body_d1153b16a2b95ca1:function(t,e){o(t).body=o(e);},__wbg_set_cache_5a01a8b5e6ca6cf2:function(t,e){o(t).cache=At[e];},__wbg_set_credentials_e9120ed88b1fc0b8:function(t,e){o(t).credentials=Ft[e];},__wbg_set_da33c120a6584674:function(t,e,_){o(t)[e>>>0]=p(_);},__wbg_set_detail_c7af5edea934390b:function(t,e){o(t).detail=o(e);},__wbg_set_handle_event_6147c38b782c7b42:function(t,e){o(t).handleEvent=o(e);},__wbg_set_headers_877ed41890d28af2:function(t,e){o(t).headers=o(e);},__wbg_set_high_water_mark_77da20c49668427d:function(t,e){o(t).highWaterMark=e;},__wbg_set_method_b4ede299b2064f37:function(t,e,_){o(t).method=v(e,_);},__wbg_set_mode_d6c2e1991aa963c6:function(t,e){o(t).mode=St[e];},__wbg_set_onclose_9cb5c3372e16c192:function(t,e){o(t).onclose=o(e);},__wbg_set_onerror_190fe67e911ebf28:function(t,e){o(t).onerror=o(e);},__wbg_set_onmessage_96337495f0bfb796:function(t,e){o(t).onmessage=o(e);},__wbg_set_onopen_3e2bf6b11d434c2d:function(t,e){o(t).onopen=o(e);},__wbg_set_signal_9022b5aa06a6ce5b:function(t,e){o(t).signal=o(e);},__wbg_signal_41dd1a8913cd0b7d:function(t){let e=o(t).signal;return g(e)},__wbg_stack_3b0d974bbf31e44f:function(t,e){let _=o(e).stack,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_static_accessor_GLOBAL_60a4124bab7dcc9a:function(){let t=typeof global>"u"?null:global;return f(t)?0:g(t)},__wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13:function(){let t=typeof globalThis>"u"?null:globalThis;return f(t)?0:g(t)},__wbg_static_accessor_SELF_4c95f759a91e9aae:function(){let t=typeof self>"u"?null:self;return f(t)?0:g(t)},__wbg_static_accessor_WINDOW_44b435597f9e9ee7:function(){let t=typeof window>"u"?null:window;return f(t)?0:g(t)},__wbg_status_9e6505cfa3e73a7c:function(t){return o(t).status},__wbg_subarray_42216645a367cd7a:function(t,e,_){let r=o(t).subarray(e>>>0,_>>>0);return g(r)},__wbg_then_254bab9b266a77a5:function(t,e,_){let r=o(t).then(o(e),o(_));return g(r)},__wbg_then_3ea18602c6a5123b:function(t,e){let _=o(t).then(o(e));return g(_)},__wbg_url_72c67c175685a054:function(t,e){let _=o(e).url,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_url_d0b8042af0d1bbba:function(t,e){let _=o(e).url,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_value_3d3defe09fb1ffca:function(t){let e=o(t).value;return g(e)},__wbg_versions_276b2795b1c6a219:function(t){let e=o(t).versions;return g(e)},__wbg_view_15fa5865c6b336e3:function(t){let e=o(t).view;return f(e)?0:g(e)},__wbg_warn_633bacc13ba7e6c3:function(t){console.warn(o(t));},__wbg_wasClean_f17429d064911939:function(t){return o(t).wasClean},__wbindgen_cast_0000000000000001:function(t,e){let _=S(t,e,xt);return g(_)},__wbindgen_cast_0000000000000002:function(t,e){let _=S(t,e,vt);return g(_)},__wbindgen_cast_0000000000000003:function(t,e){let _=S(t,e,yt);return g(_)},__wbindgen_cast_0000000000000004:function(t,e){let _=S(t,e,ht);return g(_)},__wbindgen_cast_0000000000000005:function(t,e){let _=S(t,e,ut);return g(_)},__wbindgen_cast_0000000000000006:function(t,e){let _=S(t,e,ft);return g(_)},__wbindgen_cast_0000000000000007:function(t,e){let _=Ot(t,e,lt);return g(_)},__wbindgen_cast_0000000000000008:function(t,e){let _=S(t,e,mt);return g(_)},__wbindgen_cast_0000000000000009:function(t){return g(t)},__wbindgen_cast_000000000000000a:function(t){return g(t)},__wbindgen_cast_000000000000000b:function(t,e){let _=F(t,e);return g(_)},__wbindgen_cast_000000000000000c:function(t,e){let _=v(t,e);return g(_)},__wbindgen_cast_000000000000000d:function(t){let e=BigInt.asUintN(64,t);return g(e)},__wbindgen_cast_000000000000000e:function(t,e){var _=F(t,e).slice();return n.__wbindgen_export4(t,e*1,1),g(_)},__wbindgen_object_clone_ref:function(t){let e=o(t);return g(e)},__wbindgen_object_drop_ref:function(t){p(t);}}}}function ut(c,t){n.__wasm_bindgen_func_elem_8832(c,t);}function ft(c,t){n.__wasm_bindgen_func_elem_9967(c,t);}function lt(c,t){n.__wasm_bindgen_func_elem_10023(c,t);}function mt(c,t){n.__wasm_bindgen_func_elem_17813(c,t);}function xt(c,t,e){n.__wasm_bindgen_func_elem_9035(c,t,g(e));}function yt(c,t,e){n.__wasm_bindgen_func_elem_6491(c,t,g(e));}function ht(c,t,e){n.__wasm_bindgen_func_elem_10655(c,t,g(e));}function vt(c,t,e){try{let s=n.__wbindgen_add_to_stack_pointer(-16);n.__wasm_bindgen_func_elem_17958(s,c,t,g(e));var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);if(r)throw p(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}function kt(c,t,e,_){n.__wasm_bindgen_func_elem_17960(c,t,g(e),g(_));}var It=["blob","arraybuffer"],At=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Ft=["omit","same-origin","include"],St=["same-origin","no-cors","cors","navigate"],tt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_bistream_free(c,1));typeof FinalizationRegistry>"u"?{}:new FinalizationRegistry(c=>n.__wbg_intounderlyingbytesource_free(c,1));var et=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_intounderlyingsink_free(c,1)),nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_intounderlyingsource_free(c,1)),_t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_peerunistream_free(c,1)),H=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_wasmclient_free(c,1));typeof FinalizationRegistry>"u"?{}:new FinalizationRegistry(c=>n.__wbg_wasmconnection_free(c,1));function g(c){M===R.length&&R.push(R.length+1);let t=M;return M=R[t],R[t]=c,t}var G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbindgen_export5(c.a,c.b));function J(c){let t=typeof c;if(t=="number"||t=="boolean"||c==null)return `${c}`;if(t=="string")return `"${c}"`;if(t=="symbol"){let r=c.description;return r==null?"Symbol":`Symbol(${r})`}if(t=="function"){let r=c.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(c)){let r=c.length,s="[";r>0&&(s+=J(c[0]));for(let b=1;b<r;b++)s+=", "+J(c[b]);return s+="]",s}let e=/\[object ([^\]]+)\]/.exec(toString.call(c)),_;if(e&&e.length>1)_=e[1];else return toString.call(c);if(_=="Object")try{return "Object("+JSON.stringify(c)+")"}catch{return "Object"}return c instanceof Error?`${c.name}: ${c.message}
1
+ import {a as a$1,A}from'./chunk-5ZIXL6NU.js';import {a as a$2}from'./chunk-5ZDGIHNB.js';import {h}from'./chunk-3WD7QKIS.js';import {s}from'./chunk-OCSZA6PK.js';var B=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,tt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,tt.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_bistream_free(t,0);}get applicationCryptoWrapped(){return n.bistream_applicationCryptoWrapped(this.__wbg_ptr)!==0}get endpoint_id(){let t,e;try{let s=n.__wbindgen_add_to_stack_pointer(-16);n.bistream_endpoint_id(s,this.__wbg_ptr);var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);return t=_,e=r,v(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(t,e,1);}}finishSend(){let t=n.bistream_finishSend(this.__wbg_ptr);return p(t)}get recv(){let t=n.bistream_recv(this.__wbg_ptr);return p(t)}get send(){let t=n.bistream_send(this.__wbg_ptr);return p(t)}};Symbol.dispose&&(B.prototype[Symbol.dispose]=B.prototype.free);var N=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_intounderlyingsink_free(t,0);}abort(t){let e=this.__destroy_into_raw(),_=n.intounderlyingsink_abort(e,g(t));return p(_)}close(){let t=this.__destroy_into_raw(),e=n.intounderlyingsink_close(t);return p(e)}write(t){let e=n.intounderlyingsink_write(this.__wbg_ptr,g(t));return p(e)}};Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free);var q=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_intounderlyingsource_free(t,0);}cancel(){let t=this.__destroy_into_raw();n.intounderlyingsource_cancel(t);}pull(t){let e=n.intounderlyingsource_pull(this.__wbg_ptr,g(t));return p(e)}};Symbol.dispose&&(q.prototype[Symbol.dispose]=q.prototype.free);var L=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,_t.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_t.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_peerunistream_free(t,0);}get applicationCryptoWrapped(){return n.peerunistream_applicationCryptoWrapped(this.__wbg_ptr)!==0}finishSend(){let t=n.peerunistream_finishSend(this.__wbg_ptr);return p(t)}get writable(){let t=n.peerunistream_writable(this.__wbg_ptr);return p(t)}};Symbol.dispose&&(L.prototype[Symbol.dispose]=L.prototype.free);var C=class c{static __wrap(t){let e=Object.create(c.prototype);return e.__wbg_ptr=t,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),t}free(){let t=this.__destroy_into_raw();n.__wbg_wasmclient_free(t,0);}add_peer_scope(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_add_peer_scope(this.__wbg_ptr,_,r,s,b);return p(w)}bind_connection_device_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_bind_connection_device_id(this.__wbg_ptr,_,r,s,b);return p(w)}bind_node_device_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_bind_node_device_id(this.__wbg_ptr,_,r,s,b);return p(w)}clearConnectionApplicationCryptoKey(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;n.wasmclient_clearConnectionApplicationCryptoKey(this.__wbg_ptr,e,_);}clear_session_tokens(){n.wasmclient_clear_session_tokens(this.__wbg_ptr);}confirm_inline_reciprocal_session_admission(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;var k=f(b)?0:a(b,n.__wbindgen_export,n.__wbindgen_export2),I=i;let A=n.wasmclient_confirm_inline_reciprocal_session_admission(this.__wbg_ptr,w,d,e,m,l,y,h,s,k,I);return p(A)}connect(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_connect(this.__wbg_ptr,e,_);return p(r)}connect_device(t,e){var _=f(t)?0:a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;let s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_connect_device(this.__wbg_ptr,_,r,s,b);return p(w)}connection_state(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_connection_state(this.__wbg_ptr,e,_);return p(r)}connection_states(){let t=n.wasmclient_connection_states(this.__wbg_ptr);return p(t)}create_room(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i,k=a(r,n.__wbindgen_export,n.__wbindgen_export2),I=i,A=a(s,n.__wbindgen_export,n.__wbindgen_export2),O=i,V=n.wasmclient_create_room(this.__wbg_ptr,w,d,m,l,y,h,k,I,A,O,f(b)?Number.MAX_SAFE_INTEGER:b>>>0);return p(V)}create_session(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_create_session(this.__wbg_ptr,e,_);return p(r)}delete_device(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_delete_device(this.__wbg_ptr,_,r,s,b);return p(w)}devices_with_status(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_devices_with_status(this.__wbg_ptr,e,_);return p(r)}disconnect(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_disconnect(this.__wbg_ptr,e,_);return p(r)}disconnect_device(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;var s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_disconnect_device(this.__wbg_ptr,_,r,s,b);return p(w)}disconnect_transient(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_disconnect_transient(this.__wbg_ptr,e,_);return p(r)}endpoint_id_from_ticket(t){let e,_;try{let l=n.__wbindgen_add_to_stack_pointer(-16),y=a(t,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_endpoint_id_from_ticket(l,this.__wbg_ptr,y,h);var r=u().getInt32(l+0,!0),s=u().getInt32(l+4,!0),b=u().getInt32(l+8,!0),w=u().getInt32(l+12,!0),d=r,m=s;if(w)throw d=0,m=0,p(b);return e=d,_=m,v(d,m)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(e,_,1);}}endpoint_ticket(){let t=n.wasmclient_endpoint_ticket(this.__wbg_ptr);return p(t)}endpoint_ticket_with_token(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_endpoint_ticket_with_token(this.__wbg_ptr,_,r,e);return p(s)}force_reconnect_snapshot(){n.wasmclient_force_reconnect_snapshot(this.__wbg_ptr);}get_members(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_get_members(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}heartbeat_tick(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_heartbeat_tick(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}incoming_streams(){let t=n.wasmclient_incoming_streams(this.__wbg_ptr);return p(t)}initIrohWithTestRelay(t,e){var _=f(t)?0:W(t,n.__wbindgen_export),r=i,s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_initIrohWithTestRelay(this.__wbg_ptr,_,r,s,b);return p(w)}init_iroh(t){var e=f(t)?0:W(t,n.__wbindgen_export),_=i;let r=n.wasmclient_init_iroh(this.__wbg_ptr,e,_);return p(r)}iroh_path_kind(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_iroh_path_kind(this.__wbg_ptr,e,_);return p(r)}iroh_secret_key(){let t=n.wasmclient_iroh_secret_key(this.__wbg_ptr);return p(t)}iroh_transport_rtt_ms(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_iroh_transport_rtt_ms(this.__wbg_ptr,e,_);return p(r)}is_auto_connect_excluded(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;return n.wasmclient_is_auto_connect_excluded(this.__wbg_ptr,e,_)!==0}is_connected(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_is_connected(this.__wbg_ptr,e,_);return p(r)}is_current_transport_stable_id(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_is_current_transport_stable_id(this.__wbg_ptr,_,r,e);return p(s)}join_room(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i,h=a(r,n.__wbindgen_export,n.__wbindgen_export2),k=i,I=a(s,n.__wbindgen_export,n.__wbindgen_export2),A=i,O=n.wasmclient_join_room(this.__wbg_ptr,b,w,d,m,l,y,h,k,I,A);return p(O)}leave_room(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=n.wasmclient_leave_room(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}list_managed_connections(){let t=n.wasmclient_list_managed_connections(this.__wbg_ptr);return p(t)}constructor(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;n.wasmclient_new(b,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return this.__wbg_ptr=_,H.register(this,this.__wbg_ptr,this),this}finally{n.__wbindgen_add_to_stack_pointer(16);}}static newWithAppTag(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;n.wasmclient_newWithAppTag(b,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return c.__wrap(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}node_addr(){let t=n.wasmclient_node_addr(this.__wbg_ptr);return p(t)}open_bi(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_bi(this.__wbg_ptr,e,_);return p(r)}open_native_main_control_bi(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_native_main_control_bi(this.__wbg_ptr,e,_);return p(r)}open_peer_bi(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_bi_explicit_file_sender(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi_explicit_file_sender(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_bi_transport_only(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_bi_transport_only(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_peer_native_bi(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=n.wasmclient_open_peer_native_bi(this.__wbg_ptr,r,s,b,w,f(_)?Number.MAX_SAFE_INTEGER:_>>>0);return p(d)}open_peer_uni(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_open_peer_uni(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}open_uni(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_open_uni(this.__wbg_ptr,e,_);return p(r)}peer_scopes(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_scopes(this.__wbg_ptr,e,_);return p(r)}peer_session(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_session(this.__wbg_ptr,e,_);return p(r)}peer_sessions(){let t=n.wasmclient_peer_sessions(this.__wbg_ptr);return p(t)}peer_snapshot(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_peer_snapshot(this.__wbg_ptr,e,_);return p(r)}prepare_inline_reciprocal_session_admission(t,e,_,r,s,b,w,d){let m=a(t,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i,k=a(r,n.__wbindgen_export,n.__wbindgen_export2),I=i,A=a(s,n.__wbindgen_export,n.__wbindgen_export2),O=i,V=a(b,n.__wbindgen_export,n.__wbindgen_export2),ct=i,at=a(w,n.__wbindgen_export,n.__wbindgen_export2),bt=i,pt=a(d,n.__wbindgen_export,n.__wbindgen_export2),wt=i,gt=n.wasmclient_prepare_inline_reciprocal_session_admission(this.__wbg_ptr,m,l,e,y,h,k,I,A,O,V,ct,at,bt,pt,wt);return p(gt)}present_session_token_to_host(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_present_session_token_to_host(this.__wbg_ptr,_,r,s,b);return p(w)}present_session_token_to_host_with_payload(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;var d=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i;let l=n.wasmclient_present_session_token_to_host_with_payload(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}present_session_token_to_host_with_payload_and_device_id(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_present_session_token_to_host_with_payload_and_device_id(this.__wbg_ptr,s,b,w,d,m,l,y,h);return p(k)}rankRoutes(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=ot(t,n.__wbindgen_export),d=i,m=ot(e,n.__wbindgen_export),l=i;n.wasmclient_rankRoutes(b,this.__wbg_ptr,w,d,m,l);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=Ct(_,r).slice();return n.__wbindgen_export4(_,r*4,4),s}finally{n.__wbindgen_add_to_stack_pointer(16);}}register_session_token(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;n.wasmclient_register_session_token(this.__wbg_ptr,r,s,b,w,_);}register_session_token_with_expiry_ms(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;n.wasmclient_register_session_token_with_expiry_ms(this.__wbg_ptr,s,b,w,d,_,r);}reject_connection_admission(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_reject_connection_admission(this.__wbg_ptr,_,r,s,b);return p(w)}release_peer_scope(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i;var s=f(e)?0:a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i;let w=n.wasmclient_release_peer_scope(this.__wbg_ptr,_,r,s,b);return p(w)}remote_session_admission_ready_for_ticket(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_remote_session_admission_ready_for_ticket(this.__wbg_ptr,e,_);return p(r)}report_managed_connection_settled(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i;let y=n.wasmclient_report_managed_connection_settled(this.__wbg_ptr,w,d,e,m,l,!f(r),f(r)?BigInt(0):r,!f(s),f(s)?BigInt(0):s,!f(b),f(b)?BigInt(0):b);return p(y)}report_transport_status(t,e,_,r,s,b){let w=a(t,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(e,n.__wbindgen_export,n.__wbindgen_export2),l=i;var y=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_report_transport_status(this.__wbg_ptr,w,d,m,l,y,h,!f(r),f(r)?BigInt(0):r,!f(s),f(s)?BigInt(0):s,!f(b),f(b)?BigInt(0):b);return p(k)}resolve_peer_connection_records(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_resolve_peer_connection_records(this.__wbg_ptr,e,_);return p(r)}revoke_session_token(t){try{let s=n.__wbindgen_add_to_stack_pointer(-16),b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i;n.wasmclient_revoke_session_token(s,this.__wbg_ptr,b,w);var e=u().getInt32(s+0,!0),_=u().getInt32(s+4,!0),r=u().getInt32(s+8,!0);if(r)throw p(_);return p(e)}finally{n.__wbindgen_add_to_stack_pointer(16);}}revoke_tokens_by_scope(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_revoke_tokens_by_scope(this.__wbg_ptr,e,_);return p(r)}runtime_policy(){try{let r=n.__wbindgen_add_to_stack_pointer(-16);n.wasmclient_runtime_policy(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0),_=u().getInt32(r+8,!0);if(_)throw p(e);return p(t)}finally{n.__wbindgen_add_to_stack_pointer(16);}}same_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_same_peer(this.__wbg_ptr,_,r,s,b);return p(w)}search_devices(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_search_devices(this.__wbg_ptr,e,_);return p(r)}send_message(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;var m=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i,y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;let k=n.wasmclient_send_message(this.__wbg_ptr,s,b,w,d,m,l,y,h);return p(k)}send_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=W(e,n.__wbindgen_export),b=i,w=n.wasmclient_send_peer(this.__wbg_ptr,_,r,s,b);return p(w)}send_peer_application_frame(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=W(e,n.__wbindgen_export),w=i,d=n.wasmclient_send_peer_application_frame(this.__wbg_ptr,r,s,b,w,f(_)?Number.MAX_SAFE_INTEGER:_>>>0);return p(d)}setConnectionApplicationCryptoKey(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=W(e,n.__wbindgen_export),b=i,w=n.wasmclient_setConnectionApplicationCryptoKey(this.__wbg_ptr,_,r,s,b);return p(w)}setConnectionApplicationCryptoRequired(t){try{let r=n.__wbindgen_add_to_stack_pointer(-16),s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i;n.wasmclient_setConnectionApplicationCryptoRequired(r,this.__wbg_ptr,s,b);var e=u().getInt32(r+0,!0),_=u().getInt32(r+4,!0);if(_)throw p(e)}finally{n.__wbindgen_add_to_stack_pointer(16);}}set_auth_token(t){var e=f(t)?0:a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i;n.wasmclient_set_auth_token(this.__wbg_ptr,e,_);}set_auto_connect_excluded(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_set_auto_connect_excluded(this.__wbg_ptr,_,r,e);return p(s)}set_offline(t){let e=a(t,n.__wbindgen_export,n.__wbindgen_export2),_=i,r=n.wasmclient_set_offline(this.__wbg_ptr,e,_);return p(r)}start_auto_connect(t,e){try{let s=n.__wbindgen_add_to_stack_pointer(-16),b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i;n.wasmclient_start_auto_connect(s,this.__wbg_ptr,b,w,d,m);var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);if(r)throw p(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}start_presence_loop(t,e,_,r){let s=a(t,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i,m=a(_,n.__wbindgen_export,n.__wbindgen_export2),l=i;var y=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_start_presence_loop(this.__wbg_ptr,s,b,w,d,m,l,y,h);}stop_auth_scoped_activity(){n.wasmclient_stop_auth_scoped_activity(this.__wbg_ptr);}stop_auto_connect(){n.wasmclient_stop_auto_connect(this.__wbg_ptr);}stop_presence_loop(){n.wasmclient_stop_presence_loop(this.__wbg_ptr);}submit_browser_desired_peers(t,e){try{let b=n.__wbindgen_add_to_stack_pointer(-16),w=a(e,n.__wbindgen_export,n.__wbindgen_export2),d=i;n.wasmclient_submit_browser_desired_peers(b,this.__wbg_ptr,t,w,d);var _=u().getInt32(b+0,!0),r=u().getInt32(b+4,!0),s=u().getInt32(b+8,!0);if(s)throw p(r);return _!==0}finally{n.__wbindgen_add_to_stack_pointer(16);}}update_device(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i;var l=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i,h=f(s)?0:a(s,n.__wbindgen_export,n.__wbindgen_export2),k=i;let I=n.wasmclient_update_device(this.__wbg_ptr,b,w,d,m,l,y,f(r)?0:g(r),h,k);return p(I)}update_presence(t,e,_,r,s){let b=a(t,n.__wbindgen_export,n.__wbindgen_export2),w=i,d=a(e,n.__wbindgen_export,n.__wbindgen_export2),m=i,l=a(_,n.__wbindgen_export,n.__wbindgen_export2),y=i;var h=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),k=i;let I=n.wasmclient_update_presence(this.__wbg_ptr,b,w,d,m,l,y,h,k,!f(s),f(s)?BigInt(0):s);return p(I)}update_session(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_update_session(this.__wbg_ptr,_,r,s,b);return p(w)}validate_session_token(t){let e,_;try{let l=n.__wbindgen_add_to_stack_pointer(-16),y=a(t,n.__wbindgen_export,n.__wbindgen_export2),h=i;n.wasmclient_validate_session_token(l,this.__wbg_ptr,y,h);var r=u().getInt32(l+0,!0),s=u().getInt32(l+4,!0),b=u().getInt32(l+8,!0),w=u().getInt32(l+12,!0),d=r,m=s;if(w)throw d=0,m=0,p(b);return e=d,_=m,v(d,m)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_export4(e,_,1);}}validate_session_token_for_connection(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=a(e,n.__wbindgen_export,n.__wbindgen_export2),b=i,w=n.wasmclient_validate_session_token_for_connection(this.__wbg_ptr,_,r,s,b);return p(w)}validate_session_token_for_connection_with_payload(t,e,_){let r=a(t,n.__wbindgen_export,n.__wbindgen_export2),s=i,b=a(e,n.__wbindgen_export,n.__wbindgen_export2),w=i;var d=f(_)?0:a(_,n.__wbindgen_export,n.__wbindgen_export2),m=i;let l=n.wasmclient_validate_session_token_for_connection_with_payload(this.__wbg_ptr,r,s,b,w,d,m);return p(l)}wait_for_settled_peer(t,e){let _=a(t,n.__wbindgen_export,n.__wbindgen_export2),r=i,s=n.wasmclient_wait_for_settled_peer(this.__wbg_ptr,_,r,f(e)?Number.MAX_SAFE_INTEGER:e>>>0);return p(s)}wake_browser_auto_connect(){return n.wasmclient_wake_browser_auto_connect(this.__wbg_ptr)!==0}};Symbol.dispose&&(C.prototype[Symbol.dispose]=C.prototype.free);function it(){n.start();}function dt(){return {__proto__:null,"./openrtc_bg.js":{__proto__:null,__wbg_Error_9dc85fe1bc224456:function(t,e){let _=Error(v(t,e));return g(_)},__wbg_String_8564e559799eccda:function(t,e){let _=String(o(e)),r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg___wbindgen_boolean_get_b131b2f36d6b2f55:function(t){let e=o(t),_=typeof e=="boolean"?e:void 0;return f(_)?16777215:_?1:0},__wbg___wbindgen_debug_string_56c147eb1a51f0c4:function(t,e){let _=J(o(e)),r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg___wbindgen_in_ce8569b2fc6f5088:function(t,e){return o(t)in o(e)},__wbg___wbindgen_is_function_147961669f068cd4:function(t){return typeof o(t)=="function"},__wbg___wbindgen_is_null_ced4761460071341:function(t){return o(t)===null},__wbg___wbindgen_is_object_3a2c414391dbf751:function(t){let e=o(t);return typeof e=="object"&&e!==null},__wbg___wbindgen_is_string_6541b0f6ecd4e8e5:function(t){return typeof o(t)=="string"},__wbg___wbindgen_is_undefined_4410e3c20a99fa97:function(t){return o(t)===void 0},__wbg___wbindgen_jsval_eq_174c93ec61bab0c5:function(t,e){return o(t)===o(e)},__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c:function(t,e){return o(t)==o(e)},__wbg___wbindgen_number_get_588ed6b97f0d7e14:function(t,e){let _=o(e),r=typeof _=="number"?_:void 0;u().setFloat64(t+8,f(r)?0:r,true),u().setInt32(t+0,!f(r),true);},__wbg___wbindgen_string_get_fa2687d531ed17a5:function(t,e){let _=o(e),r=typeof _=="string"?_:void 0;var s=f(r)?0:a(r,n.__wbindgen_export,n.__wbindgen_export2),b=i;u().setInt32(t+4,b,true),u().setInt32(t+0,s,true);},__wbg___wbindgen_throw_bbadd78c1bac3a77:function(t,e){throw new Error(v(t,e))},__wbg__wbg_cb_unref_c2301a3c9b78104b:function(t){o(t)._wbg_cb_unref();},__wbg_abort_56c00f462c9261d9:function(t,e){o(t).abort(o(e));},__wbg_abort_f2416f4a9852003e:function(t){o(t).abort();},__wbg_addEventListener_b635263c509aa7de:function(){return x(function(t,e,_,r){o(t).addEventListener(v(e,_),o(r));},arguments)},__wbg_append_c5a0c94a6a73b22e:function(){return x(function(t,e,_,r,s){o(t).append(v(e,_),v(r,s));},arguments)},__wbg_arrayBuffer_cc7704fa158b907a:function(){return x(function(t){let e=o(t).arrayBuffer();return g(e)},arguments)},__wbg_bistream_new:function(t){let e=B.__wrap(t);return g(e)},__wbg_body_442a47f02322d7b0:function(t){let e=o(t).body;return f(e)?0:g(e)},__wbg_buffer_8524b3453cde4918:function(t){let e=o(t).buffer;return g(e)},__wbg_byobRequest_cc72d210de793e64:function(t){let e=o(t).byobRequest;return f(e)?0:g(e)},__wbg_byteLength_96807b1d9ab24a4c:function(t){return o(t).byteLength},__wbg_byteOffset_a9c7002428843c41:function(t){return o(t).byteOffset},__wbg_call_ec09a4cf93377d3a:function(){return x(function(t,e,_){let r=o(t).call(o(e),o(_));return g(r)},arguments)},__wbg_cancel_f3a197b26dc88b39:function(t){let e=o(t).cancel();return g(e)},__wbg_catch_66060324c27be6f7:function(t,e){let _=o(t).catch(o(e));return g(_)},__wbg_clearTimeout_113b1cde814ec762:function(t){let e=clearTimeout(p(t));return g(e)},__wbg_clearTimeout_333bba87532ab9d3:function(t){let e=clearTimeout(p(t));return g(e)},__wbg_clearTimeout_47a40e3be01ed7a3:function(){return x(function(t,e){o(t).clearTimeout(p(e));},arguments)},__wbg_close_296263cfe1bb2999:function(){return x(function(t){o(t).close();},arguments)},__wbg_close_388d99468213b286:function(){return x(function(t){o(t).close();},arguments)},__wbg_close_4857e22d08b71356:function(){return x(function(t){o(t).close();},arguments)},__wbg_code_1cda2855fcd9b009:function(t){return o(t).code},__wbg_code_70beb7b22374d55e:function(t){return o(t).code},__wbg_createDataChannel_122bd3d8aacee49b:function(t,e,_){let r=o(t).createDataChannel(v(e,_));return g(r)},__wbg_crypto_38df2bab126b63dc:function(t){let e=o(t).crypto;return g(e)},__wbg_data_8a04443c1e5a8cd3:function(t){let e=o(t).data;return g(e)},__wbg_dispatchEvent_cc62a6a43d28b01c:function(){return x(function(t,e){return o(t).dispatchEvent(o(e))},arguments)},__wbg_done_6a8439e544ec6206:function(t){return o(t).done},__wbg_enqueue_bbeb09ba0b140f76:function(){return x(function(t,e){o(t).enqueue(o(e));},arguments)},__wbg_entries_4e00eefd3fd54cf1:function(t){let e=o(t).entries();return g(e)},__wbg_error_6651fee1c71e5da9:function(t){console.error(o(t));},__wbg_error_a6fa202b58aa1cd3:function(t,e){let _,r;try{_=t,r=e,console.error(v(t,e));}finally{n.__wbindgen_export4(_,r,1);}},__wbg_fetch_074561c3e313c86f:function(t){let e=fetch(o(t));return g(e)},__wbg_fetch_22858a12fcf93152:function(t,e){let _=o(t).fetch(o(e));return g(_)},__wbg_getRandomValues_76dfc69825c9c552:function(){return x(function(t,e){globalThis.crypto.getRandomValues(F(t,e));},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return x(function(t,e){o(t).getRandomValues(o(e));},arguments)},__wbg_getReader_9facd4f899beac89:function(){return x(function(t){let e=o(t).getReader();return g(e)},arguments)},__wbg_get_4b90d6d8c5deb5d5:function(t,e){let _=o(t)[e>>>0];return g(_)},__wbg_get_52a8a619f7b88df6:function(){return x(function(t,e){let _=Reflect.get(o(t),o(e));return g(_)},arguments)},__wbg_get_done_c21b9933fc9a9e9c:function(t){let e=o(t).done;return f(e)?16777215:e?1:0},__wbg_get_value_ad568c7d3db9073f:function(t){let e=o(t).value;return g(e)},__wbg_get_with_ref_key_6412cf3094599694:function(t,e){let _=o(t)[o(e)];return g(_)},__wbg_has_14676d88c1340d2c:function(){return x(function(t,e){return Reflect.has(o(t),o(e))},arguments)},__wbg_headers_5b19cf40627ae54d:function(t){let e=o(t).headers;return g(e)},__wbg_info_a2b5f8a5dae8b26c:function(t){console.info(o(t));},__wbg_instanceof_ArrayBuffer_a581da923203f29f:function(t){let e;try{e=o(t)instanceof ArrayBuffer;}catch{e=false;}return e},__wbg_instanceof_Blob_5c4e145be35f9b1e:function(t){let e;try{e=o(t)instanceof Blob;}catch{e=false;}return e},__wbg_instanceof_Response_36a65a969abaa7c6:function(t){let e;try{e=o(t)instanceof Response;}catch{e=false;}return e},__wbg_instanceof_Uint8Array_b6fe1ac89eba107e:function(t){let e;try{e=o(t)instanceof Uint8Array;}catch{e=false;}return e},__wbg_instanceof_Window_9e0fe7d3d1ff4342:function(t){let e;try{e=o(t)instanceof Window;}catch{e=false;}return e},__wbg_isArray_139f48e3c057ede8:function(t){return Array.isArray(o(t))},__wbg_length_68a9d5278d084f4f:function(t){return o(t).length},__wbg_log_6614a4effdb4e983:function(t){console.log(o(t));},__wbg_message_12958526424a887b:function(t,e){let _=o(e).message,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_msCrypto_bd5a034af96bcba6:function(t){let e=o(t).msCrypto;return g(e)},__wbg_new_0b303268aa395a38:function(){let t=new Array;return g(t)},__wbg_new_189262ff31890c23:function(){return x(function(){let t=new Headers;return g(t)},arguments)},__wbg_new_20b778a4c5c691c3:function(){let t=new Object;return g(t)},__wbg_new_227d7c05414eb861:function(){let t=new Error;return g(t)},__wbg_new_24739629d416f982:function(){return x(function(){let t=new AbortController;return g(t)},arguments)},__wbg_new_5fae30e6b23db8df:function(t,e){let _=new Error(v(t,e));return g(_)},__wbg_new_883c0db065f06efd:function(){return g(new Map)},__wbg_new_a3e5112401a82338:function(){return x(function(t,e){let _=new WebSocket(v(t,e));return g(_)},arguments)},__wbg_new_b06772b280cc6e52:function(t){let e=new Uint8Array(o(t));return g(e)},__wbg_new_from_slice_bb2d1778c0b87eb1:function(t,e){let _=new Uint8Array(F(t,e));return g(_)},__wbg_new_typed_90c3f6c29ba36d19:function(t,e){try{var _={a:t,b:e},r=(b,w)=>{let d=_.a;_.a=0;try{return kt(d,_.b,b,w)}finally{_.a=d;}};let s=new Promise(r);return g(s)}finally{_.a=0;}},__wbg_new_with_byte_offset_and_length_9e1e664fe1a5d385:function(t,e,_){let r=new Uint8Array(o(t),e>>>0,_>>>0);return g(r)},__wbg_new_with_configuration_3a96aa953ca17197:function(){return x(function(t){let e=new RTCPeerConnection(o(t));return g(e)},arguments)},__wbg_new_with_event_init_dict_bd850674488710b1:function(){return x(function(t,e,_){let r=new CustomEvent(v(t,e),o(_));return g(r)},arguments)},__wbg_new_with_into_underlying_sink_2596343f9b6c8e58:function(t){let e=new WritableStream(N.__wrap(t));return g(e)},__wbg_new_with_into_underlying_source_fd904252f385f59c:function(t,e){let _=new ReadableStream(q.__wrap(t),p(e));return g(_)},__wbg_new_with_length_4b57a7a5dc67221c:function(t){let e=new Uint8Array(t>>>0);return g(e)},__wbg_new_with_str_and_init_df876572184fe639:function(){return x(function(t,e,_){let r=new Request(v(t,e),o(_));return g(r)},arguments)},__wbg_new_with_str_sequence_505a4829cc247e79:function(){return x(function(t,e,_){let r=new WebSocket(v(t,e),o(_));return g(r)},arguments)},__wbg_next_8cb028b6ba50743f:function(){return x(function(t){let e=o(t).next();return g(e)},arguments)},__wbg_node_84ea875411254db1:function(t){let e=o(t).node;return g(e)},__wbg_now_bce4dc999095ea77:function(){return Date.now()},__wbg_now_e7c6795a7f81e10f:function(t){return o(t).now()},__wbg_parse_a5c06e19bc1187fd:function(t,e){return Date.parse(v(t,e))},__wbg_peerunistream_new:function(t){let e=L.__wrap(t);return g(e)},__wbg_performance_3fcf6e32a7e1ed0a:function(t){let e=o(t).performance;return g(e)},__wbg_process_44c7a14e11e9f69e:function(t){let e=o(t).process;return g(e)},__wbg_protocol_28aaef5ea42981d6:function(t,e){let _=o(e).protocol,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_prototypesetcall_956c7493c68e29b4:function(t,e,_){Uint8Array.prototype.set.call(F(t,e),o(_));},__wbg_push_ceb8ef046afb2041:function(t,e){return o(t).push(o(e))},__wbg_queueMicrotask_4698f900840e3286:function(t){queueMicrotask(o(t));},__wbg_queueMicrotask_477a5533c7100338:function(t){let e=o(t).queueMicrotask;return g(e)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return x(function(t,e){o(t).randomFillSync(p(e));},arguments)},__wbg_read_8426c146431f2905:function(t){let e=o(t).read();return g(e)},__wbg_readyState_25243ad6ce649774:function(t){return o(t).readyState},__wbg_reason_4ec455bac79b33ce:function(t,e){let _=o(e).reason,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_releaseLock_188846ef719acb10:function(t){o(t).releaseLock();},__wbg_removeEventListener_016c1d24523b4730:function(){return x(function(t,e,_,r){o(t).removeEventListener(v(e,_),o(r));},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return x(function(){let t=module.require;return g(t)},arguments)},__wbg_resolve_0183de2e8c6b1d54:function(t){let e=Promise.resolve(o(t));return g(e)},__wbg_respond_3cdb4cf32683fd79:function(){return x(function(t,e){o(t).respond(e>>>0);},arguments)},__wbg_send_99d049cae69c53cc:function(){return x(function(t,e,_){o(t).send(F(e,_));},arguments)},__wbg_send_bac9d3dc4f21ef28:function(){return x(function(t,e,_){o(t).send(v(e,_));},arguments)},__wbg_setTimeout_3a808dd861dd3c12:function(t,e){let _=setTimeout(o(t),e);return g(_)},__wbg_setTimeout_6613a51400c1bf9f:function(){return x(function(t,e,_){let r=o(t).setTimeout(p(e),_);return g(r)},arguments)},__wbg_setTimeout_ef24d2fc3ad97385:function(){return x(function(t,e){let _=setTimeout(o(t),e);return g(_)},arguments)},__wbg_set_5f806304fb633ab3:function(t,e,_){let r=o(t).set(o(e),o(_));return g(r)},__wbg_set_6be42768c690e380:function(t,e,_){o(t)[p(e)]=p(_);},__wbg_set_86698c227e5b9dad:function(t,e,_){o(t).set(F(e,_));},__wbg_set_a6ba3ac0e634b822:function(){return x(function(t,e,_){return Reflect.set(o(t),o(e),o(_))},arguments)},__wbg_set_binaryType_8c2dd2cf1cfc2e28:function(t,e){o(t).binaryType=It[e];},__wbg_set_body_d1153b16a2b95ca1:function(t,e){o(t).body=o(e);},__wbg_set_cache_5a01a8b5e6ca6cf2:function(t,e){o(t).cache=At[e];},__wbg_set_credentials_e9120ed88b1fc0b8:function(t,e){o(t).credentials=Ft[e];},__wbg_set_da33c120a6584674:function(t,e,_){o(t)[e>>>0]=p(_);},__wbg_set_detail_c7af5edea934390b:function(t,e){o(t).detail=o(e);},__wbg_set_handle_event_6147c38b782c7b42:function(t,e){o(t).handleEvent=o(e);},__wbg_set_headers_877ed41890d28af2:function(t,e){o(t).headers=o(e);},__wbg_set_high_water_mark_77da20c49668427d:function(t,e){o(t).highWaterMark=e;},__wbg_set_method_b4ede299b2064f37:function(t,e,_){o(t).method=v(e,_);},__wbg_set_mode_d6c2e1991aa963c6:function(t,e){o(t).mode=St[e];},__wbg_set_onclose_9cb5c3372e16c192:function(t,e){o(t).onclose=o(e);},__wbg_set_onerror_190fe67e911ebf28:function(t,e){o(t).onerror=o(e);},__wbg_set_onmessage_96337495f0bfb796:function(t,e){o(t).onmessage=o(e);},__wbg_set_onopen_3e2bf6b11d434c2d:function(t,e){o(t).onopen=o(e);},__wbg_set_signal_9022b5aa06a6ce5b:function(t,e){o(t).signal=o(e);},__wbg_signal_41dd1a8913cd0b7d:function(t){let e=o(t).signal;return g(e)},__wbg_stack_3b0d974bbf31e44f:function(t,e){let _=o(e).stack,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_static_accessor_GLOBAL_60a4124bab7dcc9a:function(){let t=typeof global>"u"?null:global;return f(t)?0:g(t)},__wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13:function(){let t=typeof globalThis>"u"?null:globalThis;return f(t)?0:g(t)},__wbg_static_accessor_SELF_4c95f759a91e9aae:function(){let t=typeof self>"u"?null:self;return f(t)?0:g(t)},__wbg_static_accessor_WINDOW_44b435597f9e9ee7:function(){let t=typeof window>"u"?null:window;return f(t)?0:g(t)},__wbg_status_9e6505cfa3e73a7c:function(t){return o(t).status},__wbg_subarray_42216645a367cd7a:function(t,e,_){let r=o(t).subarray(e>>>0,_>>>0);return g(r)},__wbg_then_254bab9b266a77a5:function(t,e,_){let r=o(t).then(o(e),o(_));return g(r)},__wbg_then_3ea18602c6a5123b:function(t,e){let _=o(t).then(o(e));return g(_)},__wbg_url_72c67c175685a054:function(t,e){let _=o(e).url,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_url_d0b8042af0d1bbba:function(t,e){let _=o(e).url,r=a(_,n.__wbindgen_export,n.__wbindgen_export2),s=i;u().setInt32(t+4,s,true),u().setInt32(t+0,r,true);},__wbg_value_3d3defe09fb1ffca:function(t){let e=o(t).value;return g(e)},__wbg_versions_276b2795b1c6a219:function(t){let e=o(t).versions;return g(e)},__wbg_view_15fa5865c6b336e3:function(t){let e=o(t).view;return f(e)?0:g(e)},__wbg_warn_633bacc13ba7e6c3:function(t){console.warn(o(t));},__wbg_wasClean_f17429d064911939:function(t){return o(t).wasClean},__wbindgen_cast_0000000000000001:function(t,e){let _=S(t,e,xt);return g(_)},__wbindgen_cast_0000000000000002:function(t,e){let _=S(t,e,vt);return g(_)},__wbindgen_cast_0000000000000003:function(t,e){let _=S(t,e,yt);return g(_)},__wbindgen_cast_0000000000000004:function(t,e){let _=S(t,e,ht);return g(_)},__wbindgen_cast_0000000000000005:function(t,e){let _=S(t,e,ut);return g(_)},__wbindgen_cast_0000000000000006:function(t,e){let _=S(t,e,ft);return g(_)},__wbindgen_cast_0000000000000007:function(t,e){let _=Ot(t,e,lt);return g(_)},__wbindgen_cast_0000000000000008:function(t,e){let _=S(t,e,mt);return g(_)},__wbindgen_cast_0000000000000009:function(t){return g(t)},__wbindgen_cast_000000000000000a:function(t){return g(t)},__wbindgen_cast_000000000000000b:function(t,e){let _=F(t,e);return g(_)},__wbindgen_cast_000000000000000c:function(t,e){let _=v(t,e);return g(_)},__wbindgen_cast_000000000000000d:function(t){let e=BigInt.asUintN(64,t);return g(e)},__wbindgen_cast_000000000000000e:function(t,e){var _=F(t,e).slice();return n.__wbindgen_export4(t,e*1,1),g(_)},__wbindgen_object_clone_ref:function(t){let e=o(t);return g(e)},__wbindgen_object_drop_ref:function(t){p(t);}}}}function ut(c,t){n.__wasm_bindgen_func_elem_8832(c,t);}function ft(c,t){n.__wasm_bindgen_func_elem_9954(c,t);}function lt(c,t){n.__wasm_bindgen_func_elem_10007(c,t);}function mt(c,t){n.__wasm_bindgen_func_elem_17813(c,t);}function xt(c,t,e){n.__wasm_bindgen_func_elem_9034(c,t,g(e));}function yt(c,t,e){n.__wasm_bindgen_func_elem_6492(c,t,g(e));}function ht(c,t,e){n.__wasm_bindgen_func_elem_10642(c,t,g(e));}function vt(c,t,e){try{let s=n.__wbindgen_add_to_stack_pointer(-16);n.__wasm_bindgen_func_elem_17958(s,c,t,g(e));var _=u().getInt32(s+0,!0),r=u().getInt32(s+4,!0);if(r)throw p(_)}finally{n.__wbindgen_add_to_stack_pointer(16);}}function kt(c,t,e,_){n.__wasm_bindgen_func_elem_17960(c,t,g(e),g(_));}var It=["blob","arraybuffer"],At=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Ft=["omit","same-origin","include"],St=["same-origin","no-cors","cors","navigate"],tt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_bistream_free(c,1));typeof FinalizationRegistry>"u"?{}:new FinalizationRegistry(c=>n.__wbg_intounderlyingbytesource_free(c,1));var et=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_intounderlyingsink_free(c,1)),nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_intounderlyingsource_free(c,1)),_t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_peerunistream_free(c,1)),H=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbg_wasmclient_free(c,1));typeof FinalizationRegistry>"u"?{}:new FinalizationRegistry(c=>n.__wbg_wasmconnection_free(c,1));function g(c){M===R.length&&R.push(R.length+1);let t=M;return M=R[t],R[t]=c,t}var G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(c=>n.__wbindgen_export5(c.a,c.b));function J(c){let t=typeof c;if(t=="number"||t=="boolean"||c==null)return `${c}`;if(t=="string")return `"${c}"`;if(t=="symbol"){let r=c.description;return r==null?"Symbol":`Symbol(${r})`}if(t=="function"){let r=c.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(c)){let r=c.length,s="[";r>0&&(s+=J(c[0]));for(let b=1;b<r;b++)s+=", "+J(c[b]);return s+="]",s}let e=/\[object ([^\]]+)\]/.exec(toString.call(c)),_;if(e&&e.length>1)_=e[1];else return toString.call(c);if(_=="Object")try{return "Object("+JSON.stringify(c)+")"}catch{return "Object"}return c instanceof Error?`${c.name}: ${c.message}
2
2
  ${c.stack}`:_}function Tt(c){c<1028||(R[c]=M,M=c);}function Ct(c,t){c=c>>>0;let e=u(),_=[];for(let r=c;r<c+4*t;r+=4)_.push(p(e.getUint32(r,true)));return _}function F(c,t){return c=c>>>0,T().subarray(c/1,c/1+t)}var E=null;function u(){return (E===null||E.buffer.detached===true||E.buffer.detached===void 0&&E.buffer!==n.memory.buffer)&&(E=new DataView(n.memory.buffer)),E}function v(c,t){return jt(c>>>0,t)}var j=null;function T(){return (j===null||j.byteLength===0)&&(j=new Uint8Array(n.memory.buffer)),j}function o(c){return R[c]}function x(c,t){try{return c.apply(this,t)}catch(e){n.__wbindgen_export3(g(e));}}var R=new Array(1024).fill(void 0);R.push(void 0,null,true,false);var M=R.length;function f(c){return c==null}function Ot(c,t,e){let _={a:c,b:t,cnt:1},r=(...s)=>{_.cnt++;try{return e(_.a,_.b,...s)}finally{r._wbg_cb_unref();}};return r._wbg_cb_unref=()=>{--_.cnt===0&&(n.__wbindgen_export5(_.a,_.b),_.a=0,G.unregister(_));},G.register(r,_,_),r}function S(c,t,e){let _={a:c,b:t,cnt:1},r=(...s)=>{_.cnt++;let b=_.a;_.a=0;try{return e(b,_.b,...s)}finally{_.a=b,r._wbg_cb_unref();}};return r._wbg_cb_unref=()=>{--_.cnt===0&&(n.__wbindgen_export5(_.a,_.b),_.a=0,G.unregister(_));},G.register(r,_,_),r}function W(c,t){let e=t(c.length*1,1)>>>0;return T().set(c,e/1),i=c.length,e}function ot(c,t){let e=t(c.length*4,4)>>>0,_=u();for(let r=0;r<c.length;r++)_.setUint32(e+4*r,g(c[r]),true);return i=c.length,e}function a(c,t,e){if(e===void 0){let w=z.encode(c),d=t(w.length,1)>>>0;return T().subarray(d,d+w.length).set(w),i=w.length,d}let _=c.length,r=t(_,1)>>>0,s=T(),b=0;for(;b<_;b++){let w=c.charCodeAt(b);if(w>127)break;s[r+b]=w;}if(b!==_){b!==0&&(c=c.slice(b)),r=e(r,_,_=b+c.length*3,1)>>>0;let w=T().subarray(r+b,r+_),d=z.encodeInto(c,w);b+=d.written,r=e(r,_,b,1)>>>0;}return i=b,r}function p(c){let t=o(c);return Tt(c),t}var U=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});U.decode();var Wt=2146435072,K=0;function jt(c,t){return K+=t,K>=Wt&&(U=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),U.decode(),K=t),U.decode(T().subarray(c,c+t))}var z=new TextEncoder;"encodeInto"in z||(z.encodeInto=function(c,t){let e=z.encode(c);return t.set(e),{read:c.length,written:e.length}});var i=0,n;function Bt(c,t){return n=c.exports,E=null,j=null,n.__wbindgen_start(),n}async function Nt(c,t){if(typeof Response=="function"&&c instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(c,t)}catch(r){if(c.ok&&e(c.type)&&c.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let _=await c.arrayBuffer();return await WebAssembly.instantiate(_,t)}else {let _=await WebAssembly.instantiate(c,t);return _ instanceof WebAssembly.Instance?{instance:_,module:c}:_}function e(_){switch(_){case "basic":case "cors":case "default":return true}return false}}async function st(c){if(n!==void 0)return n;c!==void 0&&(Object.getPrototypeOf(c)===Object.prototype?{module_or_path:c}=c:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),c===void 0&&(c=new URL("openrtc_bg.wasm",import.meta.url));let t=dt();(typeof c=="string"||typeof Request=="function"&&c instanceof Request||typeof URL=="function"&&c instanceof URL)&&(c=fetch(c));let{instance:e,module:_}=await Nt(await c,t);return Bt(e)}a$1(async()=>({initWasm:st,WasmClient:C,start:it}));function Xt(c){let t=s(c);return A(t,new a$2(t))}function $t(c,t){let e=s(c);return A(e,new h({...e,bridge:t}))}export{Xt as a,$t as b};
@@ -0,0 +1,2 @@
1
+ import {c}from'./chunk-C7YN5MSV.js';import {getApps,initializeApp}from'firebase/app';import {getToken,initializeAppCheck,ReCaptchaEnterpriseProvider}from'firebase/app-check';import {getFunctions,connectFunctionsEmulator,httpsCallable}from'firebase/functions';import {browserLocalPersistence,inMemoryPersistence,browserPopupRedirectResolver,initializeAuth,getAuth,connectAuthEmulator,setPersistence,onIdTokenChanged,getIdToken,signInWithCustomToken,onAuthStateChanged,signInAnonymously,signInWithEmailAndPassword,createUserWithEmailAndPassword,signOut,deleteUser,updateProfile,GoogleAuthProvider,OAuthProvider,signInWithCredential,signInWithPopup,signInWithRedirect,getRedirectResult}from'firebase/auth';function S(){return typeof window>"u"?false:!!(window.__TAURI_IPC__||window.__TAURI_INTERNALS__||window.__TAURI__||window.location.protocol==="tauri:"||window.location.hostname==="tauri.localhost")}var H=new Set;function I(t,e){H.has(t)||(H.add(t),console.warn(e));}function ie(t){return /^pk_(live|test)_[0-9a-f]{40}$/.test(t)}async function Qe(t,e){let n=`${t}:${e}`,o=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-256",o);return Array.from(new Uint8Array(i)).map(d=>d.toString(16).padStart(2,"0")).join("")}function R(t){let e=typeof t.apiKey=="string"?t.apiKey.trim():"";if(e)return ie(e)||I(`invalid-api-key:${e.slice(0,10)}`,"[pluto-rtc] The provided `apiKey` does not match the expected format (pk_live_... or pk_test_...). Create an app at https://api.openrtc.app/developer."),`app_${e.slice(-16)}`;throw new Error("[openrtc] `apiKey` is required. Create an app at https://api.openrtc.app/developer.")}function T(t){return t.authMode?t.authMode:("apiKey"in t&&typeof t.apiKey=="string"&&t.apiKey.trim().length>0&&typeof(t.spaceKey??t.space)=="string"&&(t.spaceKey??t.space).trim().length>0||I("default-auth-mode","[pluto-rtc] `authMode` is not set; defaulting to `anonymous` for compatibility."),"anonymous")}function Ye(t){let e=typeof t.projectId=="string"?t.projectId.trim():"";return e||(I("default-project-id","[pluto-rtc] `projectId` is not set; defaulting to the built-in PlutoRTC Firebase project."),y)}function B(t){return t.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function $e(t){let e="storagePrefix"in t&&typeof t.storagePrefix=="string"?B(t.storagePrefix):"";return e||B(R(t))||"default"}var ae={devicesPerUser:100,maxRooms:1e4,maxMembersPerRoom:250,maxPersonalDevices:25e3},Je=ae;var se=[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.cloudflare.com:3478"}],F={iceServers:se},Xe={};var q=["iroh-relay","iroh","moq"];function le(t){return (Array.isArray(t.urls)?t.urls:[t.urls]).some(n=>typeof n=="string"&&(n.startsWith("turn:")||n.startsWith("turns:")))}function ce(t){let n=(Array.isArray(t.urls)?t.urls:[t.urls]).filter(r=>typeof r=="string"&&!r.startsWith("stun:"));return n.length===0?null:{...t,urls:Array.isArray(t.urls)?n:n[0]}}function C(t){if(t)return t.map(e=>ce(e)).filter(e=>e!==null)}function K(t,e){let n=new Set(["iroh-relay","iroh","moq"]);e&&n.add("webrtc");let r=(t??q).filter(o=>n.has(o));return r.length>0?r:[...q]}function et(t){return !!t?.transports?.webrtc}function tt(t,e){let n=t?.transports?.webrtc||void 0;if(n)return t?.strictMode||n.privacyMode?{...n,iceServers:C(n.iceServers),iceTransportPolicy:"relay"}:n.iceTransportPolicy==="relay"&&!(Array.isArray(n.iceServers)&&n.iceServers.some(o=>le(o)))?(e?.("[Client] Overriding relay-only ICE policy to all because no TURN servers are configured"),{...n,iceTransportPolicy:"all"}):n}var de=/^[A-Za-z0-9._-]+$/,ue="[redacted]";function W(t){let e;try{e=new URL(t);}catch{throw new Error("[OpenRTC] transports.moq.relayUrl must be a valid HTTPS URL.")}if(e.protocol!=="https:")throw new Error("[OpenRTC] transports.moq.relayUrl must use HTTPS/WebTransport.");if(e.hash)throw new Error("[OpenRTC] transports.moq.relayUrl must not contain a fragment.");if(e.searchParams.has("jwt"))throw new Error("[OpenRTC] transports.moq.relayUrl must not contain a jwt query parameter; use transports.moq.accessToken.");return e}function A(t){return W(t.trim()).toString()}function rt(t,e){let n=W(t.trim());if(e!==void 0){let r=e.trim();if(!r)throw new Error("[OpenRTC] transports.moq.accessToken must not be empty when provided.");if(new TextEncoder().encode(r).byteLength>16384)throw new Error("[OpenRTC] transports.moq.accessToken exceeds the maximum supported size.");if(!de.test(r))throw new Error("[OpenRTC] transports.moq.accessToken must be a URL-safe JWT.");n.searchParams.append("jwt",r);}return n.toString()}function ot(t){try{let e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return "invalid-moq-relay-url"}}function it(t,e){let n=t instanceof Error?`${t.name}: ${t.message}`:String(t),r=e?.trim();return r?n.split(r).join(ue):n}var pe=[...c];function k(t){let e=t.spaceKey??t.space;return {...t,...e!==void 0?{spaceKey:e}:{}}}function j(t){return {...t,iceServers:t.iceServers?t.iceServers.map(e=>({...e})):t.iceServers}}function me(t){return {...t}}function ge(t){return {...t}}function fe(t){if(t)return {iroh:typeof t.iroh=="object"?ge(t.iroh):t.iroh,webrtc:typeof t.webrtc=="object"?j(t.webrtc):t.webrtc,ble:typeof t.ble=="object"?{...t.ble}:t.ble,moq:typeof t.moq=="object"?me(t.moq):t.moq}}function ye(t){if(t.strictMode&&!t.transports&&(t.transports={iroh:{relayOnly:true}}),!!t.transports){if(t.transports.webrtc===true?t.transports.webrtc=j(F):t.transports.webrtc===false&&(t.transports.webrtc=void 0),t.transports.moq===true)throw new Error("[OpenRTC] transports.moq=true is ambiguous because no anonymous MoQ relay is available; provide transports.moq.relayUrl explicitly.");if(t.transports.moq===false)t.transports.moq=void 0;else if(t.transports.moq&&typeof t.transports.moq=="object"){let e=t.transports.moq,n=e.relayUrl?.trim(),r=e.accessToken;if(r!==void 0&&!r.trim())throw new Error("[OpenRTC] transports.moq.accessToken must not be empty when provided.");t.transports.moq={...e,...n?{relayUrl:A(n)}:{},...r!==void 0?{accessToken:r.trim()}:{}};}t.transports.iroh===true?t.transports.iroh={}:t.transports.iroh===false&&(t.transports.iroh=void 0);}}function he(t){if(!t.strictMode||!t.transports)return;let e=t.transports.iroh&&typeof t.transports.iroh=="object"?t.transports.iroh:{};t.transports.iroh={...e,relayOnly:true,relayTransportPolicy:e.relayTransportPolicy??"websocketRequired",localDiscovery:false,localDiscoveryMode:void 0},t.transports.ble=void 0;let n=t.transports.webrtc;n&&typeof n=="object"&&(t.transports.webrtc={...n,privacyMode:true,lanMode:false,iceServers:C(n.iceServers)??[],iceTransportPolicy:"relay"});let r=t.transports.moq;if(r&&typeof r=="object"){let o=r.relayUrl?.trim();if(!o)throw new Error("[OpenRTC] strictMode requires an explicit transports.moq.relayUrl.");t.transports.moq={...r,relayUrl:A(o)};}}function pt(t){let e=k(t),n=R(e),r=T(e),o={strictMode:false,disableIrohFallback:false,transportPriority:[...pe],...e,authMode:r,transports:fe(e.transports)};ye(o),he(o),o.strictMode&&(o.transportPriority=K(e.transportPriority,!!o.transports?.webrtc));let i=G(o),a=(o.discoveryMode??"space")==="space"?"client-open":"client-auth";return {appTag:n,authMode:r,configuredPersistenceMode:i,options:o,roomCreationMode:a}}function G(t){let e=t.transports?.iroh;return t.endpointIdPersistence??t.nodeIdPersistence??(typeof e=="object"?e.persistenceMode:void 0)??"ephemeral"}function mt(t){return "options"in t&&"configuredPersistenceMode"in t?{apiKey:t.options.apiKey,authMode:T(t.options),projectId:t.options.projectId,storagePrefix:t.options.storagePrefix,nodeIdPersistence:t.configuredPersistenceMode}:{apiKey:t.apiKey,authMode:T(t),projectId:t.projectId,storagePrefix:t.storagePrefix,nodeIdPersistence:G(t)}}function gt(t,e){e&&(t.transports={...t.transports||{},...e});}var y="pluto-rtc-prod",w="https://api.openrtc.app",be="https://gateway.openrtc.app",U={apiKey:"AIzaSyA62Krj-7ZYFT5xjrTUq7mXana41Ahj_mM",authDomain:"api.openrtc.app",projectId:y,storageBucket:"pluto-rtc-prod.firebasestorage.app",messagingSenderId:"607066575224",appId:"1:607066575224:web:ed3f51825ba228db92b88d",recaptchaSiteKey:"6LfGv2gtAAAAALFAuE_kpLYpNBpk2IsKiLIGdOGl"};function ht(t){let e=k(t),r=(typeof e.projectId=="string"&&e.projectId.trim()?e.projectId.trim():void 0)??y,o=r===y;return {...e,projectId:r,coordinationGateway:e.coordinationGateway??(o?{endpoint:be,controlPlaneEndpoint:w,environment:"production"}:void 0)}}function z(t){return new Promise(e=>setTimeout(e,t))}function Pt(t){let e=new Uint8Array(t.byteLength);return e.set(t),e}function Tt(t){let e=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.byteLength;return n}function vt(t,e,n){let r=e*Math.pow(2,Math.max(0,t-1));return Math.min(n,r)}function St(t){try{let e=t;return !!e&&!!e.send&&typeof e.send.getWriter=="function"&&!!e.recv&&typeof e.recv.getReader=="function"}catch{return false}}function It(t,e,n){let r=t;if(!r)return null;try{let o=r.send,i=r.recv;if(!o||typeof o.getWriter!="function"||!i||typeof i.getReader!="function")return null;let a=typeof r.endpoint_id=="string"&&r.endpoint_id.trim().length>0?r.endpoint_id:e,c=Number.isSafeInteger(r.transport_stable_id)&&Number(r.transport_stable_id)>0?Number(r.transport_stable_id):void 0,d=Number.isSafeInteger(n)&&Number(n)>0?Number(n):void 0;if(c!==void 0&&d!==void 0&&c!==d)return null;let s=c??d;return {send:o,recv:i,endpoint_id:a,...s?{transport_stable_id:s}:{}}}catch{return null}}function Rt(t,e){let n={send:t.send,recv:e,endpoint_id:typeof t.endpoint_id=="string"?t.endpoint_id:"",...Number.isSafeInteger(t.transport_stable_id)&&Number(t.transport_stable_id)>0?{transport_stable_id:Number(t.transport_stable_id)}:{}};return t?.applicationCryptoWrapped===true&&(n.applicationCryptoWrapped=true),n}async function Ct(t,e){if(!t)return false;try{let n=t.send?.getWriter?.();if(n)try{await n.close();}catch{}finally{try{n.releaseLock();}catch{}}}catch{}try{let n=t.recv?.getReader?.();if(n)try{await n.cancel(e);}catch{}finally{try{n.releaseLock();}catch{}}}catch{}return true}function At(t,e,n={}){let r=n.context??"prependBytesToReader",o=n.traceId,i=e.byteLength===0,a=n.pendingRead??null,c=s=>n.release?.(s),d=(s,p)=>n.log?.(s,p);return new ReadableStream({async pull(s){if(!i){i=true,s.enqueue(e);return}if(a){let u=a;a=null;let m;try{m=await u;}catch(f){s.error(f),c("pending-read-error"),d("prepend-bytes:pending-read-error",{context:r,traceId:o||null,error:f?.message||String(f)});return}if(m.done){s.close(),c("pending-done");return}m.value&&s.enqueue(m.value);return}let p;try{p=await t.read();}catch(u){s.error(u),c("read-error"),d("prepend-bytes:read-error",{context:r,traceId:o||null,error:u?.message||String(u)});return}let{done:v,value:P}=p;if(v){s.close(),c("done");return}P&&s.enqueue(P);},async cancel(s){c("cancel");}})}async function kt(t,e){let n=t.read(),r=e-Date.now();if(r<=0)return {status:"timeout",pendingRead:n};let o=Symbol("probe-timeout"),i,a=new Promise(c=>{i=setTimeout(()=>c(o),r);});try{let c=await Promise.race([n,a]);if(c===o)return {status:"timeout",pendingRead:n};let{done:d,value:s}=c;return d?{status:"done"}:{status:"data",value:s&&s.byteLength>0?new Uint8Array(s):new Uint8Array(0)}}finally{i&&clearTimeout(i);}}function Q(t,e,n){let r;return new Promise((o,i)=>{r=setTimeout(()=>{if(r=void 0,typeof n=="function"){i(n());return}let a=n?`${n} timed out`:"timeout";i(new Error(`${a} after ${e}ms`));},e),t.then(a=>{r!==void 0&&clearTimeout(r),o(a);},a=>{r!==void 0&&clearTimeout(r),i(a);});})}var Z="pluto-rtc-auth";function Be(t){return t?.DEV===true||String(t?.VITE_E2E??"").trim().toLowerCase()==="true"}function Fe(t=S){return t()}function qe(t){if(Fe())return null;let e=typeof import.meta<"u"?import.meta.env:null,n=String(e?.VITE_OPENRTC_APP_CHECK_SITE_KEY??globalThis.__OPENRTC_APP_CHECK_SITE_KEY__??U.recaptchaSiteKey??"").trim(),r=String(e?.VITE_OPENRTC_APP_CHECK_MODE??globalThis.__OPENRTC_APP_CHECK_MODE__??"monitor").trim().toLowerCase();if(!n)return r==="enforce"&&console.error("[PLUTO-RTC][APP-CHECK] Enforcement requested without VITE_OPENRTC_APP_CHECK_SITE_KEY"),null;let o=String(e?.VITE_OPENRTC_APP_CHECK_DEBUG_TOKEN??"").trim();o&&!Be(e)?console.error("[PLUTO-RTC][APP-CHECK] Debug tokens are allowed only in development or explicit E2E builds"):o&&typeof self<"u"&&(self.FIREBASE_APPCHECK_DEBUG_TOKEN=o==="true"?true:o);try{return initializeAppCheck(t,{provider:new ReCaptchaEnterpriseProvider(n),isTokenAutoRefreshEnabled:!0})}catch(i){let a=i instanceof Error?i.message:String(i);return a.toLowerCase().includes("already exists")||console.warn("[PLUTO-RTC][APP-CHECK] Initialization failed",{message:a}),null}}var D=null;function Ke(){if(typeof globalThis<"u"&&globalThis.__OPENRTC_DEBUG__===true)return true;if(typeof localStorage<"u")try{return localStorage.getItem("openrtc:debug")==="1"}catch{return false}return false}function l(t,e){if(Ke()){if(typeof e>"u"){console.log(t);return}console.log(t,e);}}function jt(t){D=t;}function We(){return S()}function re(){return typeof navigator>"u"?false:/iPhone|iPad|iPod|Android/i.test(navigator.userAgent||"")}function ee(){return We()&&re()}function g(t,e,n){return Q(t,e,()=>new Error(`${n} timeout after ${e}ms`))}function te(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._",n=new Uint8Array(t);window.crypto.getRandomValues(n);let r="";for(let o=0;o<t;o+=1)r+=e[n[o]%e.length];return r}async function ne(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}var N=class{constructor(){this.redirectResultPromise=null;this.redirectResultConsumed=false;this.lastRelayedToken=null;this.lastRelayedRefreshToken=null;let e=getApps().find(o=>o.name===Z);this.app=e||initializeApp(U,Z),this.appCheck=qe(this.app);let n=re(),r=ee();if(n)try{let o=r?{persistence:[browserLocalPersistence,inMemoryPersistence]}:{persistence:[browserLocalPersistence,inMemoryPersistence],popupRedirectResolver:browserPopupRedirectResolver};this.auth=initializeAuth(this.app,o),l("[PLUTO-RTC][AUTH-HOST] Using mobile-safe Firebase auth initialization",{appName:this.app.name,persistence:"browserLocalPersistence->inMemoryPersistence",redirectResolver:r?"disabled-for-tauri-mobile":"browserPopupRedirectResolver",tauriMobile:r});}catch{this.auth=getAuth(this.app),console.warn("[PLUTO-RTC][AUTH-HOST] Mobile-safe auth initialization unavailable; falling back to default getAuth");}else this.auth=getAuth(this.app);this.functions=getFunctions(this.app,w);try{let o=typeof globalThis<"u"?String(globalThis.__OPENRTC_AUTH_EMULATOR_HOST__??"").trim():"",i=typeof globalThis<"u"?String(globalThis.__OPENRTC_FUNCTIONS_EMULATOR_HOST__??"").trim():"",a=typeof import.meta<"u"?import.meta.env:null;if(!!o||!!i||!!a&&String(a.VITE_USE_EMULATORS)==="true"&&(a.DEV||String(a.VITE_E2E)==="true")){let d=String(a?.VITE_OPENRTC_EMULATOR_HOST??"127.0.0.1").trim()||"127.0.0.1",[s,p]=o.split(":"),[v,P]=i.split(":"),u=(s??"").trim()||d,m=(v??"").trim()||d,f=Number(p??a?.VITE_OPENRTC_AUTH_EMULATOR_PORT??9100),oe=Number(P??a?.VITE_OPENRTC_FUNCTIONS_EMULATOR_PORT??5002);try{connectAuthEmulator(this.auth,`http://${u}:${f}`,{disableWarnings:!0});}catch{}try{connectFunctionsEmulator(this.functions,m,oe);}catch{}}}catch{}n?this.persistenceReady=Promise.resolve():this.persistenceReady=setPersistence(this.auth,browserLocalPersistence).catch(o=>{console.warn("[PLUTO-RTC][AUTH-HOST] Failed to set auth persistence",{message:o?.message});}),l("[PLUTO-RTC][AUTH-HOST] Initialized auth host",{appName:this.app.name,mobileSafeAuth:n}),onIdTokenChanged(this.auth,o=>{l("[PLUTO-RTC][AUTH-HOST] Firebase ID token changed",{hasUser:!!o,uid:o?.uid,providerDataCount:o?.providerData?.length||0}),this.syncDesktopAuthToken(o);});}async syncDesktopAuthToken(e,n=false){if(!D)return;let r=e?await getIdToken(e,n).catch(()=>null):null,o=e?e.refreshToken??null:null;if(r===this.lastRelayedToken&&o===this.lastRelayedRefreshToken)return;this.lastRelayedToken=r,this.lastRelayedRefreshToken=o;let i=await Promise.allSettled([Promise.resolve(D({authToken:r,refreshToken:o}))]);i[0]?.status==="rejected"&&console.warn("[PLUTO-RTC][AUTH-HOST] Failed to relay auth token to desktop backend",{message:i[0].reason?.message});}getApp(){return this.app}getFunctions(){return this.functions}async getAppCheckToken(e=false){if(!this.appCheck)return null;try{return (await getToken(this.appCheck,e)).token?.trim()||null}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn("[PLUTO-RTC][APP-CHECK] Token acquisition failed",{message:r}),null}}getCurrentUser(){return this.auth.currentUser}getAuth(){return this.auth}onAuthStateChanged(e){return l("[PLUTO-RTC][AUTH-HOST] onAuthStateChanged listener registered (via onIdTokenChanged)"),onIdTokenChanged(this.auth,e)}onIdTokenChanged(e){return l("[PLUTO-RTC][AUTH-HOST] onIdTokenChanged listener registered"),onIdTokenChanged(this.auth,e)}async getIdToken(e){return this.auth.currentUser?getIdToken(this.auth.currentUser,e?.forceRefresh??true):null}async checkForSSOToken(){if(typeof window>"u")return;let e=new URLSearchParams(window.location.search),n=new URLSearchParams(window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash),r=e.get("token")||n.get("token")||(e.get("custom_token")==="true"||n.get("custom_token")==="true"?e.get("id_token")||n.get("id_token"):null);if(r)try{await this.persistenceReady,await signInWithCustomToken(this.auth,r),window.history.replaceState({},document.title,window.location.pathname);}catch(o){console.error("[PLUTO-RTC][AUTH-HOST] SSO sign-in failed:",o);}}async signInWithCustomTokenValue(e){return await this.persistenceReady,(await signInWithCustomToken(this.auth,e)).user}async signInWithPluto(e){if(typeof window>"u")throw new Error("Pluto SSO requires a browser environment.");let n=e?.redirectUri||window.location.href,r=e?.authorizeBaseUrl||"https://pluto.openrtc.app/sso/authorize",o=new URL(r);o.searchParams.set("redirect_uri",n),window.location.assign(o.toString());}async waitForAuth(){if(await this.persistenceReady,!this.auth.currentUser)return new Promise(e=>{let n=onAuthStateChanged(this.auth,r=>{r&&(n(),e());});})}async signInAnonymously(){await signInAnonymously(this.auth);}async signIn(e,n){return (await signInWithEmailAndPassword(this.auth,e,n)).user}async signUp(e,n){return (await createUserWithEmailAndPassword(this.auth,e,n)).user}async signOut(){await signOut(this.auth);}async deleteAccount(){if(!this.auth.currentUser)throw new Error("No user signed in");await deleteUser(this.auth.currentUser);}async signInWithCredential(e){let n=Date.now();if(l("[PLUTO-RTC][AUTH-HOST] signInWithCredential start",{callbackId:e.callbackId,provider:e.provider,hasIdToken:!!e.idToken,hasAccessToken:!!e.accessToken,hasNonce:!!e.nonce}),e.isCustomToken){l("[PLUTO-RTC][AUTH-HOST] signInWithCredential: custom token detected, using signInWithCustomToken");try{if(ee())l("[PLUTO-RTC][AUTH-HOST] Skipping authStateReady before custom token sign-in on Tauri mobile",{callbackId:e.callbackId});else {l("[PLUTO-RTC][AUTH-HOST] Awaiting authStateReady...");try{await g(this.auth.authStateReady(),5e3,"authStateReady"),l("[PLUTO-RTC][AUTH-HOST] Auth state ready, signing in with custom token...");}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] authStateReady did not resolve in time; continuing custom token sign-in",{callbackId:e.callbackId,message:a?.message});}}let i;try{i=await g(signInWithCustomToken(this.auth,e.idToken),25e3,"signInWithCustomToken (custom token path)");}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] First custom token sign-in attempt failed; retrying once",{callbackId:e.callbackId,message:a?.message,code:a?.code}),await z(250),i=await g(signInWithCustomToken(this.auth,e.idToken),25e3,"signInWithCustomToken (custom token path retry)");}if(l("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken success",{callbackId:e.callbackId,provider:e.provider,uid:i.user?.uid,elapsedMs:Date.now()-n}),i.user&&(e.displayName||e.photoURL))try{await updateProfile(i.user,{displayName:e.displayName||i.user.displayName||void 0,photoURL:e.photoURL||i.user.photoURL||void 0});}catch(a){console.warn("[PLUTO-RTC][AUTH-HOST] Failed to update custom-token user profile",{callbackId:e.callbackId,message:a?.message});}return i.user}catch(o){throw console.error("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken failed",{callbackId:e.callbackId,error:o?.message,code:o?.code,stack:o?.stack,elapsedMs:Date.now()-n}),o}}let r;e.provider==="google"?r=GoogleAuthProvider.credential(e.idToken,e.accessToken):r=new OAuthProvider("apple.com").credential({idToken:e.idToken,rawNonce:e.nonce,accessToken:e.accessToken});try{let o=await g(signInWithCredential(this.auth,r),1e4,"firebase signInWithCredential");return l("[PLUTO-RTC][AUTH-HOST] signInWithCredential success",{callbackId:e.callbackId,provider:e.provider,uid:o.user?.uid,elapsedMs:Date.now()-n}),o.user}catch(o){console.warn("[PLUTO-RTC][AUTH-HOST] signInWithCredential primary path failed; trying custom token fallback",{callbackId:e.callbackId,provider:e.provider,elapsedMs:Date.now()-n,code:o?.code,message:o?.message});let i=await g(this.mintSessionTokenFromProviderToken(e),15e3,"mintSessionTokenFromProviderToken"),a=await g(signInWithCustomToken(this.auth,i),15e3,"signInWithCustomToken");return l("[PLUTO-RTC][AUTH-HOST] signInWithCustomToken fallback success",{callbackId:e.callbackId,provider:e.provider,uid:a.user?.uid,elapsedMs:Date.now()-n}),a.user}}async mintSessionTokenFromProviderToken(e){let n=httpsCallable(this.functions,"mintSessionToken");l("[PLUTO-RTC][AUTH-HOST] mintSessionToken fallback request start",{provider:e.provider,hasIdToken:!!e.idToken,hasNonce:!!e.nonce});let o=(await n({provider:e.provider,idToken:e.idToken,nonce:e.nonce,idempotencyKey:`provider-token:${e.callbackId}`})).data?.token;if(!o)throw new Error("mintSessionToken did not return a token for provider exchange");return l("[PLUTO-RTC][AUTH-HOST] mintSessionToken fallback request success",{provider:e.provider}),o}async signInWithPopup(e){if(e==="google"){let i=new GoogleAuthProvider;i.addScope("email"),i.addScope("profile"),i.setCustomParameters({prompt:"select_account"});let a=await signInWithPopup(this.auth,i);return {idToken:await getIdToken(a.user,true),refreshToken:a.user.refreshToken}}let n=new OAuthProvider("apple.com");n.addScope("email"),n.addScope("name");let r=te(32);typeof sessionStorage<"u"&&sessionStorage.setItem("apple_auth_nonce",r),n.setCustomParameters({nonce:await ne(r)});let o=await signInWithPopup(this.auth,n);return {idToken:await getIdToken(o.user,true),refreshToken:o.user.refreshToken}}async signInWithRedirect(e,n){if(e==="google"){let i=new GoogleAuthProvider;i.addScope("email"),i.addScope("profile"),i.setCustomParameters({prompt:"select_account"}),await signInWithRedirect(this.auth,i);return}let r=new OAuthProvider("apple.com");r.addScope("email"),r.addScope("name");let o=n?.nonce||te(32);typeof sessionStorage<"u"&&sessionStorage.setItem("apple_auth_nonce",o),r.setCustomParameters({nonce:await ne(o)}),await signInWithRedirect(this.auth,r);}async consumeRedirectResult(){return this.redirectResultConsumed?(l("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult skipped (already consumed)"),null):this.redirectResultPromise?this.redirectResultPromise:(this.redirectResultPromise=(async()=>{try{l("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult start");let e=await getRedirectResult(this.auth);if(!e)return l("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult: no redirect result"),{fromRedirect:!1,user:null};this.redirectResultConsumed=!0;let n=await getIdToken(e.user,!0).catch(()=>null),r=e.providerId||e.user.providerData?.[0]?.providerId||null;return l("[PLUTO-RTC][AUTH-HOST] consumeRedirectResult success",{uid:e.user.uid,providerId:r,hasIdToken:!!n}),{fromRedirect:!0,user:e.user,providerId:r,idToken:n}}finally{this.redirectResultPromise=null;}})(),this.redirectResultPromise)}async startGoogleSignIn(){await this.signInWithRedirect("google");}async startAppleSignIn(){await this.signInWithRedirect("apple");}async mintSessionToken(){let e=httpsCallable(this.functions,"mintSessionToken");if(typeof globalThis.crypto?.randomUUID!="function")throw new Error("Secure request identity is unavailable for token minting.");let r=(await e({idempotencyKey:`hosted-token:${globalThis.crypto.randomUUID()}`})).data;if(!r?.token)throw new Error("mintSessionToken did not return a token");return r.token}},E=null;function je(){return E||(E=new N),E}var Gt=new Proxy({},{get(t,e,n){let r=je(),o=r[e];return typeof o=="function"?o.bind(r):o}});
2
+ export{Rt as A,Ct as B,At as C,kt as D,Q as E,jt as F,je as G,Gt as H,Qe as a,R as b,T as c,Ye as d,$e as e,Je as f,se as g,F as h,Xe as i,et as j,tt as k,rt as l,ot as m,it as n,k as o,pt as p,mt as q,gt as r,ht as s,S as t,z as u,Pt as v,Tt as w,vt as x,St as y,It as z};
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { R as RuntimeClientOptions, I as ITransport } from './types-BAwo8biA.js';
2
- export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, K as RuntimeConnectionTarget, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, v as RuntimeRawConnection, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel } from './types-BAwo8biA.js';
1
+ import { R as RuntimeClientOptions, I as ITransport } from './types-BJU2GoVb.js';
2
+ export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, K as RuntimeConnectionTarget, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, v as RuntimeRawConnection, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel } from './types-BJU2GoVb.js';
3
3
  import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
4
- import { O as OpenRTCClient } from './spaceTokens-DyOOxC7x.js';
5
- export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-DyOOxC7x.js';
6
- import { w as ProtocolName, V as ProtocolCapability, W as ProtocolCapabilityMap, t as ApplicationPayloadCrypto, X as ApplicationCryptoStreamTools } from './types-CL4Da0BR.js';
7
- export { Y as AppLimits, Z as ApplicationCryptoBiStream, u as ApplicationPayloadReadinessOptions, v as ApplicationPayloadRouteOptions, x as ApplicationPayloadSendOptions, A as AuthMode, Q as DevicePresenceStatus, D as DiscoveryMode, G as GrantScope, _ as ProtocolBaseName, $ as ProtocolImplementationKind, a0 as ProtocolLocality, a1 as RouteDescriptor, a2 as RouteFamily, a3 as RouteImplementationKind, d as SignalingMode, S as SpaceAuthMode, a as SpaceTokenProvider } from './types-CL4Da0BR.js';
4
+ import { O as OpenRTCClient } from './spaceTokens-CiwcKKr2.js';
5
+ export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-CiwcKKr2.js';
6
+ import { w as ProtocolName, V as ProtocolCapability, W as ProtocolCapabilityMap, t as ApplicationPayloadCrypto, X as ApplicationCryptoStreamTools } from './types-zT2QwuCv.js';
7
+ export { Y as AppLimits, Z as ApplicationCryptoBiStream, u as ApplicationPayloadReadinessOptions, v as ApplicationPayloadRouteOptions, x as ApplicationPayloadSendOptions, A as AuthMode, Q as DevicePresenceStatus, D as DiscoveryMode, G as GrantScope, _ as ProtocolBaseName, $ as ProtocolImplementationKind, a0 as ProtocolLocality, a1 as RouteDescriptor, a2 as RouteFamily, a3 as RouteImplementationKind, d as SignalingMode, S as SpaceAuthMode, a as SpaceTokenProvider } from './types-zT2QwuCv.js';
8
8
  export { ROUTE_DESCRIPTORS, TRANSPORT_LABELS, getRouteDescriptor, isDirectIrohTransportLabel, isIndependentTransportLabel, isIrohBaseTransportLabel, isOptionalTransportLabel, isWebRtcTransportLabel, listRouteDescriptors, normalizeTransportLabel } from './transport/index.js';
9
9
  export { isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './runtime/device-status.js';
10
10
  export { R as RuntimeJsonFrameHandler, a as RuntimeU32BEFrameHandler, c as createRuntimeJsonFrameDecoder, b as createRuntimeU32BEFrameDecoder, d as decodeRuntimeJsonPayload, e as encodeRuntimeJsonFrame, f as encodeRuntimeJsonPayload, g as encodeRuntimeU32BEFrame } from './framing-zRvEKOld.js';
11
- export { O as OPENRTC_RUNTIME_POLICY, a as RuntimePolicySnapshot, S as ScopedSession, c as Session, d as SessionOptions, g as getRuntimePolicy } from './assembly-Ddq1o4NV.js';
11
+ export { O as OPENRTC_RUNTIME_POLICY, a as RuntimePolicySnapshot, S as ScopedSession, c as Session, d as SessionOptions, g as getRuntimePolicy } from './assembly-CscFVHYK.js';
12
12
  export { b as RuntimeAdapterKind, R as RuntimeCapabilities } from './capabilities-CaqXOIUU.js';
13
13
  import './IEngineBridge-BbsT8hof.js';
14
14
 
@@ -28,6 +28,82 @@ declare namespace OpenRTC {
28
28
  var native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
29
29
  }
30
30
 
31
+ /**
32
+ * Public developer-facing error taxonomy for OpenRTC.
33
+ *
34
+ * Keep this surface small: apps switch on `code` / `plane` / `retryable` and
35
+ * must not invent peer dial/retry owners from free-form status strings.
36
+ *
37
+ * Retry contract:
38
+ * - Retry only when `retryable === true` and `plane` is `coordination`,
39
+ * `transport`, or transient `auth`.
40
+ * - Dead-letter `admission`, `budget`, security/ACL, and non-retryable auth.
41
+ * - Error codes annotate projection; they never own dial, presence, or settlement.
42
+ */
43
+ type OpenRtcErrorPlane = 'coordination' | 'admission' | 'transport' | 'auth' | 'budget' | 'delivery' | 'internal';
44
+ declare const OPENRTC_ERROR_CODES: {
45
+ readonly AUTH_NOT_READY: "auth/not-ready";
46
+ readonly AUTH_DENIED: "auth/denied";
47
+ readonly AUTH_EXPIRED: "auth/expired";
48
+ readonly ADMISSION_DENIED: "admission/denied";
49
+ readonly ADMISSION_SCOPE_MISMATCH: "admission/scope-mismatch";
50
+ readonly BUDGET_EXCEEDED: "budget/exceeded";
51
+ readonly BUDGET_STALE: "budget/stale";
52
+ /** Gateway avenue escrow exhausted; re-auth renews budget and may replay once. */
53
+ readonly BUDGET_RENEWAL_REQUIRED: "budget/renewal-required";
54
+ readonly COORDINATION_DISCONNECTED: "coordination/disconnected";
55
+ readonly COORDINATION_PROTOCOL: "coordination/protocol";
56
+ readonly COORDINATION_RATE_LIMITED: "coordination/rate-limited";
57
+ readonly TRANSPORT_DIAL_EXHAUSTED: "transport/dial-exhausted";
58
+ readonly TRANSPORT_UNAVAILABLE: "transport/unavailable";
59
+ readonly TRANSPORT_TICKET_MISSING: "transport/ticket-missing";
60
+ readonly DELIVERY_NOT_READY: "delivery/not-ready";
61
+ readonly INTERNAL: "internal/error";
62
+ };
63
+ type OpenRtcErrorCode = (typeof OPENRTC_ERROR_CODES)[keyof typeof OPENRTC_ERROR_CODES] | (string & {});
64
+ interface OpenRtcErrorOptions {
65
+ code: OpenRtcErrorCode;
66
+ message: string;
67
+ retryable: boolean;
68
+ plane: OpenRtcErrorPlane;
69
+ cause?: unknown;
70
+ generation?: number;
71
+ transportGeneration?: number;
72
+ routeGeneration?: number;
73
+ revision?: number;
74
+ }
75
+ declare class OpenRtcError extends Error {
76
+ readonly name: string;
77
+ readonly code: OpenRtcErrorCode;
78
+ readonly retryable: boolean;
79
+ readonly plane: OpenRtcErrorPlane;
80
+ readonly generation?: number;
81
+ readonly transportGeneration?: number;
82
+ readonly routeGeneration?: number;
83
+ readonly revision?: number;
84
+ constructor(options: OpenRtcErrorOptions);
85
+ static isOpenRtcError(value: unknown): value is OpenRtcError;
86
+ /** True when an app may retry the *same logical operation* without inventing a peer dial owner. */
87
+ static shouldAppRetry(error: unknown): boolean;
88
+ toJSON(): Record<string, unknown>;
89
+ }
90
+ interface OpenRtcErrorProjection {
91
+ errorCode?: OpenRtcErrorCode;
92
+ retryable?: boolean;
93
+ errorPlane?: OpenRtcErrorPlane;
94
+ }
95
+ /** Build projection annotations without owning lifecycle. */
96
+ declare function projectOpenRtcErrorFields(error: unknown): OpenRtcErrorProjection;
97
+ declare function openRtcError(code: OpenRtcErrorCode, message: string, options: Omit<OpenRtcErrorOptions, 'code' | 'message'> & {
98
+ retryable?: boolean;
99
+ plane?: OpenRtcErrorPlane;
100
+ }): OpenRtcError;
101
+ /**
102
+ * Map gateway protocol / connect failures and common message shapes into the
103
+ * public taxonomy. Prefer structured `code`/`retryable` when present.
104
+ */
105
+ declare function classifyOpenRtcFailure(error: unknown): OpenRtcError;
106
+
31
107
  declare class TransportFactory {
32
108
  private static readonly capabilityMap;
33
109
  /** @deprecated Only WebRTC implements the legacy ITransport construction API. */
@@ -70,4 +146,4 @@ declare function encodeApplicationKeyAgreementPayload(publicKey: Uint8Array): Ap
70
146
  type UpgradeState = 'none' | 'upgrading' | 'upgraded' | 'failed';
71
147
  type OutboundMessage = string | object | ArrayBuffer | Uint8Array;
72
148
 
73
- export { ApplicationCryptoStreamTools, type ApplicationKeyAgreementPayload, ApplicationPayloadCrypto, KEY_AGREEMENT_ALGORITHM, KEY_AGREEMENT_PUBLIC_KEY_BYTES, OpenRTC, OpenRTCClient, RuntimeClientOptions as OpenRTCOptions, type OutboundMessage, ProtocolCapability, ProtocolCapabilityMap, ProtocolName, RuntimeClientOptions, type UpgradeState, createApplicationCryptoStreamTools, createSharedSecretApplicationCrypto, deriveApplicationCryptoKey, encodeApplicationKeyAgreementPayload, generateEphemeralKeyAgreement, getPreferredProtocolOrder, isApplicationEncryptedPayload };
149
+ export { ApplicationCryptoStreamTools, type ApplicationKeyAgreementPayload, ApplicationPayloadCrypto, KEY_AGREEMENT_ALGORITHM, KEY_AGREEMENT_PUBLIC_KEY_BYTES, OPENRTC_ERROR_CODES, OpenRTC, OpenRTCClient, RuntimeClientOptions as OpenRTCOptions, OpenRtcError, type OpenRtcErrorCode, type OpenRtcErrorOptions, type OpenRtcErrorPlane, type OpenRtcErrorProjection, type OutboundMessage, ProtocolCapability, ProtocolCapabilityMap, ProtocolName, RuntimeClientOptions, type UpgradeState, classifyOpenRtcFailure, createApplicationCryptoStreamTools, createSharedSecretApplicationCrypto, deriveApplicationCryptoKey, encodeApplicationKeyAgreementPayload, generateEphemeralKeyAgreement, getPreferredProtocolOrder, isApplicationEncryptedPayload, openRtcError, projectOpenRtcErrorFields };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {a,b}from'./chunk-2QFNPBOZ.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-2QFNPBOZ.js';import {a as a$1,b as b$1}from'./chunk-EAQYAVIA.js';export{d as KEY_AGREEMENT_ALGORITHM,c as KEY_AGREEMENT_PUBLIC_KEY_BYTES,h as ScopedSession,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,f as deriveApplicationCryptoKey,g as encodeApplicationKeyAgreementPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,e as generateEphemeralKeyAgreement,b as getPreferredProtocolOrder}from'./chunk-VQT6275Z.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'./chunk-CK6WQV7J.js';import'./chunk-3TZAOOON.js';import {g}from'./chunk-S4NAEWOY.js';export{v as OPENRTC_RUNTIME_POLICY,m as createApplicationCryptoStreamTools,l as createSharedSecretApplicationCrypto,w as getRuntimePolicy,k as isApplicationEncryptedPayload}from'./chunk-VCJQWWOH.js';export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,h as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'./chunk-QT2ASNI3.js';import'./chunk-SY6YGCXA.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'./chunk-C7YN5MSV.js';function s(e){let t=a(e),o=a$1(t);return b(o,"web")}s.native=function(e,t){let o=a(e),c=t??g(),m=b$1(o,c);return b(m,"native")};export{s as OpenRTC};
1
+ import {a,b}from'./chunk-BW6OKBHV.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-BW6OKBHV.js';import {a as a$1,b as b$1}from'./chunk-GOXGYBWD.js';export{d as KEY_AGREEMENT_ALGORITHM,c as KEY_AGREEMENT_PUBLIC_KEY_BYTES,h as ScopedSession,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,f as deriveApplicationCryptoKey,g as encodeApplicationKeyAgreementPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,e as generateEphemeralKeyAgreement,b as getPreferredProtocolOrder}from'./chunk-5ZIXL6NU.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'./chunk-CK6WQV7J.js';import'./chunk-5ZDGIHNB.js';import {g}from'./chunk-3WD7QKIS.js';export{o as OPENRTC_ERROR_CODES,A as OPENRTC_RUNTIME_POLICY,p as OpenRtcError,s as classifyOpenRtcFailure,m as createApplicationCryptoStreamTools,l as createSharedSecretApplicationCrypto,B as getRuntimePolicy,k as isApplicationEncryptedPayload,r as openRtcError,q as projectOpenRtcErrorFields}from'./chunk-2OQQ4I7Z.js';export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,h as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'./chunk-QT2ASNI3.js';import'./chunk-OCSZA6PK.js';export{a as ROUTE_DESCRIPTORS,e as getRouteDescriptor,f as listRouteDescriptors}from'./chunk-C7YN5MSV.js';function c(e){let t=a(e),o=a$1(t);return b(o,"web")}c.native=function(e,t){let o=a(e),s=t??g(),m=b$1(o,s);return b(m,"native")};export{c as OpenRTC};
package/dist/native.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { R as RuntimeClientOptions } from './types-BAwo8biA.js';
1
+ import { R as RuntimeClientOptions } from './types-BJU2GoVb.js';
2
2
  import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
3
3
  export { c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from './ipc-CflAVodw.js';
4
- import { O as OpenRTCClient } from './spaceTokens-DyOOxC7x.js';
5
- export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-DyOOxC7x.js';
6
- export { S as SpaceAuthMode, a as SpaceTokenProvider } from './types-CL4Da0BR.js';
4
+ import { O as OpenRTCClient } from './spaceTokens-CiwcKKr2.js';
5
+ export { E as EnableSpaceAuthResponse, M as MintSpaceTokenRequest, a as MintSpaceTokenResponse, b as OpenRTCChannelConnectOptions, c as OpenRTCDeviceNamespace, d as OpenRTCDeviceSessionOptions, e as OpenRTCRoomNamespace, f as OpenRTCTicketNamespace, g as createPublicSpaceTokenProvider, h as createSpaceTokenProvider, i as enableSpaceAuth, m as mintSpaceToken, s as sandboxSpaceKey, j as spaceToken } from './spaceTokens-CiwcKKr2.js';
6
+ export { S as SpaceAuthMode, a as SpaceTokenProvider } from './types-zT2QwuCv.js';
7
7
  import './IEngineBridge-BbsT8hof.js';
8
- import './assembly-Ddq1o4NV.js';
8
+ import './assembly-CscFVHYK.js';
9
9
  import './capabilities-CaqXOIUU.js';
10
10
 
11
11
  /**
package/dist/native.js CHANGED
@@ -1 +1 @@
1
- import {a,b}from'./chunk-2QFNPBOZ.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-2QFNPBOZ.js';import {A as A$1}from'./chunk-VQT6275Z.js';import {h}from'./chunk-S4NAEWOY.js';export{e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'./chunk-S4NAEWOY.js';import'./chunk-VCJQWWOH.js';import'./chunk-QT2ASNI3.js';import {s}from'./chunk-SY6YGCXA.js';import'./chunk-C7YN5MSV.js';function c(t,p){let e=s(t);return A$1(e,new h({...e,bridge:p}))}function A(t,p){let e=c(a(t),p);return b(e,"native")}export{A as createNativeOpenRTC};
1
+ import {a,b}from'./chunk-BW6OKBHV.js';export{e as createPublicSpaceTokenProvider,h as createSpaceTokenProvider,c as enableSpaceAuth,d as mintSpaceToken,f as sandboxSpaceKey,g as spaceToken}from'./chunk-BW6OKBHV.js';import {A as A$1}from'./chunk-5ZIXL6NU.js';import {h}from'./chunk-3WD7QKIS.js';export{e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'./chunk-3WD7QKIS.js';import'./chunk-2OQQ4I7Z.js';import'./chunk-QT2ASNI3.js';import {s}from'./chunk-OCSZA6PK.js';import'./chunk-C7YN5MSV.js';function c(t,p){let e=s(t);return A$1(e,new h({...e,bridge:p}))}function A(t,p){let e=c(a(t),p);return b(e,"native")}export{A as createNativeOpenRTC};
Binary file
@@ -1,5 +1,5 @@
1
- import { D as DelegatingRuntimeAdapter, W as WasmBridgeOptions } from '../DelegatingRuntimeAdapter-B9j_lTDM.js';
2
- import '../types-CL4Da0BR.js';
1
+ import { D as DelegatingRuntimeAdapter, W as WasmBridgeOptions } from '../DelegatingRuntimeAdapter-Cg3jFk1b.js';
2
+ import '../types-zT2QwuCv.js';
3
3
  import '../IEngineBridge-BbsT8hof.js';
4
4
  import '../capabilities-CaqXOIUU.js';
5
5
 
@@ -1 +1 @@
1
- export{a as WasmRuntimeAdapter}from'../chunk-3TZAOOON.js';import'../chunk-VCJQWWOH.js';import'../chunk-QT2ASNI3.js';import'../chunk-SY6YGCXA.js';import'../chunk-C7YN5MSV.js';
1
+ export{a as WasmRuntimeAdapter}from'../chunk-5ZDGIHNB.js';import'../chunk-2OQQ4I7Z.js';import'../chunk-QT2ASNI3.js';import'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
@@ -1,6 +1,6 @@
1
- import { c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot } from '../types-BAwo8biA.js';
1
+ import { c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot } from '../types-BJU2GoVb.js';
2
2
  import '../IEngineBridge-BbsT8hof.js';
3
- import '../types-CL4Da0BR.js';
3
+ import '../types-zT2QwuCv.js';
4
4
 
5
5
  interface RuntimeDeviceActiveOptions {
6
6
  now?: number;
@@ -1,20 +1,20 @@
1
- import { e as RuntimeFactoryOptions, b as PlutoRuntimeAssembly, P as PeerReconciliationStats } from '../assembly-Ddq1o4NV.js';
2
- export { O as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, a as RuntimePolicySnapshot, D as ScopedConnectionActorError, f as ScopedConnectionActorErrorKind, h as ScopedConnectionActorHandle, i as ScopedConnectionActorHandleOptions, j as ScopedConnectionActorRegistry, k as ScopedConnectionActorState, l as ScopedConnectionClose, m as ScopedConnectionDial, n as ScopedConnectionKey, o as ScopedLogicalChannelHandle, p as ScopedPreferredTransport, g as getRuntimePolicy, q as scopedConnectionKey, r as scopedConnectionKeyToString } from '../assembly-Ddq1o4NV.js';
1
+ import { e as RuntimeFactoryOptions, b as PlutoRuntimeAssembly, P as PeerReconciliationStats } from '../assembly-CscFVHYK.js';
2
+ export { O as OPENRTC_RUNTIME_POLICY, R as RuntimeClient, a as RuntimePolicySnapshot, D as ScopedConnectionActorError, f as ScopedConnectionActorErrorKind, h as ScopedConnectionActorHandle, i as ScopedConnectionActorHandleOptions, j as ScopedConnectionActorRegistry, k as ScopedConnectionActorState, l as ScopedConnectionClose, m as ScopedConnectionDial, n as ScopedConnectionKey, o as ScopedLogicalChannelHandle, p as ScopedPreferredTransport, g as getRuntimePolicy, q as scopedConnectionKey, r as scopedConnectionKeyToString } from '../assembly-CscFVHYK.js';
3
3
  import * as Draft14 from '@moq/net';
4
- import { a4 as SignalingOptions, I as ISignalingBackend, f as RuntimeIdentity, g as RoomMember, j as SignalingEnvelope, m as SignalingSession, h as Device, l as DesiredPeerProjection, r as BackendConnectionState, Y as AppLimits, G as GrantScope, K as JoinRoomOptions, z as IncomingStreamChannelMetadata, X as ApplicationCryptoStreamTools, a5 as RoomCreationMode, e as ClientOptions, t as ApplicationPayloadCrypto, D as DiscoveryMode, W as ProtocolCapabilityMap, a6 as ScanningLoopOptions, a7 as ScanningLoopHandle, a8 as RuntimeBootstrapOptions, a9 as RuntimeBootstrapResult, u as ApplicationPayloadReadinessOptions, aa as ManagedApplicationRouteOptions, H as PeerState, O as PeerScope, J as PeerHealth, y as ChannelDescriptor, ab as JoinRequest, p as NativeConnectParams, q as NativeConnectResult } from '../types-CL4Da0BR.js';
5
- import { C as Connection, K as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-BAwo8biA.js';
6
- export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, R as RuntimeClientOptions, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-BAwo8biA.js';
4
+ import { a4 as SignalingOptions, I as ISignalingBackend, f as RuntimeIdentity, g as RoomMember, j as SignalingEnvelope, m as SignalingSession, h as Device, l as DesiredPeerProjection, r as BackendConnectionState, Y as AppLimits, G as GrantScope, K as JoinRoomOptions, z as IncomingStreamChannelMetadata, X as ApplicationCryptoStreamTools, a5 as RoomCreationMode, e as ClientOptions, t as ApplicationPayloadCrypto, D as DiscoveryMode, W as ProtocolCapabilityMap, a6 as ScanningLoopOptions, a7 as ScanningLoopHandle, a8 as RuntimeBootstrapOptions, a9 as RuntimeBootstrapResult, u as ApplicationPayloadReadinessOptions, aa as ManagedApplicationRouteOptions, H as PeerState, O as PeerScope, J as PeerHealth, y as ChannelDescriptor, ab as JoinRequest, p as NativeConnectParams, q as NativeConnectResult } from '../types-zT2QwuCv.js';
5
+ import { C as Connection, K as RuntimeConnectionTarget, v as RuntimeRawConnection } from '../types-BJU2GoVb.js';
6
+ export { w as ChannelDescriptor, x as ConnectionEvent, y as ConnectionTarget, D as DeviceProfile, z as IncomingStream, P as PeerConnectOptions, A as PeerReadiness, B as PeerStreamOptions, E as PresenceLoopOptions, F as RawConnection, t as RuntimeApplicationPayloadReadinessOptions, G as RuntimeAuthContext, H as RuntimeAuthIdentity, J as RuntimeAutoConnectPolicy, l as RuntimeChannelDescriptor, R as RuntimeClientOptions, u as RuntimeConnectionEvent, s as RuntimeConnectionStateSnapshot, c as RuntimeDevice, e as RuntimeDeviceConnectOptions, L as RuntimeDevicePresenceStatus, M as RuntimeDeviceStatus, d as RuntimeDeviceStatusSnapshot, n as RuntimeIncomingStream, q as RuntimeJoinRoomOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, N as RuntimeLogicalChannelFraming, b as RuntimeManagedSession, O as RuntimeManagedSessionKind, a as RuntimeManagedSessionOptions, Q as RuntimeManagedSessionPlatform, i as RuntimePeerConnectOptions, k as RuntimePeerHealth, S as RuntimePeerLifecycleStatus, j as RuntimePeerReadinessSnapshot, T as RuntimePeerScope, U as RuntimePeerSessionSnapshot, h as RuntimePeerState, m as RuntimePeerStreamOptions, V as RuntimePresenceLoopOptions, W as RuntimePresencePolicy, r as RuntimeRoomMember, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, X as RuntimeSession, Y as RuntimeUiConnectionStatus, Z as ScopedChannelOptions, _ as ScopedLogicalChannel, $ as Session, a0 as SessionOptions } from '../types-BJU2GoVb.js';
7
7
  import { R as RuntimeCapabilities } from '../capabilities-CaqXOIUU.js';
8
8
  export { B as BROWSER_WASM_RUNTIME_CAPABILITIES, c as BrowserRuntimeCapabilityHost, N as NATIVE_IPC_RUNTIME_CAPABILITIES, d as NativeRuntimeStatusSnapshot, e as NativeRuntimeTransportFeatureStatus, b as RuntimeAdapterKind, a as RuntimeCapabilityProfile, f as cloneRuntimeCapabilities, r as runtimeCapabilitiesForBrowserHost, g as runtimeCapabilitiesFromNativeStatus, h as runtimeCapabilityProfile } from '../capabilities-CaqXOIUU.js';
9
9
  export { RuntimeDeviceActiveOptions, isRuntimeDeviceActive, isRuntimeDeviceConnectable, isRuntimeDeviceRoutable } from './device-status.js';
10
10
  export { h as RuntimeJsonFrameDecoderOptions, R as RuntimeJsonFrameHandler, a as RuntimeU32BEFrameHandler, i as concatRuntimeBytes, c as createRuntimeJsonFrameDecoder, b as createRuntimeU32BEFrameDecoder, d as decodeRuntimeJsonPayload, e as encodeRuntimeJsonFrame, f as encodeRuntimeJsonPayload, g as encodeRuntimeU32BEFrame, r as readRuntimeU32BE } from '../framing-zRvEKOld.js';
11
- import { I as IpcRuntimeAdapter } from '../tauri-DZJ_ZEfB.js';
12
- export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-DZJ_ZEfB.js';
11
+ import { I as IpcRuntimeAdapter } from '../tauri-BpsecNrp.js';
12
+ export { a as IpcRuntimeAdapterOptions, T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-BpsecNrp.js';
13
13
  import { WasmRuntimeAdapter } from './WasmRuntimeAdapter.js';
14
14
  import { P as PlutoIpcBridge } from '../ipc-CflAVodw.js';
15
15
  export { N as NativeIpcFailureKind, a as PlutoIpcUnlisten, c as classifyNativeIpcFailure, i as isNativeIpcCommandUnavailable } from '../ipc-CflAVodw.js';
16
16
  import '../IEngineBridge-BbsT8hof.js';
17
- import '../DelegatingRuntimeAdapter-B9j_lTDM.js';
17
+ import '../DelegatingRuntimeAdapter-Cg3jFk1b.js';
18
18
 
19
19
  declare class Signaling {
20
20
  private readonly appTag;
@@ -1 +1 @@
1
- export{b as createIpcClient,a as createWasmClient}from'../chunk-EAQYAVIA.js';export{z as RuntimeClient,i as RuntimeConnectionController,m as ScopedConnectionActorError,p as ScopedConnectionActorHandle,q as ScopedConnectionActorRegistry,l as clog,x as concatRuntimeBytes,k as correlationForDriveGrantScope,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,y as readRuntimeU32BE,j as renderCorrelationFields,n as scopedConnectionKey,o as scopedConnectionKeyToString}from'../chunk-VQT6275Z.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';export{a as WasmRuntimeAdapter}from'../chunk-3TZAOOON.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-FGGDUGTK.js';export{h as IpcRuntimeAdapter,e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'../chunk-S4NAEWOY.js';export{x as BROWSER_WASM_RUNTIME_CAPABILITIES,y as NATIVE_IPC_RUNTIME_CAPABILITIES,v as OPENRTC_RUNTIME_POLICY,z as cloneRuntimeCapabilities,w as getRuntimePolicy,n as logOpenRtcTeardownTrace,b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog,A as runtimeCapabilitiesForBrowserHost,B as runtimeCapabilitiesFromNativeStatus,C as runtimeCapabilityProfile}from'../chunk-VCJQWWOH.js';import'../chunk-QT2ASNI3.js';import'../chunk-SY6YGCXA.js';import'../chunk-C7YN5MSV.js';
1
+ export{b as createIpcClient,a as createWasmClient}from'../chunk-GOXGYBWD.js';export{z as RuntimeClient,i as RuntimeConnectionController,m as ScopedConnectionActorError,p as ScopedConnectionActorHandle,q as ScopedConnectionActorRegistry,l as clog,x as concatRuntimeBytes,k as correlationForDriveGrantScope,w as createRuntimeJsonFrameDecoder,s as createRuntimeU32BEFrameDecoder,u as decodeRuntimeJsonPayload,v as encodeRuntimeJsonFrame,t as encodeRuntimeJsonPayload,r as encodeRuntimeU32BEFrame,y as readRuntimeU32BE,j as renderCorrelationFields,n as scopedConnectionKey,o as scopedConnectionKeyToString}from'../chunk-5ZIXL6NU.js';export{a as isRuntimeDeviceActive,c as isRuntimeDeviceConnectable,b as isRuntimeDeviceRoutable}from'../chunk-CK6WQV7J.js';export{a as WasmRuntimeAdapter}from'../chunk-5ZDGIHNB.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-D7Y72PSI.js';export{h as IpcRuntimeAdapter,e as classifyNativeIpcFailure,f as isNativeIpcCommandUnavailable}from'../chunk-3WD7QKIS.js';export{C as BROWSER_WASM_RUNTIME_CAPABILITIES,D as NATIVE_IPC_RUNTIME_CAPABILITIES,A as OPENRTC_RUNTIME_POLICY,E as cloneRuntimeCapabilities,B as getRuntimePolicy,n as logOpenRtcTeardownTrace,b as openRtcDebug,a as openRtcDebugEnabled,c as openRtcDebugInfo,d as openRtcDebugLog,F as runtimeCapabilitiesForBrowserHost,G as runtimeCapabilitiesFromNativeStatus,H as runtimeCapabilityProfile}from'../chunk-2OQQ4I7Z.js';import'../chunk-QT2ASNI3.js';import'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
@@ -1,6 +1,6 @@
1
- export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-DZJ_ZEfB.js';
1
+ export { T as TauriRuntimeAdapter, b as TauriRuntimeAdapterOptions, c as createTauriIpcBridge } from '../tauri-BpsecNrp.js';
2
2
  import '../ipc-CflAVodw.js';
3
- import '../types-CL4Da0BR.js';
4
- import '../DelegatingRuntimeAdapter-B9j_lTDM.js';
3
+ import '../types-zT2QwuCv.js';
4
+ import '../DelegatingRuntimeAdapter-Cg3jFk1b.js';
5
5
  import '../IEngineBridge-BbsT8hof.js';
6
6
  import '../capabilities-CaqXOIUU.js';
@@ -1 +1 @@
1
- export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-FGGDUGTK.js';import'../chunk-S4NAEWOY.js';import'../chunk-VCJQWWOH.js';import'../chunk-QT2ASNI3.js';import'../chunk-SY6YGCXA.js';import'../chunk-C7YN5MSV.js';
1
+ export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-D7Y72PSI.js';import'../chunk-3WD7QKIS.js';import'../chunk-2OQQ4I7Z.js';import'../chunk-QT2ASNI3.js';import'../chunk-OCSZA6PK.js';import'../chunk-C7YN5MSV.js';
@@ -1,7 +1,7 @@
1
- import { R as RuntimeClient, a as RuntimePolicySnapshot, P as PeerReconciliationStats, b as PlutoRuntimeAssembly } from './assembly-Ddq1o4NV.js';
2
- import { C as ConnectDeviceResult, b as ConnectDeviceHooks, c as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, G as GrantScope, a as SpaceTokenProvider } from './types-CL4Da0BR.js';
1
+ import { R as RuntimeClient, a as RuntimePolicySnapshot, P as PeerReconciliationStats, b as PlutoRuntimeAssembly } from './assembly-CscFVHYK.js';
2
+ import { C as ConnectDeviceResult, b as ConnectDeviceHooks, c as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, G as GrantScope, a as SpaceTokenProvider } from './types-zT2QwuCv.js';
3
3
  import { A as AuthContext } from './IEngineBridge-BbsT8hof.js';
4
- import { a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, h as RuntimePeerState, i as RuntimePeerConnectOptions, C as Connection, j as RuntimePeerReadinessSnapshot, k as RuntimePeerHealth, l as RuntimeChannelDescriptor, m as RuntimePeerStreamOptions, n as RuntimeIncomingStream, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, s as RuntimeConnectionStateSnapshot, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent, v as RuntimeRawConnection } from './types-BAwo8biA.js';
4
+ import { a as RuntimeManagedSessionOptions, b as RuntimeManagedSession, c as RuntimeDevice, d as RuntimeDeviceStatusSnapshot, e as RuntimeDeviceConnectOptions, f as RuntimeLocalDeviceInfo, g as RuntimeLocalDeviceProfile, h as RuntimePeerState, i as RuntimePeerConnectOptions, C as Connection, j as RuntimePeerReadinessSnapshot, k as RuntimePeerHealth, l as RuntimeChannelDescriptor, m as RuntimePeerStreamOptions, n as RuntimeIncomingStream, o as RuntimeScopedChannelOptions, p as RuntimeScopedLogicalChannel, q as RuntimeJoinRoomOptions, r as RuntimeRoomMember, s as RuntimeConnectionStateSnapshot, t as RuntimeApplicationPayloadReadinessOptions, u as RuntimeConnectionEvent, v as RuntimeRawConnection } from './types-BJU2GoVb.js';
5
5
  import { R as RuntimeCapabilities, a as RuntimeCapabilityProfile } from './capabilities-CaqXOIUU.js';
6
6
 
7
7
  type OpenRTCChannelConnectOptions = Omit<RuntimeScopedChannelOptions, 'scope' | 'deviceId' | 'ticket'> & {