openrtc 1.0.21 → 1.0.23

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.
@@ -0,0 +1 @@
1
+ import {E,D}from'./chunk-VCJQWWOH.js';var n=class extends E{constructor(e){super(new D(e));}setWasmClient(e){this.unwrap().setWasmClient(e);}};export{n as a};
@@ -1,2 +1,2 @@
1
- import {a as a$1,A}from'./chunk-4S2WYUYW.js';import {a as a$2}from'./chunk-IF5JSSMC.js';import {h}from'./chunk-E5CLEIY6.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_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}
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}
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};
@@ -1 +1 @@
1
- import {g,h}from'./chunk-E5CLEIY6.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-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};
@@ -0,0 +1,2 @@
1
+ import {v as v$1,E as E$1,B,D as D$1,z,c,o,b,n,q,r,s,t as t$1,u as u$1}from'./chunk-VCJQWWOH.js';import {x,u,a,g,t,E as E$2,G}from'./chunk-SY6YGCXA.js';function Q(d){let e=String(d?.message??d??"").toLowerCase();return e?e.includes("__tauri_internals__")||e.includes("window is not defined")||e.includes("cannot read properties of undefined")?"runtime-unavailable":e.includes("timeout after")?"timeout":e.includes("not found")||e.includes("not allowed")||e.includes("unknown command")||e.includes("plugin not found")||e.includes("plugin:openrtc-tauri-plugin")||e.includes("plugin:openrtc")?"command-unavailable":"unknown":"unknown"}function A(d){return Q(d)==="command-unavailable"}function k(d,e="native runtime"){if(!d||typeof d!="object")throw new Error(`[openrtc] ${e} requires a valid IPC bridge object.`);if(typeof d.invoke!="function")throw new Error(`[openrtc] ${e} IPC bridge is missing invoke(command, args).`);if(typeof d.listen!="function")throw new Error(`[openrtc] ${e} IPC bridge is missing listen(event, handler).`);return d}var R=null;async function X(){return R||(R=(async()=>{let d="openrtc-tauri",e="../../../tauri/src/runtime/ipc";try{return await import(d)}catch(t){try{return await import(e)}catch(i){let n=new Error("[openrtc] Native support now lives in the first-party `openrtc-tauri` package. Install `openrtc-tauri` (and `@tauri-apps/api`) or pass an explicit IPC bridge to OpenRTC.native(...).");throw n.cause={packageError:t,workspaceError:i},n}}})()),R}function $(){let d=null,e=async()=>(d||(d=X().then(t=>k(t.createTauriIpcBridge(),"openrtc-tauri"))),d);return {async invoke(t,i){return (await e()).invoke(t,i)},async listen(t,i){return (await e()).listen(t,i)},async isAvailable(){try{let t=await e();return typeof t.isAvailable=="function"?!!await t.isAvailable():!0}catch{return false}}}}var Z="relay-only endpoint ticket unavailable",ee=12e3,te=250,ie=1500;function ne(d){return String(d?.message??d??"").toLowerCase().includes(Z)}async function E(d,e={}){let t=e.windowMs??ee,i=e.minDelayMs??te,n=e.maxDelayMs??ie,r=Date.now(),c=0,a=null;for(;e.isActive?.()??true;){c+=1;try{return await d()}catch(h){if(a=h,!ne(h))throw h;let o=Date.now()-r;if(o>=t)throw h;let l=Math.min(x(c,i,n),Math.max(0,t-o));l>0&&await u(l);}}throw a||new Error("endpoint ticket minting stopped before a ticket was available")}function Y(d){let e=d?.split(".")[1];if(!e)return null;try{let t=e.replace(/-/g,"+").replace(/_/g,"/"),i=(4-t.length%4)%4,n=atob(t+"=".repeat(i)),r=JSON.parse(n);return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function j(d,e){let t=d?.[e];return typeof t=="string"&&t.trim()?t.trim():null}function J(d,e){return j(d,"namespaceId")===e||j(d,"appTag")===`space::${e}`}var v=class v{constructor(e){this.subscriptionNonce=0;this.lastSyncedAuthToken=null;this.cachedLocalDeviceId=null;this.cachedLocalDeviceName=null;this.tauriCoreAvailability=null;this.tauriCoreAvailabilityValue=null;this.tauriCoreAvailabilityCheckedAtMs=0;this.authSyncInFlight=null;this.nativeTrustTokenUnsubscribe=null;this.nativeTrustRelayQueue=Promise.resolve();this.nativeTrustRelayError=null;this.nativeRuntimeCapabilitiesSyncInFlight=null;this.gatewayDesiredPeersCleanup=null;this.gatewayDesiredPeerRelayKey=null;this.gatewayDesiredPeerRelayGeneration=0;this.gatewayDesiredPeerRevision=0;this.gatewayDesiredPeerSubmission=Promise.resolve();this.gatewayDesiredPeerLifecycle=Promise.resolve();this.gatewayExcludedPeers=new Set;this.lastNativeAuthSyncAtMs=0;this.runtimeCapabilities=B(null,false);this.fallback=new D$1({...e,coordinationPlatformType:"desktop"}),this.app=this.fallback.app,this.auth=this.fallback.auth,this.appTag=this.fallback.tag,this.options=this.fallback.getResolvedOptions(),this.transportOptions=e.transports,this.strictMode=e.strictMode===true,this.turnCredentialsProvider=e.turnCredentialsProvider,this.allowWasmFallback=e.allowWasmFallback??false,this.ipcBridge=k(e.ipcBridge??$(),"NativeIpcBridge"),this.runtimeCapabilities=B(null,this.allowWasmFallback),this.syncNativeRuntimeCapabilities("constructor");}get currentUser(){return this.fallback.currentUser}get tag(){return this.fallback.tag}getRuntimeCapabilities(){let e=z(this.runtimeCapabilities);return e.fallback.wasm=this.allowWasmFallback,e}usesCoordinationGateway(){return this.fallback.usesCoordinationGateway()}assertManagedCoordinationGateway(){if(!this.usesCoordinationGateway())throw new Error("[OpenRTC] Native managed coordination requires coordinationGateway; the legacy native Firebase data plane has been removed.")}async joinCoordinationRoom(e,t,i){await this.syncCoordinationDeviceIdentity(),await this.fallback.joinCoordinationRoom(e,t,i);}leaveCoordinationRoom(e){return this.fallback.leaveCoordinationRoom(e)}getCoordinationRoomMembers(e){return this.fallback.getCoordinationRoomMembers(e)}watchCoordinationRoomMembers(e,t){return this.fallback.watchCoordinationRoomMembers(e,t)}async syncCoordinationDeviceIdentity(){if(!this.usesCoordinationGateway())return;let e=await this.getLocalDeviceInfo().catch(()=>null),t=e?.deviceId||await this.resolveLocalDeviceId();this.fallback.setCoordinationLocalDeviceId(t),this.fallback.setCoordinationPlatformType(this.normalizeNativeCoordinationPlatform(e?.platformType));}setWasmClient(e){if(!this.allowWasmFallback){let t="[NativeIpcBridge][NATIVE-GUARD] Refusing WasmClient attachment because native IPC is authoritative and WASM fallback is disabled.";throw console.error(t,{capabilities:this.getRuntimeCapabilities()}),new Error(t)}this.fallback.setWasmClient(e);}onAuthChange(e){return this.fallback.onAuthChange(e)}checkForSSOToken(){return this.fallback.checkForSSOToken()}waitForAuth(){return this.fallback.waitForAuth()}signInAnonymously(){return this.fallback.signInAnonymously()}getTurnCredentials(){return this.fallback.getTurnCredentials()}cleanupStaleDevices(){return this.fallback.cleanupStaleDevices()}sendMessage(e,t,i,n){return this.fallback.sendMessage(e,t,i,n)}pollMessages(e){return this.fallback.pollMessages(e)}watchFriendDevices(e,t){return this.assertManagedCoordinationGateway(),this.fallback.watchFriendDevices(e,t)}async updateFriendTicket(e){this.assertManagedCoordinationGateway(),await this.syncCoordinationDeviceIdentity(),await this.fallback.updateFriendTicket(e);}createSession(e){return this.fallback.createSession(e)}updateSession(e,t){return this.fallback.updateSession(e,t)}async openPeerBi(e,t){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_bi_stream",{peerId:e,timeoutMs:t??null}):this.fallback.openPeerBi(e,t)}async openPeerBiTransportOnly(e,t){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_bi_transport_only_stream",{peerId:e,timeoutMs:t??null},{fallbackCommand:"open_peer_bi_stream"}):this.fallback.openPeerBiTransportOnly(e,t)}async openPeerNativeBi(e,t,i){return await this.canUseTauriIpc()?this.openPeerBiViaIpc("open_peer_native_bi_stream",{peerId:e,label:t,timeoutMs:i??null},{fallbackCommand:"open_peer_bi_stream",fallbackArgs:{peerId:e,timeoutMs:i??null}}):this.fallback.openPeerNativeBi(e,t,i)}async incoming_streams(){if(!await this.canUseTauriIpc()){let r=this.fallback;if(typeof r.incoming_streams=="function")return r.incoming_streams();throw new Error("Native incoming stream bridge is unavailable")}let e=`native-incoming-${Date.now()}-${++this.subscriptionNonce}`,t=null,i=false,n=async()=>{i=true;let r=t;t=null,await Promise.allSettled([r?Promise.resolve(r()):Promise.resolve(),this.invokeIpc("stop_rtc_subscription",{requestId:e},{timeoutMs:null}).catch(()=>{})]);};return new ReadableStream({start:async r=>{try{t=await this.listenIpc("openrtc://peer-bi-stream/incoming",c$1=>{if(i)return;let a=c$1.payload,h=typeof a?.requestId=="string"?a.requestId:typeof a?.request_id=="string"?a.request_id:"";if(h!==e){c("[NativeIpcBridge][incoming-application-stream] ignored request id",{expectedRequestId:e,eventRequestId:h});return}let o=typeof a?.streamId=="string"?a.streamId.trim():typeof a?.stream_id=="string"?a.stream_id.trim():"";if(!o)return;let l=typeof a?.remoteNodeId=="string"?a.remoteNodeId.trim():typeof a?.remote_node_id=="string"?a.remote_node_id.trim():"",s=Number.isSafeInteger(a?.transportStableId)?Number(a.transportStableId):Number.isSafeInteger(a?.transport_stable_id)?Number(a.transport_stable_id):0;if(!l||s<=0){c("[NativeIpcBridge][incoming-application-stream] ignored invalid generation",{requestId:e,remoteNodeId:l,transportStableId:s});return}c("[NativeIpcBridge][incoming-application-stream] accepted event",{requestId:e,remoteNodeId:l,transportStableId:s});let u=this.peerBiStreamFromId(o,{startReadAfterListeners:!0});r.enqueue({type:"bi",stream:{send:u.writable,recv:u.readable,endpoint_id:l},endpointId:l,transportStableId:s,protocolHint:"unknown",channel:null});}),await this.invokeIpc("start_incoming_peer_bi_streams",{requestId:e},{timeoutMs:null});}catch(c){i=true,r.error(c),await n();}},cancel:async()=>{await n();}})}async is_current_transport_stable_id(e,t){if(!await this.canUseTauriIpc()){let i=this.fallback;return typeof i.is_current_transport_stable_id=="function"?i.is_current_transport_stable_id(e,t):false}return !e.trim()||t<=0n||t>BigInt(Number.MAX_SAFE_INTEGER)?false:this.invokeIpc("is_current_transport_stable_id",{endpointId:e.trim(),transportStableId:Number(t)})}openPeerUni(e,t){return this.fallback.openPeerUni(e,t)}isConnected(e){return this.fallback.isConnected(e)}getAuthContext(){return this.fallback.getAuthContext()}resolveNativeAuthScopedUserId(e){return this.currentUser?.id??this.getAuthContext()?.userId??e??null}resolveConfiguredSpaceKey(){let e=this.options.spaceKey??this.options.space;return typeof e=="string"?e.trim():""}usesAnonymousSpaceMode(){return this.options.authMode==="anonymous"&&this.resolveConfiguredSpaceKey().length>0}requiresNativeAuthToken(){return !this.usesAnonymousSpaceMode()||typeof this.options.spaceTokenProvider=="function"}async nativeAuthTokenMatchesExpectedScope(e){if(!this.usesAnonymousSpaceMode())return true;let t=typeof this.options.apiKey=="string"?this.options.apiKey.trim():"",i=this.resolveConfiguredSpaceKey();if(!t||!i)return true;let n=await a(t,i).catch(()=>null);return n?J(Y(e),n):true}resolveNativeSignalingUserId(e){return this.usesAnonymousSpaceMode()?(typeof e=="string"?e.trim():"")||this.resolveConfiguredSpaceKey()||null:this.resolveNativeAuthScopedUserId(e)}getCurrentUserId(){return this.resolveNativeSignalingUserId(this.fallback.getCurrentUserIdForScope())}nativeAuthWaitMs(){return this.requiresNativeAuthToken()?v.AUTH_REQUIRED_WAIT_MS:0}resolveWebLogicalDeviceId(){return this.fallback.getResolvedWebLogicalDeviceId()}normalizeDevice(e,t){return this.fallback.normalizeDeviceRecord(e,t)}matchesTag(e){return this.fallback.matchesLegacyOrCurrentTag(e)}nativeRosterTagDisposition(e){let t=o(e);if(this.matchesTag(t))return {keep:true,classification:"match"};let i=typeof t.appTag=="string"&&t.appTag.trim().length>0?t.appTag.trim():typeof t.tag=="string"&&t.tag.trim().length>0?t.tag.trim():void 0;return i===void 0?{keep:true,classification:"untagged"}:{keep:false,classification:"foreign",foreignTag:i}}filterNativeRosterByTag(e,t){let i=new Set,n=e.filter(r=>{let c=this.nativeRosterTagDisposition(r);return !c.keep&&c.foreignTag&&i.add(c.foreignTag),c.keep});return e.length>0&&n.length===0&&i.size>0?console.warn(`[NativeIpcBridge] ${t}: dropped ALL ${e.length} native device(s) as foreign-app \u2014 this is the app-tag drift signature (empty native device list). The native Rust OpenRTC app tag does not match the SDK app tag; check that the desktop binary and the web bundle use the same VITE_PLUTO_OPENRTC_API_KEY / VITE_PLUTO_OPENRTC_APP_TAG for this environment lane.`,{sdkAppTag:this.appTag,foreignTags:Array.from(i),droppedCount:e.length}):i.size>0&&c(`[NativeIpcBridge] ${t}: filtered ${e.length-n.length} foreign-app device(s) from the native roster`,{sdkAppTag:this.appTag,foreignTags:Array.from(i)}),n}normalizeNativeIceServer(e){let t=e.urls,i=Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.trim().length>0):typeof t=="string"&&t.trim().length>0?[t]:[];return i.length===0?null:{urls:i,username:typeof e.username=="string"&&e.username.trim().length>0?e.username:void 0,credential:typeof e.credential=="string"&&e.credential.trim().length>0?e.credential:void 0}}filterNativeStunServers(e){return e.map(t=>({...t,urls:t.urls.filter(i=>!i.startsWith("stun:"))})).filter(t=>t.urls.length>0)}nativeIceServerHasTurnUrl(e){return e.urls.some(t=>t.startsWith("turn:")||t.startsWith("turns:"))}async loadNativeTurnIceServers(){if(typeof this.turnCredentialsProvider!="function")return [];let e=await this.turnCredentialsProvider().catch(t=>(console.warn("[NativeIpcBridge] TURN credential provider failed:",t),null));return !e||!Array.isArray(e.iceServers)?[]:e.iceServers.map(t=>this.normalizeNativeIceServer(t)).filter(t=>!!t)}async buildNativeTransportConfigPayload(){let e=this.transportOptions;if(!e&&!this.strictMode)return null;let t=null;if(!this.strictMode&&e?.iroh&&typeof e.iroh=="object"){let o=e.iroh;o.localDiscovery===true&&(t={enabled:true,advertise:o.localDiscoveryMode!=="passive"});}let i=null;if(e?.webrtc===true||e?.webrtc&&typeof e.webrtc=="object"){let o=e.webrtc===true?null:e.webrtc,l=o?.useDefaultIceServers!==false,s=Array.isArray(o?.iceServers)&&o.iceServers.length>0?o.iceServers.map(y=>this.normalizeNativeIceServer(y)).filter(y=>!!y):l?g.map(y=>this.normalizeNativeIceServer(y)).filter(y=>!!y):[],u=this.strictMode||o?.privacyMode===true;(this.strictMode||o?.privacyMode===true||o?.useTurn===true)&&(s=[...s,...await this.loadNativeTurnIceServers()]),u&&(s=this.filterNativeStunServers(s));let m=s.some(y=>this.nativeIceServerHasTurnUrl(y)),g$1=u&&m;u&&!m&&console.warn("[NativeIpcBridge] Relay-only WebRTC requested, but no TURN servers are configured; native WebRTC override disabled");let _=o?.lanMode===true;(s.length>0||g$1||_||!l)&&(i={iceServers:s.length>0||!l?s:void 0,privacyMode:g$1,lanMode:_||void 0});}let n=null;if(e?.moq&&typeof e.moq=="object"){let o=typeof e.moq.relayUrl=="string"&&e.moq.relayUrl.trim().length>0?e.moq.relayUrl:void 0;if(o){let l=typeof e.moq.accessToken=="string"&&e.moq.accessToken.trim().length>0?e.moq.accessToken.trim():void 0;n={relayUrl:o,accessToken:l};}}let r=null;if(!this.strictMode&&(e?.ble===true||e?.ble&&typeof e.ble=="object")){let o=e.ble===true?null:e.ble,l=Number(o?.connectTimeoutMs);r={enabled:o?.enabled!==false,connectTimeoutMs:Number.isFinite(l)&&l>0?Math.round(l):void 0};}let c=this.strictMode||e?.iroh&&typeof e.iroh=="object"&&e.iroh.relayOnly===true,a=e?.iroh&&typeof e.iroh=="object"?e.iroh.relayTransportPolicy:void 0,h=this.strictMode?a??"auto":a;return !c&&!h&&!i&&!n&&!t&&!r?null:{irohRelayOnly:c||void 0,irohRelayTransportPolicy:h,irohLan:t,webrtc:i,moq:n,ble:r}}isTauriEnv(){return t()}nextConnectionEventRetryDelayMs(e){return x(e,v.CONNECTION_EVENT_RETRY_MIN_DELAY_MS,v.CONNECTION_EVENT_RETRY_MAX_DELAY_MS)}async clearNativeAuthRelay(e){if(await this.canUseTauriIpc())try{await this.invokeIpc("desktop_set_pluto_auth_token",{authToken:null,refreshToken:null}),this.lastSyncedAuthToken=null,this.lastNativeAuthSyncAtMs=0,c(`[NativeIpcBridge] cleared native auth relay (${e})`);}catch(t){console.warn(`[NativeIpcBridge] failed clearing native auth relay (${e}):`,t);}}async clearNativeTrustRelay(e){if(this.nativeTrustTokenUnsubscribe?.(),this.nativeTrustTokenUnsubscribe=null,this.nativeTrustRelayError=null,this.fallback.invalidateCoordinationNativeTrustToken(),!!await this.canUseTauriIpc())try{await this.invokeIpc("openrtc_set_native_trust_token",{trustToken:null,expiresAtMs:null}),c(`[NativeIpcBridge] cleared native trust relay (${e})`);}catch(t){A(t)||console.warn(`[NativeIpcBridge] failed clearing native trust relay (${e}):`,t);}}relayNativeTrustToken(e,t){let i=async()=>{await this.canUseTauriIpc()&&(await this.invokeIpc("openrtc_set_native_trust_token",{trustToken:e?.token??null,expiresAtMs:e?.expiresAtMs??null}),c(`[NativeIpcBridge] native trust token ${e?"relayed":"cleared"} (${t})`));},n=this.nativeTrustRelayQueue.then(i,i);return this.nativeTrustRelayQueue=n.catch(()=>{}),n}async ensureNativeTrustRelay(e=false){if(!this.usesCoordinationGateway())return true;if(typeof this.options.coordinationGateway?.nativeTrustTokenProvider!="function")return false;if(!await this.canUseTauriIpc())return true;try{let t=await this.fallback.getCoordinationNativeTrustToken(e);return await this.relayNativeTrustToken(t,"auth-ready"),this.nativeTrustRelayError=null,this.nativeTrustTokenUnsubscribe||(this.nativeTrustTokenUnsubscribe=this.fallback.subscribeCoordinationNativeTrustToken(i=>{this.relayNativeTrustToken(i,"provider-refresh").catch(n=>{console.warn("[NativeIpcBridge] native trust token refresh relay failed:",n);});},{emitCurrent:!1})),!0}catch(t){return this.nativeTrustRelayError=(t instanceof Error?t.message:String(t)).trim().slice(0,300)||"unknown provider failure",console.warn("[NativeIpcBridge] native trust token unavailable:",t),false}}async relayNativeAuthToken(e,t,i,n){if(!await this.canUseTauriIpc())return true;if(!await this.nativeAuthTokenMatchesExpectedScope(e))return c(`[NativeIpcBridge] auth sync deferred (${i}): token claims do not match configured space`),false;if(e===this.lastSyncedAuthToken)return true;try{await this.invokeIpc("desktop_set_pluto_auth_token",{authToken:e,refreshToken:t??null});}catch(r){return A(r)?console.warn(`[NativeIpcBridge] desktop auth relay unavailable (${i}); install/register openrtc-tauri-plugin and include its default permission set.`,r):console.warn(`[NativeIpcBridge] desktop auth relay failed (${i}):`,r),false}return this.lastSyncedAuthToken=e,this.lastNativeAuthSyncAtMs=Date.now(),c(`[NativeIpcBridge] auth token relayed to native runtime (${i}) user_id=${n??this.currentUser?.id??"unknown"}`),true}async relayExplicitNativeAuthContext(e){let t=this.authSyncInFlight,i=(async()=>(await t?.catch(()=>{}),this.relayNativeAuthToken(e.token,e.refreshToken,"setAuthContext",e.userId)))();this.authSyncInFlight=i;try{return await i}finally{this.authSyncInFlight===i&&(this.authSyncInFlight=null);}}applyNativeRuntimeStatus(e){this.runtimeCapabilities=B(e,this.allowWasmFallback);}syncNativeRuntimeCapabilities(e){return this.ipcBridge?this.nativeRuntimeCapabilitiesSyncInFlight?this.nativeRuntimeCapabilitiesSyncInFlight:(this.nativeRuntimeCapabilitiesSyncInFlight=(async()=>{try{let t=await this.invokeIpc("rtc_native_status",void 0,{timeoutMs:v.NATIVE_STATUS_IPC_TIMEOUT_MS});this.applyNativeRuntimeStatus(t),c(`[NativeIpcBridge] refreshed native runtime capabilities (${e})`);}catch(t){b("[NativeIpcBridge] native runtime capability refresh skipped",t);}})().finally(()=>{this.nativeRuntimeCapabilitiesSyncInFlight=null;}),this.nativeRuntimeCapabilitiesSyncInFlight):Promise.resolve()}async canUseTauriIpc(){if(this.ipcBridge){let e=typeof this.ipcBridge.isAvailable=="function"?!!await this.ipcBridge.isAvailable():true;return e&&this.syncNativeRuntimeCapabilities("ipc-available"),e}return typeof window>"u"?false:this.tauriCoreAvailabilityValue===true?true:this.tauriCoreAvailabilityValue===false&&Date.now()-this.tauriCoreAvailabilityCheckedAtMs<v.TAURI_IPC_NEGATIVE_CACHE_MS?false:(this.tauriCoreAvailability||(this.tauriCoreAvailability=(async()=>{try{if(this.isTauriEnv())return this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),this.syncNativeRuntimeCapabilities("tauri-env"),!0;try{let e=await this.invokeIpc("rtc_native_status");return this.applyNativeRuntimeStatus(e),c("[NativeIpcBridge] Resolved Tauri IPC via rtc_native_status probe"),this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!0}catch(e){let t=String(e?.message??e??"");return t.includes("__TAURI_INTERNALS__")||t.includes("Cannot read properties of undefined")||t.includes("window is not defined")?(this.tauriCoreAvailabilityValue=!1,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!1):(c("[NativeIpcBridge] Tauri IPC probe reached native layer (command-level error acceptable)"),this.tauriCoreAvailabilityValue=!0,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),!0)}}catch{return this.tauriCoreAvailabilityValue=false,this.tauriCoreAvailabilityCheckedAtMs=Date.now(),false}})().finally(()=>{this.tauriCoreAvailability=null;})),this.tauriCoreAvailability)}async invokeIpc(e,t,i){let n=this.ipcBridge.invoke(e,t),r=i&&Object.prototype.hasOwnProperty.call(i,"timeoutMs")?i.timeoutMs:v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS;return r==null||r<=0?n:E$2(n,r,()=>new Error(`${e} timeout after ${r}ms`))}async listenIpc(e,t){return this.ipcBridge.listen(e,i=>{t({payload:i});})}async openPeerBiViaIpc(e,t,i){let n=await this.invokePeerBiOpen(e,t,i),r=typeof n?.streamId=="string"?n.streamId.trim():typeof n?.stream_id=="string"?n.stream_id.trim():"";if(!r)throw new Error(`${e} returned no streamId`);return this.peerBiStreamFromId(r)}peerBiStreamFromId(e,t={}){let i=this,n=null,r=null,c=false,a=null,h=null,o=async()=>{let m=[n,r];n=null,r=null,await Promise.allSettled(m.filter(g=>typeof g=="function").map(g=>Promise.resolve(g())));},l=(async()=>{n=await this.listenIpc("openrtc://peer-bi-stream/chunk",m=>{let g=m.payload;if((typeof g?.streamId=="string"?g.streamId:typeof g?.stream_id=="string"?g.stream_id:"")!==e||c||!a)return;let f=g?.bytes;f instanceof Uint8Array?a.enqueue(f):Array.isArray(f)&&a.enqueue(new Uint8Array(f));}),r=await this.listenIpc("openrtc://peer-bi-stream/closed",m=>{let g=m.payload;if((typeof g?.streamId=="string"?g.streamId:typeof g?.stream_id=="string"?g.stream_id:"")!==e||c||!a)return;c=true;let f=typeof g?.error=="string"?g.error.trim():"";f?a.error(new Error(f)):a.close(),o();}),t.startReadAfterListeners&&await this.invokeIpc("start_peer_bi_stream_read",{streamId:e},{timeoutMs:null});})().catch(m=>{h=m,a&&!c&&(c=true,a.error(m));}),s=async()=>{await this.invokeIpc("close_peer_bi_stream",{streamId:e},{timeoutMs:null}).catch(()=>{}),await o();},u=new ReadableStream({async start(m){a=m,await l,h&&!c&&(c=true,m.error(h));},async cancel(){c=true,await s();}}),I=new WritableStream({write:async m=>{await i.invokeIpc("write_peer_bi_stream",{streamId:e,bytes:Array.from(m)},{timeoutMs:null});},close:s,abort:s});return {readable:u,writable:I}}async invokePeerBiOpen(e,t,i){try{return await this.invokeIpc(e,t)}catch(n){if(!i?.fallbackCommand||!this.isMissingNativeCommandError(n))throw n;return this.invokeIpc(i.fallbackCommand,i.fallbackArgs??t)}}isMissingNativeCommandError(e){let t=e instanceof Error?e.message:String(e??"");return t.includes("Command")&&t.includes("not found")}async shouldUseTauriSignaling(){if(await this.canUseTauriIpc())return true;if(this.allowWasmFallback)return false;throw new Error("[pluto-rtc] Tauri runtime adapter requires native IPC, but it is unavailable.")}async signInWithPluto(){if(!await this.canUseTauriIpc()){await this.fallback.signInWithPluto();return}let e=await this.invokeIpc("rtc_sign_in_with_pluto"),t=typeof e?.customToken=="string"?e.customToken.trim():"";if(!t)throw new Error("[pluto-rtc] Native Pluto SSO did not return a custom token.");await G().signInWithCustomTokenValue(t),await this.ensureNativeAuth("pluto-sso",{requireToken:true,maxWaitMs:1e4});}async setAuthContext(e){let t=this.getAuthContext()?.userId??null,i=typeof e?.userId=="string"&&e.userId.trim()||null,n=this.fallback.setAuthContext(e);if(t&&i&&t!==i&&await this.stopNativeAuthScopedActivity(t),await n,!e?.token)await this.clearNativeAuthRelay("setAuthContext"),await this.clearNativeTrustRelay("setAuthContext");else {if(!await this.relayExplicitNativeAuthContext(e))throw new Error("Native auth token unavailable for setAuthContext");if(!await this.ensureNativeTrustRelay())throw new Error(`Native trust token unavailable for setAuthContext: ${this.nativeTrustRelayError??"unknown provider failure"}`)}}async signOut(){await this.fallback.signOut(),await Promise.all([this.clearNativeAuthRelay("signOut"),this.clearNativeTrustRelay("signOut")]);}async stopAuthScopedActivity(e){let t=this.resolveNativeSignalingUserId(e?.userId??null);await this.stopNativeAuthScopedActivity(t);}async stopNativeAuthScopedActivity(e){await this.stopGatewayDesiredPeerRelay(),this.gatewayExcludedPeers.clear();let t=await this.shouldUseTauriSignaling();if(n("NativeIpcBridge.stopAuthScopedActivity",{userId:e,useTauri:t}),t)try{await Promise.allSettled([this.revokeSessionTokensByScope("user-device"),this.invokeIpc("stop_rtc_presence_loop"),this.invokeIpc("stop_rtc_auto_connect")]);}catch(i){console.warn("[NativeIpcBridge] Failed to stop native auth-scoped RTC activity:",i);}await this.fallback.stopAuthScopedActivity({userId:e});}async ensureNativeAuthOnce(e,t){if(!await this.canUseTauriIpc())return true;if(this.authSyncInFlight)return this.authSyncInFlight;let i=(async()=>{try{if(!this.currentUser)return c(`[NativeIpcBridge] auth sync deferred (${e}): no current user`),!t;let n=Date.now()-this.lastNativeAuthSyncAtMs>=480*1e3,r=this.currentUser?.getToken?await this.currentUser.getToken(n):null,a=this.getAuthContext()?.refreshToken??this.auth?.currentUser?.refreshToken??null;return r?this.relayNativeAuthToken(r,a,e,this.currentUser?.id):(c(`[NativeIpcBridge] auth sync deferred (${e}): missing token for user ${this.currentUser?.id}`),!t)}catch(n){return console.error("[NativeIpcBridge] auth sync failed:",n),false}})();this.authSyncInFlight=i;try{return await i}finally{this.authSyncInFlight===i&&(this.authSyncInFlight=null);}}async ensureNativeAuth(e="runtime",t){if(!await this.canUseTauriIpc())return true;let i=t?.requireToken??false,n=t?.maxWaitMs??(i?v.AUTH_REQUIRED_WAIT_MS:0),r=t?.pollMs??250,c=Date.now()+Math.max(0,n);for(;;){if(await this.ensureNativeAuthOnce(e,i))return true;if(!i||Date.now()>=c)return false;await u(r);}}decodeNativeDeviceIdentity(e){let t=e?.systemInfo??e?.system_info??null,i=typeof e?.deviceId=="string"?e.deviceId.trim():typeof e?.device_id=="string"?e.device_id.trim():"",n=typeof e?.deviceName=="string"?e.deviceName.trim():typeof e?.device_name=="string"?e.device_name.trim():"",r=typeof e?.platformType=="string"?e.platformType.trim():typeof e?.platform_type=="string"?e.platform_type.trim():typeof t?.platformType=="string"?t.platformType.trim():typeof t?.platform_type=="string"?t.platform_type.trim():"";return {deviceId:i,deviceName:n,platformType:r}}async resolveLocalDeviceId(){if(this.cachedLocalDeviceId)return this.cachedLocalDeviceId;if(await this.canUseTauriIpc())try{let t=await this.invokeIpc("get_rtc_local_device_info"),{deviceId:i,deviceName:n}=this.decodeNativeDeviceIdentity(t);if(i)return this.cachedLocalDeviceId=i,n&&(this.cachedLocalDeviceName=n),i}catch(t){console.warn("[NativeIpcBridge] get_rtc_local_device_info failed:",t);}let e=this.resolveWebLogicalDeviceId();return this.cachedLocalDeviceId=e,e}async resolveLocalDeviceName(){if(this.cachedLocalDeviceName)return this.cachedLocalDeviceName;if(await this.canUseTauriIpc())try{let e=await this.invokeIpc("get_rtc_local_device_info"),{deviceName:t}=this.decodeNativeDeviceIdentity(e);if(t){let i=this.normalizeNativeDeviceName(t);return this.cachedLocalDeviceName=i,i}}catch(e){console.warn("[NativeIpcBridge] get_rtc_local_device_info failed:",e);}return this.defaultDeviceNameFallback()}normalizeNativeDeviceName(e){let t=e.trim();if(!t)return this.defaultDeviceNameFallback();if(t==="Desktop Device"){let i=this.defaultDeviceNameFallback();if(i!=="Desktop Device")return i}return t}defaultDeviceNameFallback(){if(typeof window>"u"||typeof navigator>"u")return "Desktop Device";let e=navigator.userAgent||"";return /iPhone|iPad|iPod/i.test(e)?"iPhone":/Android/i.test(e)?"Android":"Desktop Device"}inferNativePlatformTypeFallback(){if(typeof window>"u"||typeof navigator>"u")return "desktop";if(!this.isTauriEnv())return "web";let e=navigator.userAgent||"";return /iPhone|iPad|iPod|Android|Mobile/i.test(e)?"mobile":"desktop"}normalizeNativeCoordinationPlatform(e){let t=e?.trim().toLowerCase()??"";return t==="mobile"||t==="ios"||t==="android"||t.includes("iphone")||t.includes("ipad")||this.inferNativePlatformTypeFallback()==="mobile"?"mobile":"desktop"}withPresenceMetadata(e,t){try{let i=e?JSON.parse(e):{};return JSON.stringify({...i,deviceId:t,plutoVersion:"0.1.0-desktop"})}catch{return JSON.stringify({deviceId:t,plutoVersion:"0.1.0-desktop",rawMetadata:e})}}async searchDevices(e){return this.assertManagedCoordinationGateway(),this.fallback.searchDevices(e)}async listDevicesWithStatus(){return this.assertManagedCoordinationGateway(),(await this.fallback.searchDevices()).map(e=>q(e))}async getPeerSession(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("get_rtc_peer_session",{id:e});return !t||typeof t!="object"?null:r(t)}return this.fallback.getPeerSession(e)}async listPeerSessions(){if(await this.shouldUseTauriSignaling()){let e=await this.invokeIpc("list_rtc_peer_sessions");return (Array.isArray(e)?e:[]).map(t=>r(t))}return this.fallback.listPeerSessions()}async waitForSettledPeer(e,t){if(await this.shouldUseTauriSignaling()){let i=typeof t=="number"?Math.max(v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS,t+1e3):v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS,n=await this.invokeIpc("wait_for_rtc_settled_peer",{id:e,timeoutMs:t},{timeoutMs:i});return !n||typeof n!="object"?null:r(n)}return this.fallback.waitForSettledPeer(e,t)}async resolvePeerConnectionRecords(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("resolve_rtc_peer_connection_records",{id:e});return (Array.isArray(t)?t:[]).map(i=>s(i))}return this.fallback.resolvePeerConnectionRecords(e)}async resolvePeerIdentity(e){if(await this.shouldUseTauriSignaling()){let t=await this.invokeIpc("resolve_rtc_peer_identity",{id:e});return t$1(t)}return this.fallback.resolvePeerIdentity(e)}async setOffline(e){return this.assertManagedCoordinationGateway(),this.fallback.setOffline(e)}async updateDevice(e,t){return this.assertManagedCoordinationGateway(),await this.syncCoordinationDeviceIdentity(),this.fallback.updateDevice(e,t)}async deleteDevice(e){return this.assertManagedCoordinationGateway(),await this.syncCoordinationDeviceIdentity(),this.fallback.deleteDevice(e)}async getLocalDeviceInfo(){if(!await this.canUseTauriIpc()){let e=await this.getLocalDeviceId?.();return e?{deviceId:e,deviceName:this.defaultDeviceNameFallback(),platformType:this.inferNativePlatformTypeFallback()}:null}try{let e=await this.invokeIpc("get_rtc_local_device_info"),t=this.decodeNativeDeviceIdentity(e),{deviceId:i}=t;return i?{deviceId:i,deviceName:this.normalizeNativeDeviceName(t.deviceName),platformType:t.platformType||this.inferNativePlatformTypeFallback(),capabilities:e?.capabilities??void 0,lastSeenAt:typeof e?.last_seen_at=="string"?e.last_seen_at:void 0}:null}catch(e){return console.warn("[NativeIpcBridge] getLocalDeviceInfo failed:",e),null}}async updateLocalDeviceName(e){if(!await this.canUseTauriIpc())return null;try{let t=await this.invokeIpc("update_rtc_local_device_name",{deviceName:e}),i=this.decodeNativeDeviceIdentity(t),{deviceId:n}=i;return n?(this.cachedLocalDeviceName=this.normalizeNativeDeviceName(e),{deviceId:n,deviceName:this.cachedLocalDeviceName,platformType:i.platformType||this.inferNativePlatformTypeFallback(),capabilities:t?.capabilities??void 0,lastSeenAt:typeof t?.last_seen_at=="string"?t.last_seen_at:void 0}):null}catch(t){return console.warn("[NativeIpcBridge] updateLocalDeviceName failed:",t),null}}async startManagedSessionNative(e){if(this.assertManagedCoordinationGateway(),!await this.shouldUseTauriSignaling())throw new Error("[pluto-rtc] Native IPC unavailable for startManagedSessionNative().");if(!await this.ensureNativeAuth("startManagedSessionNative",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for startManagedSessionNative");let i=this.resolveNativeSignalingUserId(e.userId);if(!i)throw new Error("Native managed session startup requires a runtime auth-scoped user id.");i!==e.userId&&console.info("[NativeIpcBridge][managed-session][user-id-remap]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i});let n=this.resolveConfiguredSpaceKey();console.info("[NativeIpcBridge][managed-session][start-request]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i,spaceKey:n?"[configured]":null,deviceName:e.deviceName??null,localDeviceId:e.localDeviceId??null,presence:e.presence!==false,autoConnect:e.autoConnect!==false,hasMetadata:typeof e.metadata=="string"&&e.metadata.trim().length>0});let r=await this.buildNativeTransportConfigPayload(),c={userId:i,deviceName:e.deviceName??null,localDeviceId:e.localDeviceId??null,metadata:e.metadata??null,...r?{transports:r}:{},autoConnect:false,presence:false,apiKey:this.options.apiKey??null,spaceKey:n||null},a=await this.invokeIpc("start_rtc_managed_session",c,{timeoutMs:null});this.syncNativeRuntimeCapabilities("managed-session-started");let h=typeof a?.ticket=="string"&&a.ticket.trim().length>0?a.ticket.trim():null,o=a?.localDevice&&typeof a.localDevice=="object"?a.localDevice:a?.local_device&&typeof a.local_device=="object"?a.local_device:null,l=o?{deviceId:typeof o.deviceId=="string"?o.deviceId:typeof o.device_id=="string"?o.device_id:"",deviceName:this.normalizeNativeDeviceName(typeof o.deviceName=="string"?o.deviceName:typeof o.device_name=="string"?o.device_name:""),platformType:typeof o.platformType=="string"?o.platformType:typeof o.platform_type=="string"?o.platform_type:"desktop",capabilities:o.capabilities??void 0,lastSeenAt:typeof o.lastSeenAt=="string"?o.lastSeenAt:typeof o.last_seen_at=="string"?o.last_seen_at:void 0}:null,s={localNodeId:typeof a?.localNodeId=="string"?a.localNodeId:typeof a?.local_node_id=="string"?a.local_node_id:null,ticket:h,ticketScope:typeof a?.ticketScope=="string"?a.ticketScope:typeof a?.ticket_scope=="string"?a.ticket_scope:null,presenceStarted:typeof a?.presenceStarted=="boolean"?a.presenceStarted:!!a?.presence_started,autoConnectStarted:typeof a?.autoConnectStarted=="boolean"?a.autoConnectStarted:!!a?.auto_connect_started,localDevice:l?.deviceId?l:null};if(this.usesCoordinationGateway()){e.presence!==false&&!s.ticket&&(s.ticket=await this.getEndpointTicketWithToken("user-device",0),s.ticketScope=s.ticket?"user-device":null);let u=s.localDevice?.deviceId||e.localDeviceId?.trim()||await this.resolveLocalDeviceId();if(u&&this.fallback.setCoordinationLocalDeviceId(u),this.fallback.setCoordinationPlatformType(this.normalizeNativeCoordinationPlatform(s.localDevice?.platformType)),e.presence!==false){if(!s.localNodeId||!s.ticket)throw new Error("Native managed session did not return the node identity required for gateway presence.");await this.fallback.updatePresence(s.localNodeId,s.ticket,true,3e5,e.metadata,s.localDevice?.deviceName||e.deviceName),s.presenceStarted=true;}else s.presenceStarted=false;e.autoConnect!==false&&u?(await this.startGatewayAutoConnect(i,u),s.autoConnectStarted=true):s.autoConnectStarted=false;}return console.info("[NativeIpcBridge][managed-session][ipc-started]",{requestedUserId:e.userId,runtimeUserId:this.currentUser?.id??this.getAuthContext()?.userId??null,effectiveUserId:i,localNodeId:s.localNodeId,ticketScope:s.ticketScope,presenceStarted:s.presenceStarted,autoConnectStarted:s.autoConnectStarted,localDeviceId:s.localDevice?.deviceId??null}),s}async reconcileNativeManagedSession(e){return this.assertManagedCoordinationGateway(),console.info("[NativeIpcBridge] gateway coordination survives host resume; native transport reconciliation is event-driven.",{reason:e?.reason??"frontend"}),null}async notifyNetworkChange(e){return await this.canUseTauriIpc()?(c("[NativeIpcBridge] forwarding host network-change hint",{reason:e?.reason??"host"}),this.invokeIpc("notify_rtc_network_change")):null}async getManagedNodeId(e){let t=e?.initializeIfMissing??true;console.info("[NativeIpcBridge][getManagedNodeId] enter",{initializeIfMissing:t});let i=await this.canUseTauriIpc();if(console.info("[NativeIpcBridge][getManagedNodeId] canUseTauriIpc",{canUse:i}),!i)return null;try{console.info("[NativeIpcBridge][getManagedNodeId] invoking get_iroh_node_id");let n=await this.invokeIpc("get_iroh_node_id");if(console.info("[NativeIpcBridge][getManagedNodeId] get_iroh_node_id returned",{existing:n}),n||!t)return n;console.info("[NativeIpcBridge][getManagedNodeId] invoking start_iroh_node");let r=await this.invokeIpc("start_iroh_node");return console.info("[NativeIpcBridge][getManagedNodeId] start_iroh_node returned",{started:r}),r}catch(n){if(console.warn("[NativeIpcBridge] getManagedNodeId failed:",n),!t)return null;throw n}}async getEndpointTicket(){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] getEndpointTicket requires native IPC in Tauri runtime.");return E(()=>this.invokeIpc("get_iroh_endpoint_ticket"))}async connectToDevice(e){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] connectToDevice requires native IPC in Tauri runtime.");this.options.authMode!=="anonymous"?await this.ensureNativeAuth("connectToDevice",{requireToken:true,maxWaitMs:v.AUTH_REQUIRED_WAIT_MS}):c("[NativeIpcBridge] connectToDevice using anonymous native ticket path");let t=Math.max(1,Math.floor(e.timeoutMs??v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS));return this.invokeIpc("connect_to_device",{deviceId:e.deviceId??null,endpointTicket:e.endpointTicket,timeoutMs:t},{timeoutMs:t+1e3})}async registerSessionToken(e,t,i){await this.canUseTauriIpc()&&await this.invokeIpc("register_session_token",{token:e,scope:t,maxConnections:i});}async getEndpointTicketWithToken(e,t){if(!await this.canUseTauriIpc())return null;try{return await E(()=>this.invokeIpc("get_endpoint_ticket_with_token",{scope:e,maxConnections:t}))}catch{return null}}async validateSessionToken(e,t){if(!await this.canUseTauriIpc())return null;try{return await this.invokeIpc("validate_session_token",{token:e,connectionId:t??null})}catch{return null}}async revokeSessionTokensByScope(e){if(n("NativeIpcBridge.revokeSessionTokensByScope",{grantScope:e}),!await this.canUseTauriIpc())return [];try{return await this.invokeIpc("revoke_session_tokens_by_scope",{scope:e})}catch{return []}}async disconnectDevice(e){if(!await this.canUseTauriIpc())throw new Error("[pluto-rtc] disconnectDevice requires native IPC in Tauri runtime.");await this.invokeIpc("disconnect_device",{deviceId:e});}async setAutoConnectExcluded(e,t){if(!await this.canUseTauriIpc())return;let i=e.trim().toLowerCase();i&&(this.usesCoordinationGateway()&&(t?this.gatewayExcludedPeers.add(i):this.gatewayExcludedPeers.delete(i)),await this.invokeIpc(this.usesCoordinationGateway()?"set_rtc_external_auto_connect_excluded":"set_auto_connect_excluded",{deviceId:e,excluded:t}),this.usesCoordinationGateway()&&await this.fallback.setCoordinationExcludedPeers([...this.gatewayExcludedPeers].sort()));}onDevicesChange(e,t){return this.assertManagedCoordinationGateway(),this.fallback.onDevicesChange(e,t)}async subscribeDevices(e){return this.assertManagedCoordinationGateway(),this.fallback.subscribeDevices(e)}async subscribeSessions(e){return this.assertManagedCoordinationGateway(),this.fallback.subscribeSessions(e)}async getLocalDeviceId(){return this.resolveLocalDeviceId()}async updatePresence(e,t,i=true,n=3e5,r){return this.assertManagedCoordinationGateway(),await this.syncCoordinationDeviceIdentity(),this.fallback.updatePresence(e,t,i,n,r)}startAutoConnect(e,t){this.assertManagedCoordinationGateway(),this.startGatewayAutoConnect(e,t).catch(i=>{console.warn("[NativeIpcBridge] gateway auto-connect failed:",i);});}forceReconnectSnapshot(){this.assertManagedCoordinationGateway(),this.fallback.forceReconnectSnapshot();}startPresenceLoop(e,t,i,n,r){this.assertManagedCoordinationGateway(),this.syncCoordinationDeviceIdentity().then(()=>this.fallback.startPresenceLoop(e,t,i,n,r)).catch(c=>{console.warn("[NativeIpcBridge] gateway presence failed:",c);});}async startAutoConnectOnce(e,t){this.assertManagedCoordinationGateway(),await this.startGatewayAutoConnect(e,t);}async clearGatewayDesiredPeerRelay(){let e=this.gatewayDesiredPeerSubmission;this.gatewayDesiredPeerRelayGeneration+=1,this.gatewayDesiredPeersCleanup?.(),this.gatewayDesiredPeersCleanup=null,this.gatewayDesiredPeerRelayKey=null,this.gatewayDesiredPeerRevision=0,this.gatewayDesiredPeerSubmission=Promise.resolve(),await e;}serializeGatewayDesiredPeerLifecycle(e){let t=this.gatewayDesiredPeerLifecycle.then(e);return this.gatewayDesiredPeerLifecycle=t.catch(()=>{}),t}stopGatewayDesiredPeerRelay(){return this.serializeGatewayDesiredPeerLifecycle(async()=>{await this.clearGatewayDesiredPeerRelay();})}startGatewayAutoConnect(e,t){return this.serializeGatewayDesiredPeerLifecycle(()=>this.startGatewayAutoConnectSerialized(e,t))}async startGatewayAutoConnectSerialized(e,t){if(!await this.shouldUseTauriSignaling())throw new Error("[openrtc] Native IPC unavailable for coordination gateway auto-connect.");if(!await this.ensureNativeAuth("startGatewayAutoConnect",{requireToken:this.requiresNativeAuthToken(),maxWaitMs:this.nativeAuthWaitMs()}))throw new Error("Native auth token unavailable for coordination gateway auto-connect");let n=this.resolveNativeSignalingUserId(e);if(!n)throw new Error("Coordination gateway auto-connect requires an authenticated user id.");let r=await this.resolveLocalDeviceId()||t.trim();if(!r)throw new Error("Coordination gateway auto-connect requires a local device id.");let c=JSON.stringify([n,r]);this.fallback.setCoordinationLocalDeviceId(r);let a=this.gatewayDesiredPeerRelayKey===c&&this.gatewayDesiredPeersCleanup;if(a||(await this.clearGatewayDesiredPeerRelay(),this.gatewayDesiredPeerRelayKey=c),await this.invokeIpc("start_rtc_external_auto_connect",{userId:n,localDeviceId:r}),a)return;let h=this.gatewayDesiredPeerRelayGeneration;this.gatewayDesiredPeersCleanup=this.fallback.onDevicesChange(o=>{let l=o.map(u=>({deviceId:String(u.deviceId??"").trim(),nodeId:typeof u.nodeId=="string"&&u.nodeId.trim()||null,ticket:typeof u.ticket=="string"&&u.ticket.trim()||null,online:u.online===true,sessionId:typeof u.sessionId=="string"&&u.sessionId.trim()||null,excludedPeers:Array.isArray(u.excludedPeers)?[...new Set(u.excludedPeers.map(I=>String(I??"").trim().toLowerCase()).filter(Boolean))].sort():[]})).filter(u=>u.deviceId.length>0&&u.deviceId!==r).sort((u,I)=>u.deviceId.localeCompare(I.deviceId)),s=++this.gatewayDesiredPeerRevision;this.gatewayDesiredPeerSubmission=this.gatewayDesiredPeerSubmission.then(async()=>{this.gatewayDesiredPeerRelayGeneration!==h||this.gatewayDesiredPeerRelayKey!==c||await this.invokeIpc("submit_rtc_desired_peers",{revision:s,peersJson:JSON.stringify(l)});}).catch(u=>{console.warn("[NativeIpcBridge] failed to relay gateway desired peers to Rust:",{revision:s,error:u});});},r);}async startPresenceLoopOnce(e,t,i,n,r){this.assertManagedCoordinationGateway(),await this.syncCoordinationDeviceIdentity(),await this.fallback.startPresenceLoop(e,t,i,n,r);}shouldUseResolvedDeviceName(e){let t=e.trim();return t.length===0||t==="Unknown Device"||t==="Desktop Device"}async sendExplicitFilePath(e,t,i=""){if(c("[NativeIpcBridge] sendExplicitFilePath start",{connectionId:e,filePath:t,transferId:i||null,authMode:this.options.authMode}),await this.canUseTauriIpc()){this.options.authMode!=="anonymous"?await this.ensureNativeAuth("sendExplicitFilePath"):c("[NativeIpcBridge] sendExplicitFilePath using anonymous native path");let n=await this.invokeIpc("send_file",{connectionId:e,filePath:t,transferId:i});return c("[NativeIpcBridge] sendExplicitFilePath completed",{connectionId:e,transferId:i||null,result:n}),n}return this.fallback.sendExplicitFilePath(e,t,i)}async sendExplicitFileData(e){c("[NativeIpcBridge] sendExplicitFileData start",{connectionId:e.connectionId??null,connectionRemoteNodeId:e.connection?.remoteNodeId??null,remoteNodeId:e.remoteNodeId??null,transferId:e.transferId??null,fileName:e.file.name,fileSize:e.file.size,authMode:this.options.authMode});let t=e.applicationCrypto??this.options.applicationCrypto;if(await this.canUseTauriIpc()){this.options.authMode!=="anonymous"?await this.ensureNativeAuth("sendExplicitFileData"):c("[NativeIpcBridge] sendExplicitFileData using anonymous native path");let i=e.connectionId||e.connection?.deviceId||e.connection?.remoteNodeId||e.remoteNodeId||"";if(!i)throw new Error("sendExplicitFileData requires a settled peer identifier in native runtime");let n=new Uint8Array(await e.file.arrayBuffer());await this.invokeIpc("send_file_data",{connectionId:i,filename:e.file.name,data:Array.from(n),transferId:e.transferId}),c("[NativeIpcBridge] sendExplicitFileData completed",{connectionId:i,transferId:e.transferId??null,fileName:e.file.name,fileSize:e.file.size});return}return this.fallback.sendExplicitFileData({...e,applicationCrypto:t})}async getConnectionStates(){if(await this.canUseTauriIpc())try{this.options.authMode!=="anonymous"&&await this.ensureNativeAuth("getConnectionStates");let e=await this.invokeIpc("list_rtc_connection_states");return (Array.isArray(e)?e:[]).map(t=>u$1(t)).filter(t=>!!t)}catch(e){return A(e)?c("[NativeIpcBridge] native connection-state replay unavailable; continuing without replay. Install/register openrtc-tauri-plugin default permissions to enable it."):console.warn("[NativeIpcBridge] Failed to fetch native connection states:",e),[]}return []}async getConnectionState(e){let t=e.trim();if(!t||!await this.canUseTauriIpc())return null;try{return this.options.authMode!=="anonymous"&&await this.ensureNativeAuth("getConnectionState"),u$1(await this.invokeIpc("get_rtc_connection_state",{connectionId:t}))}catch(i){return console.warn("[NativeIpcBridge] Failed to fetch native connection state:",{connectionId:t,error:i}),null}}async onConnectionStateChange(e){let t=false,i=null,n=new Map,r=Date.now(),c=0,a=()=>{let l=i;l&&Promise.resolve(l());},h=async()=>{try{let l=await this.getConnectionStates();l.length>0&&(b("[NativeIpcBridge] replaying current native connection states",l.map(s=>({connectionId:s.connectionId,deviceId:s.deviceId??null,deviceIdHint:s.deviceIdHint??null,remoteNodeId:s.remoteNodeId??null,state:s.state,transportState:s.transportState??null,protocolState:s.protocolState??null,routable:s.routable??null}))),l.forEach(s=>e(s)));}catch(l){console.warn("[NativeIpcBridge] Failed to replay native connection states after event subscription:",l);}},o=async l=>{let s=(n.get(l)??0)+1;n.set(l,s);let u$1=await this.getConnectionState(l);if(!u$1||t||n.get(l)!==s)return;if(["closed","failed","disconnected"].includes(String(u$1.state??"").trim().toLowerCase())){if(await u(v.CONNECTION_TERMINAL_CONFIRMATION_MS),t||n.get(l)!==s)return;u$1=await this.getConnectionState(l)??u$1;}!t&&n.get(l)===s&&e(u$1);};for(;!t&&Date.now()-r<=v.CONNECTION_EVENT_SUBSCRIBE_WINDOW_MS;){if(c+=1,!await this.canUseTauriIpc()){await u(this.nextConnectionEventRetryDelayMs(c));continue}return i=await this.listenIpc("connection-state-changed",l=>{let s=u$1(l?.payload);s&&(b("[NativeIpcBridge] connection-state-changed trigger",{connectionId:s.connectionId}),o(s.connectionId));}),await h(),()=>{t=true,a();}}return ()=>{t=true,a();}}async onIncomingNativeMessage(e){if(!await this.canUseTauriIpc())return ()=>{};let t=await this.listenIpc("iroh://message",i=>{if(i?.payload?.data&&i.payload.streamId==="main")try{let n=new Uint8Array(i.payload.data);if(n.length<2||n[0]!==0)return;let c=n.slice(1),a=new TextDecoder().decode(c),h=JSON.parse(a);e(i.payload.connectionId,i.payload.remoteNodeId??null,h);}catch{}});return typeof t=="function"?t:()=>{}}async getTransferHistory(e=50){return await this.canUseTauriIpc()?this.invokeIpc("get_transfer_history",{limit:e}):[]}async deleteTransferJob(e){await this.canUseTauriIpc()&&await this.invokeIpc("delete_transfer_job",{jobId:e});}};v.AUTH_REQUIRED_WAIT_MS=v$1.nativeIpc.authRequiredWaitMs,v.DEFAULT_BOUNDED_IPC_TIMEOUT_MS=v$1.nativeIpc.defaultBoundedCommandTimeoutMs,v.CONNECTION_EVENT_SUBSCRIBE_WINDOW_MS=v$1.nativeIpc.connectionEventSubscribeWindowMs,v.CONNECTION_EVENT_RETRY_MIN_DELAY_MS=v$1.nativeIpc.connectionEventRetryMinDelayMs,v.CONNECTION_EVENT_RETRY_MAX_DELAY_MS=v$1.nativeIpc.connectionEventRetryMaxDelayMs,v.CONNECTION_TERMINAL_CONFIRMATION_MS=1500,v.TAURI_IPC_NEGATIVE_CACHE_MS=v$1.nativeIpc.tauriIpcNegativeCacheMs,v.NATIVE_STATUS_IPC_TIMEOUT_MS=2500;var D=v;var H=class extends E$1{constructor(e){let t=k(e.bridge,"IpcRuntimeAdapter");super(new D({...e,ipcBridge:t,allowWasmFallback:e.allowWasmFallback??false}));}};
2
+ export{Y as a,j as b,J as c,E as d,Q as e,A as f,$ as g,H as h};