"use strict";(self.webpackChunkfront=self.webpackChunkfront||[]).push([[921],{5984:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resetSubscribers=t.removeSubscriber=t.addSubscriber=t.hasSubscribers=t.getSubscribers=void 0;var r={},n=[];t.getSubscribers=function(e){return(0,t.hasSubscribers)(e)?Array.from(r[e]):n},t.hasSubscribers=function(e){var t;return(null===(t=r[e])||void 0===t?void 0:t.size)>0},t.addSubscriber=function(e,t){r[e]=r[e]||new Set,r[e].add(t)},t.removeSubscriber=function(e,t){r[e].delete(t)},t.resetSubscribers=function(e){if(e&&r.hasOwnProperty(e))delete r[e];else for(var t in r)r.hasOwnProperty(t)&&delete r[t]}},16421:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,c){function u(e){try{s(n.next(e))}catch(e){c(e)}}function a(e){try{s(n.throw(e))}catch(e){c(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(c=0)),c;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,n=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.resetWebSockets=t.sharedWebSockets=void 0,t.sharedWebSockets={},t.resetWebSockets=function(e){if(e&&t.sharedWebSockets.hasOwnProperty(e))delete t.sharedWebSockets[e];else for(var r in t.sharedWebSockets)t.sharedWebSockets.hasOwnProperty(r)&&delete t.sharedWebSockets[r]}},21881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.websocketWrapper=void 0,t.websocketWrapper=function(e,t){return new Proxy(e,{get:function(e,r){var n=e[r];return"reconnect"===r?t:"function"==typeof n?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):n},set:function(e,t,r){return/^on/.test(t)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(e[t]=r,!0)}})},t.default=t.websocketWrapper},29800:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.isEventSourceSupported=t.isReactNative=t.ReadyState=t.DEFAULT_HEARTBEAT=t.UNPARSABLE_JSON_OBJECT=t.DEFAULT_RECONNECT_INTERVAL_MS=t.DEFAULT_RECONNECT_LIMIT=t.SOCKET_IO_PING_CODE=t.SOCKET_IO_PATH=t.SOCKET_IO_PING_INTERVAL=t.DEFAULT_EVENT_SOURCE_OPTIONS=t.EMPTY_EVENT_HANDLERS=t.DEFAULT_OPTIONS=void 0,t.DEFAULT_OPTIONS={},t.EMPTY_EVENT_HANDLERS={},t.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:t.EMPTY_EVENT_HANDLERS},t.SOCKET_IO_PING_INTERVAL=25e3,t.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",t.SOCKET_IO_PING_CODE="2",t.DEFAULT_RECONNECT_LIMIT=20,t.DEFAULT_RECONNECT_INTERVAL_MS=5e3,t.UNPARSABLE_JSON_OBJECT={},t.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3},function(e){e[e.UNINSTANTIATED=-1]="UNINSTANTIATED",e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(r||(t.ReadyState=r={})),t.isReactNative="undefined"!=typeof navigator&&"ReactNative"===navigator.product,t.isEventSourceSupported=!t.isReactNative&&function(){try{return"EventSource"in globalThis}catch(e){return!1}}()},44921:(e,t,r)=>{t.Ay=void 0;var n=r(91380);Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return n.useWebSocket}});r(47407),r(29800),r(69797),r(81001)},45784:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.createOrJoinSocket=void 0;var n=r(18389),o=r(29800),c=r(18049),u=r(45784),a=r(5984);t.createOrJoinSocket=function(e,t,r,s,i,l,f,d,p){if(!o.isEventSourceSupported&&s.current.eventSourceOptions)throw o.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(s.current.share){var v=null;void 0===n.sharedWebSockets[t]?(n.sharedWebSockets[t]=s.current.eventSourceOptions?new EventSource(t,s.current.eventSourceOptions):new WebSocket(t,s.current.protocols),e.current=n.sharedWebSockets[t],r(o.ReadyState.CONNECTING),v=(0,u.attachSharedListeners)(n.sharedWebSockets[t],t,s,p)):(e.current=n.sharedWebSockets[t],r(n.sharedWebSockets[t].readyState));var S={setLastMessage:i,setReadyState:r,optionsRef:s,reconnectCount:f,lastMessageTime:d,reconnect:l};return(0,a.addSubscriber)(t,S),function(e,t,r,c,u){return function(){if((0,a.removeSubscriber)(e,t),!(0,a.hasSubscribers)(e)){try{var s=n.sharedWebSockets[e];s instanceof WebSocket&&(s.onclose=function(e){r.current.onClose&&r.current.onClose(e),c(o.ReadyState.CLOSED)}),s.close()}catch(e){}u&&u(),delete n.sharedWebSockets[e]}}}(t,S,s,r,v)}if(e.current=s.current.eventSourceOptions?new EventSource(t,s.current.eventSourceOptions):new WebSocket(t,s.current.protocols),r(o.ReadyState.CONNECTING),!e.current)throw new Error("WebSocket failed to be created");return(0,c.attachListeners)(e.current,{setLastMessage:i,setReadyState:r},s,l.current,f,d,p)}},69797:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsWebSocket=function(e,t){if(!t&&e instanceof WebSocket==0)throw new Error("")},t.resetGlobalState=function(e){(0,o.resetSubscribers)(e),(0,n.resetWebSockets)(e)};var n=r(18389),o=r(5984)},87889:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.heartbeat=function(e,t,r){var o=r||{},c=o.interval,u=void 0===c?n.DEFAULT_HEARTBEAT.interval:c,a=o.timeout,s=void 0===a?n.DEFAULT_HEARTBEAT.timeout:a,i=o.message,l=void 0===i?n.DEFAULT_HEARTBEAT.message:i,f=Math.max(100,u/10),d=Date.now(),p=setInterval((function(){var r=Date.now(),n=function(e){return Array.isArray(e)?e.reduce((function(e,t){return e.current>t.current?e:t})).current:e.current}(t);if(n+s<=r)console.warn("Heartbeat timed out, closing connection, last message received ".concat(r-n,"ms ago, last ping sent ").concat(r-d,"ms ago")),e.close();else if(n+u<=r&&d+u<=r)try{"function"==typeof l?e.send(l()):e.send(l),d=r}catch(t){console.error("Heartbeat failed, closing connection",t instanceof Error?t.message:t),e.close()}}),f);return e.addEventListener("close",(function(){clearInterval(p)})),function(){}};var n=r(29800)},91380:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.setUpSocketIOPing=t.appendQueryParams=t.parseSocketIOUrl=void 0;var n=r(29800);t.parseSocketIOUrl=function(e){if(e){var t=/^https|wss/.test(e),r=e.replace(/^(https?|wss?)(:\/\/)?/,"").replace(/\/$/,"");return"".concat(o=t?"wss":"ws","://").concat(r).concat(n.SOCKET_IO_PATH)}if(""===e){var o=(t=/^https/.test(window.location.protocol))?"wss":"ws",c=window.location.port?":".concat(window.location.port):"";return"".concat(o,"://").concat(window.location.hostname).concat(c).concat(n.SOCKET_IO_PATH)}return e},t.appendQueryParams=function(e,t){void 0===t&&(t={});var r=/\?([\w]+=[\w]+)/.test(e),n="".concat(Object.entries(t).reduce((function(e,t){var r=t[0],n=t[1];return e+"".concat(r,"=").concat(n,"&")}),"").slice(0,-1));return"".concat(e).concat(r?"&":"?").concat(n)},t.setUpSocketIOPing=function(e,t){return void 0===t&&(t=n.SOCKET_IO_PING_INTERVAL),window.setInterval((function(){return e(n.SOCKET_IO_PING_CODE)}),t)}}}]);