PageSourceSearch

https://1wqdhu.life/resources/v1/app/assets/socket-io-adapter-Cz7Hnc3D.js

js 1wqdhu.life collected 2026-10-10 02:38:05 UTC 1,477 bytes, 1 lines download raw bytes

1import{defineComponent as m,provide as u,inject as h,toValue as r}from"vue";import{cy as f,Y as l}from"./logger-B4OCWT-4.js";import{d as k}from"./test-manager-DesYLJOQ.js";const c=Symbol();m({props:["adapter"],setup(o,{slots:t}){return u(c,o.adapter),()=>t.default?.()}});const w={install:(o,t)=>{o.provide(c,t.adapter),f(()=>[r(t.enabled),r(t.connectionKey)],(e,n)=>{const[s,d]=e,[i,p]=n??[];s&&!i?t.adapter.connect():i&&!s?t.adapter.disconnect():s&&d!=p&&t.adapter.reconnect()})}},S=()=>{const o=h(c);if(o===void 0)throw new Error("ServerUpdatesContext is missing");return o},a={path:"/v4/socket.io",autoConnect:!1,timeout:1e4,transports:["websocket"],forceNew:!0,reconnection:!0,withCredentials:!0};class b{socket;emitter;options;async connect(){(await this.#t()).connect()}async disconnect(){(await this.#t()).disconnect()}reconnect(){this.disconnect(),this.connect()}async#t(){if(!this.socket){const{io:t}=await l(async()=>{const{io:e}=await __retry_dynamic_loader__(()=>import("./index-DnBibYSk.js"));return{io:e}},[]);this.socket=t({...a,...this.options,query:{...a.query,...this.options.query,Language:"en"}}),this.socket.on("a",({type:e,...n})=>{this.emitter.emit(e,n?.data??n),this.emitter.emit("any",{type:e,...n}),e==="disconnect"&&n.status===500&&(this.socket?.disconnect(),this.socket?.connect())})}return this.socket}constructor(t){this.options=t,this.emitter=k()}on(t,e){return this.emitter.on(t,e)}off(t,e){this.emitter.off(t,e)}}export{w as S,b as a,S as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.