@kq_npm/client_leaflet
Version:
KQGIS Client leaflet for Javascript
9 lines • 1.73 MB
JavaScript
/*!
*
* kqgis_client_leaflet.(http://www.kqgeo.com/)
* Copyright© 2000 - 2021 KqGIS Software Co.Ltd
* license: Apache-2.0
* version: v8.5.8
*
*/
(()=>{function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}var __webpack_modules__={3274:function(t){!function(e,r){t.exports=r()}("undefined"!=typeof self&&self,function(){return function(t){function e(s){if(r[s])return r[s].exports;var i=r[s]={i:s,l:!1,exports:{}};return t[s].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,s){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:s})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)e.d(s,i,function(e){return t[e]}.bind(null,i));return s},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}({"./src/byte.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BYTE={LF:"\n",NULL:"\0"}},"./src/client.ts":function(t,e,r){"use strict";var s=this&&this.__awaiter||function(t,e,r,s){return new(r||(r=Promise))(function(i,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){t.done?i(t.value):function(t){return t instanceof r?t:new r(function(e){e(t)})}(t.value).then(o,a)}l((s=s.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){function r(r){return function(o){return function(r){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(n=a.trys,!(n=n.length>0&&n[n.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){a.label=r[1];break}if(6===r[0]&&a.label<n[1]){a.label=n[1],n=r;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(r);break}n[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],i=0}finally{s=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,o])}}var s,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o};Object.defineProperty(e,"__esModule",{value:!0});var n=r("./src/stomp-handler.ts"),o=r("./src/versions.ts"),a=r("./src/web-socket-state.ts"),l=function(){function t(t){void 0===t&&(t={}),this.stompVersions=o.Versions.default,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this._active=!1;var e=function(){};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}return Object.defineProperty(t.prototype,"webSocket",{get:function(){return this._webSocket},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disconnectHeaders",{get:function(){return this._disconnectHeaders},set:function(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"connected",{get:function(){return!!this._stompHandler&&this._stompHandler.connected},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"connectedVersion",{get:function(){return this._stompHandler?this._stompHandler.connectedVersion:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),t.prototype.configure=function(t){Object.assign(this,t)},t.prototype.activate=function(){this._active=!0,this._connect()},t.prototype._connect=function(){return s(this,void 0,void 0,function(){var t=this;return i(this,function(e){switch(e.label){case 0:return this.connected?(this.debug("STOMP: already connected, nothing to do"),[2]):[4,this.beforeConnect()];case 1:return e.sent(),this._active?(this.debug("Opening Web Socket..."),this._webSocket=this._createWebSocket(),this._stompHandler=new n.StompHandler(this,this._webSocket,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,onConnect:function(e){if(!t._active)return t.debug("STOMP got connected while deactivate was issued, will disconnect now"),void t._disposeStompHandler();t.onConnect(e)},onDisconnect:function(e){t.onDisconnect(e)},onStompError:function(e){t.onStompError(e)},onWebSocketClose:function(e){t.onWebSocketClose(e),t._active&&t._schedule_reconnect()},onWebSocketError:function(e){t.onWebSocketError(e)},onUnhandledMessage:function(e){t.onUnhandledMessage(e)},onUnhandledReceipt:function(e){t.onUnhandledReceipt(e)},onUnhandledFrame:function(e){t.onUnhandledFrame(e)}}),this._stompHandler.start(),[2]):(this.debug("Client has been marked inactive, will not attempt to connect"),[2])}})})},t.prototype._createWebSocket=function(){var t;return t=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions()),t.binaryType="arraybuffer",t},t.prototype._schedule_reconnect=function(){var t=this;this.reconnectDelay>0&&(this.debug("STOMP: scheduling reconnection in "+this.reconnectDelay+"ms"),this._reconnector=setTimeout(function(){t._connect()},this.reconnectDelay))},t.prototype.deactivate=function(){this._active=!1,this._reconnector&&clearTimeout(this._reconnector),this._disposeStompHandler()},t.prototype.forceDisconnect=function(){this._webSocket&&(this._webSocket.readyState!==a.WebSocketState.CONNECTING&&this._webSocket.readyState!==a.WebSocketState.OPEN||this._stompHandler._closeWebsocket())},t.prototype._disposeStompHandler=function(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)},t.prototype.publish=function(t){this._stompHandler.publish(t)},t.prototype.watchForReceipt=function(t,e){this._stompHandler.watchForReceipt(t,e)},t.prototype.subscribe=function(t,e,r){return void 0===r&&(r={}),this._stompHandler.subscribe(t,e,r)},t.prototype.unsubscribe=function(t,e){void 0===e&&(e={}),this._stompHandler.unsubscribe(t,e)},t.prototype.begin=function(t){return this._stompHandler.begin(t)},t.prototype.commit=function(t){this._stompHandler.commit(t)},t.prototype.abort=function(t){this._stompHandler.abort(t)},t.prototype.ack=function(t,e,r){void 0===r&&(r={}),this._stompHandler.ack(t,e,r)},t.prototype.nack=function(t,e,r){void 0===r&&(r={}),this._stompHandler.nack(t,e,r)},t}();e.Client=l},"./src/compatibility/compat-client.ts":function(t,e,r){"use strict";var s=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function s(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=r("./src/client.ts"),n=r("./src/compatibility/heartbeat-info.ts"),o=function(t){function e(e){var r=t.call(this)||this;return r.maxWebSocketFrameSize=16384,r._heartbeatInfo=new n.HeartbeatInfo(r),r.reconnect_delay=0,r.webSocketFactory=e,r.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,t)},r}return s(e,t),e.prototype._parseConnect=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,s,i,n={};if(t.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof t[1])n=t[0],s=t[1],i=t[2],r=t[3];else switch(t.length){case 6:n.login=t[0],n.passcode=t[1],s=t[2],i=t[3],r=t[4],n.host=t[5];break;default:n.login=t[0],n.passcode=t[1],s=t[2],i=t[3],r=t[4]}return[n,s,i,r]},e.prototype.connect=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var s=this._parseConnect.apply(this,e);s[0]&&(this.connectHeaders=s[0]),s[1]&&(this.onConnect=s[1]),s[2]&&(this.onStompError=s[2]),s[3]&&(this.onWebSocketClose=s[3]),t.prototype.activate.call(this)},e.prototype.disconnect=function(e,r){void 0===r&&(r={}),e&&(this.onDisconnect=e),this.disconnectHeaders=r,t.prototype.deactivate.call(this)},e.prototype.send=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r="");var s=!1===(e=Object.assign({},e))["content-length"];s&&delete e["content-length"],this.publish({destination:t,headers:e,body:r,skipContentLengthHeader:s})},Object.defineProperty(e.prototype,"reconnect_delay",{set:function(t){this.reconnectDelay=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ws",{get:function(){return this._webSocket},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this.connectedVersion},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onreceive",{get:function(){return this.onUnhandledMessage},set:function(t){this.onUnhandledMessage=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onreceipt",{get:function(){return this.onUnhandledReceipt},set:function(t){this.onUnhandledReceipt=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heartbeat",{get:function(){return this._heartbeatInfo},set:function(t){this.heartbeatIncoming=t.incoming,this.heartbeatOutgoing=t.outgoing},enumerable:!0,configurable:!0}),e}(i.Client);e.CompatClient=o},"./src/compatibility/heartbeat-info.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t){this.client=t}return Object.defineProperty(t.prototype,"outgoing",{get:function(){return this.client.heartbeatOutgoing},set:function(t){this.client.heartbeatOutgoing=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return this.client.heartbeatIncoming},set:function(t){this.client.heartbeatIncoming=t},enumerable:!0,configurable:!0}),t}();e.HeartbeatInfo=s},"./src/compatibility/stomp.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/versions.ts"),i=r("./src/compatibility/compat-client.ts"),n=function(){function t(){}return t.client=function(e,r){null==r&&(r=s.Versions.default.protocolVersions());return new i.CompatClient(function(){return new(t.WebSocketClass||WebSocket)(e,r)})},t.over=function(t){var e;return"function"==typeof t?e=t:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),e=function(){return t}),new i.CompatClient(e)},t.WebSocketClass=null,t}();e.Stomp=n},"./src/frame-impl.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/byte.ts"),i=function(){function t(t){var e=t.command,r=t.headers,s=t.body,i=t.binaryBody,n=t.escapeHeaderValues,o=t.skipContentLengthHeader;this.command=e,this.headers=Object.assign({},r||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=s||"",this.isBinaryBody=!1),this.escapeHeaderValues=n||!1,this.skipContentLengthHeader=o||!1}return Object.defineProperty(t.prototype,"body",{get:function(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binaryBody",{get:function(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody},enumerable:!0,configurable:!0}),t.fromRawFrame=function(e,r){for(var s={},i=function(t){return t.replace(/^\s+|\s+$/g,"")},n=0,o=e.headers.reverse();n<o.length;n++){var a=o[n],l=(a.indexOf(":"),i(a[0])),h=i(a[1]);r&&"CONNECT"!==e.command&&"CONNECTED"!==e.command&&(h=t.hdrValueUnEscape(h)),s[l]=h}return new t({command:e.command,headers:s,binaryBody:e.binaryBody,escapeHeaderValues:r})},t.prototype.toString=function(){return this.serializeCmdAndHeaders()},t.prototype.serialize=function(){var e=this.serializeCmdAndHeaders();return this.isBinaryBody?t.toUnit8Array(e,this._binaryBody).buffer:e+this._body+s.BYTE.NULL},t.prototype.serializeCmdAndHeaders=function(){var e=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(var r=0,i=Object.keys(this.headers||{});r<i.length;r++){var n=i[r],o=this.headers[n];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?e.push(n+":"+t.hdrValueEscape(""+o)):e.push(n+":"+o)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&e.push("content-length:"+this.bodyLength()),e.join(s.BYTE.LF)+s.BYTE.LF+s.BYTE.LF},t.prototype.isBodyEmpty=function(){return 0===this.bodyLength()},t.prototype.bodyLength=function(){var t=this.binaryBody;return t?t.length:0},t.sizeOfUTF8=function(t){return t?(new TextEncoder).encode(t).length:0},t.toUnit8Array=function(t,e){var r=(new TextEncoder).encode(t),s=new Uint8Array([0]),i=new Uint8Array(r.length+e.length+s.length);return i.set(r),i.set(e,r.length),i.set(s,r.length+e.length),i},t.marshall=function(e){return new t(e).serialize()},t.hdrValueEscape=function(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")},t.hdrValueUnEscape=function(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")},t}();e.FrameImpl=i},"./src/index.ts":function(t,e,r){"use strict";function s(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),s(r("./src/client.ts")),s(r("./src/frame-impl.ts")),s(r("./src/parser.ts")),s(r("./src/stomp-config.ts")),s(r("./src/stomp-headers.ts")),s(r("./src/stomp-subscription.ts")),s(r("./src/versions.ts")),s(r("./src/web-socket-state.ts")),s(r("./src/compatibility/compat-client.ts")),s(r("./src/compatibility/stomp.ts"))},"./src/parser.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}return t.prototype.parseChunk=function(t,e){void 0===e&&(e=!1);var r;if(r=t instanceof ArrayBuffer?new Uint8Array(t):this._encoder.encode(t),e&&0!==r[r.length-1]){var s=new Uint8Array(r.length+1);s.set(r,0),s[r.length]=0,r=s}for(var i=0;i<r.length;i++){var n=r[i];this._onByte(n)}},t.prototype._collectFrame=function(t){0!==t&&13!==t&&(10!==t?(this._onByte=this._collectCommand,this._reinjectByte(t)):this.onIncomingPing())},t.prototype._collectCommand=function(t){if(13!==t)return 10===t?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(t)},t.prototype._collectHeaders=function(t){13!==t&&(10!==t?(this._onByte=this._collectHeaderKey,this._reinjectByte(t)):this._setupCollectBody())},t.prototype._reinjectByte=function(t){this._onByte(t)},t.prototype._collectHeaderKey=function(t){if(58===t)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(t)},t.prototype._collectHeaderValue=function(t){if(13!==t)return 10===t?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(t)},t.prototype._setupCollectBody=function(){var t=this._results.headers.filter(function(t){return"content-length"===t[0]})[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated},t.prototype._collectBodyNullTerminated=function(t){0!==t?this._consumeByte(t):this._retrievedBody()},t.prototype._collectBodyFixedSize=function(t){0!=this._bodyBytesRemaining--?this._consumeByte(t):this._retrievedBody()},t.prototype._retrievedBody=function(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()},t.prototype._consumeByte=function(t){this._token.push(t)},t.prototype._consumeTokenAsUTF8=function(){return this._decoder.decode(this._consumeTokenAsRaw())},t.prototype._consumeTokenAsRaw=function(){var t=new Uint8Array(this._token);return this._token=[],t},t.prototype._initState=function(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame},t}();e.Parser=s},"./src/stomp-config.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){return function(){}}();e.StompConfig=s},"./src/stomp-handler.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("./src/byte.ts"),i=r("./src/frame-impl.ts"),n=r("./src/parser.ts"),o=r("./src/versions.ts"),a=r("./src/web-socket-state.ts"),l=function(){function t(t,e,r){var s=this;void 0===r&&(r={}),this._client=t,this._webSocket=e,this._serverFrameHandlers={CONNECTED:function(t){s.debug("connected to server "+t.headers.server),s._connected=!0,s._connectedVersion=t.headers.version,s._connectedVersion===o.Versions.V1_2&&(s._escapeHeaderValues=!0),s._setupHeartbeat(t.headers),s.onConnect(t)},MESSAGE:function(t){var e=t.headers.subscription,r=s._subscriptions[e]||s.onUnhandledMessage,i=t,n=s,a=s._connectedVersion===o.Versions.V1_2?i.headers.ack:i.headers["message-id"];i.ack=function(t){return void 0===t&&(t={}),n.ack(a,e,t)},i.nack=function(t){return void 0===t&&(t={}),n.nack(a,e,t)},r(i)},RECEIPT:function(t){var e=s._receiptWatchers[t.headers["receipt-id"]];e?(e(t),delete s._receiptWatchers[t.headers["receipt-id"]]):s.onUnhandledReceipt(t)},ERROR:function(t){s.onStompError(t)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(r)}return Object.defineProperty(t.prototype,"connectedVersion",{get:function(){return this._connectedVersion},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"connected",{get:function(){return this._connected},enumerable:!0,configurable:!0}),t.prototype.configure=function(t){Object.assign(this,t)},t.prototype.start=function(){var t=this,e=new n.Parser(function(e){var r=i.FrameImpl.fromRawFrame(e,t._escapeHeaderValues);t.logRawCommunication||t.debug("<<< "+r);(t._serverFrameHandlers[r.command]||t.onUnhandledFrame)(r)},function(){t.debug("<<< PONG")});this._webSocket.onmessage=function(r){if(t.debug("Received data"),t._lastServerActivityTS=Date.now(),t.logRawCommunication){var s=r.data instanceof ArrayBuffer?(new TextDecoder).decode(r.data):r.data;t.debug("<<< "+s)}e.parseChunk(r.data,t.appendMissingNULLonIncoming)},this._webSocket.onclose=function(e){t.debug("Connection closed to "+t._webSocket.url),t.onWebSocketClose(e),t._cleanUp()},this._webSocket.onerror=function(e){t.onWebSocketError(e)},this._webSocket.onopen=function(){var e=Object.assign({},t.connectHeaders);t.debug("Web Socket Opened..."),e["accept-version"]=t.stompVersions.supportedVersions(),e["heart-beat"]=[t.heartbeatOutgoing,t.heartbeatIncoming].join(","),t._transmit({command:"CONNECT",headers:e})}},t.prototype._setupHeartbeat=function(t){var e=this;if((t.version===o.Versions.V1_1||t.version===o.Versions.V1_2)&&t["heart-beat"]){var r=t["heart-beat"].split(",").map(function(t){return parseInt(t,10)}),i=r[0],n=r[1];if(0!==this.heartbeatOutgoing&&0!==n){var l=Math.max(this.heartbeatOutgoing,n);this.debug("send PING every "+l+"ms"),this._pinger=setInterval(function(){e._webSocket.readyState===a.WebSocketState.OPEN&&(e._webSocket.send(s.BYTE.LF),e.debug(">>> PING"))},l)}if(0!==this.heartbeatIncoming&&0!==i){var h=Math.max(this.heartbeatIncoming,i);this.debug("check PONG every "+h+"ms"),this._ponger=setInterval(function(){var t=Date.now()-e._lastServerActivityTS;t>2*h&&(e.debug("did not receive server activity for the last "+t+"ms"),e._closeWebsocket())},h)}}},t.prototype._closeWebsocket=function(){this._webSocket.onmessage=function(){},this._webSocket.close()},t.prototype._transmit=function(t){var e=t.command,r=t.headers,s=t.body,n=t.binaryBody,o=t.skipContentLengthHeader,a=new i.FrameImpl({command:e,headers:r,body:s,binaryBody:n,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o}),l=a.serialize();if(this.logRawCommunication?this.debug(">>> "+l):this.debug(">>> "+a),this.forceBinaryWSFrames&&"string"==typeof l&&(l=(new TextEncoder).encode(l)),"string"==typeof l&&this.splitLargeFrames)for(var h=l;h.length>0;){var c=h.substring(0,this.maxWebSocketChunkSize);h=h.substring(this.maxWebSocketChunkSize),this._webSocket.send(c),this.debug("chunk sent = "+c.length+", remaining = "+h.length)}else this._webSocket.send(l)},t.prototype.dispose=function(){var t=this;if(this.connected)try{var e=Object.assign({},this.disconnectHeaders);e.receipt||(e.receipt="close-"+this._counter++),this.watchForReceipt(e.receipt,function(e){t._closeWebsocket(),t._cleanUp(),t.onDisconnect(e)}),this._transmit({command:"DISCONNECT",headers:e})}catch(t){this.debug("Ignoring error during disconnect "+t)}else this._webSocket.readyState!==a.WebSocketState.CONNECTING&&this._webSocket.readyState!==a.WebSocketState.OPEN||this._closeWebsocket()},t.prototype._cleanUp=function(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)},t.prototype.publish=function(t){var e=t.destination,r=t.headers,s=t.body,i=t.binaryBody,n=t.skipContentLengthHeader,o=Object.assign({destination:e},r);this._transmit({command:"SEND",headers:o,body:s,binaryBody:i,skipContentLengthHeader:n})},t.prototype.watchForReceipt=function(t,e){this._receiptWatchers[t]=e},t.prototype.subscribe=function(t,e,r){void 0===r&&(r={}),(r=Object.assign({},r)).id||(r.id="sub-"+this._counter++),r.destination=t,this._subscriptions[r.id]=e,this._transmit({command:"SUBSCRIBE",headers:r});var s=this;return{id:r.id,unsubscribe:function(t){return s.unsubscribe(r.id,t)}}},t.prototype.unsubscribe=function(t,e){void 0===e&&(e={}),e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})},t.prototype.begin=function(t){var e=t||"tx-"+this._counter++;this._transmit({command:"BEGIN",headers:{transaction:e}});var r=this;return{id:e,commit:function(){r.commit(e)},abort:function(){r.abort(e)}}},t.prototype.commit=function(t){this._transmit({command:"COMMIT",headers:{transaction:t}})},t.prototype.abort=function(t){this._transmit({command:"ABORT",headers:{transaction:t}})},t.prototype.ack=function(t,e,r){void 0===r&&(r={}),r=Object.assign({},r),this._connectedVersion===o.Versions.V1_2?r.id=t:r["message-id"]=t,r.subscription=e,this._transmit({command:"ACK",headers:r})},t.prototype.nack=function(t,e,r){return void 0===r&&(r={}),r=Object.assign({},r),this._connectedVersion===o.Versions.V1_2?r.id=t:r["message-id"]=t,r.subscription=e,this._transmit({command:"NACK",headers:r})},t}();e.StompHandler=l},"./src/stomp-headers.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){return function(){}}();e.StompHeaders=s},"./src/stomp-subscription.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){return function(){}}();e.StompSubscription=s},"./src/versions.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t){this.versions=t}return t.prototype.supportedVersions=function(){return this.versions.join(",")},t.prototype.protocolVersions=function(){return this.versions.map(function(t){return"v"+t.replace(".","")+".stomp"})},t.V1_0="1.0",t.V1_1="1.1",t.V1_2="1.2",t.default=new t([t.V1_0,t.V1_1,t.V1_2]),t}();e.Versions=s},"./src/web-socket-state.ts":function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(e.WebSocketState||(e.WebSocketState={}))},0:function(t,e,r){t.exports=r("./src/index.ts")}})})},5592:t=>{function e(){}t.exports=e,t.exports.HttpsAgent=e},7526:(t,e)=>{"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);return[r,r===e?0:4-r%4]}function s(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function i(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),n.push(s(i));return n.join("")}e.byteLength=function(t){var e=r(t),s=e[0],i=e[1];return 3*(s+i)/4-i},e.toByteArray=function(t){var e,s,i=r(t),n=i[0],l=i[1],h=new a(function(t,e,r){return 3*(e+r)/4-r}(0,n,l)),c=0,u=l>0?n-4:n;for(s=0;s<u;s+=4)e=o[t.charCodeAt(s)]<<18|o[t.charCodeAt(s+1)]<<12|o[t.charCodeAt(s+2)]<<6|o[t.charCodeAt(s+3)],h[c++]=e>>16&255,h[c++]=e>>8&255,h[c++]=255&e;return 2===l&&(e=o[t.charCodeAt(s)]<<2|o[t.charCodeAt(s+1)]>>4,h[c++]=255&e),1===l&&(e=o[t.charCodeAt(s)]<<10|o[t.charCodeAt(s+1)]<<4|o[t.charCodeAt(s+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e),h},e.fromByteArray=function(t){for(var e,r=t.length,s=r%3,o=[],a=0,l=r-s;a<l;a+=16383)o.push(i(t,a,a+16383>l?l:a+16383));return 1===s?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===s&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,c=l.length;h<c;++h)n[h]=l[h],o[l.charCodeAt(h)]=h;o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},8898:t=>{t.exports=function(t,e){return!(t[0]>e[2]||t[2]<e[0]||t[3]<e[1]||t[1]>e[3])}},8287:(t,e,r)=>{"use strict";function s(t){if(t>G)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return n(t,e,r)}function n(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|c(t,e),n=s(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var s;s=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return s.__proto__=i.prototype,s}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return i.from(n,e,r);var o=function(t){if(i.isBuffer(t)){var e=0|h(t.length),r=s(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(void 0!==t.length)return"number"!=typeof t.length||T(t.length)?s(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return o(t),s(t<0?0:0|h(t))}function l(t){for(var e=t.length<0?0:0|h(t.length),r=s(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t){if(t>=G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");return 0|t}function c(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(n)return s?-1:E(t).length;e=(""+e).toLowerCase(),n=!0}}function u(t,e,r){var s=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var s=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>s)&&(r=s);for(var i="",n=e;n<r;++n)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[n]);return i}(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return function(t,e,r){var s="";r=Math.min(t.length,r);for(var i=e;i<r;++i)s+=String.fromCharCode(127&t[i]);return s}(this,e,r);case"latin1":case"binary":return function(t,e,r){var s="";r=Math.min(t.length,r);for(var i=e;i<r;++i)s+=String.fromCharCode(t[i]);return s}(this,e,r);case"base64":return function(t,e,r){return 0===e&&r===t.length?M.fromByteArray(t):M.fromByteArray(t.slice(e,r))}(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var s=t.slice(e,r),i="",n=0;n<s.length;n+=2)i+=String.fromCharCode(s[n]+256*s[n+1]);return i}(this,e,r);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function d(t,e,r){var s=t[e];t[e]=t[r],t[r]=s}function p(t,e,r,s,n){if(0===t.length)return-1;if("string"==typeof r?(s=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,T(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=i.from(e,s)),i.isBuffer(e))return 0===e.length?-1:f(t,e,r,s,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):f(t,[e],r,s,n);throw new TypeError("val must be string, number or Buffer")}function f(t,e,r,s,i){function n(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,l=e.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}var h;if(i){var c=-1;for(h=r;h<a;h++)if(n(t,h)===n(e,-1===c?0:h-c)){if(-1===c&&(c=h),h-c+1===l)return c*o}else-1!==c&&(h-=h-c),c=-1}else for(r+l>a&&(r=a-l),h=r;h>=0;h--){for(var u=!0,d=0;d<l;d++)if(n(t,h+d)!==n(e,d)){u=!1;break}if(u)return h}return-1}function m(t,e,r,s){r=Number(r)||0;var i=t.length-r;s?(s=Number(s))>i&&(s=i):s=i;var n=e.length;s>n/2&&(s=n/2);for(var o=0;o<s;++o){var a=parseInt(e.substr(2*o,2),16);if(T(a))return o;t[r+o]=a}return o}function g(t,e,r,s){return I(E(e,t.length-r),t,r,s)}function y(t,e,r,s){return I(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,s)}function A(t,e,r,s){return y(t,e,r,s)}function v(t,e,r,s){return I(L(e),t,r,s)}function b(t,e,r,s){return I(function(t,e){for(var r,s,i,n=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),s=r>>8,i=r%256,n.push(i),n.push(s);return n}(e,t.length-r),t,r,s)}function S(t,e,r){r=Math.min(t.length,r);for(var s=[],i=e;i<r;){var n=t[i],o=null,a=n>239?4:n>223?3:n>191?2:1;if(i+a<=r){var l,h,c,u;switch(a){case 1:n<128&&(o=n);break;case 2:128==(192&(l=t[i+1]))&&(u=(31&n)<<6|63&l)>127&&(o=u);break;case 3:l=t[i+1],h=t[i+2],128==(192&l)&&128==(192&h)&&(u=(15&n)<<12|(63&l)<<6|63&h)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:l=t[i+1],h=t[i+2],c=t[i+3],128==(192&l)&&128==(192&h)&&128==(192&c)&&(u=(15&n)<<18|(63&l)<<12|(63&h)<<6|63&c)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,s.push(o>>>10&1023|55296),o=56320|1023&o),s.push(o),i+=a}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);var r="",s=0;for(;s<e;)r+=String.fromCharCode.apply(String,t.slice(s,s+=D));return r}(s)}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function _(t,e,r,s,n,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+s>t.length)throw new RangeError("Index out of range")}function P(t,e,r,s,i,n){if(r+s>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function w(t,e,r,s,i){return e=+e,r>>>=0,i||P(t,0,r,4),B.write(t,e,r,s,23,4),r+4}function x(t,e,r,s,i){return e=+e,r>>>=0,i||P(t,0,r,8),B.write(t,e,r,s,52,8),r+8}function E(t,e){e=e||1/0;for(var r,s=t.length,i=null,n=[],o=0;o<s;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&n.push(239,191,189);continue}if(o+1===s){(e-=3)>-1&&n.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&n.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&n.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;n.push(r)}else if(r<2048){if((e-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function L(t){return M.toByteArray(function(t){if(t=t.split("=")[0],(t=t.trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,s){for(var i=0;i<s&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function O(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function T(t){return t!=t}var M=r(7526),B=r(251);e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50;var G=2147483647;e.kMaxLength=G,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return n(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},i.allocUnsafe=function(t){return a(t)},i.allocUnsafeSlow=function(t){return a(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(O(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),O(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,s=e.length,n=0,o=Math.min(r,s);n<o;++n)if(t[n]!==e[n]){r=t[n],s=e[n];break}return r<s?-1:s<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var s=i.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var o=t[r];if(O(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(s,n),n+=o.length}return s},i.byteLength=c,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):u.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,s,n){if(O(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===s&&(s=0),void 0===n&&(n=this.length),e<0||r>t.length||s<0||n>this.length)throw new RangeError("out of range index");if(s>=n&&e>=r)return 0;if(s>=n)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,s>>>=0,n>>>=0,this===t)return 0;for(var o=n-s,a=r-e,l=Math.min(o,a),h=this.slice(s,n),c=t.slice(e,r),u=0;u<l;++u)if(h[u]!==c[u]){o=h[u],a=c[u];break}return o<a?-1:a<o?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},i.prototype.write=function(t,e,r,s){if(void 0===e)s="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)s=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===s&&(s="utf8")):(s=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var n=!1;;)switch(s){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return v(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(n)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),n=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var s=this.subarray(t,e);return s.__proto__=i.prototype,s},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var s=this[t],i=1,n=0;++n<e&&(i*=256);)s+=this[t+n]*i;return s},i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var s=this[t+--e],i=1;e>0&&(i*=256);)s+=this[t+--e]*i;return s},i.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var s=this[t],i=1,n=0;++n<e&&(i*=256);)s+=this[t+n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var s=e,i=1,n=this[t+--s];s>0&&(i*=256);)n+=this[t+--s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),B.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),B.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),B.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),B.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,s){if(t=+t,e>>>=0,r>>>=0,!s){_(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,n=0;for(this[e]=255&t;++n<r&&(i*=256);)this[e+n]=t/i&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,s){if(t=+t,e>>>=0,r>>>=0,!s){_(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,n=1;for(this[e+i]=255&t;--i>=0&&(n*=256);)this[e+i]=t/n&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,s){if(t=+t,e>>>=0,!s){var i=Math.pow(2,8*r-1);_(this,t,e,r,i-1,-i)}var n=0,o=1,a=0;for(this[e]=255&t;++n<r&&(o*=256);)t<0&&0===a&&0!==this[e+n-1]&&(a=1),this[e+n]=(t/o>>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,s){if(t=+t,e>>>=0,!s){var i=Math.pow(2,8*r-1);_(this,t,e,r,i-1,-i)}var n=r-1,o=1,a=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===a&&0!==this[e+n+1]&&(a=1),this[e+n]=(t/o>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return w(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return w(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return x(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return x(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,s){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),s||0===s||(s=this.length),e>=t.length&&(e=t.length),e||(e=0),s>0&&s<r&&(s=r),s===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),t.length-e<s-r&&(s=t.length-e+r);var n=s-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,s);else if(this===t&&r<e&&e<s)for(var o=n-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,s),e);return n},i.prototype.fill=function(t,e,r,s){if("string"==typeof t){if("string"==typeof e?(s=e,e=0,r=this.length):"string"==typeof r&&(s=r,r=this.length),void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!i.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(1===t.length){var n=t.charCodeAt(0);("utf8"===s&&n<128||"latin1"===s)&&(t=n)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=i.isBuffer(t)?t:i.from(t,s),l=a.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%l]}return this};var N=/[^+/0-9A-Za-z-_]/g},6866:t=>{t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},7007:t=>{function e(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=h(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}function r(t){return void 0===t._maxListeners?e.defaultMaxListeners:t._maxListeners}function s(t,e,s,i){var n,o,a;if("function"!=typeof s)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,s.listener?s.listener:s),o=t._events),a=o[e]):(o=t._events=h(null),t._eventsCount=0),a){if("function"==typeof a?a=o[e]=i?[s,a]:[a,s]:i?a.unshift(s):a.push(s),!a.warned&&(n=r(t))&&n>0&&a.length>n){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else a=o[e]=s,++t._eventsCount;return t}function i(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function n(t,e,r){var s={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=u.call(i,s);return