{"version":3,"file":"BaseActionCableConnector-Bobs5GOO.js","sources":["../../../node_modules/.pnpm/@rails+actioncable@6.1.3/node_modules/@rails/actioncable/app/assets/javascripts/action_cable.js","../../../app/javascript/shared/helpers/BaseActionCableConnector.js"],"sourcesContent":["(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([ \"exports\" ], factory) : factory(global.ActionCable = {});\n})(this, function(exports) {\n \"use strict\";\n var adapters = {\n logger: self.console,\n WebSocket: self.WebSocket\n };\n var logger = {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n for (var _len = arguments.length, messages = Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n messages.push(Date.now());\n (_adapters$logger = adapters.logger).log.apply(_adapters$logger, [ \"[ActionCable]\" ].concat(messages));\n }\n }\n };\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n var classCallCheck = function(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n var createClass = function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n var now = function now() {\n return new Date().getTime();\n };\n var secondsSince = function secondsSince(time) {\n return (now() - time) / 1e3;\n };\n var clamp = function clamp(number, min, max) {\n return Math.max(min, Math.min(max, number));\n };\n var ConnectionMonitor = function() {\n function ConnectionMonitor(connection) {\n classCallCheck(this, ConnectionMonitor);\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n ConnectionMonitor.prototype.start = function start() {\n if (!this.isRunning()) {\n this.startedAt = now();\n delete this.stoppedAt;\n this.startPolling();\n addEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor started. pollInterval = \" + this.getPollInterval() + \" ms\");\n }\n };\n ConnectionMonitor.prototype.stop = function stop() {\n if (this.isRunning()) {\n this.stoppedAt = now();\n this.stopPolling();\n removeEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor stopped\");\n }\n };\n ConnectionMonitor.prototype.isRunning = function isRunning() {\n return this.startedAt && !this.stoppedAt;\n };\n ConnectionMonitor.prototype.recordPing = function recordPing() {\n this.pingedAt = now();\n };\n ConnectionMonitor.prototype.recordConnect = function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n };\n ConnectionMonitor.prototype.recordDisconnect = function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n };\n ConnectionMonitor.prototype.startPolling = function startPolling() {\n this.stopPolling();\n this.poll();\n };\n ConnectionMonitor.prototype.stopPolling = function stopPolling() {\n clearTimeout(this.pollTimeout);\n };\n ConnectionMonitor.prototype.poll = function poll() {\n var _this = this;\n this.pollTimeout = setTimeout(function() {\n _this.reconnectIfStale();\n _this.poll();\n }, this.getPollInterval());\n };\n ConnectionMonitor.prototype.getPollInterval = function getPollInterval() {\n var _constructor$pollInte = this.constructor.pollInterval, min = _constructor$pollInte.min, max = _constructor$pollInte.max, multiplier = _constructor$pollInte.multiplier;\n var interval = multiplier * Math.log(this.reconnectAttempts + 1);\n return Math.round(clamp(interval, min, max) * 1e3);\n };\n ConnectionMonitor.prototype.reconnectIfStale = function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \" + this.reconnectAttempts + \", pollInterval = \" + this.getPollInterval() + \" ms, time disconnected = \" + secondsSince(this.disconnectedAt) + \" s, stale threshold = \" + this.constructor.staleThreshold + \" s\");\n this.reconnectAttempts++;\n if (this.disconnectedRecently()) {\n logger.log(\"ConnectionMonitor skipping reopening recent disconnect\");\n } else {\n logger.log(\"ConnectionMonitor reopening\");\n this.connection.reopen();\n }\n }\n };\n ConnectionMonitor.prototype.connectionIsStale = function connectionIsStale() {\n return secondsSince(this.pingedAt ? this.pingedAt : this.startedAt) > this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.disconnectedRecently = function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.visibilityDidChange = function visibilityDidChange() {\n var _this2 = this;\n if (document.visibilityState === \"visible\") {\n setTimeout(function() {\n if (_this2.connectionIsStale() || !_this2.connection.isOpen()) {\n logger.log(\"ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = \" + document.visibilityState);\n _this2.connection.reopen();\n }\n }, 200);\n }\n };\n return ConnectionMonitor;\n }();\n ConnectionMonitor.pollInterval = {\n min: 3,\n max: 30,\n multiplier: 5\n };\n ConnectionMonitor.staleThreshold = 6;\n var INTERNAL = {\n message_types: {\n welcome: \"welcome\",\n disconnect: \"disconnect\",\n ping: \"ping\",\n confirmation: \"confirm_subscription\",\n rejection: \"reject_subscription\"\n },\n disconnect_reasons: {\n unauthorized: \"unauthorized\",\n invalid_request: \"invalid_request\",\n server_restart: \"server_restart\"\n },\n default_mount_path: \"/cable\",\n protocols: [ \"actioncable-v1-json\", \"actioncable-unsupported\" ]\n };\n var message_types = INTERNAL.message_types, protocols = INTERNAL.protocols;\n var supportedProtocols = protocols.slice(0, protocols.length - 1);\n var indexOf = [].indexOf;\n var Connection = function() {\n function Connection(consumer) {\n classCallCheck(this, Connection);\n this.open = this.open.bind(this);\n this.consumer = consumer;\n this.subscriptions = this.consumer.subscriptions;\n this.monitor = new ConnectionMonitor(this);\n this.disconnected = true;\n }\n Connection.prototype.send = function send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data));\n return true;\n } else {\n return false;\n }\n };\n Connection.prototype.open = function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \" + this.getState());\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \" + this.getState() + \", subprotocols: \" + protocols);\n if (this.webSocket) {\n this.uninstallEventHandlers();\n }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols);\n this.installEventHandlers();\n this.monitor.start();\n return true;\n }\n };\n Connection.prototype.close = function close() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n allowReconnect: true\n }, allowReconnect = _ref.allowReconnect;\n if (!allowReconnect) {\n this.monitor.stop();\n }\n if (this.isActive()) {\n return this.webSocket.close();\n }\n };\n Connection.prototype.reopen = function reopen() {\n logger.log(\"Reopening WebSocket, current state is \" + this.getState());\n if (this.isActive()) {\n try {\n return this.close();\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error);\n } finally {\n logger.log(\"Reopening WebSocket in \" + this.constructor.reopenDelay + \"ms\");\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n };\n Connection.prototype.getProtocol = function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n };\n Connection.prototype.isOpen = function isOpen() {\n return this.isState(\"open\");\n };\n Connection.prototype.isActive = function isActive() {\n return this.isState(\"open\", \"connecting\");\n };\n Connection.prototype.isProtocolSupported = function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n };\n Connection.prototype.isState = function isState() {\n for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) {\n states[_key] = arguments[_key];\n }\n return indexOf.call(states, this.getState()) >= 0;\n };\n Connection.prototype.getState = function getState() {\n if (this.webSocket) {\n for (var state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase();\n }\n }\n }\n return null;\n };\n Connection.prototype.installEventHandlers = function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\" + eventName] = handler;\n }\n };\n Connection.prototype.uninstallEventHandlers = function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\" + eventName] = function() {};\n }\n };\n return Connection;\n }();\n Connection.reopenDelay = 500;\n Connection.prototype.events = {\n message: function message(event) {\n if (!this.isProtocolSupported()) {\n return;\n }\n var _JSON$parse = JSON.parse(event.data), identifier = _JSON$parse.identifier, message = _JSON$parse.message, reason = _JSON$parse.reason, reconnect = _JSON$parse.reconnect, type = _JSON$parse.type;\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect();\n return this.subscriptions.reload();\n\n case message_types.disconnect:\n logger.log(\"Disconnecting. Reason: \" + reason);\n return this.close({\n allowReconnect: reconnect\n });\n\n case message_types.ping:\n return this.monitor.recordPing();\n\n case message_types.confirmation:\n return this.subscriptions.notify(identifier, \"connected\");\n\n case message_types.rejection:\n return this.subscriptions.reject(identifier);\n\n default:\n return this.subscriptions.notify(identifier, \"received\", message);\n }\n },\n open: function open() {\n logger.log(\"WebSocket onopen event, using '\" + this.getProtocol() + \"' subprotocol\");\n this.disconnected = false;\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\");\n return this.close({\n allowReconnect: false\n });\n }\n },\n close: function close(event) {\n logger.log(\"WebSocket onclose event\");\n if (this.disconnected) {\n return;\n }\n this.disconnected = true;\n this.monitor.recordDisconnect();\n return this.subscriptions.notifyAll(\"disconnected\", {\n willAttemptReconnect: this.monitor.isRunning()\n });\n },\n error: function error() {\n logger.log(\"WebSocket onerror event\");\n }\n };\n var extend = function extend(object, properties) {\n if (properties != null) {\n for (var key in properties) {\n var value = properties[key];\n object[key] = value;\n }\n }\n return object;\n };\n var Subscription = function() {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments[2];\n classCallCheck(this, Subscription);\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n }\n Subscription.prototype.perform = function perform(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data.action = action;\n return this.send(data);\n };\n Subscription.prototype.send = function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n };\n Subscription.prototype.unsubscribe = function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n };\n return Subscription;\n }();\n var Subscriptions = function() {\n function Subscriptions(consumer) {\n classCallCheck(this, Subscriptions);\n this.consumer = consumer;\n this.subscriptions = [];\n }\n Subscriptions.prototype.create = function create(channelName, mixin) {\n var channel = channelName;\n var params = (typeof channel === \"undefined\" ? \"undefined\" : _typeof(channel)) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n };\n Subscriptions.prototype.add = function add(subscription) {\n this.subscriptions.push(subscription);\n this.consumer.ensureActiveConnection();\n this.notify(subscription, \"initialized\");\n this.sendCommand(subscription, \"subscribe\");\n return subscription;\n };\n Subscriptions.prototype.remove = function remove(subscription) {\n this.forget(subscription);\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\");\n }\n return subscription;\n };\n Subscriptions.prototype.reject = function reject(identifier) {\n var _this = this;\n return this.findAll(identifier).map(function(subscription) {\n _this.forget(subscription);\n _this.notify(subscription, \"rejected\");\n return subscription;\n });\n };\n Subscriptions.prototype.forget = function forget(subscription) {\n this.subscriptions = this.subscriptions.filter(function(s) {\n return s !== subscription;\n });\n return subscription;\n };\n Subscriptions.prototype.findAll = function findAll(identifier) {\n return this.subscriptions.filter(function(s) {\n return s.identifier === identifier;\n });\n };\n Subscriptions.prototype.reload = function reload() {\n var _this2 = this;\n return this.subscriptions.map(function(subscription) {\n return _this2.sendCommand(subscription, \"subscribe\");\n });\n };\n Subscriptions.prototype.notifyAll = function notifyAll(callbackName) {\n var _this3 = this;\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return this.subscriptions.map(function(subscription) {\n return _this3.notify.apply(_this3, [ subscription, callbackName ].concat(args));\n });\n };\n Subscriptions.prototype.notify = function notify(subscription, callbackName) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n var subscriptions = void 0;\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription);\n } else {\n subscriptions = [ subscription ];\n }\n return subscriptions.map(function(subscription) {\n return typeof subscription[callbackName] === \"function\" ? subscription[callbackName].apply(subscription, args) : undefined;\n });\n };\n Subscriptions.prototype.sendCommand = function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n };\n return Subscriptions;\n }();\n var Consumer = function() {\n function Consumer(url) {\n classCallCheck(this, Consumer);\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n Consumer.prototype.send = function send(data) {\n return this.connection.send(data);\n };\n Consumer.prototype.connect = function connect() {\n return this.connection.open();\n };\n Consumer.prototype.disconnect = function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n };\n Consumer.prototype.ensureActiveConnection = function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n };\n createClass(Consumer, [ {\n key: \"url\",\n get: function get$$1() {\n return createWebSocketURL(this._url);\n }\n } ]);\n return Consumer;\n }();\n function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url();\n }\n if (url && !/^wss?:/i.test(url)) {\n var a = document.createElement(\"a\");\n a.href = url;\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n }\n function createConsumer() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getConfig(\"url\") || INTERNAL.default_mount_path;\n return new Consumer(url);\n }\n function getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\" + name + \"']\");\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n exports.Connection = Connection;\n exports.ConnectionMonitor = ConnectionMonitor;\n exports.Consumer = Consumer;\n exports.INTERNAL = INTERNAL;\n exports.Subscription = Subscription;\n exports.Subscriptions = Subscriptions;\n exports.adapters = adapters;\n exports.createWebSocketURL = createWebSocketURL;\n exports.logger = logger;\n exports.createConsumer = createConsumer;\n exports.getConfig = getConfig;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});\n","import { createConsumer } from '@rails/actioncable';\n\nconst PRESENCE_INTERVAL = 20000;\nconst RECONNECT_INTERVAL = 1000;\n\nclass BaseActionCableConnector {\n static isDisconnected = false;\n\n constructor(app, pubsubToken, websocketHost = '') {\n const websocketURL = websocketHost ? `${websocketHost}/cable` : undefined;\n\n this.consumer = createConsumer(websocketURL);\n this.subscription = this.consumer.subscriptions.create(\n {\n channel: 'RoomChannel',\n pubsub_token: pubsubToken,\n account_id: app.$store.getters.getCurrentAccountId,\n user_id: app.$store.getters.getCurrentUserID,\n },\n {\n updatePresence() {\n this.perform('update_presence');\n },\n received: this.onReceived,\n disconnected: () => {\n BaseActionCableConnector.isDisconnected = true;\n this.onDisconnected();\n this.initReconnectTimer();\n },\n }\n );\n this.app = app;\n this.events = {};\n this.reconnectTimer = null;\n this.isAValidEvent = () => true;\n this.triggerPresenceInterval = () => {\n setTimeout(() => {\n this.subscription.updatePresence();\n this.triggerPresenceInterval();\n }, PRESENCE_INTERVAL);\n };\n this.triggerPresenceInterval();\n }\n\n checkConnection() {\n const isConnectionActive = this.consumer.connection.isOpen();\n const isReconnected =\n BaseActionCableConnector.isDisconnected && isConnectionActive;\n if (isReconnected) {\n this.clearReconnectTimer();\n this.onReconnect();\n BaseActionCableConnector.isDisconnected = false;\n } else {\n this.initReconnectTimer();\n }\n }\n\n clearReconnectTimer = () => {\n if (this.reconnectTimer) {\n clearTimeout(this.reconnectTimer);\n this.reconnectTimer = null;\n }\n };\n\n initReconnectTimer = () => {\n this.clearReconnectTimer();\n this.reconnectTimer = setTimeout(() => {\n this.checkConnection();\n }, RECONNECT_INTERVAL);\n };\n\n // eslint-disable-next-line class-methods-use-this\n onReconnect = () => {};\n\n // eslint-disable-next-line class-methods-use-this\n onDisconnected = () => {};\n\n disconnect() {\n this.consumer.disconnect();\n }\n\n onReceived = ({ event, data } = {}) => {\n if (this.isAValidEvent(data)) {\n if (this.events[event] && typeof this.events[event] === 'function') {\n this.events[event](data);\n }\n }\n };\n}\n\nexport default BaseActionCableConnector;\n"],"names":["global","factory","exports","this","adapters","logger","_adapters$logger","_len","messages","_key","_typeof","obj","classCallCheck","instance","Constructor","createClass","defineProperties","target","props","i","descriptor","protoProps","staticProps","now","secondsSince","time","clamp","number","min","max","ConnectionMonitor","connection","_this","_constructor$pollInte","multiplier","interval","_this2","INTERNAL","message_types","protocols","supportedProtocols","indexOf","Connection","consumer","data","_ref","allowReconnect","error","states","state","eventName","handler","event","_JSON$parse","identifier","message","reason","reconnect","type","extend","object","properties","key","value","Subscription","params","mixin","action","Subscriptions","channelName","channel","subscription","s","callbackName","_this3","args","_len2","_key2","subscriptions","command","Consumer","url","createWebSocketURL","a","createConsumer","getConfig","name","element","PRESENCE_INTERVAL","RECONNECT_INTERVAL","_BaseActionCableConnector","app","pubsubToken","websocketHost","__publicField","websocketURL","isConnectionActive","BaseActionCableConnector"],"mappings":"0PAAC,SAASA,EAAQC,EAAS,CACsCA,EAAQC,CAAO,CAChF,GAAGC,EAAM,SAASD,EAAS,CAEzB,IAAIE,EAAW,CACb,OAAQ,KAAK,QACb,UAAW,KAAK,SACpB,EACMC,EAAS,CACX,IAAK,UAAe,CAClB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