1import{c as E,d as be}from"./@babel-e89a8ea1.js";import{r as ue}from"./react-18a3c9df.js";import{r as ye}from"./react-dom-db3eb397.js";var Se={},D={},N={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEventSourceSupported=e.isReactNative=e.ReadyState=e.DEFAULT_HEARTBEAT=e.UNPARSABLE_JSON_OBJECT=e.DEFAULT_RECONNECT_INTERVAL_MS=e.DEFAULT_RECONNECT_LIMIT=e.SOCKET_IO_PING_CODE=e.SOCKET_IO_PATH=e.SOCKET_IO_PING_INTERVAL=e.DEFAULT_EVENT_SOURCE_OPTIONS=e.EMPTY_EVENT_HANDLERS=e.DEFAULT_OPTIONS=void 0;var r=1,t=1e3*r;e.DEFAULT_OPTIONS={},e.EMPTY_EVENT_HANDLERS={},e.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:e.EMPTY_EVENT_HANDLERS},e.SOCKET_IO_PING_INTERVAL=25*t,e.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",e.SOCKET_IO_PING_CODE="2",e.DEFAULT_RECONNECT_LIMIT=20,e.DEFAULT_RECONNECT_INTERVAL_MS=5e3,e.UNPARSABLE_JSON_OBJECT={},e.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3};var a;(function(c){c[c.UNINSTANTIATED=-1]="UNINSTANTIATED",c[c.CONNECTING=0]="CONNECTING",c[c.OPEN=1]="OPEN",c[c.CLOSING=2]="CLOSING",c[c.CLOSED=3]="CLOSED"})(a||(e.ReadyState=a={}));var n=function(){try{return"EventSource"in globalThis}catch{return!1}};e.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",e.isEventSourceSupported=!e.isReactNative&&n()})(N);var Q={},Y={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetWebSockets=e.sharedWebSockets=void 0,e.sharedWebSockets={};var r=function(t){if(t&&e.sharedWebSockets.hasOwnProperty(t))delete e.sharedWebSockets[t];else for(var a in e.sharedWebSockets)e.sharedWebSockets.hasOwnProperty(a)&&delete e.sharedWebSockets[a]};e.resetWebSockets=r})(Y);var q={},I={};Object.defineProperty(I,"__esModule",{value:!0});I.setUpSocketIOPing=I.appendQueryParams=I.parseSocketIOUrl=void 0;var J=N,he=function(e){if(e){var r=/^https|wss/.test(e),t=e.replace(/^(https?|wss?)(:\/\/)?/,""),a=t.replace(/\/$/,""),n=r?"wss":"ws";return"".concat(n,"://").concat(a).concat(J.SOCKET_IO_PATH)}else if(e===""){var r=/^https/.test(window.location.protocol),n=r?"wss":"ws",c=window.location.port?":".concat(window.location.port):"";return"".concat(n,"://").concat(window.location.hostname).concat(c).concat(J.SOCKET_IO_PATH)}return e};I.parseSocketIOUrl=he;var ge=function(e,r){r===void 0&&(r={});var t=/\?([\w]+=[\w]+)/,a=t.test(e),n="".concat(Object.entries(r).reduce(function(c,l){var d=l[0],s=l[1];return c+"".concat(d,"=").concat(s,"&")},"").slice(0,-1));return"".concat(e).concat(a?"&":"?").concat(n)};I.appendQueryParams=ge;var Te=function(e,r){r===void 0&&(r=J.SOCKET_IO_PING_INTERVAL);var t=function(){return e(J.SOCKET_IO_PING_CODE)};return window.setInterval(t,r)};I.setUpSocketIOPing=Te;var z={};Object.defineProperty(z,"__esModule",{value:!0});z.heartbeat=me;var te=N;function Ne(e){return Array.isArray(e)?e.reduce(function(r,t){return r.current>t.current?r:t}).current:e.current}function me(e,r,t){var a=t||{},n=a.interval,c=n===void 0?te.DEFAULT_HEARTBEAT.interval:n,l=a.timeout,d=l===void 0?te.DEFAULT_HEARTBEAT.timeout:l,s=a.message,u=s===void 0?te.DEFAULT_HEARTBEAT.message:s,o=Math.max(100,c/10),v=Date.now(),S=setInterval(function(){var i=Date.now(),_=Ne(r);if(_+d<=i)console.warn("Heartbeat timed out, closing connection, last message received ".concat(i-_,"ms ago, last ping sent ").concat(i-v,"ms ago")),e.close();else if(_+c<=i&&v+c<=i)try{typeof u=="function"?e.send(u()):e.send(u),v=i}catch(y){console.error("Heartbeat failed, closing connection",y instanceof Error?y.message:y),e.close()}},o);return e.addEventListener("close",function(){clearInterval(S)}),function(){}}var W={},X={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetSubscribers=e.removeSubscriber=e.addSubscriber=e.hasSubscribers=e.getSubscribers=void 0;var r={},t=[],a=function(s){return(0,e.hasSubscribers)(s)?Array.from(r[s]):t};e.getSubscribers=a;var n=function(s){var u;return((u=r[s])===null||u===void 0?void 0:u.size)>0};e.hasSubscribers=n;var c=function(s,u){r[s]=r[s]||new Set,r[s].add(u)};e.addSubscriber=c;var l=function(s,u){r[s].delete(u)};e.removeSubscriber=l;var d=function(s){if(s&&r.hasOwnProperty(s))delete r[s];else for(var u in r)r.hasOwnProperty(u)&&delete r[u]};e.resetSubscribers=d})(X);
1Object.defineProperty(W,"__esModule",{value:!0});W.assertIsWebSocket=Ie;W.resetGlobalState=Ae;var we=Y,Ce=X;function Ie(e,r){if(!r&&!(e instanceof WebSocket))throw new Error("")}function Ae(e){(0,Ce.resetSubscribers)(e),(0,we.resetWebSockets)(e)}var G=E&&E.__assign||function(){return G=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G.apply(this,arguments)};Object.defineProperty(q,"__esModule",{value:!0});q.attachListeners=void 0;var Pe=I,ke=z,C=N,Me=W,Le=function(e,r,t,a){e.onmessage=function(n){var c;r.current.onMessage&&r.current.onMessage(n),typeof(a==null?void 0:a.current)=="number"&&(a.current=Date.now()),!(typeof r.current.filter=="function"&&r.current.filter(n)!==!0)&&(r.current.heartbeat&&typeof r.current.heartbeat!="boolean"&&((c=r.current.heartbeat)===null||c===void 0?void 0:c.returnMessage)===n.data||t(n))}},pe=function(e,r,t,a,n){e.onopen=function(c){if(r.current.onOpen&&r.current.onOpen(c),a.current=0,t(C.ReadyState.OPEN),r.current.heartbeat&&e instanceof WebSocket){var l=typeof r.current.heartbeat=="boolean"?void 0:r.current.heartbeat;n.current=Date.now(),(0,ke.heartbeat)(e,n,l)}}},De=function(e,r,t,a,n){if(C.isEventSourceSupported&&e instanceof EventSource)return function(){};(0,Me.assertIsWebSocket)(e,r.current.skipAssert);var c;return e.onclose=function(l){var d;if(r.current.onClose&&r.current.onClose(l),t(C.ReadyState.CLOSED),r.current.shouldReconnect&&r.current.shouldReconnect(l)){var s=(d=r.current.reconnectAttempts)!==null&&d!==void 0?d:C.DEFAULT_RECONNECT_LIMIT;if(n.current<s){var u=typeof r.current.reconnectInterval=="function"?r.current.reconnectInterval(n.current):r.current.reconnectInterval;c=window.setTimeout(function(){n.current++,a()},u??C.DEFAULT_RECONNECT_INTERVAL_MS)}else r.current.onReconnectStop&&r.current.onReconnectStop(s),console.warn("Max reconnect attempts of ".concat(s," exceeded"))}},function(){return c&&window.clearTimeout(c)}},We=function(e,r,t,a,n){var c;return e.onerror=function(l){var d;if(r.current.onError&&r.current.onError(l),C.isEventSourceSupported&&e instanceof EventSource&&(r.current.onClose&&r.current.onClose(G(G({},l),{code:1006,reason:"An error occurred with the EventSource: ".concat(l),wasClean:!1})),t(C.ReadyState.CLOSED),e.close()),r.current.retryOnError)if(n.current<((d=r.current.reconnectAttempts)!==null&&d!==void 0?d:C.DEFAULT_RECONNECT_LIMIT)){var s=typeof r.current.reconnectInterval=="function"?r.current.reconnectInterval(n.current):r.current.reconnectInterval;c=window.setTimeout(function(){n.current++,a()},s??C.DEFAULT_RECONNECT_INTERVAL_MS)}else r.current.onReconnectStop&&r.current.onReconnectStop(r.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(r.current.reconnectAttempts," exceeded"))},function(){return c&&window.clearTimeout(c)}},Ue=function(e,r,t,a,n,c,l){var d=r.setLastMessage,s=r.setReadyState,u,o,v;return t.current.fromSocketIO&&(u=(0,Pe.setUpSocketIOPing)(l)),Le(e,t,d,c),pe(e,t,s,n,c),o=De(e,t,s,a,n),v=We(e,t,s,a,n),function(){s(C.ReadyState.CLOSING),o(),v(),e.close(),u&&clearInterval(u)}};q.attachListeners=Ue;var Z={},V=E&&E.__assign||function(){return V=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)};Object.defineProperty(Z,"__esModule",{value:!0});Z.attachSharedListeners=void 0;var je=Y,M=N,$=X,Re=I,$e=z,Fe=function(e,r,t){e.onmessage=function(a){(0,$.getSubscribers)(r).forEach(function(n){var c;n.optionsRef.current.onMessage&&n.optionsRef.current.onMessage(a),typeof((c=n==null?void 0:n.lastMessageTime)===null||c===void 0?void 0:c.current)=="number"&&(n.lastMessageTime.current=Date.now()),!(typeof n.optionsRef.current.filter=="function"&&n.optionsRef.current.filter(a)!==!0)&&(t&&typeof t!="boolean"&&(t==null?void 0:t.returnMessage)===a.data||n.setLastMessage(a))})}},He=function(e,r,t){e.onopen=function(a){var n=(0,$.getSubscribers)(r);n.forEach(function(c){c.reconnectCount.current=0,c.optionsRef.current.onOpen&&c.optionsRef.current.onOpen(a),c.setReadyState(M.ReadyState.OPEN),t&&e instanceof WebSocket&&(c.lastMessageTime.current=Date.now())}),t&&e instanceof WebSocket&&(0,$e.heartbeat)(e,n.map(function(c){return c.lastMessageTime}),typeof t=="boolean"?void 0:t)}},Je=function(e,r){e instanceof WebSocket&&(e.onclose=function(t){(0,$.getSubscribers)(r).forEach(function(a){a.optionsRef.current.onClose&&a.optionsRef.current.onClose(t),a.setReadyState(M.ReadyState.CLOSED)}),delete je.sharedWebSockets[r],(0,$.getSubscribers)(r).forEach(function(a){var n;if(a.optionsRef.current.shouldReconnect&&a.optionsRef.current.shouldReconnect(t)){var c=(n=a.optionsRef.current.reconnectAttempts)!==null&&n!==void 0?n:M.DEFAULT_RECONNECT_LIMIT;if(a.reconnectCount.current<c){var l=typeof a.optionsRef.current.reconnectInterval=="function"?a.optionsRef.current.reconnectInterval(a.reconnectCount.current):a.optionsRef.current.reconnectInterval;setTimeout(function(){a.reconnectCount.current++,a.reconnect.current()},l??M.DEFAULT_RECONNECT_INTERVAL_MS)}else a.optionsRef.current.onReconnectStop&&a.optionsRef.current.onReconnectStop(a.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(c," exceeded"))}})})},Ge=function(e,r){e.onerror=function(t){(0,$.getSubscribers)(r).forEach(function(a){a.optionsRef.current.onError&&a.optionsRef.current.onError(t),M.isEventSourceSupp
1orted&&e instanceof EventSource&&(a.optionsRef.current.onClose&&a.optionsRef.current.onClose(V(V({},t),{code:1006,reason:"An error occurred with the EventSource: ".concat(t),wasClean:!1})),a.setReadyState(M.ReadyState.CLOSED))}),M.isEventSourceSupported&&e instanceof EventSource&&e.close()}},Ve=function(e,r,t,a){var n;return t.current.fromSocketIO&&(n=(0,Re.setUpSocketIOPing)(a)),Fe(e,r,t.current.heartbeat),Je(e,r),He(e,r,t.current.heartbeat),Ge(e,r),function(){n&&clearInterval(n)}};Z.attachSharedListeners=Ve;Object.defineProperty(Q,"__esModule",{value:!0});Q.createOrJoinSocket=void 0;var P=Y,R=N,Be=q,Ke=Z,ce=X,Qe=function(e,r,t,a,n){return function(){if((0,ce.removeSubscriber)(e,r),!(0,ce.hasSubscribers)(e)){try{var c=P.sharedWebSockets[e];c instanceof WebSocket&&(c.onclose=function(l){t.current.onClose&&t.current.onClose(l),a(R.ReadyState.CLOSED)}),c.close()}catch{}n&&n(),delete P.sharedWebSockets[e]}}},Ye=function(e,r,t,a,n,c,l,d,s){if(!R.isEventSourceSupported&&a.current.eventSourceOptions)throw R.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(a.current.share){var u=null;P.sharedWebSockets[r]===void 0?(P.sharedWebSockets[r]=a.current.eventSourceOptions?new EventSource(r,a.current.eventSourceOptions):new WebSocket(r,a.current.protocols),e.current=P.sharedWebSockets[r],t(R.ReadyState.CONNECTING),u=(0,Ke.attachSharedListeners)(P.sharedWebSockets[r],r,a,s)):(e.current=P.sharedWebSockets[r],t(P.sharedWebSockets[r].readyState));var o={setLastMessage:n,setReadyState:t,optionsRef:a,reconnectCount:l,lastMessageTime:d,reconnect:c};return(0,ce.addSubscriber)(r,o),Qe(r,o,a,t,u)}else{if(e.current=a.current.eventSourceOptions?new EventSource(r,a.current.eventSourceOptions):new WebSocket(r,a.current.protocols),t(R.ReadyState.CONNECTING),!e.current)throw new Error("WebSocket failed to be created");return(0,Be.attachListeners)(e.current,{setLastMessage:n,setReadyState:t},a,c.current,l,d,s)}};Q.createOrJoinSocket=Ye;var _e={};(function(e){var r=E&&E.__awaiter||function(s,u,o,v){function S(i){return i instanceof o?i:new o(function(_){_(i)})}return new(o||(o=Promise))(function(i,_){function y(b){try{f(v.next(b))}catch(A){_(A)}}function g(b){try{f(v.throw(b))}catch(A){_(A)}}function f(b){b.done?i(b.value):S(b.value).then(y,g)}f((v=v.apply(s,u||[])).next())})},t=E&&E.__generator||function(s,u){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},v,S,i,_=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return _.next=y(0),_.throw=y(1),_.return=y(2),typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function y(f){return function(b){return g([f,b])}}function g(f){if(v)throw new TypeError("Generator is already executing.");for(;_&&(_=0,f[0]&&(o=0)),o;)try{if(v=1,S&&(i=f[0]&2?S.return:f[0]?S.throw||((i=S.return)&&i.call(S),0):S.next)&&!(i=i.call(S,f[1])).done)return i;switch(S=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,S=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(f[0]===6&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=u.call(s,o)}catch(b){f=[6,b],S=0}finally{v=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},a=E&&E.__spreadArray||function(s,u,o){if(o||arguments.length===2)for(var v=0,S=u.length,i;v<S;v++)(i||!(v in u))&&(i||(i=Array.prototype.slice.call(u,0,v)),i[v]=u[v]);return s.concat(i||Array.prototype.slice.call(u))};Object.defineProperty(e,"__esModule",{value:!0}),e.getUrl=void 0;var n=I,c=N,l=function(s){return new Promise(function(u){return window.setTimeout(u,s)})},d=function(s,u){for(var o=[],v=2;v<arguments.length;v++)o[v-2]=arguments[v];return r(void 0,a([s,u],o,!0),void 0,function(S,i,_){var y,g,f,b,A,m,F,U;return _===void 0&&(_=0),t(this,function(O){switch(O.label){case 0:if(typeof S!="function")return[3,10];O.label=1;case 1:return O.trys.push([1,3,,9]),[4,S()];case 2:return y=O.sent(),[3,9];case 3:return O.sent(),i.current.retryOnError?(g=(m=i.current.reconnectAttempts)!==null&&m!==void 0?m:c.DEFAULT_RECONNECT_LIMIT,_<g?(f=typeof i.current.reconnectInterval=="function"?i.current.reconnectInterval(_):i.current.reconnectInterval,[4,l(f??c.DEFAULT_RECONNECT_INTERVAL_MS)]):[3,5]):[3,7];case 4:return O.sent(),[2,(0,e.getUrl)(S,i,_+1)];case 5:return(U=(F=i.current).onReconnectStop)===null||U===void 0||U.call(F,_),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:y=S,O.label=11;case 11:return b=i.current.fromSocketIO?(0,n.parseSocketIOUrl)(y):y,A=i.current.queryParams?(0,n.appendQueryParams)(b,i.current.queryParams):b,[2,A]}})})};e.getUrl=d})(_e);var Ee={};
1(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.websocketWrapper=void 0;var r=function(t,a){return new Proxy(t,{get:function(n,c){var l=n[c];return c==="reconnect"?a:typeof l=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):l},set:function(n,c,l){return/^on/.test(c)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(n[c]=l,!0)}})};e.websocketWrapper=r,e.default=e.websocketWrapper})(Ee);var k=E&&E.__assign||function(){return k=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k.apply(this,arguments)},qe=E&&E.__awaiter||function(e,r,t,a){function n(c){return c instanceof t?c:new t(function(l){l(c)})}return new(t||(t=Promise))(function(c,l){function d(o){try{u(a.next(o))}catch(v){l(v)}}function s(o){try{u(a.throw(o))}catch(v){l(v)}}function u(o){o.done?c(o.value):n(o.value).then(d,s)}u((a=a.apply(e,r||[])).next())})},ze=E&&E.__generator||function(e,r){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,n,c,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=d(0),l.throw=d(1),l.return=d(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(u){return function(o){return s([u,o])}}function s(u){if(a)throw new TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(t=0)),t;)try{if(a=1,n&&(c=u[0]&2?n.return:u[0]?n.throw||((c=n.return)&&c.call(n),0):n.next)&&!(c=c.call(n,u[1])).done)return c;switch(n=0,c&&(u=[u[0]&2,c.value]),u[0]){case 0:case 1:c=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!c||u[1]>c[0]&&u[1]<c[3])){t.label=u[1];break}if(u[0]===6&&t.label<c[1]){t.label=c[1],c=u;break}if(c&&t.label<c[2]){t.label=c[2],t.ops.push(u);break}c[2]&&t.ops.pop(),t.trys.pop();continue}u=r.call(e,t)}catch(o){u=[6,o],n=0}finally{a=c=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Xe=E&&E.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(D,"__esModule",{value:!0});D.useWebSocket=void 0;var h=ue,ne=ye,w=N,Ze=Q,xe=_e,er=Xe(Ee),le=W,rr=function(e,r,t){r===void 0&&(r=w.DEFAULT_OPTIONS),t===void 0&&(t=!0);var a=(0,h.useState)(null),n=a[0],c=a[1],l=(0,h.useState)({}),d=l[0],s=l[1],u=(0,h.useMemo)(function(){if(!r.disableJson&&n)try{return JSON.parse(n.data)}catch{return w.UNPARSABLE_JSON_OBJECT}return null},[n,r.disableJson]),o=(0,h.useRef)(null),v=(0,h.useRef)(null),S=(0,h.useRef)(function(){}),i=(0,h.useRef)(0),_=(0,h.useRef)(Date.now()),y=(0,h.useRef)([]),g=(0,h.useRef)(null),f=(0,h.useRef)(r);f.current=r;var b=o.current&&d[o.current]!==void 0?d[o.current]:e!==null&&t===!0?w.ReadyState.CONNECTING:w.ReadyState.UNINSTANTIATED,A=r.queryParams?JSON.stringify(r.queryParams):null,m=(0,h.useCallback)(function(O,T){var L;if(T===void 0&&(T=!0),w.isEventSourceSupported&&v.current instanceof EventSource){console.warn("Unable to send a message from an eventSource");return}((L=v.current)===null||L===void 0?void 0:L.readyState)===w.ReadyState.OPEN?((0,le.assertIsWebSocket)(v.current,f.current.skipAssert),v.current.send(O)):T&&y.current.push(O)},[]),F=(0,h.useCallback)(function(O,T){T===void 0&&(T=!0),m(JSON.stringify(O),T)},[m]),U=(0,h.useCallback)(function(){return f.current.share!==!0||w.isEventSourceSupported&&v.current instanceof EventSource?v.current:(g.current===null&&v.current&&((0,le.assertIsWebSocket)(v.current,f.current.skipAssert),g.current=(0,er.default)(v.current,S)),g.current)},[]);return(0,h.useEffect)(function(){if(e!==null&&t===!0){var O,T=!1,L=!0,oe=function(){return qe(void 0,void 0,void 0,function(){var H,p,ie;return ze(this,function(se){switch(se.label){case 0:return H=o,[4,(0,xe.getUrl)(e,f)];case 1:return H.current=se.sent(),o.current===null?(console.error("Failed to get a valid URL. WebSocket connection aborted."),o.current="ABORTED",(0,ne.flushSync)(function(){return s(function(j){return k(k({},j),{ABORTED:w.ReadyState.CLOSED})})}),[2]):(p=function(j){T||(0,ne.flushSync)(function(){return c(j)})},ie=function(j){T||(0,ne.flushSync)(function(){return s(function(Oe){var re;return k(k({},Oe),o.current&&(re={},re[o.current]=j,re))})})},L&&(O=(0,Ze.createOrJoinSocket)(v,o.current,ie,f,p,S,i,_,m)),[2])}})})};return S.current=function(){T||(g.current&&(g.current=null),O==null||O(),oe())},oe(),function(){T=!0,L=!1,g.current&&(g.current=null),O==null||O(),c(null)}}else(e===null||t===!1)&&(i.current=0,s(function(H){var p;return k(k({},H),o.current&&(p={},p[o.current]=w.ReadyState.CLOSED,p))}))},[e,t,A,m]),(0,h.useEffect)(function(){b===w.ReadyState.OPEN&&y.current.splice(0).forEac
1h(function(O){m(O)})},[b]),{sendMessage:m,sendJsonMessage:F,lastMessage:n,lastJsonMessage:u,readyState:b,getWebSocket:U}};D.useWebSocket=rr;var x={},B=E&&E.__assign||function(){return B=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},B.apply(this,arguments)};Object.defineProperty(x,"__esModule",{value:!0});x.useSocketIO=void 0;var fe=ue,tr=D,nr=N,ae={type:"empty",payload:null},ar=function(e){if(!e||!e.data)return ae;var r=e.data.match(/\[.*]/);if(!r)return ae;var t=JSON.parse(r);return!Array.isArray(t)||!t[1]?ae:{type:t[0],payload:t[1]}},cr=function(e,r,t){r===void 0&&(r=nr.DEFAULT_OPTIONS),t===void 0&&(t=!0);var a=(0,fe.useMemo)(function(){return B(B({},r),{fromSocketIO:!0})},[]),n=(0,tr.useWebSocket)(e,a,t),c=n.sendMessage,l=n.sendJsonMessage,d=n.lastMessage,s=n.readyState,u=n.getWebSocket,o=(0,fe.useMemo)(function(){return ar(d)},[d]);return{sendMessage:c,sendJsonMessage:l,lastMessage:o,lastJsonMessage:o,readyState:s,getWebSocket:u}};x.useSocketIO=cr;var ee={},K=E&&E.__assign||function(){return K=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(this,arguments)},ur=E&&E.__rest||function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]]);return t};
1Object.defineProperty(ee,"__esModule",{value:!0});ee.useEventSource=void 0;var ve=ue,or=D,de=N,ir=function(e,r,t){r===void 0&&(r=de.DEFAULT_EVENT_SOURCE_OPTIONS);var a=r.withCredentials,n=r.events,c=ur(r,["withCredentials","events"]);t===void 0&&(t=!0);var l=K(K({},c),{eventSourceOptions:{withCredentials:a}}),d=(0,ve.useRef)(de.EMPTY_EVENT_HANDLERS);n&&(d.current=n);var s=(0,or.useWebSocket)(e,l,t),u=s.lastMessage,o=s.readyState,v=s.getWebSocket;return(0,ve.useEffect)(function(){u!=null&&u.type&&Object.entries(d.current).forEach(function(S){var i=S[0],_=S[1];i===u.type&&_(u)})},[u]),{lastEvent:u,readyState:o,getEventSource:v}};ee.useEventSource=ir;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resetGlobalState=e.useEventSource=e.ReadyState=e.useSocketIO=e.default=void 0;var r=D;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.useWebSocket}});var t=x;Object.defineProperty(e,"useSocketIO",{enumerable:!0,get:function(){return t.useSocketIO}});var a=N;Object.defineProperty(e,"ReadyState",{enumerable:!0,get:function(){return a.ReadyState}});var n=ee;Object.defineProperty(e,"useEventSource",{enumerable:!0,get:function(){return n.useEventSource}});var c=W;Object.defineProperty(e,"resetGlobalState",{enumerable:!0,get:function(){return c.resetGlobalState}})})(Se);const vr=be(Se);export{Se as d,vr 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.