From 72fc3d55810e95bdeb5dd5d5952f06e6fafd3ce5 Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Tue, 10 May 2022 07:42:53 -0400 Subject: [PATCH] IE Restore --- .../js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js | 9 +++ .../widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map | 1 + .../js/widgetv2/2.90658096bc82c95d6b4b.ie.js | 2 + .../widgetv2/2.90658096bc82c95d6b4b.ie.js.map | 1 + .../js/widgetv2/3.ebd2630847bc8173025f.ie.js | 2 + .../widgetv2/3.ebd2630847bc8173025f.ie.js.map | 1 + .../js/widgetv2/4.80f011fffa0f91545942.ie.js | 2 + .../widgetv2/4.80f011fffa0f91545942.ie.js.map | 1 + .../js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js | 2 + .../widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map | 1 + .../js/widgetv2/6.5e9f23d9c05330e9214e.ie.js | 2 + .../widgetv2/6.5e9f23d9c05330e9214e.ie.js.map | 1 + .../js/widgetv2/7.24e095ac1eddde957959.ie.js | 2 + .../widgetv2/7.24e095ac1eddde957959.ie.js.map | 1 + .../defaulttheme/js/widgetv2/react.app.ie.js | 66 +++++++++++++++++++ .../js/widgetv2/react.app.ie.js.map | 1 + .../defaulttheme/js/widgetv2/vendor.ie.js | 0 17 files changed, 95 insertions(+) create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js.map create mode 100644 lhc_web/design/defaulttheme/js/widgetv2/vendor.ie.js diff --git a/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js new file mode 100644 index 0000000000..145a08bffc --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js @@ -0,0 +1,9 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[1],{482:function(t,e,r){var n=r(493),o=function(){return!this}();function i(t,e){this.name="AuthTokenExpiredError",this.message=t,this.expiry=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function s(t){this.name="AuthTokenInvalidError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function a(t,e){this.name="AuthTokenNotBeforeError",this.message=t,this.date=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function c(t){this.name="AuthTokenError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function h(t){this.name="AuthError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function u(t,e){this.name="SilentMiddlewareBlockedError",this.message=t,this.type=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function p(t){this.name="InvalidActionError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function l(t){this.name="InvalidArgumentsError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function f(t){this.name="InvalidOptionsError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function d(t){this.name="InvalidMessageError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function y(t,e){this.name="SocketProtocolError",this.message=t,this.code=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function g(t){this.name="ServerProtocolError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function m(t){this.name="HTTPServerError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function b(t){this.name="ResourceLimitError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function v(t){this.name="TimeoutError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function E(t,e){this.name="BadConnectionError",this.message=t,this.type=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function T(t){this.name="BrokerError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function S(t,e){this.name="ProcessExitError",this.message=t,this.code=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function w(t){this.name="UnknownError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}i.prototype=Object.create(Error.prototype),s.prototype=Object.create(Error.prototype),a.prototype=Object.create(Error.prototype),c.prototype=Object.create(Error.prototype),h.prototype=Object.create(Error.prototype),u.prototype=Object.create(Error.prototype),p.prototype=Object.create(Error.prototype),l.prototype=Object.create(Error.prototype),f.prototype=Object.create(Error.prototype),d.prototype=Object.create(Error.prototype),y.prototype=Object.create(Error.prototype),g.prototype=Object.create(Error.prototype),m.prototype=Object.create(Error.prototype),b.prototype=Object.create(Error.prototype),v.prototype=Object.create(Error.prototype),E.prototype=Object.create(Error.prototype),T.prototype=Object.create(Error.prototype),S.prototype=Object.create(Error.prototype),w.prototype=Object.create(Error.prototype),t.exports={AuthTokenExpiredError:i,AuthTokenInvalidError:s,AuthTokenNotBeforeError:a,AuthTokenError:c,AuthError:h,SilentMiddlewareBlockedError:u,InvalidActionError:p,InvalidArgumentsError:l,InvalidOptionsError:f,InvalidMessageError:d,SocketProtocolError:y,ServerProtocolError:g,HTTPServerError:m,ResourceLimitError:b,TimeoutError:v,BadConnectionError:E,BrokerError:T,ProcessExitError:S,UnknownError:w},t.exports.socketProtocolErrorStatuses={1001:"Socket was disconnected",1002:"A WebSocket protocol error was encountered",1003:"Server terminated socket because it received invalid data",1005:"Socket closed without status code",1006:"Socket hung up",1007:"Message format was incorrect",1008:"Encountered a policy violation",1009:"Message was too big to process",1010:"Client ended the connection because the server did not comply with extension requirements",1011:"Server encountered an unexpected fatal condition",4e3:"Server ping timed out",4001:"Client pong timed out",4002:"Server failed to sign auth token",4003:"Failed to complete handshake",4004:"Client failed to save auth token",4005:"Did not receive #handshake from client before timeout",4006:"Failed to bind socket to message broker",4007:"Client connection establishment timed out",4008:"Server rejected handshake from client",4009:"Server received a message before the client handshake"},t.exports.socketProtocolIgnoreStatuses={1e3:"Socket closed normally",1001:"Socket hung up"};var k={domain:1,domainEmitter:1,domainThrown:1};t.exports.dehydrateError=function(t,e){var r;if(t&&"object"==typeof t)for(var o in r={message:t.message},e&&(r.stack=t.stack),t)k[o]||(r[o]=t[o]);else r="function"==typeof t?"[function "+(t.name||"anonymous")+"]":t;return n(r)},t.exports.hydrateError=function(t){var e=null;if(null!=t)if("object"==typeof t)for(var r in e=new Error(t.message),t)t.hasOwnProperty(r)&&(e[r]=t[r]);else e=t;return e},t.exports.decycle=n},483:function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;oo)throw new f("The "+t+" value provided exceeded the maximum amount allowed")};if(a("connectTimeout"),a("ackTimeout"),this._localEvents={connect:1,connectAbort:1,close:1,disconnect:1,message:1,error:1,raw:1,kickOut:1,subscribe:1,unsubscribe:1,subscribeStateChange:1,authStateChange:1,authenticate:1,deauthenticate:1,removeAuthToken:1,subscribeRequest:1},this.connectAttempts=0,this._emitBuffer=new h,this.channels={},this.options=t,this._cid=1,this.options.callIdGenerator=function(){return r._cid++},this.options.autoReconnect){null==this.options.autoReconnectOptions&&(this.options.autoReconnectOptions={});var u=this.options.autoReconnectOptions;null==u.initialDelay&&(u.initialDelay=1e4),null==u.randomness&&(u.randomness=1e4),null==u.multiplier&&(u.multiplier=1.5),null==u.maxDelay&&(u.maxDelay=6e4)}if(null==this.options.subscriptionRetryOptions&&(this.options.subscriptionRetryOptions={}),this.options.authEngine?this.auth=this.options.authEngine:this.auth=new i,this.options.codecEngine?this.codec=this.options.codecEngine:this.codec=s,this.options.protocol){var p=new f('The "protocol" option does not affect socketcluster-client. If you want to utilize SSL/TLS - use "secure" option instead');this._onSCError(p)}this.options.path=this.options.path.replace(/\/$/,"")+"/",this.options.query=t.query||{},"string"==typeof this.options.query&&(this.options.query=c.parse(this.options.query)),this._channelEmitter=new n,this._unloadHandler=function(){r.disconnect()},v&&this.disconnectOnUnload&&e.addEventListener&&e.addEventListener("beforeunload",this._unloadHandler,!1),this._clientMap[this.clientId]=this,this.options.autoConnect&&this.connect()};E.prototype=Object.create(n.prototype),E.CONNECTING=E.prototype.CONNECTING=a.prototype.CONNECTING,E.OPEN=E.prototype.OPEN=a.prototype.OPEN,E.CLOSED=E.prototype.CLOSED=a.prototype.CLOSED,E.AUTHENTICATED=E.prototype.AUTHENTICATED="authenticated",E.UNAUTHENTICATED=E.prototype.UNAUTHENTICATED="unauthenticated",E.PENDING=E.prototype.PENDING="pending",E.ignoreStatuses=l.socketProtocolIgnoreStatuses,E.errorStatuses=l.socketProtocolErrorStatuses,E.prototype._privateEventHandlerMap={"#publish":function(t){var e=this._undecorateChannelName(t.channel);this.isSubscribed(e,!0)&&this._channelEmitter.emit(e,t.data)},"#kickOut":function(t){var e=this._undecorateChannelName(t.channel),r=this.channels[e];r&&(n.prototype.emit.call(this,"kickOut",t.message,e),r.emit("kickOut",t.message,e),this._triggerChannelUnsubscribe(r))},"#setAuthToken":function(t,e){var r=this;if(t){this.auth.saveToken(this.authTokenName,t.token,{},(function(n){n?(e.error(n),r._onSCError(n)):(r._changeToAuthenticatedState(t.token),e.end())}))}else e.error(new d("No token data provided by #setAuthToken event"))},"#removeAuthToken":function(t,e){var r=this;this.auth.removeToken(this.authTokenName,(function(t,o){t?(e.error(t),r._onSCError(t)):(n.prototype.emit.call(r,"removeAuthToken",o),r._changeToUnauthenticatedStateAndClearTokens(),e.end())}))},"#disconnect":function(t){this.transport.close(t.code,t.data)}},E.prototype.getState=function(){return this.state},E.prototype.getBytesReceived=function(){return this.transport.getBytesReceived()},E.prototype.deauthenticate=function(t){var e=this;this.auth.removeToken(this.authTokenName,(function(r,o){r?e._onSCError(r):(n.prototype.emit.call(e,"removeAuthToken",o),e.state!==e.CLOSED&&e.emit("#removeAuthToken"),e._changeToUnauthenticatedStateAndClearTokens()),t&&t(r)}))},E.prototype.connect=E.prototype.open=function(){var t=this;if(this.active)this.state===this.CLOSED&&(this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef),this.state=this.CONNECTING,n.prototype.emit.call(this,"connecting"),this.transport&&this.transport.off(),this.transport=new a(this.auth,this.codec,this.options),this.transport.on("open",(function(e){t.state=t.OPEN,t._onSCOpen(e)})),this.transport.on("error",(function(e){t._onSCError(e)})),this.transport.on("close",(function(e,r){t.state=t.CLOSED,t._onSCClose(e,r)})),this.transport.on("openAbort",(function(e,r){t.state=t.CLOSED,t._onSCClose(e,r,!0)})),this.transport.on("event",(function(e,r,n){t._onSCEvent(e,r,n)})));else{var e=new y("Cannot connect a destroyed client");this._onSCError(e)}},E.prototype.reconnect=function(t,e){this.disconnect(t,e),this.connect()},E.prototype.disconnect=function(t,e){if("number"!=typeof(t=t||1e3))throw new f("If specified, the code argument must be a number");this.state===this.OPEN||this.state===this.CONNECTING?this.transport.close(t,e):(this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef))},E.prototype.destroy=function(t,r){v&&e.removeEventListener&&e.removeEventListener("beforeunload",this._unloadHandler,!1),this.active=!1,this.disconnect(t,r),delete this._clientMap[this.clientId]},E.prototype._changeToUnauthenticatedStateAndClearTokens=function(){if(this.authState!==this.UNAUTHENTICATED){var t=this.authState,e=this.signedAuthToken;this.authState=this.UNAUTHENTICATED,this.signedAuthToken=null,this.authToken=null;var r={oldState:t,newState:this.authState};n.prototype.emit.call(this,"authStateChange",r),n.prototype.emit.call(this,"deauthenticate",e)}},E.prototype._changeToAuthenticatedState=function(t){if(this.signedAuthToken=t,this.authToken=this._extractAuthTokenData(t),this.authState!==this.AUTHENTICATED){var e=this.authState;this.authState=this.AUTHENTICATED;var r={oldState:e,newState:this.authState,signedAuthToken:t,authToken:this.authToken};this.preparingPendingSubscriptions||this.processPendingSubscriptions(),n.prototype.emit.call(this,"authStateChange",r)}n.prototype.emit.call(this,"authenticate",t)},E.prototype.decodeBase64=function(t){return u.from(t,"base64").toString("utf8")},E.prototype.encodeBase64=function(t){return u.from(t,"utf8").toString("base64")},E.prototype._extractAuthTokenData=function(t){var e=(t||"").split(".")[1];if(null!=e){var r=e;try{return r=this.decodeBase64(r),JSON.parse(r)}catch(t){return r}}return null},E.prototype.getAuthToken=function(){return this.authToken},E.prototype.getSignedAuthToken=function(){return this.signedAuthToken},E.prototype.authenticate=function(t,e){var r=this;this.emit("#authenticate",t,(function(n,o){o&&null!=o.isAuthenticated?o.authError&&(o.authError=l.hydrateError(o.authError)):o={isAuthenticated:r.authState,authError:null},n?("BadConnectionError"!==n.name&&"TimeoutError"!==n.name&&r._changeToUnauthenticatedStateAndClearTokens(),e&&e(n,o)):r.auth.saveToken(r.authTokenName,t,{},(function(n){n&&r._onSCError(n),o.isAuthenticated?r._changeToAuthenticatedState(t):r._changeToUnauthenticatedStateAndClearTokens(),e&&e(n,o)}))}))},E.prototype._tryReconnect=function(t){var e,r=this,n=this.connectAttempts++,o=this.options.autoReconnectOptions;if(null==t||n>0){var i=Math.round(o.initialDelay+(o.randomness||0)*Math.random());e=Math.round(i*Math.pow(o.multiplier,n))}else e=t;e>o.maxDelay&&(e=o.maxDelay),clearTimeout(this._reconnectTimeoutRef),this.pendingReconnect=!0,this.pendingReconnectTimeout=e,this._reconnectTimeoutRef=setTimeout((function(){r.connect()}),e)},E.prototype._onSCOpen=function(t){var e=this;this.preparingPendingSubscriptions=!0,t?(this.id=t.id,this.pingTimeout=t.pingTimeout,this.transport.pingTimeout=this.pingTimeout,t.isAuthenticated?this._changeToAuthenticatedState(t.authToken):this._changeToUnauthenticatedStateAndClearTokens()):this._changeToUnauthenticatedStateAndClearTokens(),this.connectAttempts=0,this.options.autoSubscribeOnConnect&&this.processPendingSubscriptions(),n.prototype.emit.call(this,"connect",t,(function(){e.processPendingSubscriptions()})),this.state===this.OPEN&&this._flushEmitBuffer()},E.prototype._onSCError=function(t){var e=this;setTimeout((function(){if(e.listeners("error").length<1)throw t;n.prototype.emit.call(e,"error",t)}),0)},E.prototype._suspendSubscriptions=function(){var t,e;for(var r in this.channels)this.channels.hasOwnProperty(r)&&(e=(t=this.channels[r]).state===t.SUBSCRIBED||t.state===t.PENDING?t.PENDING:t.UNSUBSCRIBED,this._triggerChannelUnsubscribe(t,e))},E.prototype._abortAllPendingEventsDueToBadConnection=function(t){for(var e,r=this._emitBuffer.head;r;){e=r.next;var n=r.data;clearTimeout(n.timeout),delete n.timeout,r.detach(),r=e;var o=n.callback;if(o){delete n.callback;var i="Event '"+n.event+"' was aborted due to a bad connection",s=new b(i,t);o.call(n,s,n)}n.cid&&this.transport.cancelPendingResponse(n.cid)}},E.prototype._onSCClose=function(t,e,r){if(this.id=null,this.transport&&this.transport.off(),this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef),this._suspendSubscriptions(),this._abortAllPendingEventsDueToBadConnection(r?"connectAbort":"disconnect"),this.options.autoReconnect&&(4e3===t||4001===t||1005===t?this._tryReconnect(0):1e3!==t&&t<4500&&this._tryReconnect()),r?n.prototype.emit.call(this,"connectAbort",t,e):n.prototype.emit.call(this,"disconnect",t,e),n.prototype.emit.call(this,"close",t,e),!E.ignoreStatuses[t]){var o;o=e?"Socket connection closed with status code "+t+" and reason: "+e:"Socket connection closed with status code "+t;var i=new g(E.errorStatuses[t]||o,t);this._onSCError(i)}},E.prototype._onSCEvent=function(t,e,r){var o=this._privateEventHandlerMap[t];o?o.call(this,e,r):n.prototype.emit.call(this,t,e,(function(){r&&r.callback.apply(r,arguments)}))},E.prototype.decode=function(t){return this.transport.decode(t)},E.prototype.encode=function(t){return this.transport.encode(t)},E.prototype._flushEmitBuffer=function(){for(var t,e=this._emitBuffer.head;e;){t=e.next;var r=e.data;e.detach(),this.transport.emitObject(r),e=t}},E.prototype._handleEventAckTimeout=function(t,e){e&&e.detach(),delete t.timeout;var r=t.callback;if(r){delete t.callback;var n=new m("Event response for '"+t.event+"' timed out");r.call(t,n,t)}t.cid&&this.transport.cancelPendingResponse(t.cid)},E.prototype._emit=function(t,e,r){var n=this;this.state===this.CLOSED&&this.connect();var o={event:t,callback:r},i=new h.Item;this.options.cloneData?o.data=p(e):o.data=e,i.data=o,o.timeout=setTimeout((function(){n._handleEventAckTimeout(o,i)}),this.ackTimeout),this._emitBuffer.append(i),this.state===this.OPEN&&this._flushEmitBuffer()},E.prototype.send=function(t){this.transport.send(t)},E.prototype.emit=function(t,e,r){if(null==this._localEvents[t])this._emit(t,e,r);else if("error"===t)n.prototype.emit.call(this,t,e);else{var o=new y('The "'+t+'" event is reserved and cannot be emitted on a client socket');this._onSCError(o)}},E.prototype.publish=function(t,e,r){var n={channel:this._decorateChannelName(t),data:e};this.emit("#publish",n,r)},E.prototype._triggerChannelSubscribe=function(t,e){var r=t.name;if(t.state!==t.SUBSCRIBED){var o=t.state;t.state=t.SUBSCRIBED;var i={channel:r,oldState:o,newState:t.state,subscriptionOptions:e};t.emit("subscribeStateChange",i),t.emit("subscribe",r,e),n.prototype.emit.call(this,"subscribeStateChange",i),n.prototype.emit.call(this,"subscribe",r,e)}},E.prototype._triggerChannelSubscribeFail=function(t,e,r){var o=e.name,i=!e.waitForAuth||this.authState===this.AUTHENTICATED;e.state!==e.UNSUBSCRIBED&&i&&(e.state=e.UNSUBSCRIBED,e.emit("subscribeFail",t,o,r),n.prototype.emit.call(this,"subscribeFail",t,o,r))},E.prototype._cancelPendingSubscribeCallback=function(t){null!=t._pendingSubscriptionCid&&(this.transport.cancelPendingResponse(t._pendingSubscriptionCid),delete t._pendingSubscriptionCid)},E.prototype._decorateChannelName=function(t){return this.channelPrefix&&(t=this.channelPrefix+t),t},E.prototype._undecorateChannelName=function(t){return this.channelPrefix&&0===t.indexOf(this.channelPrefix)?t.replace(this.channelPrefix,""):t},E.prototype._trySubscribe=function(t){var e=this,r=!t.waitForAuth||this.authState===this.AUTHENTICATED;if(this.state===this.OPEN&&!this.preparingPendingSubscriptions&&null==t._pendingSubscriptionCid&&r){var o={noTimeout:!0},i={channel:this._decorateChannelName(t.name)};t.waitForAuth&&(o.waitForAuth=!0,i.waitForAuth=o.waitForAuth),t.data&&(i.data=t.data),t.batch&&(o.batch=!0,i.batch=!0),t._pendingSubscriptionCid=this.transport.emit("#subscribe",i,o,(function(r){delete t._pendingSubscriptionCid,r?e._triggerChannelSubscribeFail(r,t,i):e._triggerChannelSubscribe(t,i)})),n.prototype.emit.call(this,"subscribeRequest",t.name,i)}},E.prototype.subscribe=function(t,e){var r=this.channels[t];return r?e&&r.setOptions(e):(r=new o(t,this,e),this.channels[t]=r),r.state===r.UNSUBSCRIBED&&(r.state=r.PENDING,this._trySubscribe(r)),r},E.prototype._triggerChannelUnsubscribe=function(t,e){var r=t.name,o=t.state;if(t.state=e||t.UNSUBSCRIBED,this._cancelPendingSubscribeCallback(t),o===t.SUBSCRIBED){var i={channel:r,oldState:o,newState:t.state};t.emit("subscribeStateChange",i),t.emit("unsubscribe",r),n.prototype.emit.call(this,"subscribeStateChange",i),n.prototype.emit.call(this,"unsubscribe",r)}},E.prototype._tryUnsubscribe=function(t){if(this.state===this.OPEN){var e={noTimeout:!0};t.batch&&(e.batch=!0),this._cancelPendingSubscribeCallback(t);var r=this._decorateChannelName(t.name);this.transport.emit("#unsubscribe",r,e)}},E.prototype.unsubscribe=function(t){var e=this.channels[t];e&&e.state!==e.UNSUBSCRIBED&&(this._triggerChannelUnsubscribe(e),this._tryUnsubscribe(e))},E.prototype.channel=function(t,e){var r=this.channels[t];return r||(r=new o(t,this,e),this.channels[t]=r),r},E.prototype.destroyChannel=function(t){var e=this.channels[t];e&&(e.unwatch(),e.unsubscribe(),delete this.channels[t])},E.prototype.subscriptions=function(t){var e,r=[];for(var n in this.channels)this.channels.hasOwnProperty(n)&&(e=this.channels[n],(t?e&&(e.state===e.SUBSCRIBED||e.state===e.PENDING):e&&e.state===e.SUBSCRIBED)&&r.push(n));return r},E.prototype.isSubscribed=function(t,e){var r=this.channels[t];return e?!!r&&(r.state===r.SUBSCRIBED||r.state===r.PENDING):!!r&&r.state===r.SUBSCRIBED},E.prototype.processPendingSubscriptions=function(){var t=this;this.preparingPendingSubscriptions=!1;var e=[];for(var r in this.channels)if(this.channels.hasOwnProperty(r)){var n=this.channels[r];n.state===n.PENDING&&e.push(n)}e.sort((function(t,e){var r=t.priority||0,n=e.priority||0;return r>n?-1:r + * @license MIT + */ +var n=r(502),o=r(503),i=r(504);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!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))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var u=-1;for(i=r;ia&&(r=a-c),i=r;i>=0;i--){for(var p=!0,l=0;lo&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function _(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:h>223?3:h>191?2:1;if(o+p<=r)switch(p){case 1:h<128&&(u=h);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&h)<<6|63&i)>127&&(u=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(c=(15&h)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&h)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,p=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=p}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),h=this.slice(n,o),u=t.slice(e,r),p=0;po)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(66))},488:function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},489:function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=r;return o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]}},490:function(t,e,r){var n=r(484),o=r(506);t.exports.factory=o,t.exports.SCClientSocket=n,t.exports.Emitter=r(483),t.exports.create=function(t){return o.create(t)},t.exports.connect=t.exports.create,t.exports.destroy=function(t){return o.destroy(t)},t.exports.clients=o.clients,t.exports.version="14.3.1"},491:function(t,e,r){var n=r(492),o=function(t,e,r){n.call(this),this.PENDING="pending",this.SUBSCRIBED="subscribed",this.UNSUBSCRIBED="unsubscribed",this.name=t,this.state=this.UNSUBSCRIBED,this.client=e,this.options=r||{},this.setOptions(this.options)};(o.prototype=Object.create(n.prototype)).setOptions=function(t){t||(t={}),this.waitForAuth=t.waitForAuth||!1,this.batch=t.batch||!1,void 0!==t.data&&(this.data=t.data)},o.prototype.getState=function(){return this.state},o.prototype.subscribe=function(t){this.client.subscribe(this.name,t)},o.prototype.unsubscribe=function(){this.client.unsubscribe(this.name)},o.prototype.isSubscribed=function(t){return this.client.isSubscribed(this.name,t)},o.prototype.publish=function(t,e){this.client.publish(this.name,t,e)},o.prototype.watch=function(t){this.client.watch(this.name,t)},o.prototype.unwatch=function(t){this.client.unwatch(this.name,t)},o.prototype.watchers=function(){return this.client.watchers(this.name)},o.prototype.destroy=function(){this.client.destroyChannel(this.name)},t.exports.SCChannel=o},492:function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o>2],o+=r[(3&e[i])<<4|e[i+1]>>4],o+=r[(15&e[i+1])<<2|e[i+2]>>6],o+=r[63&e[i+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},i=function(t,r){if(e.ArrayBuffer&&r instanceof e.ArrayBuffer)return{base64:!0,data:o(r)};if(e.Buffer){if(r instanceof e.Buffer)return{base64:!0,data:r.toString("base64")};if(r&&"Buffer"===r.type&&Array.isArray(r.data))return{base64:!0,data:(e.Buffer.from?e.Buffer.from(r.data):new e.Buffer(r.data)).toString("base64")}}return r};t.exports.decode=function(t){if(null==t)return null;if("#1"===t||"#2"===t)return t;var e=t.toString();if(!n.test(e))return e;try{return JSON.parse(e)}catch(t){}return e},t.exports.encode=function(t){return"#1"===t||"#2"===t?t:JSON.stringify(t,i)}}).call(this,r(66))},496:function(t,e,r){(function(e){var n,o,i=r(483),s=r(485).Response,a=r(486);e.WebSocket?(n=e.WebSocket,o=function(t,e){return new n(t)}):(n=r(499),o=function(t,e){return new n(t,null,e)});var c=r(482),h=c.TimeoutError,u=c.BadConnectionError,p=function(t,e,r){var n=this;this.state=this.CLOSED,this.auth=t,this.codec=e,this.options=r,this.connectTimeout=r.connectTimeout,this.pingTimeout=r.ackTimeout,this.pingTimeoutDisabled=!!r.pingTimeoutDisabled,this.callIdGenerator=r.callIdGenerator,this.authTokenName=r.authTokenName,this._pingTimeoutTicker=null,this._callbackMap={},this._batchSendList=[],this.state=this.CONNECTING;var i=this.uri(),s=o(i,this.options);s.binaryType=this.options.binaryType,this.socket=s,s.onopen=function(){n._onOpen()},s.onclose=function(t){var e;e=null==t.code?1005:t.code,n._onClose(e,t.reason)},s.onmessage=function(t,e){n._onMessage(t.data)},s.onerror=function(t){n.state===n.CONNECTING&&n._onClose(1006)},this._connectTimeoutRef=setTimeout((function(){n._onClose(4007),n.socket.close(4007)}),this.connectTimeout)};p.prototype=Object.create(i.prototype),p.CONNECTING=p.prototype.CONNECTING="connecting",p.OPEN=p.prototype.OPEN="open",p.CLOSED=p.prototype.CLOSED="closed",p.prototype.uri=function(){var t,e=this.options.query||{},r=this.options.secure?"wss":"ws";if(this.options.timestampRequests&&(e[this.options.timestampParam]=(new Date).getTime()),(e=a.encode(e)).length&&(e="?"+e),this.options.host)t=this.options.host;else{var n="";this.options.port&&("wss"===r&&443!==this.options.port||"ws"===r&&80!==this.options.port)&&(n=":"+this.options.port),t=this.options.hostname+n}return r+"://"+t+this.options.path+e},p.prototype._onOpen=function(){var t=this;clearTimeout(this._connectTimeoutRef),this._resetPingTimeout(),this._handshake((function(e,r){var n;e?(n=r&&r.code?r.code:4003,t._onError(e),t._onClose(n,e.toString()),t.socket.close(n)):(t.state=t.OPEN,i.prototype.emit.call(t,"open",r),t._resetPingTimeout())}))},p.prototype._handshake=function(t){var e=this;this.auth.loadToken(this.authTokenName,(function(r,n){if(r)t(r);else{e.emit("#handshake",{authToken:n},{force:!0},(function(e,r){r&&(r.authToken=n,r.authError&&(r.authError=c.hydrateError(r.authError))),t(e,r)}))}}))},p.prototype._abortAllPendingEventsDueToBadConnection=function(t){for(var e in this._callbackMap)if(this._callbackMap.hasOwnProperty(e)){var r=this._callbackMap[e];delete this._callbackMap[e],clearTimeout(r.timeout),delete r.timeout;var n="Event '"+r.event+"' was aborted due to a bad connection",o=new u(n,t),i=r.callback;delete r.callback,i.call(r,o,r)}},p.prototype._onClose=function(t,e){delete this.socket.onopen,delete this.socket.onclose,delete this.socket.onmessage,delete this.socket.onerror,clearTimeout(this._connectTimeoutRef),clearTimeout(this._pingTimeoutTicker),clearTimeout(this._batchTimeout),this.state===this.OPEN?(this.state=this.CLOSED,i.prototype.emit.call(this,"close",t,e),this._abortAllPendingEventsDueToBadConnection("disconnect")):this.state===this.CONNECTING&&(this.state=this.CLOSED,i.prototype.emit.call(this,"openAbort",t,e),this._abortAllPendingEventsDueToBadConnection("connectAbort"))},p.prototype._handleEventObject=function(t,e){if(t&&null!=t.event){var r=new s(this,t.cid);i.prototype.emit.call(this,"event",t.event,t.data,r)}else if(t&&null!=t.rid){var n=this._callbackMap[t.rid];if(n&&(clearTimeout(n.timeout),delete n.timeout,delete this._callbackMap[t.rid],n.callback)){var o=c.hydrateError(t.error);n.callback(o,t.data)}}else i.prototype.emit.call(this,"event","raw",e)},p.prototype._onMessage=function(t){i.prototype.emit.call(this,"event","message",t);var e=this.decode(t);if("#1"===e)this._resetPingTimeout(),this.socket.readyState===this.socket.OPEN&&this.sendObject("#2");else if(Array.isArray(e))for(var r=e.length,n=0;n0&&h>c&&(h=c);for(var u=0;u=0?(p=y.substr(0,g),l=y.substr(g+1)):(p=y,l=""),f=decodeURIComponent(p),d=decodeURIComponent(l),n(s,f)?o(s[f])?s[f].push(d):s[f]=[s[f],d]:s[f]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},498:function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return o(t[s])?i(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n0?s-4:s;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[u++]=255&e);1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e);return c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;sa?a:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var o,i,s=[],a=e;a>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},503:function(t,e){e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<>1,u=-7,p=r?o-1:0,l=r?-1:1,f=t[e+p];for(p+=l,i=f&(1<<-u)-1,f>>=-u,u+=a;u>0;i=256*i+t[e+p],p+=l,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=n;u>0;s=256*s+t[e+p],p+=l,u-=8);if(0===i)i=1-h;else{if(i===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),i-=h}return(f?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,c,h=8*i-o-1,u=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+p>=1?l/c:l*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=u?(a=0,s=u):s+p>=1?(a=(e*c-1)*Math.pow(2,o),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;t[r+f]=255&a,f+=d,a/=256,o-=8);for(s=s<0;t[r+f]=255&s,f+=d,s/=256,h-=8);t[r+f-d]|=128*y}},504:function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},505:function(t,e,r){(function(e){var r=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var r,n,o;try{r=Map}catch(t){r=function(){}}try{n=Set}catch(t){n=function(){}}try{o=Promise}catch(t){o=function(){}}function i(s,c,h,u,p){"object"==typeof c&&(h=c.depth,u=c.prototype,p=c.includeNonEnumerable,c=c.circular);var l=[],f=[],d=void 0!==e;return void 0===c&&(c=!0),void 0===h&&(h=1/0),function s(h,y){if(null===h)return null;if(0===y)return h;var g,m;if("object"!=typeof h)return h;if(t(h,r))g=new r;else if(t(h,n))g=new n;else if(t(h,o))g=new o((function(t,e){h.then((function(e){t(s(e,y-1))}),(function(t){e(s(t,y-1))}))}));else if(i.__isArray(h))g=[];else if(i.__isRegExp(h))g=new RegExp(h.source,a(h)),h.lastIndex&&(g.lastIndex=h.lastIndex);else if(i.__isDate(h))g=new Date(h.getTime());else{if(d&&e.isBuffer(h))return g=new e(h.length),h.copy(g),g;t(h,Error)?g=Object.create(h):void 0===u?(m=Object.getPrototypeOf(h),g=Object.create(m)):(g=Object.create(u),m=u)}if(c){var b=l.indexOf(h);if(-1!=b)return f[b];l.push(h),f.push(g)}for(var v in t(h,r)&&h.forEach((function(t,e){var r=s(e,y-1),n=s(t,y-1);g.set(r,n)})),t(h,n)&&h.forEach((function(t){var e=s(t,y-1);g.add(e)})),h){var E;m&&(E=Object.getOwnPropertyDescriptor(m,v)),E&&null==E.set||(g[v]=s(h[v],y-1))}if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(h);for(v=0;va)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,c=y,o=l;var m=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;u[h++]=m>>>24&255,u[h++]=m>>>16&255,u[h++]=m>>>8&255,u[h++]=255&m;var b=d/4294967296*1e4&268435455;u[h++]=b>>>8&255,u[h++]=255&b,u[h++]=b>>>24&15|16,u[h++]=b>>>16&255,u[h++]=l>>>8|128,u[h++]=255&l;for(var v=0;v<6;++v)u[h+v]=p[v];return e||s(u)}},509:function(t,e,r){var n=r(488),o=r(489);t.exports=function(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var s=(t=t||{}).random||(t.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;++a)e[i+a]=s[a];return e||o(s)}}}]); +//# sourceMappingURL=1.76e60b1aab09f2ea2bea.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map new file mode 100644 index 0000000000..8cf3730b86 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./node_modules/sc-errors/index.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/component-emitter/index.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/scclientsocket.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/response.js","webpack://LHCReactAPP/./node_modules/querystring-es3/index.js","webpack://LHCReactAPP/./node_modules/buffer/index.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/uuid/lib/rng-browser.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/uuid/lib/bytesToUuid.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/index.js","webpack://LHCReactAPP/./node_modules/sc-channel/index.js","webpack://LHCReactAPP/./node_modules/sc-channel/node_modules/component-emitter/index.js","webpack://LHCReactAPP/./node_modules/sc-errors/decycle.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/auth.js","webpack://LHCReactAPP/./node_modules/sc-formatter/index.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/sctransport.js","webpack://LHCReactAPP/./node_modules/querystring-es3/decode.js","webpack://LHCReactAPP/./node_modules/querystring-es3/encode.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/ws-browser.js","webpack://LHCReactAPP/./node_modules/linked-list/index.js","webpack://LHCReactAPP/./node_modules/linked-list/_source/linked-list.js","webpack://LHCReactAPP/./node_modules/base64-js/index.js","webpack://LHCReactAPP/./node_modules/ieee754/index.js","webpack://LHCReactAPP/./node_modules/isarray/index.js","webpack://LHCReactAPP/./node_modules/clone/clone.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/lib/factory.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/uuid/index.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/uuid/v1.js","webpack://LHCReactAPP/./node_modules/socketcluster-client/node_modules/uuid/v4.js"],"names":["decycle","isStrict","this","AuthTokenExpiredError","message","expiry","name","Error","captureStackTrace","arguments","callee","stack","AuthTokenInvalidError","AuthTokenNotBeforeError","date","AuthTokenError","AuthError","SilentMiddlewareBlockedError","type","InvalidActionError","InvalidArgumentsError","InvalidOptionsError","InvalidMessageError","SocketProtocolError","code","ServerProtocolError","HTTPServerError","ResourceLimitError","TimeoutError","BadConnectionError","BrokerError","ProcessExitError","UnknownError","prototype","Object","create","module","exports","socketProtocolErrorStatuses","1001","1002","1003","1005","1006","1007","1008","1009","1010","1011","4000","4001","4002","4003","4004","4005","4006","4007","4008","4009","socketProtocolIgnoreStatuses","1000","unserializableErrorProperties","domain","domainEmitter","domainThrown","dehydrateError","error","includeStackTrace","dehydratedError","i","hydrateError","hydratedError","hasOwnProperty","Emitter","obj","key","mixin","on","addEventListener","event","fn","_callbacks","push","once","off","apply","removeListener","removeAllListeners","removeEventListener","length","cb","callbacks","splice","emit","args","slice","call","len","listeners","hasListeners","SCChannel","AuthEngine","Response","formatter","SCTransport","querystring","LinkedList","Buffer","clone","scErrors","isBrowser","window","SCClientSocket","opts","self","id","state","CLOSED","authState","UNAUTHENTICATED","signedAuthToken","authToken","pendingReconnect","pendingReconnectTimeout","preparingPendingSubscriptions","clientId","connectTimeout","ackTimeout","channelPrefix","disconnectOnUnload","authTokenName","pingTimeout","pingTimeoutDisabled","active","_clientMap","clientMap","maxTimeout","Math","pow","verifyDuration","propertyName","_localEvents","connectAttempts","_emitBuffer","channels","options","_cid","callIdGenerator","autoReconnect","autoReconnectOptions","reconnectOptions","initialDelay","randomness","multiplier","maxDelay","subscriptionRetryOptions","authEngine","auth","codecEngine","codec","protocol","protocolOptionError","_onSCError","path","replace","query","parse","_channelEmitter","_unloadHandler","disconnect","global","autoConnect","connect","CONNECTING","OPEN","AUTHENTICATED","PENDING","ignoreStatuses","errorStatuses","_privateEventHandlerMap","data","undecoratedChannelName","_undecorateChannelName","channel","isSubscribed","_triggerChannelUnsubscribe","response","saveToken","token","err","_changeToAuthenticatedState","end","removeToken","oldToken","_changeToUnauthenticatedStateAndClearTokens","transport","close","getState","getBytesReceived","deauthenticate","callback","open","clearTimeout","_reconnectTimeoutRef","status","_onSCOpen","_onSCClose","res","_onSCEvent","reconnect","destroy","oldState","oldSignedToken","stateChangeData","newState","_extractAuthTokenData","processPendingSubscriptions","decodeBase64","encodedString","from","toString","encodeBase64","decodedString","encodedTokenData","split","tokenData","JSON","e","getAuthToken","getSignedAuthToken","authenticate","authStatus","isAuthenticated","authError","_tryReconnect","timeout","exponent","initialTimeout","round","random","setTimeout","autoSubscribeOnConnect","_flushEmitBuffer","_suspendSubscriptions","channelName","SUBSCRIBED","UNSUBSCRIBED","_abortAllPendingEventsDueToBadConnection","failureType","nextNode","currentNode","head","next","eventObject","detach","errorMessage","cid","cancelPendingResponse","openAbort","closeMessage","handler","decode","encode","object","emitObject","_handleEventAckTimeout","eventNode","_emit","Item","cloneData","append","send","publish","pubData","_decorateChannelName","_triggerChannelSubscribe","subscriptionOptions","_triggerChannelSubscribeFail","meetsAuthRequirements","waitForAuth","_cancelPendingSubscribeCallback","_pendingSubscriptionCid","decoratedChannelName","indexOf","_trySubscribe","noTimeout","batch","subscribe","setOptions","_tryUnsubscribe","unsubscribe","currentChannel","destroyChannel","unwatch","subscriptions","includePending","subs","pendingChannels","sort","a","b","ap","priority","bp","forEach","watch","watchers","socket","sent","_respond","responseData","rid","undefined","stringify","base64","ieee754","isArray","kMaxLength","TYPED_ARRAY_SUPPORT","createBuffer","that","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","allocUnsafe","value","TypeError","ArrayBuffer","array","byteOffset","byteLength","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","fromString","isBuffer","checked","copy","buffer","val","fromObject","assertSize","size","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","start","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","m","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","lastIndexOf","arr","indexSize","arrLength","valLength","String","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","charCodeAt","asciiToBytes","latin1Write","base64Write","ucs2Write","units","c","hi","lo","utf16leToBytes","fromByteArray","min","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","fromCharCode","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","foo","subarray","typedArraySupport","poolSize","_augment","Symbol","species","defineProperty","configurable","fill","allocUnsafeSlow","_isBuffer","compare","x","y","concat","list","pos","swap16","swap32","swap64","equals","inspect","max","match","join","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","INVALID_BASE64_RE","Infinity","leadSurrogate","toByteArray","trim","stringtrim","base64clean","src","dst","getRandomValues","crypto","bind","msCrypto","rnds8","rnds","r","byteToHex","bth","factory","clients","version","client","objects","paths","derez","nu","Boolean","Date","RegExp","$ref","_internalStorage","isLocalStorageEnabled","_checkLocalStorageEnabled","localStorage","setItem","removeItem","loadToken","getItem","validJSONStartRegex","arrayBufferToBase64","arraybuffer","base64Chars","substring","binaryToBase64Replacer","input","test","WebSocket","createWebSocket","uri","_pingTimeoutTicker","_callbackMap","_batchSendList","wsSocket","binaryType","onopen","_onOpen","onclose","_onClose","reason","onmessage","flags","_onMessage","onerror","_connectTimeoutRef","host","schema","secure","timestampRequests","timestampParam","getTime","port","hostname","_resetPingTimeout","_handshake","statusCode","_onError","force","badConnectionError","_batchTimeout","_handleEventObject","rehydratedError","readyState","sendObject","bytesReceived","packet","simpleEventObject","Function","serializeObject","formatError","sendObjectBatch","pubSubBatchDuration","sendObjectSingle","prop","qs","sep","eq","regexp","maxKeys","kstr","vstr","k","v","idx","decodeURIComponent","xs","stringifyPrimitive","map","objectKeys","ks","encodeURIComponent","f","keys","WorkerGlobalScope","MozWebSocket","ws","protocols","ListPrototype","List","ListItem","of","items","iterator","item","tail","toArray","result","prepend","ListItemPrototype","prev","b64","lens","getLens","validLen","placeHoldersLen","tmp","Arr","_byteLength","curByte","revLookup","uint8","extraBytes","parts","len2","encodeChunk","lookup","num","output","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","d","s","NaN","rt","abs","log","LN2","_instanceof","nativeMap","nativeSet","nativePromise","Map","_","Set","Promise","parent","circular","depth","includeNonEnumerable","allParents","allChildren","useBuffer","_clone","child","proto","resolve","reject","then","__isArray","__isRegExp","source","__getRegExpFlags","lastIndex","__isDate","getPrototypeOf","index","keyChild","valueChild","entryChild","add","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","allPropertyNames","getOwnPropertyNames","__objToStr","o","re","ignoreCase","multiline","clonePrototype","uuid","_clients","getPort","isSecureDefault","isSecure","location","multiplex","v4","protocolPrefix","queryString","queryArray","queryMap","getMultiplexId","v1","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","msecs","nsecs","dt","tl","tmh","ii"],"mappings":"mGAAA,IAAIA,EAAU,EAAQ,KAElBC,EAAW,WAAe,OAAQC,KAAvB,GAEf,SAASC,EAAsBC,EAASC,GACtCH,KAAKI,KAAO,wBACZJ,KAAKE,QAAUA,EACfF,KAAKG,OAASA,EACVE,MAAMC,oBAAsBP,EAC9BM,MAAMC,kBAAkBN,KAAMO,UAAUC,QAExCR,KAAKS,OAAQ,IAAKJ,OAASI,MAM/B,SAASC,EAAsBR,GAC7BF,KAAKI,KAAO,wBACZJ,KAAKE,QAAUA,EACXG,MAAMC,oBAAsBP,EAC9BM,MAAMC,kBAAkBN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AM/N,EAAK+N,GAIvB,OAAOrX,GAAO0W,EAAYpN","file":"1.76e60b1aab09f2ea2bea.ie.js","sourcesContent":["var decycle = require('./decycle');\n\nvar isStrict = (function () { return !this; })();\n\nfunction AuthTokenExpiredError(message, expiry) {\n this.name = 'AuthTokenExpiredError';\n this.message = message;\n this.expiry = expiry;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nAuthTokenExpiredError.prototype = Object.create(Error.prototype);\n\n\nfunction AuthTokenInvalidError(message) {\n this.name = 'AuthTokenInvalidError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nAuthTokenInvalidError.prototype = Object.create(Error.prototype);\n\n\nfunction AuthTokenNotBeforeError(message, date) {\n this.name = 'AuthTokenNotBeforeError';\n this.message = message;\n this.date = date;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nAuthTokenNotBeforeError.prototype = Object.create(Error.prototype);\n\n\n// For any other auth token error.\nfunction AuthTokenError(message) {\n this.name = 'AuthTokenError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nAuthTokenError.prototype = Object.create(Error.prototype);\n\n// For any other auth error; not specifically related to the auth token itself.\nfunction AuthError(message) {\n this.name = 'AuthError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nAuthError.prototype = Object.create(Error.prototype);\n\n\nfunction SilentMiddlewareBlockedError(message, type) {\n this.name = 'SilentMiddlewareBlockedError';\n this.message = message;\n this.type = type;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nSilentMiddlewareBlockedError.prototype = Object.create(Error.prototype);\n\n\nfunction InvalidActionError(message) {\n this.name = 'InvalidActionError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nInvalidActionError.prototype = Object.create(Error.prototype);\n\nfunction InvalidArgumentsError(message) {\n this.name = 'InvalidArgumentsError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nInvalidArgumentsError.prototype = Object.create(Error.prototype);\n\nfunction InvalidOptionsError(message) {\n this.name = 'InvalidOptionsError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nInvalidOptionsError.prototype = Object.create(Error.prototype);\n\n\nfunction InvalidMessageError(message) {\n this.name = 'InvalidMessageError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nInvalidMessageError.prototype = Object.create(Error.prototype);\n\n\nfunction SocketProtocolError(message, code) {\n this.name = 'SocketProtocolError';\n this.message = message;\n this.code = code;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nSocketProtocolError.prototype = Object.create(Error.prototype);\n\n\nfunction ServerProtocolError(message) {\n this.name = 'ServerProtocolError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nServerProtocolError.prototype = Object.create(Error.prototype);\n\nfunction HTTPServerError(message) {\n this.name = 'HTTPServerError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nHTTPServerError.prototype = Object.create(Error.prototype);\n\n\nfunction ResourceLimitError(message) {\n this.name = 'ResourceLimitError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nResourceLimitError.prototype = Object.create(Error.prototype);\n\n\nfunction TimeoutError(message) {\n this.name = 'TimeoutError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nTimeoutError.prototype = Object.create(Error.prototype);\n\n\nfunction BadConnectionError(message, type) {\n this.name = 'BadConnectionError';\n this.message = message;\n this.type = type;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nBadConnectionError.prototype = Object.create(Error.prototype);\n\n\nfunction BrokerError(message) {\n this.name = 'BrokerError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nBrokerError.prototype = Object.create(Error.prototype);\n\n\nfunction ProcessExitError(message, code) {\n this.name = 'ProcessExitError';\n this.message = message;\n this.code = code;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nProcessExitError.prototype = Object.create(Error.prototype);\n\n\nfunction UnknownError(message) {\n this.name = 'UnknownError';\n this.message = message;\n if (Error.captureStackTrace && !isStrict) {\n Error.captureStackTrace(this, arguments.callee);\n } else {\n this.stack = (new Error()).stack;\n }\n}\nUnknownError.prototype = Object.create(Error.prototype);\n\n\n// Expose all error types.\n\nmodule.exports = {\n AuthTokenExpiredError: AuthTokenExpiredError,\n AuthTokenInvalidError: AuthTokenInvalidError,\n AuthTokenNotBeforeError: AuthTokenNotBeforeError,\n AuthTokenError: AuthTokenError,\n AuthError: AuthError,\n SilentMiddlewareBlockedError: SilentMiddlewareBlockedError,\n InvalidActionError: InvalidActionError,\n InvalidArgumentsError: InvalidArgumentsError,\n InvalidOptionsError: InvalidOptionsError,\n InvalidMessageError: InvalidMessageError,\n SocketProtocolError: SocketProtocolError,\n ServerProtocolError: ServerProtocolError,\n HTTPServerError: HTTPServerError,\n ResourceLimitError: ResourceLimitError,\n TimeoutError: TimeoutError,\n BadConnectionError: BadConnectionError,\n BrokerError: BrokerError,\n ProcessExitError: ProcessExitError,\n UnknownError: UnknownError\n};\n\nmodule.exports.socketProtocolErrorStatuses = {\n 1001: 'Socket was disconnected',\n 1002: 'A WebSocket protocol error was encountered',\n 1003: 'Server terminated socket because it received invalid data',\n 1005: 'Socket closed without status code',\n 1006: 'Socket hung up',\n 1007: 'Message format was incorrect',\n 1008: 'Encountered a policy violation',\n 1009: 'Message was too big to process',\n 1010: 'Client ended the connection because the server did not comply with extension requirements',\n 1011: 'Server encountered an unexpected fatal condition',\n 4000: 'Server ping timed out',\n 4001: 'Client pong timed out',\n 4002: 'Server failed to sign auth token',\n 4003: 'Failed to complete handshake',\n 4004: 'Client failed to save auth token',\n 4005: 'Did not receive #handshake from client before timeout',\n 4006: 'Failed to bind socket to message broker',\n 4007: 'Client connection establishment timed out',\n 4008: 'Server rejected handshake from client',\n 4009: 'Server received a message before the client handshake'\n};\n\nmodule.exports.socketProtocolIgnoreStatuses = {\n 1000: 'Socket closed normally',\n 1001: 'Socket hung up'\n};\n\n// Properties related to error domains cannot be serialized.\nvar unserializableErrorProperties = {\n domain: 1,\n domainEmitter: 1,\n domainThrown: 1\n};\n\n// Convert an error into a JSON-compatible type which can later be hydrated\n// back to its *original* form.\nmodule.exports.dehydrateError = function dehydrateError(error, includeStackTrace) {\n var dehydratedError;\n\n if (error && typeof error === 'object') {\n dehydratedError = {\n message: error.message\n };\n if (includeStackTrace) {\n dehydratedError.stack = error.stack;\n }\n for (var i in error) {\n if (!unserializableErrorProperties[i]) {\n dehydratedError[i] = error[i];\n }\n }\n } else if (typeof error === 'function') {\n dehydratedError = '[function ' + (error.name || 'anonymous') + ']';\n } else {\n dehydratedError = error;\n }\n\n return decycle(dehydratedError);\n};\n\n// Convert a dehydrated error back to its *original* form.\nmodule.exports.hydrateError = function hydrateError(error) {\n var hydratedError = null;\n if (error != null) {\n if (typeof error === 'object') {\n hydratedError = new Error(error.message);\n for (var i in error) {\n if (error.hasOwnProperty(i)) {\n hydratedError[i] = error[i];\n }\n }\n } else {\n hydratedError = error;\n }\n }\n return hydratedError;\n};\n\nmodule.exports.decycle = decycle;\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","var Emitter = require('component-emitter');\r\nvar SCChannel = require('sc-channel').SCChannel;\r\nvar Response = require('./response').Response;\r\nvar AuthEngine = require('./auth').AuthEngine;\r\nvar formatter = require('sc-formatter');\r\nvar SCTransport = require('./sctransport').SCTransport;\r\nvar querystring = require('querystring');\r\nvar LinkedList = require('linked-list');\r\nvar Buffer = require('buffer/').Buffer;\r\nvar clone = require('clone');\r\n\r\nvar scErrors = require('sc-errors');\r\nvar InvalidArgumentsError = scErrors.InvalidArgumentsError;\r\nvar InvalidMessageError = scErrors.InvalidMessageError;\r\nvar InvalidActionError = scErrors.InvalidActionError;\r\nvar SocketProtocolError = scErrors.SocketProtocolError;\r\nvar TimeoutError = scErrors.TimeoutError;\r\nvar BadConnectionError = scErrors.BadConnectionError;\r\n\r\nvar isBrowser = typeof window !== 'undefined';\r\n\r\n\r\nvar SCClientSocket = function (opts) {\r\n var self = this;\r\n\r\n Emitter.call(this);\r\n\r\n this.id = null;\r\n this.state = this.CLOSED;\r\n this.authState = this.UNAUTHENTICATED;\r\n this.signedAuthToken = null;\r\n this.authToken = null;\r\n this.pendingReconnect = false;\r\n this.pendingReconnectTimeout = null;\r\n this.preparingPendingSubscriptions = false;\r\n this.clientId = opts.clientId;\r\n\r\n this.connectTimeout = opts.connectTimeout;\r\n this.ackTimeout = opts.ackTimeout;\r\n this.channelPrefix = opts.channelPrefix || null;\r\n this.disconnectOnUnload = opts.disconnectOnUnload == null ? true : opts.disconnectOnUnload;\r\n this.authTokenName = opts.authTokenName;\r\n\r\n // pingTimeout will be ackTimeout at the start, but it will\r\n // be updated with values provided by the 'connect' event\r\n this.pingTimeout = this.ackTimeout;\r\n this.pingTimeoutDisabled = !!opts.pingTimeoutDisabled;\r\n this.active = true;\r\n\r\n this._clientMap = opts.clientMap || {};\r\n\r\n var maxTimeout = Math.pow(2, 31) - 1;\r\n\r\n var verifyDuration = function (propertyName) {\r\n if (self[propertyName] > maxTimeout) {\r\n throw new InvalidArgumentsError('The ' + propertyName +\r\n ' value provided exceeded the maximum amount allowed');\r\n }\r\n };\r\n\r\n verifyDuration('connectTimeout');\r\n verifyDuration('ackTimeout');\r\n\r\n this._localEvents = {\r\n 'connect': 1,\r\n 'connectAbort': 1,\r\n 'close': 1,\r\n 'disconnect': 1,\r\n 'message': 1,\r\n 'error': 1,\r\n 'raw': 1,\r\n 'kickOut': 1,\r\n 'subscribe': 1,\r\n 'unsubscribe': 1,\r\n 'subscribeStateChange': 1,\r\n 'authStateChange': 1,\r\n 'authenticate': 1,\r\n 'deauthenticate': 1,\r\n 'removeAuthToken': 1,\r\n 'subscribeRequest': 1\r\n };\r\n\r\n this.connectAttempts = 0;\r\n\r\n this._emitBuffer = new LinkedList();\r\n this.channels = {};\r\n\r\n this.options = opts;\r\n\r\n this._cid = 1;\r\n\r\n this.options.callIdGenerator = function () {\r\n return self._cid++;\r\n };\r\n\r\n if (this.options.autoReconnect) {\r\n if (this.options.autoReconnectOptions == null) {\r\n this.options.autoReconnectOptions = {};\r\n }\r\n\r\n // Add properties to the this.options.autoReconnectOptions object.\r\n // We assign the reference to a reconnectOptions variable to avoid repetition.\r\n var reconnectOptions = this.options.autoReconnectOptions;\r\n if (reconnectOptions.initialDelay == null) {\r\n reconnectOptions.initialDelay = 10000;\r\n }\r\n if (reconnectOptions.randomness == null) {\r\n reconnectOptions.randomness = 10000;\r\n }\r\n if (reconnectOptions.multiplier == null) {\r\n reconnectOptions.multiplier = 1.5;\r\n }\r\n if (reconnectOptions.maxDelay == null) {\r\n reconnectOptions.maxDelay = 60000;\r\n }\r\n }\r\n\r\n if (this.options.subscriptionRetryOptions == null) {\r\n this.options.subscriptionRetryOptions = {};\r\n }\r\n\r\n if (this.options.authEngine) {\r\n this.auth = this.options.authEngine;\r\n } else {\r\n this.auth = new AuthEngine();\r\n }\r\n\r\n if (this.options.codecEngine) {\r\n this.codec = this.options.codecEngine;\r\n } else {\r\n // Default codec engine\r\n this.codec = formatter;\r\n }\r\n\r\n if (this.options.protocol) {\r\n var protocolOptionError = new InvalidArgumentsError('The \"protocol\" option' +\r\n ' does not affect socketcluster-client. If you want to utilize SSL/TLS' +\r\n ' - use \"secure\" option instead');\r\n this._onSCError(protocolOptionError);\r\n }\r\n\r\n this.options.path = this.options.path.replace(/\\/$/, '') + '/';\r\n\r\n this.options.query = opts.query || {};\r\n if (typeof this.options.query === 'string') {\r\n this.options.query = querystring.parse(this.options.query);\r\n }\r\n\r\n this._channelEmitter = new Emitter();\r\n\r\n this._unloadHandler = function () {\r\n self.disconnect();\r\n };\r\n\r\n if (isBrowser && this.disconnectOnUnload && global.addEventListener) {\r\n global.addEventListener('beforeunload', this._unloadHandler, false);\r\n }\r\n this._clientMap[this.clientId] = this;\r\n\r\n if (this.options.autoConnect) {\r\n this.connect();\r\n }\r\n};\r\n\r\nSCClientSocket.prototype = Object.create(Emitter.prototype);\r\n\r\nSCClientSocket.CONNECTING = SCClientSocket.prototype.CONNECTING = SCTransport.prototype.CONNECTING;\r\nSCClientSocket.OPEN = SCClientSocket.prototype.OPEN = SCTransport.prototype.OPEN;\r\nSCClientSocket.CLOSED = SCClientSocket.prototype.CLOSED = SCTransport.prototype.CLOSED;\r\n\r\nSCClientSocket.AUTHENTICATED = SCClientSocket.prototype.AUTHENTICATED = 'authenticated';\r\nSCClientSocket.UNAUTHENTICATED = SCClientSocket.prototype.UNAUTHENTICATED = 'unauthenticated';\r\n\r\nSCClientSocket.PENDING = SCClientSocket.prototype.PENDING = 'pending';\r\n\r\nSCClientSocket.ignoreStatuses = scErrors.socketProtocolIgnoreStatuses;\r\nSCClientSocket.errorStatuses = scErrors.socketProtocolErrorStatuses;\r\n\r\nSCClientSocket.prototype._privateEventHandlerMap = {\r\n '#publish': function (data) {\r\n var undecoratedChannelName = this._undecorateChannelName(data.channel);\r\n var isSubscribed = this.isSubscribed(undecoratedChannelName, true);\r\n\r\n if (isSubscribed) {\r\n this._channelEmitter.emit(undecoratedChannelName, data.data);\r\n }\r\n },\r\n '#kickOut': function (data) {\r\n var undecoratedChannelName = this._undecorateChannelName(data.channel);\r\n var channel = this.channels[undecoratedChannelName];\r\n if (channel) {\r\n Emitter.prototype.emit.call(this, 'kickOut', data.message, undecoratedChannelName);\r\n channel.emit('kickOut', data.message, undecoratedChannelName);\r\n this._triggerChannelUnsubscribe(channel);\r\n }\r\n },\r\n '#setAuthToken': function (data, response) {\r\n var self = this;\r\n\r\n if (data) {\r\n var triggerAuthenticate = function (err) {\r\n if (err) {\r\n // This is a non-fatal error, we don't want to close the connection\r\n // because of this but we do want to notify the server and throw an error\r\n // on the client.\r\n response.error(err);\r\n self._onSCError(err);\r\n } else {\r\n self._changeToAuthenticatedState(data.token);\r\n response.end();\r\n }\r\n };\r\n\r\n this.auth.saveToken(this.authTokenName, data.token, {}, triggerAuthenticate);\r\n } else {\r\n response.error(new InvalidMessageError('No token data provided by #setAuthToken event'));\r\n }\r\n },\r\n '#removeAuthToken': function (data, response) {\r\n var self = this;\r\n\r\n this.auth.removeToken(this.authTokenName, function (err, oldToken) {\r\n if (err) {\r\n // Non-fatal error - Do not close the connection\r\n response.error(err);\r\n self._onSCError(err);\r\n } else {\r\n Emitter.prototype.emit.call(self, 'removeAuthToken', oldToken);\r\n self._changeToUnauthenticatedStateAndClearTokens();\r\n response.end();\r\n }\r\n });\r\n },\r\n '#disconnect': function (data) {\r\n this.transport.close(data.code, data.data);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.getState = function () {\r\n return this.state;\r\n};\r\n\r\nSCClientSocket.prototype.getBytesReceived = function () {\r\n return this.transport.getBytesReceived();\r\n};\r\n\r\nSCClientSocket.prototype.deauthenticate = function (callback) {\r\n var self = this;\r\n\r\n this.auth.removeToken(this.authTokenName, function (err, oldToken) {\r\n if (err) {\r\n // Non-fatal error - Do not close the connection\r\n self._onSCError(err);\r\n } else {\r\n Emitter.prototype.emit.call(self, 'removeAuthToken', oldToken);\r\n if (self.state !== self.CLOSED) {\r\n self.emit('#removeAuthToken');\r\n }\r\n self._changeToUnauthenticatedStateAndClearTokens();\r\n }\r\n callback && callback(err);\r\n });\r\n};\r\n\r\nSCClientSocket.prototype.connect = SCClientSocket.prototype.open = function () {\r\n var self = this;\r\n\r\n if (!this.active) {\r\n var error = new InvalidActionError('Cannot connect a destroyed client');\r\n this._onSCError(error);\r\n return;\r\n }\r\n\r\n if (this.state === this.CLOSED) {\r\n this.pendingReconnect = false;\r\n this.pendingReconnectTimeout = null;\r\n clearTimeout(this._reconnectTimeoutRef);\r\n\r\n this.state = this.CONNECTING;\r\n Emitter.prototype.emit.call(this, 'connecting');\r\n\r\n if (this.transport) {\r\n this.transport.off();\r\n }\r\n\r\n this.transport = new SCTransport(this.auth, this.codec, this.options);\r\n\r\n this.transport.on('open', function (status) {\r\n self.state = self.OPEN;\r\n self._onSCOpen(status);\r\n });\r\n\r\n this.transport.on('error', function (err) {\r\n self._onSCError(err);\r\n });\r\n\r\n this.transport.on('close', function (code, data) {\r\n self.state = self.CLOSED;\r\n self._onSCClose(code, data);\r\n });\r\n\r\n this.transport.on('openAbort', function (code, data) {\r\n self.state = self.CLOSED;\r\n self._onSCClose(code, data, true);\r\n });\r\n\r\n this.transport.on('event', function (event, data, res) {\r\n self._onSCEvent(event, data, res);\r\n });\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.reconnect = function (code, data) {\r\n this.disconnect(code, data);\r\n this.connect();\r\n};\r\n\r\nSCClientSocket.prototype.disconnect = function (code, data) {\r\n code = code || 1000;\r\n\r\n if (typeof code !== 'number') {\r\n throw new InvalidArgumentsError('If specified, the code argument must be a number');\r\n }\r\n\r\n if (this.state === this.OPEN || this.state === this.CONNECTING) {\r\n this.transport.close(code, data);\r\n } else {\r\n this.pendingReconnect = false;\r\n this.pendingReconnectTimeout = null;\r\n clearTimeout(this._reconnectTimeoutRef);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.destroy = function (code, data) {\r\n if (isBrowser && global.removeEventListener) {\r\n global.removeEventListener('beforeunload', this._unloadHandler, false);\r\n }\r\n this.active = false;\r\n this.disconnect(code, data);\r\n delete this._clientMap[this.clientId];\r\n};\r\n\r\nSCClientSocket.prototype._changeToUnauthenticatedStateAndClearTokens = function () {\r\n if (this.authState !== this.UNAUTHENTICATED) {\r\n var oldState = this.authState;\r\n var oldSignedToken = this.signedAuthToken;\r\n this.authState = this.UNAUTHENTICATED;\r\n this.signedAuthToken = null;\r\n this.authToken = null;\r\n\r\n var stateChangeData = {\r\n oldState: oldState,\r\n newState: this.authState\r\n };\r\n Emitter.prototype.emit.call(this, 'authStateChange', stateChangeData);\r\n Emitter.prototype.emit.call(this, 'deauthenticate', oldSignedToken);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._changeToAuthenticatedState = function (signedAuthToken) {\r\n this.signedAuthToken = signedAuthToken;\r\n this.authToken = this._extractAuthTokenData(signedAuthToken);\r\n\r\n if (this.authState !== this.AUTHENTICATED) {\r\n var oldState = this.authState;\r\n this.authState = this.AUTHENTICATED;\r\n var stateChangeData = {\r\n oldState: oldState,\r\n newState: this.authState,\r\n signedAuthToken: signedAuthToken,\r\n authToken: this.authToken\r\n };\r\n if (!this.preparingPendingSubscriptions) {\r\n this.processPendingSubscriptions();\r\n }\r\n\r\n Emitter.prototype.emit.call(this, 'authStateChange', stateChangeData);\r\n }\r\n Emitter.prototype.emit.call(this, 'authenticate', signedAuthToken);\r\n};\r\n\r\nSCClientSocket.prototype.decodeBase64 = function (encodedString) {\r\n return Buffer.from(encodedString, 'base64').toString('utf8');\r\n};\r\n\r\nSCClientSocket.prototype.encodeBase64 = function (decodedString) {\r\n return Buffer.from(decodedString, 'utf8').toString('base64');\r\n};\r\n\r\nSCClientSocket.prototype._extractAuthTokenData = function (signedAuthToken) {\r\n var tokenParts = (signedAuthToken || '').split('.');\r\n var encodedTokenData = tokenParts[1];\r\n if (encodedTokenData != null) {\r\n var tokenData = encodedTokenData;\r\n try {\r\n tokenData = this.decodeBase64(tokenData);\r\n return JSON.parse(tokenData);\r\n } catch (e) {\r\n return tokenData;\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nSCClientSocket.prototype.getAuthToken = function () {\r\n return this.authToken;\r\n};\r\n\r\nSCClientSocket.prototype.getSignedAuthToken = function () {\r\n return this.signedAuthToken;\r\n};\r\n\r\n// Perform client-initiated authentication by providing an encrypted token string.\r\nSCClientSocket.prototype.authenticate = function (signedAuthToken, callback) {\r\n var self = this;\r\n\r\n this.emit('#authenticate', signedAuthToken, function (err, authStatus) {\r\n if (authStatus && authStatus.isAuthenticated != null) {\r\n // If authStatus is correctly formatted (has an isAuthenticated property),\r\n // then we will rehydrate the authError.\r\n if (authStatus.authError) {\r\n authStatus.authError = scErrors.hydrateError(authStatus.authError);\r\n }\r\n } else {\r\n // Some errors like BadConnectionError and TimeoutError will not pass a valid\r\n // authStatus object to the current function, so we need to create it ourselves.\r\n authStatus = {\r\n isAuthenticated: self.authState,\r\n authError: null\r\n };\r\n }\r\n if (err) {\r\n if (err.name !== 'BadConnectionError' && err.name !== 'TimeoutError') {\r\n // In case of a bad/closed connection or a timeout, we maintain the last\r\n // known auth state since those errors don't mean that the token is invalid.\r\n\r\n self._changeToUnauthenticatedStateAndClearTokens();\r\n }\r\n callback && callback(err, authStatus);\r\n } else {\r\n self.auth.saveToken(self.authTokenName, signedAuthToken, {}, function (err) {\r\n if (err) {\r\n self._onSCError(err);\r\n }\r\n if (authStatus.isAuthenticated) {\r\n self._changeToAuthenticatedState(signedAuthToken);\r\n } else {\r\n self._changeToUnauthenticatedStateAndClearTokens();\r\n }\r\n callback && callback(err, authStatus);\r\n });\r\n }\r\n });\r\n};\r\n\r\nSCClientSocket.prototype._tryReconnect = function (initialDelay) {\r\n var self = this;\r\n\r\n var exponent = this.connectAttempts++;\r\n var reconnectOptions = this.options.autoReconnectOptions;\r\n var timeout;\r\n\r\n if (initialDelay == null || exponent > 0) {\r\n var initialTimeout = Math.round(reconnectOptions.initialDelay + (reconnectOptions.randomness || 0) * Math.random());\r\n\r\n timeout = Math.round(initialTimeout * Math.pow(reconnectOptions.multiplier, exponent));\r\n } else {\r\n timeout = initialDelay;\r\n }\r\n\r\n if (timeout > reconnectOptions.maxDelay) {\r\n timeout = reconnectOptions.maxDelay;\r\n }\r\n\r\n clearTimeout(this._reconnectTimeoutRef);\r\n\r\n this.pendingReconnect = true;\r\n this.pendingReconnectTimeout = timeout;\r\n this._reconnectTimeoutRef = setTimeout(function () {\r\n self.connect();\r\n }, timeout);\r\n};\r\n\r\nSCClientSocket.prototype._onSCOpen = function (status) {\r\n var self = this;\r\n\r\n this.preparingPendingSubscriptions = true;\r\n\r\n if (status) {\r\n this.id = status.id;\r\n this.pingTimeout = status.pingTimeout;\r\n this.transport.pingTimeout = this.pingTimeout;\r\n if (status.isAuthenticated) {\r\n this._changeToAuthenticatedState(status.authToken);\r\n } else {\r\n this._changeToUnauthenticatedStateAndClearTokens();\r\n }\r\n } else {\r\n // This can happen if auth.loadToken (in sctransport.js) fails with\r\n // an error - This means that the signedAuthToken cannot be loaded by\r\n // the auth engine and therefore, we need to unauthenticate the client.\r\n this._changeToUnauthenticatedStateAndClearTokens();\r\n }\r\n\r\n this.connectAttempts = 0;\r\n\r\n if (this.options.autoSubscribeOnConnect) {\r\n this.processPendingSubscriptions();\r\n }\r\n\r\n // If the user invokes the callback while in autoSubscribeOnConnect mode, it\r\n // won't break anything.\r\n Emitter.prototype.emit.call(this, 'connect', status, function () {\r\n self.processPendingSubscriptions();\r\n });\r\n\r\n if (this.state === this.OPEN) {\r\n this._flushEmitBuffer();\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._onSCError = function (err) {\r\n var self = this;\r\n\r\n // Throw error in different stack frame so that error handling\r\n // cannot interfere with a reconnect action.\r\n setTimeout(function () {\r\n if (self.listeners('error').length < 1) {\r\n throw err;\r\n } else {\r\n Emitter.prototype.emit.call(self, 'error', err);\r\n }\r\n }, 0);\r\n};\r\n\r\nSCClientSocket.prototype._suspendSubscriptions = function () {\r\n var channel, newState;\r\n for (var channelName in this.channels) {\r\n if (this.channels.hasOwnProperty(channelName)) {\r\n channel = this.channels[channelName];\r\n if (channel.state === channel.SUBSCRIBED ||\r\n channel.state === channel.PENDING) {\r\n\r\n newState = channel.PENDING;\r\n } else {\r\n newState = channel.UNSUBSCRIBED;\r\n }\r\n\r\n this._triggerChannelUnsubscribe(channel, newState);\r\n }\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._abortAllPendingEventsDueToBadConnection = function (failureType) {\r\n var currentNode = this._emitBuffer.head;\r\n var nextNode;\r\n\r\n while (currentNode) {\r\n nextNode = currentNode.next;\r\n var eventObject = currentNode.data;\r\n clearTimeout(eventObject.timeout);\r\n delete eventObject.timeout;\r\n currentNode.detach();\r\n currentNode = nextNode;\r\n\r\n var callback = eventObject.callback;\r\n if (callback) {\r\n delete eventObject.callback;\r\n var errorMessage = \"Event '\" + eventObject.event +\r\n \"' was aborted due to a bad connection\";\r\n var error = new BadConnectionError(errorMessage, failureType);\r\n callback.call(eventObject, error, eventObject);\r\n }\r\n // Cleanup any pending response callback in the transport layer too.\r\n if (eventObject.cid) {\r\n this.transport.cancelPendingResponse(eventObject.cid);\r\n }\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._onSCClose = function (code, data, openAbort) {\r\n var self = this;\r\n\r\n this.id = null;\r\n\r\n if (this.transport) {\r\n this.transport.off();\r\n }\r\n this.pendingReconnect = false;\r\n this.pendingReconnectTimeout = null;\r\n clearTimeout(this._reconnectTimeoutRef);\r\n\r\n this._suspendSubscriptions();\r\n this._abortAllPendingEventsDueToBadConnection(openAbort ? 'connectAbort' : 'disconnect');\r\n\r\n // Try to reconnect\r\n // on server ping timeout (4000)\r\n // or on client pong timeout (4001)\r\n // or on close without status (1005)\r\n // or on handshake failure (4003)\r\n // or on handshake rejection (4008)\r\n // or on socket hung up (1006)\r\n if (this.options.autoReconnect) {\r\n if (code === 4000 || code === 4001 || code === 1005) {\r\n // If there is a ping or pong timeout or socket closes without\r\n // status, don't wait before trying to reconnect - These could happen\r\n // if the client wakes up after a period of inactivity and in this case we\r\n // want to re-establish the connection as soon as possible.\r\n this._tryReconnect(0);\r\n\r\n // Codes 4500 and above will be treated as permanent disconnects.\r\n // Socket will not try to auto-reconnect.\r\n } else if (code !== 1000 && code < 4500) {\r\n this._tryReconnect();\r\n }\r\n }\r\n\r\n if (openAbort) {\r\n Emitter.prototype.emit.call(self, 'connectAbort', code, data);\r\n } else {\r\n Emitter.prototype.emit.call(self, 'disconnect', code, data);\r\n }\r\n Emitter.prototype.emit.call(self, 'close', code, data);\r\n\r\n if (!SCClientSocket.ignoreStatuses[code]) {\r\n var closeMessage;\r\n if (data) {\r\n closeMessage = 'Socket connection closed with status code ' + code + ' and reason: ' + data;\r\n } else {\r\n closeMessage = 'Socket connection closed with status code ' + code;\r\n }\r\n var err = new SocketProtocolError(SCClientSocket.errorStatuses[code] || closeMessage, code);\r\n this._onSCError(err);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._onSCEvent = function (event, data, res) {\r\n var handler = this._privateEventHandlerMap[event];\r\n if (handler) {\r\n handler.call(this, data, res);\r\n } else {\r\n Emitter.prototype.emit.call(this, event, data, function () {\r\n res && res.callback.apply(res, arguments);\r\n });\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.decode = function (message) {\r\n return this.transport.decode(message);\r\n};\r\n\r\nSCClientSocket.prototype.encode = function (object) {\r\n return this.transport.encode(object);\r\n};\r\n\r\nSCClientSocket.prototype._flushEmitBuffer = function () {\r\n var currentNode = this._emitBuffer.head;\r\n var nextNode;\r\n\r\n while (currentNode) {\r\n nextNode = currentNode.next;\r\n var eventObject = currentNode.data;\r\n currentNode.detach();\r\n this.transport.emitObject(eventObject);\r\n currentNode = nextNode;\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._handleEventAckTimeout = function (eventObject, eventNode) {\r\n if (eventNode) {\r\n eventNode.detach();\r\n }\r\n delete eventObject.timeout;\r\n\r\n var callback = eventObject.callback;\r\n if (callback) {\r\n delete eventObject.callback;\r\n var error = new TimeoutError(\"Event response for '\" + eventObject.event + \"' timed out\");\r\n callback.call(eventObject, error, eventObject);\r\n }\r\n // Cleanup any pending response callback in the transport layer too.\r\n if (eventObject.cid) {\r\n this.transport.cancelPendingResponse(eventObject.cid);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._emit = function (event, data, callback) {\r\n var self = this;\r\n\r\n if (this.state === this.CLOSED) {\r\n this.connect();\r\n }\r\n var eventObject = {\r\n event: event,\r\n callback: callback\r\n };\r\n\r\n var eventNode = new LinkedList.Item();\r\n\r\n if (this.options.cloneData) {\r\n eventObject.data = clone(data);\r\n } else {\r\n eventObject.data = data;\r\n }\r\n eventNode.data = eventObject;\r\n\r\n eventObject.timeout = setTimeout(function () {\r\n self._handleEventAckTimeout(eventObject, eventNode);\r\n }, this.ackTimeout);\r\n\r\n this._emitBuffer.append(eventNode);\r\n if (this.state === this.OPEN) {\r\n this._flushEmitBuffer();\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.send = function (data) {\r\n this.transport.send(data);\r\n};\r\n\r\nSCClientSocket.prototype.emit = function (event, data, callback) {\r\n if (this._localEvents[event] == null) {\r\n this._emit(event, data, callback);\r\n } else if (event === 'error') {\r\n Emitter.prototype.emit.call(this, event, data);\r\n } else {\r\n var error = new InvalidActionError('The \"' + event + '\" event is reserved and cannot be emitted on a client socket');\r\n this._onSCError(error);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.publish = function (channelName, data, callback) {\r\n var pubData = {\r\n channel: this._decorateChannelName(channelName),\r\n data: data\r\n };\r\n this.emit('#publish', pubData, callback);\r\n};\r\n\r\nSCClientSocket.prototype._triggerChannelSubscribe = function (channel, subscriptionOptions) {\r\n var channelName = channel.name;\r\n\r\n if (channel.state !== channel.SUBSCRIBED) {\r\n var oldState = channel.state;\r\n channel.state = channel.SUBSCRIBED;\r\n\r\n var stateChangeData = {\r\n channel: channelName,\r\n oldState: oldState,\r\n newState: channel.state,\r\n subscriptionOptions: subscriptionOptions\r\n };\r\n channel.emit('subscribeStateChange', stateChangeData);\r\n channel.emit('subscribe', channelName, subscriptionOptions);\r\n Emitter.prototype.emit.call(this, 'subscribeStateChange', stateChangeData);\r\n Emitter.prototype.emit.call(this, 'subscribe', channelName, subscriptionOptions);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._triggerChannelSubscribeFail = function (err, channel, subscriptionOptions) {\r\n var channelName = channel.name;\r\n var meetsAuthRequirements = !channel.waitForAuth || this.authState === this.AUTHENTICATED;\r\n\r\n if (channel.state !== channel.UNSUBSCRIBED && meetsAuthRequirements) {\r\n channel.state = channel.UNSUBSCRIBED;\r\n\r\n channel.emit('subscribeFail', err, channelName, subscriptionOptions);\r\n Emitter.prototype.emit.call(this, 'subscribeFail', err, channelName, subscriptionOptions);\r\n }\r\n};\r\n\r\n// Cancel any pending subscribe callback\r\nSCClientSocket.prototype._cancelPendingSubscribeCallback = function (channel) {\r\n if (channel._pendingSubscriptionCid != null) {\r\n this.transport.cancelPendingResponse(channel._pendingSubscriptionCid);\r\n delete channel._pendingSubscriptionCid;\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._decorateChannelName = function (channelName) {\r\n if (this.channelPrefix) {\r\n channelName = this.channelPrefix + channelName;\r\n }\r\n return channelName;\r\n};\r\n\r\nSCClientSocket.prototype._undecorateChannelName = function (decoratedChannelName) {\r\n if (this.channelPrefix && decoratedChannelName.indexOf(this.channelPrefix) === 0) {\r\n return decoratedChannelName.replace(this.channelPrefix, '');\r\n }\r\n return decoratedChannelName;\r\n};\r\n\r\nSCClientSocket.prototype._trySubscribe = function (channel) {\r\n var self = this;\r\n\r\n var meetsAuthRequirements = !channel.waitForAuth || this.authState === this.AUTHENTICATED;\r\n\r\n // We can only ever have one pending subscribe action at any given time on a channel\r\n if (this.state === this.OPEN && !this.preparingPendingSubscriptions &&\r\n channel._pendingSubscriptionCid == null && meetsAuthRequirements) {\r\n\r\n var options = {\r\n noTimeout: true\r\n };\r\n\r\n var subscriptionOptions = {\r\n channel: this._decorateChannelName(channel.name)\r\n };\r\n if (channel.waitForAuth) {\r\n options.waitForAuth = true;\r\n subscriptionOptions.waitForAuth = options.waitForAuth;\r\n }\r\n if (channel.data) {\r\n subscriptionOptions.data = channel.data;\r\n }\r\n if (channel.batch) {\r\n options.batch = true;\r\n subscriptionOptions.batch = true;\r\n }\r\n\r\n channel._pendingSubscriptionCid = this.transport.emit(\r\n '#subscribe', subscriptionOptions, options,\r\n function (err) {\r\n delete channel._pendingSubscriptionCid;\r\n if (err) {\r\n self._triggerChannelSubscribeFail(err, channel, subscriptionOptions);\r\n } else {\r\n self._triggerChannelSubscribe(channel, subscriptionOptions);\r\n }\r\n }\r\n );\r\n Emitter.prototype.emit.call(this, 'subscribeRequest', channel.name, subscriptionOptions);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.subscribe = function (channelName, options) {\r\n var channel = this.channels[channelName];\r\n\r\n if (!channel) {\r\n channel = new SCChannel(channelName, this, options);\r\n this.channels[channelName] = channel;\r\n } else if (options) {\r\n channel.setOptions(options);\r\n }\r\n\r\n if (channel.state === channel.UNSUBSCRIBED) {\r\n channel.state = channel.PENDING;\r\n this._trySubscribe(channel);\r\n }\r\n\r\n return channel;\r\n};\r\n\r\nSCClientSocket.prototype._triggerChannelUnsubscribe = function (channel, newState) {\r\n var channelName = channel.name;\r\n var oldState = channel.state;\r\n\r\n if (newState) {\r\n channel.state = newState;\r\n } else {\r\n channel.state = channel.UNSUBSCRIBED;\r\n }\r\n this._cancelPendingSubscribeCallback(channel);\r\n\r\n if (oldState === channel.SUBSCRIBED) {\r\n var stateChangeData = {\r\n channel: channelName,\r\n oldState: oldState,\r\n newState: channel.state\r\n };\r\n channel.emit('subscribeStateChange', stateChangeData);\r\n channel.emit('unsubscribe', channelName);\r\n Emitter.prototype.emit.call(this, 'subscribeStateChange', stateChangeData);\r\n Emitter.prototype.emit.call(this, 'unsubscribe', channelName);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype._tryUnsubscribe = function (channel) {\r\n var self = this;\r\n\r\n if (this.state === this.OPEN) {\r\n var options = {\r\n noTimeout: true\r\n };\r\n if (channel.batch) {\r\n options.batch = true;\r\n }\r\n // If there is a pending subscribe action, cancel the callback\r\n this._cancelPendingSubscribeCallback(channel);\r\n\r\n // This operation cannot fail because the TCP protocol guarantees delivery\r\n // so long as the connection remains open. If the connection closes,\r\n // the server will automatically unsubscribe the client and thus complete\r\n // the operation on the server side.\r\n var decoratedChannelName = this._decorateChannelName(channel.name);\r\n this.transport.emit('#unsubscribe', decoratedChannelName, options);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.unsubscribe = function (channelName) {\r\n var channel = this.channels[channelName];\r\n\r\n if (channel) {\r\n if (channel.state !== channel.UNSUBSCRIBED) {\r\n this._triggerChannelUnsubscribe(channel);\r\n this._tryUnsubscribe(channel);\r\n }\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.channel = function (channelName, options) {\r\n var currentChannel = this.channels[channelName];\r\n\r\n if (!currentChannel) {\r\n currentChannel = new SCChannel(channelName, this, options);\r\n this.channels[channelName] = currentChannel;\r\n }\r\n return currentChannel;\r\n};\r\n\r\nSCClientSocket.prototype.destroyChannel = function (channelName) {\r\n var channel = this.channels[channelName];\r\n\r\n if (channel) {\r\n channel.unwatch();\r\n channel.unsubscribe();\r\n delete this.channels[channelName];\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.subscriptions = function (includePending) {\r\n var subs = [];\r\n var channel, includeChannel;\r\n for (var channelName in this.channels) {\r\n if (this.channels.hasOwnProperty(channelName)) {\r\n channel = this.channels[channelName];\r\n\r\n if (includePending) {\r\n includeChannel = channel && (channel.state === channel.SUBSCRIBED ||\r\n channel.state === channel.PENDING);\r\n } else {\r\n includeChannel = channel && channel.state === channel.SUBSCRIBED;\r\n }\r\n\r\n if (includeChannel) {\r\n subs.push(channelName);\r\n }\r\n }\r\n }\r\n return subs;\r\n};\r\n\r\nSCClientSocket.prototype.isSubscribed = function (channelName, includePending) {\r\n var channel = this.channels[channelName];\r\n if (includePending) {\r\n return !!channel && (channel.state === channel.SUBSCRIBED ||\r\n channel.state === channel.PENDING);\r\n }\r\n return !!channel && channel.state === channel.SUBSCRIBED;\r\n};\r\n\r\nSCClientSocket.prototype.processPendingSubscriptions = function () {\r\n var self = this;\r\n\r\n this.preparingPendingSubscriptions = false;\r\n\r\n var pendingChannels = [];\r\n\r\n for (var i in this.channels) {\r\n if (this.channels.hasOwnProperty(i)) {\r\n var channel = this.channels[i];\r\n if (channel.state === channel.PENDING) {\r\n pendingChannels.push(channel);\r\n }\r\n }\r\n }\r\n\r\n pendingChannels.sort(function (a, b) {\r\n var ap = a.priority || 0;\r\n var bp = b.priority || 0;\r\n if (ap > bp) {\r\n return -1;\r\n }\r\n if (ap < bp) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n\r\n pendingChannels.forEach(function (channel) {\r\n self._trySubscribe(channel);\r\n });\r\n};\r\n\r\nSCClientSocket.prototype.watch = function (channelName, handler) {\r\n if (typeof handler !== 'function') {\r\n throw new InvalidArgumentsError('No handler function was provided');\r\n }\r\n this._channelEmitter.on(channelName, handler);\r\n};\r\n\r\nSCClientSocket.prototype.unwatch = function (channelName, handler) {\r\n if (handler) {\r\n this._channelEmitter.removeListener(channelName, handler);\r\n } else {\r\n this._channelEmitter.removeAllListeners(channelName);\r\n }\r\n};\r\n\r\nSCClientSocket.prototype.watchers = function (channelName) {\r\n return this._channelEmitter.listeners(channelName);\r\n};\r\n\r\nmodule.exports = SCClientSocket;\r\n","var scErrors = require('sc-errors');\r\nvar InvalidActionError = scErrors.InvalidActionError;\r\n\r\nvar Response = function (socket, id) {\r\n this.socket = socket;\r\n this.id = id;\r\n this.sent = false;\r\n};\r\n\r\nResponse.prototype._respond = function (responseData) {\r\n if (this.sent) {\r\n throw new InvalidActionError('Response ' + this.id + ' has already been sent');\r\n } else {\r\n this.sent = true;\r\n this.socket.send(this.socket.encode(responseData));\r\n }\r\n};\r\n\r\nResponse.prototype.end = function (data) {\r\n if (this.id) {\r\n var responseData = {\r\n rid: this.id\r\n };\r\n if (data !== undefined) {\r\n responseData.data = data;\r\n }\r\n this._respond(responseData);\r\n }\r\n};\r\n\r\nResponse.prototype.error = function (error, data) {\r\n if (this.id) {\r\n var err = scErrors.dehydrateError(error);\r\n\r\n var responseData = {\r\n rid: this.id,\r\n error: err\r\n };\r\n if (data !== undefined) {\r\n responseData.data = data;\r\n }\r\n\r\n this._respond(responseData);\r\n }\r\n};\r\n\r\nResponse.prototype.callback = function (error, data) {\r\n if (error) {\r\n this.error(error, data);\r\n } else {\r\n this.end(data);\r\n }\r\n};\r\n\r\nmodule.exports.Response = Response;\r\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n","var SCClientSocket = require('./lib/scclientsocket');\r\nvar factory = require('./lib/factory');\r\n\r\nmodule.exports.factory = factory;\r\nmodule.exports.SCClientSocket = SCClientSocket;\r\n\r\nmodule.exports.Emitter = require('component-emitter');\r\n\r\nmodule.exports.create = function (options) {\r\n return factory.create(options);\r\n};\r\n\r\nmodule.exports.connect = module.exports.create;\r\n\r\nmodule.exports.destroy = function (socket) {\r\n return factory.destroy(socket);\r\n};\r\n\r\nmodule.exports.clients = factory.clients;\r\n\r\nmodule.exports.version = '14.3.1';\r\n","var Emitter = require('component-emitter');\n\nvar SCChannel = function (name, client, options) {\n var self = this;\n\n Emitter.call(this);\n\n this.PENDING = 'pending';\n this.SUBSCRIBED = 'subscribed';\n this.UNSUBSCRIBED = 'unsubscribed';\n\n this.name = name;\n this.state = this.UNSUBSCRIBED;\n this.client = client;\n\n this.options = options || {};\n this.setOptions(this.options);\n};\n\nSCChannel.prototype = Object.create(Emitter.prototype);\n\nSCChannel.prototype.setOptions = function (options) {\n if (!options) {\n options = {};\n }\n this.waitForAuth = options.waitForAuth || false;\n this.batch = options.batch || false;\n\n if (options.data !== undefined) {\n this.data = options.data;\n }\n};\n\nSCChannel.prototype.getState = function () {\n return this.state;\n};\n\nSCChannel.prototype.subscribe = function (options) {\n this.client.subscribe(this.name, options);\n};\n\nSCChannel.prototype.unsubscribe = function () {\n this.client.unsubscribe(this.name);\n};\n\nSCChannel.prototype.isSubscribed = function (includePending) {\n return this.client.isSubscribed(this.name, includePending);\n};\n\nSCChannel.prototype.publish = function (data, callback) {\n this.client.publish(this.name, data, callback);\n};\n\nSCChannel.prototype.watch = function (handler) {\n this.client.watch(this.name, handler);\n};\n\nSCChannel.prototype.unwatch = function (handler) {\n this.client.unwatch(this.name, handler);\n};\n\nSCChannel.prototype.watchers = function () {\n return this.client.watchers(this.name);\n};\n\nSCChannel.prototype.destroy = function () {\n this.client.destroyChannel(this.name);\n};\n\nmodule.exports.SCChannel = SCChannel;\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","// Based on https://github.com/dscape/cycle/blob/master/cycle.js\n\nmodule.exports = function decycle(object) {\n// Make a deep copy of an object or array, assuring that there is at most\n// one instance of each object or array in the resulting structure. The\n// duplicate references (which might be forming cycles) are replaced with\n// an object of the form\n// {$ref: PATH}\n// where the PATH is a JSONPath string that locates the first occurance.\n// So,\n// var a = [];\n// a[0] = a;\n// return JSON.stringify(JSON.decycle(a));\n// produces the string '[{\"$ref\":\"$\"}]'.\n\n// JSONPath is used to locate the unique object. $ indicates the top level of\n// the object or array. [NUMBER] or [STRING] indicates a child member or\n// property.\n\n var objects = [], // Keep a reference to each unique object or array\n paths = []; // Keep the path to each unique object or array\n\n return (function derez(value, path) {\n\n// The derez recurses through the object, producing the deep copy.\n\n var i, // The loop counter\n name, // Property name\n nu; // The new object or array\n\n// typeof null === 'object', so go on if this value is really an object but not\n// one of the weird builtin objects.\n\n if (typeof value === 'object' && value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n\n// If the value is an object or array, look to see if we have already\n// encountered it. If so, return a $ref/path object. This is a hard way,\n// linear search that will get slower as the number of unique objects grows.\n\n for (i = 0; i < objects.length; i += 1) {\n if (objects[i] === value) {\n return {$ref: paths[i]};\n }\n }\n\n// Otherwise, accumulate the unique value and its path.\n\n objects.push(value);\n paths.push(path);\n\n// If it is an array, replicate the array.\n\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n nu = [];\n for (i = 0; i < value.length; i += 1) {\n nu[i] = derez(value[i], path + '[' + i + ']');\n }\n } else {\n\n// If it is an object, replicate the object.\n\n nu = {};\n for (name in value) {\n if (Object.prototype.hasOwnProperty.call(value, name)) {\n nu[name] = derez(value[name],\n path + '[' + JSON.stringify(name) + ']');\n }\n }\n }\n return nu;\n }\n return value;\n }(object, '$'));\n};\n","var AuthEngine = function () {\r\n this._internalStorage = {};\r\n this.isLocalStorageEnabled = this._checkLocalStorageEnabled();\r\n};\r\n\r\nAuthEngine.prototype._checkLocalStorageEnabled = function () {\r\n var err;\r\n try {\r\n // Some browsers will throw an error here if localStorage is disabled.\r\n global.localStorage;\r\n\r\n // Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem\r\n // throw QuotaExceededError. We're going to detect this and avoid hard to debug edge cases.\r\n global.localStorage.setItem('__scLocalStorageTest', 1);\r\n global.localStorage.removeItem('__scLocalStorageTest');\r\n } catch (e) {\r\n err = e;\r\n }\r\n return !err;\r\n};\r\n\r\nAuthEngine.prototype.saveToken = function (name, token, options, callback) {\r\n if (this.isLocalStorageEnabled && global.localStorage) {\r\n global.localStorage.setItem(name, token);\r\n } else {\r\n this._internalStorage[name] = token;\r\n }\r\n callback && callback(null, token);\r\n};\r\n\r\nAuthEngine.prototype.removeToken = function (name, callback) {\r\n var token;\r\n\r\n this.loadToken(name, function (err, authToken) {\r\n token = authToken;\r\n });\r\n\r\n if (this.isLocalStorageEnabled && global.localStorage) {\r\n global.localStorage.removeItem(name);\r\n } else {\r\n delete this._internalStorage[name];\r\n }\r\n\r\n callback && callback(null, token);\r\n};\r\n\r\nAuthEngine.prototype.loadToken = function (name, callback) {\r\n var token;\r\n\r\n if (this.isLocalStorageEnabled && global.localStorage) {\r\n token = global.localStorage.getItem(name);\r\n } else {\r\n token = this._internalStorage[name] || null;\r\n }\r\n callback(null, token);\r\n};\r\n\r\nmodule.exports.AuthEngine = AuthEngine;\r\n","var base64Chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar validJSONStartRegex = /^[ \\n\\r\\t]*[{\\[]/;\n\nvar arrayBufferToBase64 = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer);\n var len = bytes.length;\n var base64 = '';\n\n for (var i = 0; i < len; i += 3) {\n base64 += base64Chars[bytes[i] >> 2];\n base64 += base64Chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += base64Chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += base64Chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nvar binaryToBase64Replacer = function (key, value) {\n if (global.ArrayBuffer && value instanceof global.ArrayBuffer) {\n return {\n base64: true,\n data: arrayBufferToBase64(value)\n };\n } else if (global.Buffer) {\n if (value instanceof global.Buffer){\n return {\n base64: true,\n data: value.toString('base64')\n };\n }\n // Some versions of Node.js convert Buffers to Objects before they are passed to\n // the replacer function - Because of this, we need to rehydrate Buffers\n // before we can convert them to base64 strings.\n if (value && value.type === 'Buffer' && Array.isArray(value.data)) {\n var rehydratedBuffer;\n if (global.Buffer.from) {\n rehydratedBuffer = global.Buffer.from(value.data);\n } else {\n rehydratedBuffer = new global.Buffer(value.data);\n }\n return {\n base64: true,\n data: rehydratedBuffer.toString('base64')\n };\n }\n }\n return value;\n};\n\n// Decode the data which was transmitted over the wire to a JavaScript Object in a format which SC understands.\n// See encode function below for more details.\nmodule.exports.decode = function (input) {\n if (input == null) {\n return null;\n }\n // Leave ping or pong message as is\n if (input === '#1' || input === '#2') {\n return input;\n }\n var message = input.toString();\n\n // Performance optimization to detect invalid JSON packet sooner.\n if (!validJSONStartRegex.test(message)) {\n return message;\n }\n\n try {\n return JSON.parse(message);\n } catch (err) {}\n return message;\n};\n\n// Encode a raw JavaScript object (which is in the SC protocol format) into a format for\n// transfering it over the wire. In this case, we just convert it into a simple JSON string.\n// If you want to create your own custom codec, you can encode the object into any format\n// (e.g. binary ArrayBuffer or string with any kind of compression) so long as your decode\n// function is able to rehydrate that object back into its original JavaScript Object format\n// (which adheres to the SC protocol).\n// See https://github.com/SocketCluster/socketcluster/blob/master/socketcluster-protocol.md\n// for details about the SC protocol.\nmodule.exports.encode = function (object) {\n // Leave ping or pong message as is\n if (object === '#1' || object === '#2') {\n return object;\n }\n return JSON.stringify(object, binaryToBase64Replacer);\n};\n","var Emitter = require('component-emitter');\r\nvar Response = require('./response').Response;\r\nvar querystring = require('querystring');\r\nvar WebSocket;\r\nvar createWebSocket;\r\n\r\nif (global.WebSocket) {\r\n WebSocket = global.WebSocket;\r\n createWebSocket = function (uri, options) {\r\n return new WebSocket(uri);\r\n };\r\n} else {\r\n WebSocket = require('ws');\r\n createWebSocket = function (uri, options) {\r\n return new WebSocket(uri, null, options);\r\n };\r\n}\r\n\r\nvar scErrors = require('sc-errors');\r\nvar TimeoutError = scErrors.TimeoutError;\r\nvar BadConnectionError = scErrors.BadConnectionError;\r\n\r\n\r\nvar SCTransport = function (authEngine, codecEngine, options) {\r\n var self = this;\r\n\r\n this.state = this.CLOSED;\r\n this.auth = authEngine;\r\n this.codec = codecEngine;\r\n this.options = options;\r\n this.connectTimeout = options.connectTimeout;\r\n this.pingTimeout = options.ackTimeout;\r\n this.pingTimeoutDisabled = !!options.pingTimeoutDisabled;\r\n this.callIdGenerator = options.callIdGenerator;\r\n this.authTokenName = options.authTokenName;\r\n\r\n this._pingTimeoutTicker = null;\r\n this._callbackMap = {};\r\n this._batchSendList = [];\r\n\r\n // Open the connection.\r\n\r\n this.state = this.CONNECTING;\r\n var uri = this.uri();\r\n\r\n var wsSocket = createWebSocket(uri, this.options);\r\n wsSocket.binaryType = this.options.binaryType;\r\n\r\n this.socket = wsSocket;\r\n\r\n wsSocket.onopen = function () {\r\n self._onOpen();\r\n };\r\n\r\n wsSocket.onclose = function (event) {\r\n var code;\r\n if (event.code == null) {\r\n // This is to handle an edge case in React Native whereby\r\n // event.code is undefined when the mobile device is locked.\r\n // TODO: This is not perfect since this condition could also apply to\r\n // an abnormal close (no close control frame) which would be a 1006.\r\n code = 1005;\r\n } else {\r\n code = event.code;\r\n }\r\n self._onClose(code, event.reason);\r\n };\r\n\r\n wsSocket.onmessage = function (message, flags) {\r\n self._onMessage(message.data);\r\n };\r\n\r\n wsSocket.onerror = function (error) {\r\n // The onclose event will be called automatically after the onerror event\r\n // if the socket is connected - Otherwise, if it's in the middle of\r\n // connecting, we want to close it manually with a 1006 - This is necessary\r\n // to prevent inconsistent behavior when running the client in Node.js\r\n // vs in a browser.\r\n\r\n if (self.state === self.CONNECTING) {\r\n self._onClose(1006);\r\n }\r\n };\r\n\r\n this._connectTimeoutRef = setTimeout(function () {\r\n self._onClose(4007);\r\n self.socket.close(4007);\r\n }, this.connectTimeout);\r\n};\r\n\r\nSCTransport.prototype = Object.create(Emitter.prototype);\r\n\r\nSCTransport.CONNECTING = SCTransport.prototype.CONNECTING = 'connecting';\r\nSCTransport.OPEN = SCTransport.prototype.OPEN = 'open';\r\nSCTransport.CLOSED = SCTransport.prototype.CLOSED = 'closed';\r\n\r\nSCTransport.prototype.uri = function () {\r\n var query = this.options.query || {};\r\n var schema = this.options.secure ? 'wss' : 'ws';\r\n\r\n if (this.options.timestampRequests) {\r\n query[this.options.timestampParam] = (new Date()).getTime();\r\n }\r\n\r\n query = querystring.encode(query);\r\n\r\n if (query.length) {\r\n query = '?' + query;\r\n }\r\n\r\n var host;\r\n if (this.options.host) {\r\n host = this.options.host;\r\n } else {\r\n var port = '';\r\n\r\n if (this.options.port && ((schema === 'wss' && this.options.port !== 443)\r\n || (schema === 'ws' && this.options.port !== 80))) {\r\n port = ':' + this.options.port;\r\n }\r\n host = this.options.hostname + port;\r\n }\r\n\r\n return schema + '://' + host + this.options.path + query;\r\n};\r\n\r\nSCTransport.prototype._onOpen = function () {\r\n var self = this;\r\n\r\n clearTimeout(this._connectTimeoutRef);\r\n this._resetPingTimeout();\r\n\r\n this._handshake(function (err, status) {\r\n if (err) {\r\n var statusCode;\r\n if (status && status.code) {\r\n statusCode = status.code;\r\n } else {\r\n statusCode = 4003;\r\n }\r\n self._onError(err);\r\n self._onClose(statusCode, err.toString());\r\n self.socket.close(statusCode);\r\n } else {\r\n self.state = self.OPEN;\r\n Emitter.prototype.emit.call(self, 'open', status);\r\n self._resetPingTimeout();\r\n }\r\n });\r\n};\r\n\r\nSCTransport.prototype._handshake = function (callback) {\r\n var self = this;\r\n this.auth.loadToken(this.authTokenName, function (err, token) {\r\n if (err) {\r\n callback(err);\r\n } else {\r\n // Don't wait for this.state to be 'open'.\r\n // The underlying WebSocket (this.socket) is already open.\r\n var options = {\r\n force: true\r\n };\r\n self.emit('#handshake', {\r\n authToken: token\r\n }, options, function (err, status) {\r\n if (status) {\r\n // Add the token which was used as part of authentication attempt\r\n // to the status object.\r\n status.authToken = token;\r\n if (status.authError) {\r\n status.authError = scErrors.hydrateError(status.authError);\r\n }\r\n }\r\n callback(err, status);\r\n });\r\n }\r\n });\r\n};\r\n\r\nSCTransport.prototype._abortAllPendingEventsDueToBadConnection = function (failureType) {\r\n for (var i in this._callbackMap) {\r\n if (this._callbackMap.hasOwnProperty(i)) {\r\n var eventObject = this._callbackMap[i];\r\n delete this._callbackMap[i];\r\n\r\n clearTimeout(eventObject.timeout);\r\n delete eventObject.timeout;\r\n\r\n var errorMessage = \"Event '\" + eventObject.event +\r\n \"' was aborted due to a bad connection\";\r\n var badConnectionError = new BadConnectionError(errorMessage, failureType);\r\n\r\n var callback = eventObject.callback;\r\n delete eventObject.callback;\r\n callback.call(eventObject, badConnectionError, eventObject);\r\n }\r\n }\r\n};\r\n\r\nSCTransport.prototype._onClose = function (code, data) {\r\n delete this.socket.onopen;\r\n delete this.socket.onclose;\r\n delete this.socket.onmessage;\r\n delete this.socket.onerror;\r\n\r\n clearTimeout(this._connectTimeoutRef);\r\n clearTimeout(this._pingTimeoutTicker);\r\n clearTimeout(this._batchTimeout);\r\n\r\n if (this.state === this.OPEN) {\r\n this.state = this.CLOSED;\r\n Emitter.prototype.emit.call(this, 'close', code, data);\r\n this._abortAllPendingEventsDueToBadConnection('disconnect');\r\n\r\n } else if (this.state === this.CONNECTING) {\r\n this.state = this.CLOSED;\r\n Emitter.prototype.emit.call(this, 'openAbort', code, data);\r\n this._abortAllPendingEventsDueToBadConnection('connectAbort');\r\n }\r\n};\r\n\r\nSCTransport.prototype._handleEventObject = function (obj, message) {\r\n if (obj && obj.event != null) {\r\n var response = new Response(this, obj.cid);\r\n Emitter.prototype.emit.call(this, 'event', obj.event, obj.data, response);\r\n } else if (obj && obj.rid != null) {\r\n var eventObject = this._callbackMap[obj.rid];\r\n if (eventObject) {\r\n clearTimeout(eventObject.timeout);\r\n delete eventObject.timeout;\r\n delete this._callbackMap[obj.rid];\r\n\r\n if (eventObject.callback) {\r\n var rehydratedError = scErrors.hydrateError(obj.error);\r\n eventObject.callback(rehydratedError, obj.data);\r\n }\r\n }\r\n } else {\r\n Emitter.prototype.emit.call(this, 'event', 'raw', message);\r\n }\r\n};\r\n\r\nSCTransport.prototype._onMessage = function (message) {\r\n Emitter.prototype.emit.call(this, 'event', 'message', message);\r\n\r\n var obj = this.decode(message);\r\n\r\n // If ping\r\n if (obj === '#1') {\r\n this._resetPingTimeout();\r\n if (this.socket.readyState === this.socket.OPEN) {\r\n this.sendObject('#2');\r\n }\r\n } else {\r\n if (Array.isArray(obj)) {\r\n var len = obj.length;\r\n for (var i = 0; i < len; i++) {\r\n this._handleEventObject(obj[i], message);\r\n }\r\n } else {\r\n this._handleEventObject(obj, message);\r\n }\r\n }\r\n};\r\n\r\nSCTransport.prototype._onError = function (err) {\r\n Emitter.prototype.emit.call(this, 'error', err);\r\n};\r\n\r\nSCTransport.prototype._resetPingTimeout = function () {\r\n if (this.pingTimeoutDisabled) {\r\n return;\r\n }\r\n var self = this;\r\n\r\n var now = (new Date()).getTime();\r\n clearTimeout(this._pingTimeoutTicker);\r\n\r\n this._pingTimeoutTicker = setTimeout(function () {\r\n self._onClose(4000);\r\n self.socket.close(4000);\r\n }, this.pingTimeout);\r\n};\r\n\r\nSCTransport.prototype.getBytesReceived = function () {\r\n return this.socket.bytesReceived;\r\n};\r\n\r\nSCTransport.prototype.close = function (code, data) {\r\n code = code || 1000;\r\n\r\n if (this.state === this.OPEN) {\r\n var packet = {\r\n code: code,\r\n data: data\r\n };\r\n this.emit('#disconnect', packet);\r\n\r\n this._onClose(code, data);\r\n this.socket.close(code);\r\n\r\n } else if (this.state === this.CONNECTING) {\r\n this._onClose(code, data);\r\n this.socket.close(code);\r\n }\r\n};\r\n\r\nSCTransport.prototype.emitObject = function (eventObject, options) {\r\n var simpleEventObject = {\r\n event: eventObject.event,\r\n data: eventObject.data\r\n };\r\n\r\n if (eventObject.callback) {\r\n simpleEventObject.cid = eventObject.cid = this.callIdGenerator();\r\n this._callbackMap[eventObject.cid] = eventObject;\r\n }\r\n\r\n this.sendObject(simpleEventObject, options);\r\n\r\n return eventObject.cid || null;\r\n};\r\n\r\nSCTransport.prototype._handleEventAckTimeout = function (eventObject) {\r\n if (eventObject.cid) {\r\n delete this._callbackMap[eventObject.cid];\r\n }\r\n delete eventObject.timeout;\r\n\r\n var callback = eventObject.callback;\r\n if (callback) {\r\n delete eventObject.callback;\r\n var error = new TimeoutError(\"Event response for '\" + eventObject.event + \"' timed out\");\r\n callback.call(eventObject, error, eventObject);\r\n }\r\n};\r\n\r\n// The last two optional arguments (a and b) can be options and/or callback\r\nSCTransport.prototype.emit = function (event, data, a, b) {\r\n var self = this;\r\n\r\n var callback, options;\r\n\r\n if (b) {\r\n options = a;\r\n callback = b;\r\n } else {\r\n if (a instanceof Function) {\r\n options = {};\r\n callback = a;\r\n } else {\r\n options = a;\r\n }\r\n }\r\n\r\n var eventObject = {\r\n event: event,\r\n data: data,\r\n callback: callback\r\n };\r\n\r\n if (callback && !options.noTimeout) {\r\n eventObject.timeout = setTimeout(function () {\r\n self._handleEventAckTimeout(eventObject);\r\n }, this.options.ackTimeout);\r\n }\r\n\r\n var cid = null;\r\n if (this.state === this.OPEN || options.force) {\r\n cid = this.emitObject(eventObject, options);\r\n }\r\n return cid;\r\n};\r\n\r\nSCTransport.prototype.cancelPendingResponse = function (cid) {\r\n delete this._callbackMap[cid];\r\n};\r\n\r\nSCTransport.prototype.decode = function (message) {\r\n return this.codec.decode(message);\r\n};\r\n\r\nSCTransport.prototype.encode = function (object) {\r\n return this.codec.encode(object);\r\n};\r\n\r\nSCTransport.prototype.send = function (data) {\r\n if (this.socket.readyState !== this.socket.OPEN) {\r\n this._onClose(1005);\r\n } else {\r\n this.socket.send(data);\r\n }\r\n};\r\n\r\nSCTransport.prototype.serializeObject = function (object) {\r\n var str, formatError;\r\n try {\r\n str = this.encode(object);\r\n } catch (err) {\r\n formatError = err;\r\n this._onError(formatError);\r\n }\r\n if (!formatError) {\r\n return str;\r\n }\r\n return null;\r\n};\r\n\r\nSCTransport.prototype.sendObjectBatch = function (object) {\r\n var self = this;\r\n\r\n this._batchSendList.push(object);\r\n if (this._batchTimeout) {\r\n return;\r\n }\r\n\r\n this._batchTimeout = setTimeout(function () {\r\n delete self._batchTimeout;\r\n if (self._batchSendList.length) {\r\n var str = self.serializeObject(self._batchSendList);\r\n if (str != null) {\r\n self.send(str);\r\n }\r\n self._batchSendList = [];\r\n }\r\n }, this.options.pubSubBatchDuration || 0);\r\n};\r\n\r\nSCTransport.prototype.sendObjectSingle = function (object) {\r\n var str = this.serializeObject(object);\r\n if (str != null) {\r\n this.send(str);\r\n }\r\n};\r\n\r\nSCTransport.prototype.sendObject = function (object, options) {\r\n if (options && options.batch) {\r\n this.sendObjectBatch(object);\r\n } else {\r\n this.sendObjectSingle(object);\r\n }\r\n};\r\n\r\nmodule.exports.SCTransport = SCTransport;\r\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","var global;\r\nif (typeof WorkerGlobalScope !== 'undefined') {\r\n global = self;\r\n} else {\r\n global = typeof window !== 'undefined' && window || (function() { return this; })();\r\n}\r\n\r\nvar WebSocket = global.WebSocket || global.MozWebSocket;\r\n\r\n/**\r\n * WebSocket constructor.\r\n *\r\n * The third `opts` options object gets ignored in web browsers, since it's\r\n * non-standard, and throws a TypeError if passed to the constructor.\r\n * See: https://github.com/einaros/ws/issues/227\r\n *\r\n * @param {String} uri\r\n * @param {Array} protocols (optional)\r\n * @param {Object} opts (optional)\r\n * @api public\r\n */\r\n\r\nfunction ws(uri, protocols, opts) {\r\n var instance;\r\n if (protocols) {\r\n instance = new WebSocket(uri, protocols);\r\n } else {\r\n instance = new WebSocket(uri);\r\n }\r\n return instance;\r\n}\r\n\r\nif (WebSocket) ws.prototype = WebSocket.prototype;\r\n\r\nmodule.exports = WebSocket ? ws : null;\r\n","'use strict';\n\nmodule.exports = require('./_source/linked-list.js');\n","'use strict';\n\n/**\n * Constants.\n */\n\nvar errorMessage;\n\nerrorMessage = 'An argument without append, prepend, ' +\n 'or detach methods was given to `List';\n\n/**\n * Creates a new List: A linked list is a bit like an Array, but\n * knows nothing about how many items are in it, and knows only about its\n * first (`head`) and last (`tail`) items. Each item (e.g. `head`, `tail`,\n * &c.) knows which item comes before or after it (its more like the\n * implementation of the DOM in JavaScript).\n * @global\n * @private\n * @constructor\n * @class Represents an instance of List.\n */\n\nfunction List(/*items...*/) {\n if (arguments.length) {\n return List.from(arguments);\n }\n}\n\nvar ListPrototype;\n\nListPrototype = List.prototype;\n\n/**\n * Creates a new list from the arguments (each a list item) passed in.\n * @name List.of\n * @param {...ListItem} [items] - Zero or more items to attach.\n * @returns {list} - A new instance of List.\n */\n\nList.of = function (/*items...*/) {\n return List.from.call(this, arguments);\n};\n\n/**\n * Creates a new list from the given array-like object (each a list item)\n * passed in.\n * @name List.from\n * @param {ListItem[]} [items] - The items to append.\n * @returns {list} - A new instance of List.\n */\nList.from = function (items) {\n var list = new this(), length, iterator, item;\n\n if (items && (length = items.length)) {\n iterator = -1;\n\n while (++iterator < length) {\n item = items[iterator];\n\n if (item !== null && item !== undefined) {\n list.append(item);\n }\n }\n }\n\n return list;\n};\n\n/**\n * List#head\n * Default to `null`.\n */\nListPrototype.head = null;\n\n/**\n * List#tail\n * Default to `null`.\n */\nListPrototype.tail = null;\n\n/**\n * Returns the list's items as an array. This does *not* detach the items.\n * @name List#toArray\n * @returns {ListItem[]} - An array of (still attached) ListItems.\n */\nListPrototype.toArray = function () {\n var item = this.head,\n result = [];\n\n while (item) {\n result.push(item);\n item = item.next;\n }\n\n return result;\n};\n\n/**\n * Prepends the given item to the list: Item will be the new first item\n * (`head`).\n * @name List#prepend\n * @param {ListItem} item - The item to prepend.\n * @returns {ListItem} - An instance of ListItem (the given item).\n */\nListPrototype.prepend = function (item) {\n if (!item) {\n return false;\n }\n\n if (!item.append || !item.prepend || !item.detach) {\n throw new Error(errorMessage + '#prepend`.');\n }\n\n var self, head;\n\n // Cache self.\n self = this;\n\n // If self has a first item, defer prepend to the first items prepend\n // method, and return the result.\n head = self.head;\n\n if (head) {\n return head.prepend(item);\n }\n\n // ...otherwise, there is no `head` (or `tail`) item yet.\n\n // Detach the prependee.\n item.detach();\n\n // Set the prependees parent list to reference self.\n item.list = self;\n\n // Set self's first item to the prependee, and return the item.\n self.head = item;\n\n return item;\n};\n\n/**\n * Appends the given item to the list: Item will be the new last item (`tail`)\n * if the list had a first item, and its first item (`head`) otherwise.\n * @name List#append\n * @param {ListItem} item - The item to append.\n * @returns {ListItem} - An instance of ListItem (the given item).\n */\n\nListPrototype.append = function (item) {\n if (!item) {\n return false;\n }\n\n if (!item.append || !item.prepend || !item.detach) {\n throw new Error(errorMessage + '#append`.');\n }\n\n var self, head, tail;\n\n // Cache self.\n self = this;\n\n // If self has a last item, defer appending to the last items append\n // method, and return the result.\n tail = self.tail;\n\n if (tail) {\n return tail.append(item);\n }\n\n // If self has a first item, defer appending to the first items append\n // method, and return the result.\n head = self.head;\n\n if (head) {\n return head.append(item);\n }\n\n // ...otherwise, there is no `tail` or `head` item yet.\n\n // Detach the appendee.\n item.detach();\n\n // Set the appendees parent list to reference self.\n item.list = self;\n\n // Set self's first item to the appendee, and return the item.\n self.head = item;\n\n return item;\n};\n\n/**\n * Creates a new ListItem: A linked list item is a bit like DOM node:\n * It knows only about its \"parent\" (`list`), the item before it (`prev`),\n * and the item after it (`next`).\n * @global\n * @private\n * @constructor\n * @class Represents an instance of ListItem.\n */\n\nfunction ListItem() {}\n\nList.Item = ListItem;\n\nvar ListItemPrototype = ListItem.prototype;\n\nListItemPrototype.next = null;\n\nListItemPrototype.prev = null;\n\nListItemPrototype.list = null;\n\n/**\n * Detaches the item operated on from its parent list.\n * @name ListItem#detach\n * @returns {ListItem} - The item operated on.\n */\nListItemPrototype.detach = function () {\n // Cache self, the parent list, and the previous and next items.\n var self = this,\n list = self.list,\n prev = self.prev,\n next = self.next;\n\n // If the item is already detached, return self.\n if (!list) {\n return self;\n }\n\n // If self is the last item in the parent list, link the lists last item\n // to the previous item.\n if (list.tail === self) {\n list.tail = prev;\n }\n\n // If self is the first item in the parent list, link the lists first item\n // to the next item.\n if (list.head === self) {\n list.head = next;\n }\n\n // If both the last and first items in the parent list are the same,\n // remove the link to the last item.\n if (list.tail === list.head) {\n list.tail = null;\n }\n\n // If a previous item exists, link its next item to selfs next item.\n if (prev) {\n prev.next = next;\n }\n\n // If a next item exists, link its previous item to selfs previous item.\n if (next) {\n next.prev = prev;\n }\n\n // Remove links from self to both the next and previous items, and to the\n // parent list.\n self.prev = self.next = self.list = null;\n\n // Return self.\n return self;\n};\n\n/**\n * Prepends the given item *before* the item operated on.\n * @name ListItem#prepend\n * @param {ListItem} item - The item to prepend.\n * @returns {ListItem} - The item operated on, or false when that item is not\n * attached.\n */\nListItemPrototype.prepend = function (item) {\n if (!item || !item.append || !item.prepend || !item.detach) {\n throw new Error(errorMessage + 'Item#prepend`.');\n }\n\n // Cache self, the parent list, and the previous item.\n var self = this,\n list = self.list,\n prev = self.prev;\n\n // If self is detached, return false.\n if (!list) {\n return false;\n }\n\n // Detach the prependee.\n item.detach();\n\n // If self has a previous item...\n if (prev) {\n // ...link the prependees previous item, to selfs previous item.\n item.prev = prev;\n\n // ...link the previous items next item, to self.\n prev.next = item;\n }\n\n // Set the prependees next item to self.\n item.next = self;\n\n // Set the prependees parent list to selfs parent list.\n item.list = list;\n\n // Set the previous item of self to the prependee.\n self.prev = item;\n\n // If self is the first item in the parent list, link the lists first item\n // to the prependee.\n if (self === list.head) {\n list.head = item;\n }\n\n // If the the parent list has no last item, link the lists last item to\n // self.\n if (!list.tail) {\n list.tail = self;\n }\n\n // Return the prependee.\n return item;\n};\n\n/**\n * Appends the given item *after* the item operated on.\n * @name ListItem#append\n * @param {ListItem} item - The item to append.\n * @returns {ListItem} - The item operated on, or false when that item is not\n * attached.\n */\nListItemPrototype.append = function (item) {\n // If item is falsey, return false.\n if (!item || !item.append || !item.prepend || !item.detach) {\n throw new Error(errorMessage + 'Item#append`.');\n }\n\n // Cache self, the parent list, and the next item.\n var self = this,\n list = self.list,\n next = self.next;\n\n // If self is detached, return false.\n if (!list) {\n return false;\n }\n\n // Detach the appendee.\n item.detach();\n\n // If self has a next item...\n if (next) {\n // ...link the appendees next item, to selfs next item.\n item.next = next;\n\n // ...link the next items previous item, to the appendee.\n next.prev = item;\n }\n\n // Set the appendees previous item to self.\n item.prev = self;\n\n // Set the appendees parent list to selfs parent list.\n item.list = list;\n\n // Set the next item of self to the appendee.\n self.next = item;\n\n // If the the parent list has no last item or if self is the parent lists\n // last item, link the lists last item to the appendee.\n if (self === list.tail || !list.tail) {\n list.tail = item;\n }\n\n // Return the appendee.\n return item;\n};\n\n/**\n * Expose `List`.\n */\n\nmodule.exports = List;\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","var SCClientSocket = require('./scclientsocket');\r\nvar scErrors = require('sc-errors');\r\nvar uuid = require('uuid');\r\nvar InvalidArgumentsError = scErrors.InvalidArgumentsError;\r\n\r\nvar _clients = {};\r\n\r\nfunction getMultiplexId(options) {\r\n var protocolPrefix = options.secure ? 'https://' : 'http://';\r\n var queryString = '';\r\n if (options.query) {\r\n if (typeof options.query === 'string') {\r\n queryString = options.query;\r\n } else {\r\n var queryArray = [];\r\n var queryMap = options.query;\r\n for (var key in queryMap) {\r\n if (queryMap.hasOwnProperty(key)) {\r\n queryArray.push(key + '=' + queryMap[key]);\r\n }\r\n }\r\n if (queryArray.length) {\r\n queryString = '?' + queryArray.join('&');\r\n }\r\n }\r\n }\r\n var host;\r\n if (options.host) {\r\n host = options.host;\r\n } else {\r\n host = options.hostname + ':' + options.port;\r\n }\r\n return protocolPrefix + host + options.path + queryString;\r\n}\r\n\r\nfunction isUrlSecure() {\r\n return global.location && location.protocol === 'https:';\r\n}\r\n\r\nfunction getPort(options, isSecureDefault) {\r\n var isSecure = options.secure == null ? isSecureDefault : options.secure;\r\n return options.port || (global.location && location.port ? location.port : isSecure ? 443 : 80);\r\n}\r\n\r\nfunction create(options) {\r\n var self = this;\r\n\r\n options = options || {};\r\n\r\n if (options.host && !options.host.match(/[^:]+:\\d{2,5}/)) {\r\n throw new InvalidArgumentsError('The host option should include both' +\r\n ' the hostname and the port number in the format \"hostname:port\"');\r\n }\r\n\r\n if (options.host && options.hostname) {\r\n throw new InvalidArgumentsError('The host option should already include' +\r\n ' the hostname and the port number in the format \"hostname:port\"' +\r\n ' - Because of this, you should never use host and hostname options together');\r\n }\r\n\r\n if (options.host && options.port) {\r\n throw new InvalidArgumentsError('The host option should already include' +\r\n ' the hostname and the port number in the format \"hostname:port\"' +\r\n ' - Because of this, you should never use host and port options together');\r\n }\r\n\r\n var isSecureDefault = isUrlSecure();\r\n\r\n var opts = {\r\n port: getPort(options, isSecureDefault),\r\n hostname: global.location && location.hostname || 'localhost',\r\n path: '/socketcluster/',\r\n secure: isSecureDefault,\r\n autoConnect: true,\r\n autoReconnect: true,\r\n autoSubscribeOnConnect: true,\r\n connectTimeout: 20000,\r\n ackTimeout: 10000,\r\n timestampRequests: false,\r\n timestampParam: 't',\r\n authEngine: null,\r\n authTokenName: 'socketCluster.authToken',\r\n binaryType: 'arraybuffer',\r\n multiplex: true,\r\n pubSubBatchDuration: null,\r\n cloneData: false\r\n };\r\n for (var i in options) {\r\n if (options.hasOwnProperty(i)) {\r\n opts[i] = options[i];\r\n }\r\n }\r\n opts.clientMap = _clients;\r\n\r\n if (opts.multiplex === false) {\r\n opts.clientId = uuid.v4();\r\n var socket = new SCClientSocket(opts);\r\n _clients[opts.clientId] = socket;\r\n return socket;\r\n }\r\n opts.clientId = getMultiplexId(opts);\r\n\r\n if (_clients[opts.clientId]) {\r\n if (opts.autoConnect) {\r\n _clients[opts.clientId].connect();\r\n }\r\n } else {\r\n _clients[opts.clientId] = new SCClientSocket(opts);\r\n }\r\n return _clients[opts.clientId];\r\n}\r\n\r\nfunction destroy(socket) {\r\n socket.destroy();\r\n}\r\n\r\nmodule.exports = {\r\n create: create,\r\n destroy: destroy,\r\n clients: _clients\r\n};\r\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js new file mode 100644 index 0000000000..fa1ea5920b --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[2],{513:function(e,t,a){"use strict";a.r(t);var n=a(6),l=a.n(n),c=a(7),o=a.n(c),s=a(9),i=a.n(s),r=a(10),m=a.n(r),d=a(3),u=a.n(d),p=a(11),h=a.n(p),b=a(12),f=a.n(b),g=a(0),E=a.n(g),v=(a(20),a(25)),N=function(e){function t(e){var a;return l()(this,t),a=i()(this,m()(t).call(this,e)),f()(u()(a),"state",{mail:null,success:"",errors:null,sending:!1}),f()(u()(a),"dismissModal",(function(){a.props.toggle()})),a.changeFont=a.changeFont.bind(u()(a)),a.emailRef=E.a.createRef(),a}return h()(t,e),o()(t,[{key:"changeFont",value:function(e){this.props.changeFont(e)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this;this.props.t;return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block p-1 pt-0 pb-0",tabIndex:"-1",style:{top:"auto",bottom:"0",height:"auto"}},E.a.createElement("div",{className:"modal-content radius-0 border-0"},E.a.createElement("div",{className:"modal-body pl-2 pr-2 pt-0 pb-0"},E.a.createElement("div",{className:"mb-0"},E.a.createElement("div",{className:"row"},E.a.createElement("div",{className:"col-5 mr-0 pr-1 text-center"},E.a.createElement("a",{href:"#",onClick:function(){return e.changeFont(!1)},className:"d-block font-weight-bold font-button"},"-",E.a.createElement("i",{className:"material-icons chat-setting-item"},""))),E.a.createElement("div",{className:"col-5 ml-0 pl-1 pr-1 text-center"},E.a.createElement("a",{href:"#",onClick:function(){return e.changeFont(!0)},className:"d-block font-weight-bold font-button"},"+",E.a.createElement("i",{className:"material-icons chat-setting-item"},""))),E.a.createElement("div",{className:"col-2 pl-1"},E.a.createElement("button",{type:"button",className:"close w-100 text-success","data-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"},E.a.createElement("span",{"aria-hidden":"true"},"✓")))))))))}}]),t}(g.PureComponent);t.default=Object(v.b)()(N)}}]); +//# sourceMappingURL=2.90658096bc82c95d6b4b.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js.map new file mode 100644 index 0000000000..b129c189ee --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./src/components/FontSizeModal.js"],"names":["FontSizeModal","props","mail","success","errors","sending","toggle","changeFont","bind","emailRef","React","createRef","increase","this","t","Fragment","role","id","aria-modal","className","tabIndex","style","top","bottom","height","href","onClick","type","data-dismiss","dismissModal","aria-label","aria-hidden","PureComponent","withTranslation"],"mappings":"8QAIMA,E,YASF,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAPX,CACJC,KAAM,KACNC,QAAS,GACTC,OAAQ,KACRC,SAAS,IAGM,2BAcJ,WACX,EAAKJ,MAAMK,YAbX,EAAKC,WAAa,EAAKA,WAAWC,KAAhB,QAClB,EAAKC,SAAWC,IAAMC,YAHP,E,wDAMRC,GACPC,KAAKZ,MAAMM,WAAWK,K,4EAYjB,WACSC,KAAKZ,MAAXa,EAQR,OAEO,kBAAC,IAAMC,SAAP,KACK,yBAAKC,KAAK,SAASC,GAAG,iBAAiBC,aAAW,OAAOC,UAAU,wCAAwCC,SAAS,KAAKC,MATvH,CACVC,IAAK,OACLC,OAAQ,IACRC,OAAQ,SAOI,yBAAKL,UAAU,mCACX,yBAAKA,UAAU,kCACX,yBAAKA,UAAU,QACX,yBAAKA,UAAU,OACX,yBAAKA,UAAU,+BACX,uBAAGM,KAAK,IAAIC,QAAS,kBAAM,EAAKnB,YAAW,IAAQY,UAAU,wCAA7D,IACK,uBAAGA,UAAU,oCAAb,OAGT,yBAAKA,UAAU,oCACX,uBAAGM,KAAK,IAAIC,QAAS,kBAAM,EAAKnB,YAAW,IAAOY,UAAU,wCAA5D,IAAoG,uBAAGA,UAAU,oCAAb,OAGxG,yBAAKA,UAAU,cACX,4BAAQQ,KAAK,SAASR,UAAU,2BAA2BS,eAAa,QAAQF,QAASb,KAAKgB,aAAcC,aAAW,SAAQ,0BAAMC,cAAY,QAAlB,iB,GAvD/IC,iBAqEbC,wBAAkBjC","file":"2.90658096bc82c95d6b4b.ie.js","sourcesContent":["import React, { PureComponent } from 'react';\nimport axios from \"axios\";\nimport { withTranslation } from 'react-i18next';\n\nclass FontSizeModal extends PureComponent {\n\n state = {\n mail: null,\n success: '',\n errors: null,\n sending: false\n };\n\n constructor(props) {\n super(props);\n this.changeFont = this.changeFont.bind(this);\n this.emailRef = React.createRef();\n }\n\n changeFont(increase) {\n this.props.changeFont(increase);\n }\n\n componentDidMount() {\n\n }\n\n dismissModal = () => {\n this.props.toggle()\n }\n\n\n render() {\n const { t } = this.props;\n\n const style = {\n top: 'auto',\n bottom: '0',\n height: 'auto'\n };\n\n return (\n\n \n \n\n \n\n )\n }\n}\n\nexport default withTranslation()(FontSizeModal);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js new file mode 100644 index 0000000000..f46c6ccef3 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[3],{512:function(e,t,a){"use strict";a.r(t);var n=a(6),s=a.n(n),l=a(7),i=a.n(l),r=a(9),o=a.n(r),c=a(10),m=a.n(c),d=a(3),u=a.n(d),h=a(11),p=a.n(h),b=a(12),f=a.n(b),g=a(0),v=a.n(g),E=a(20),w=a.n(E),N=a(25),y=function(e){function t(e){var a;return s()(this,t),a=o()(this,m()(t).call(this,e)),f()(u()(a),"state",{mail:null,success:"",errors:null,sending:!1}),f()(u()(a),"dismissModal",(function(){a.props.toggle()})),a.sendMail=a.sendMail.bind(u()(a)),a.emailRef=v.a.createRef(),a}return p()(t,e),i()(t,[{key:"sendMail",value:function(e){var t=this;this.setState({sending:!0}),w.a.post(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash+"/(action)/send",{email:this.state.mail},{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){0==e.data.error?t.props.toggle():(t.setState({sending:!1}),t.setState({errors:e.data.result}))})),e&&e.preventDefault()}},{key:"componentDidMount",value:function(){var e=this;w.a.get(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash).then((function(t){e.setState({mail:t.data}),e.emailRef.current&&e.emailRef.current.focus()})).catch((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this,t=this.props.t;return v.a.createElement(v.a.Fragment,null,null!==this.state.mail&&v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{className:"fade modal-backdrop show"}),v.a.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block",tabIndex:"-1"},v.a.createElement("div",{className:"modal-dialog modal-lg"},v.a.createElement("div",{className:"modal-content"},v.a.createElement("div",{className:"modal-header pt-1 pb-1 pl-2 pr-2"}," ",v.a.createElement("h4",{className:"modal-title",id:"myModalLabel"},v.a.createElement("span",{className:"material-icons"},""),t("button.mail")),v.a.createElement("button",{type:"button",className:"close float-right","data-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"},v.a.createElement("span",{"aria-hidden":"true"},"×"))),v.a.createElement("div",{className:"modal-body"},v.a.createElement("div",{className:"row"},v.a.createElement("div",{className:"col-12"},this.state.errors&&v.a.createElement("div",{className:"mb-0",dangerouslySetInnerHTML:{__html:this.state.errors}}),v.a.createElement("div",{className:"mb-0"},v.a.createElement("form",{onSubmit:this.sendMail},v.a.createElement("input",{className:"form-control form-group form-control-sm",ref:this.emailRef,required:"required",type:"email",defaultValue:this.state.mail,onChange:function(t){return e.setState({mail:t.target.value})},placeholder:t("chat.enter_email"),title:t("chat.enter_email")}),v.a.createElement("div",{className:"btn-group",role:"group","aria-label":"..."},v.a.createElement("button",{type:"submit",disabled:this.state.sending,className:"btn btn-secondary btn-sm"},t("button.send")),v.a.createElement("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:this.dismissModal},t("button.cancel")))))))))))))}}]),t}(g.PureComponent);t.default=Object(N.b)()(y)}}]); +//# sourceMappingURL=3.ebd2630847bc8173025f.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js.map new file mode 100644 index 0000000000..d857ca63c5 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./src/components/MailModal.js"],"names":["MailModal","props","mail","success","errors","sending","toggle","sendMail","bind","emailRef","React","createRef","event","this","setState","axios","post","window","lhcChat","chatId","chatHash","email","state","headers","then","response","data","error","result","preventDefault","get","current","focus","err","console","log","t","Fragment","className","role","id","aria-modal","tabIndex","type","data-dismiss","onClick","dismissModal","aria-label","aria-hidden","dangerouslySetInnerHTML","__html","onSubmit","ref","required","defaultValue","onChange","e","target","value","placeholder","title","disabled","PureComponent","withTranslation"],"mappings":"uRAIMA,E,YASF,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAPX,CACJC,KAAM,KACNC,QAAS,GACTC,OAAQ,KACRC,SAAS,IAGM,2BAoCJ,WACX,EAAKJ,MAAMK,YAnCX,EAAKC,SAAW,EAAKA,SAASC,KAAd,QAChB,EAAKC,SAAWC,IAAMC,YAHP,E,sDAMVC,GAAO,WAEZC,KAAKC,SAAS,CAAC,SAAY,IAE3BC,IAAMC,KAAKC,OAAOC,QAAP,SAA6B,kCAAoCL,KAAKZ,MAAMkB,OAAS,IAAMN,KAAKZ,MAAMmB,SAAW,iBAAkB,CAACC,MAAMR,KAAKS,MAAMpB,MAAO,CAACqB,QAAU,CAAC,eAAgB,uCAAuCC,MAAK,SAACC,GACjN,GAAvBA,EAASC,KAAKC,MACd,EAAK1B,MAAMK,UAEX,EAAKQ,SAAS,CAAC,SAAY,IAC3B,EAAKA,SAAS,CAAC,OAAWW,EAASC,KAAKE,aAI5ChB,GACAA,EAAMiB,mB,0CAGM,WAChBd,IAAMe,IAAIb,OAAOC,QAAP,SAA6B,kCAAoCL,KAAKZ,MAAMkB,OAAS,IAAMN,KAAKZ,MAAMmB,UAC/GI,MAAK,SAACC,GACH,EAAKX,SAAS,CAAC,KAASW,EAASC,OAC7B,EAAKjB,SAASsB,SACd,EAAKtB,SAASsB,QAAQC,WAJ9B,OAOO,SAACC,GACJC,QAAQC,IAAIF,Q,+BAQX,WACGG,EAAMvB,KAAKZ,MAAXmC,EAER,OACI,kBAAC,IAAMC,SAAP,KACyB,OAApBxB,KAAKS,MAAMpB,MAAiB,kBAAC,IAAMmC,SAAP,KAC7B,yBAAKC,UAAU,6BACf,yBAAKC,KAAK,SAASC,GAAG,iBAAiBC,aAAW,OAAOH,UAAU,0BAA0BI,SAAS,MAClG,yBAAKJ,UAAU,yBACX,yBAAKA,UAAU,iBACX,yBAAKA,UAAU,oCAAf,IAAmD,wBAAIA,UAAU,cAAcE,GAAG,gBAAe,0BAAMF,UAAU,kBAAhB,KAAiDF,EAAE,gBAChJ,4BAAQO,KAAK,SAASL,UAAU,oBAAoBM,eAAa,QAAQC,QAAShC,KAAKiC,aAAcC,aAAW,SAAQ,0BAAMC,cAAY,QAAlB,OAE5H,yBAAKV,UAAU,cACX,yBAAKA,UAAU,OACX,yBAAKA,UAAU,UACVzB,KAAKS,MAAMlB,QAAU,yBAAKkC,UAAU,OAAOW,wBAAyB,CAACC,OAAOrC,KAAKS,MAAMlB,UACxF,yBAAKkC,UAAU,QACX,0BAAMa,SAAUtC,KAAKN,UACjB,2BAAO+B,UAAU,0CAA0Cc,IAAKvC,KAAKJ,SAAU4C,SAAS,WAAWV,KAAK,QAAQW,aAAczC,KAAKS,MAAMpB,KAAMqD,SAAU,SAACC,GAAD,OAAO,EAAK1C,SAAS,CAAC,KAAS0C,EAAEC,OAAOC,SAASC,YAAavB,EAAE,oBAAqBwB,MAAOxB,EAAE,sBACvP,yBAAKE,UAAU,YAAYC,KAAK,QAAQQ,aAAW,OAC/C,4BAAQJ,KAAK,SAASkB,SAAUhD,KAAKS,MAAMjB,QAASiC,UAAU,4BAA4BF,EAAE,gBAC5F,4BAAQO,KAAK,SAASL,UAAU,2BAA2BO,QAAShC,KAAKiC,cAAeV,EAAE,iC,GAvEtH0B,iBAuFTC,wBAAkB/D","file":"3.ebd2630847bc8173025f.ie.js","sourcesContent":["import React, { PureComponent } from 'react';\nimport axios from \"axios\";\nimport { withTranslation } from 'react-i18next';\n\nclass MailModal extends PureComponent {\n\n state = {\n mail: null,\n success: '',\n errors: null,\n sending: false\n };\n\n constructor(props) {\n super(props);\n this.sendMail = this.sendMail.bind(this);\n this.emailRef = React.createRef();\n }\n\n sendMail(event) {\n\n this.setState({'sending' : true});\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/sendmailsettings/\" + this.props.chatId + '/' + this.props.chatHash + '/(action)/send', {email:this.state.mail}, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n if (response.data.error == false) {\n this.props.toggle();\n } else {\n this.setState({'sending' : false});\n this.setState({'errors' : response.data.result});\n }\n });\n\n if (event)\n event.preventDefault();\n }\n\n componentDidMount() {\n axios.get(window.lhcChat['base_url'] + 'widgetrestapi/sendmailsettings/' + this.props.chatId + '/' + this.props.chatHash)\n .then((response) => {\n this.setState({'mail' : response.data});\n if (this.emailRef.current) {\n this.emailRef.current.focus();\n }\n })\n .catch((err) => {\n console.log(err);\n });\n }\n\n dismissModal = () => {\n this.props.toggle()\n }\n\n render() {\n const { t } = this.props;\n\n return (\n \n {this.state.mail !== null && \n
\n
\n
\n
\n

{t('button.mail')}

\n \n
\n
\n
\n
\n {this.state.errors &&
}\n
\n
\n this.setState({'mail' : e.target.value})} placeholder={t('chat.enter_email')} title={t('chat.enter_email')} />\n
\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
}\n
\n )\n }\n}\n\nexport default withTranslation()(MailModal);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js new file mode 100644 index 0000000000..4c9691391f --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[4],{510:function(t,e,a){"use strict";a.r(e);var i,n=a(12),s=a.n(n),r=a(6),o=a.n(r),p=a(7),h=a.n(p),c=a(9),d=a.n(c),l=a(10),g=a.n(l),f=a(3),u=a.n(f),m=a(11),w=a.n(m),_=a(0),b=a.n(_),v=a(24),I=a(140),y=(a(199),a(25)),C=a(5),E=a(2),D=a(195);function O(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}var S=Object(v.b)((function(t){return{chatwidget:t.chatwidget}}))(i=function(t){function e(t){var a;return o()(this,e),(a=d()(this,g()(e).call(this,t))).state={},a.initOfflineFormCall(),a.handleSubmit=a.handleSubmit.bind(u()(a)),a.handleContentChange=a.handleContentChange.bind(u()(a)),a.handleContentChangeCustom=a.handleContentChangeCustom.bind(u()(a)),a.goToChat=a.goToChat.bind(u()(a)),a}return w()(e,t),h()(e,[{key:"initOfflineFormCall",value:function(t){this.props.dispatch(Object(C.h)({department:this.props.chatwidget.get("department"),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode"),bot_id:this.props.chatwidget.get("bot_id"),trigger_id:this.props.chatwidget.get("trigger_id"),online:0,dep_default:t||this.props.chatwidget.get("departmentDefault")||0}))}},{key:"handleSubmit",value:function(t){var e=this.state,a=!1,i=new FormData;void 0!==e.File&&(a=!0,i.append("File",e.File,e.File.name)),e.jsvar=this.props.chatwidget.get("jsVars"),e["captcha_"+this.props.chatwidget.getIn(["captcha","hash"])]=this.props.chatwidget.getIn(["captcha","ts"]),e.tscaptcha=this.props.chatwidget.getIn(["captcha","ts"]),e.user_timezone=E.a.getTimeZone(),e.URLRefer=window.location.href.substring(window.location.protocol.length),e.r=this.props.chatwidget.get("ses_ref"),""!=this.props.chatwidget.get("operator")&&(e.operator=this.props.chatwidget.get("operator")),null!==this.props.chatwidget.get("priority")&&(e.priority=this.props.chatwidget.get("priority"));var n=E.a.getCustomFieldsSubmit(this.props.chatwidget.getIn(["customData","fields"]));null!==n&&(e=function(t){for(var e=1;e0&&this.props.chatwidget.getIn(["offlineData","department","departments"]).map((function(a){a.get("value")==t.value&&(1==a.get("online")&&(e.props.dispatch({type:"dep_default",data:t.value}),e.props.dispatch({type:"onlineStatus",data:!0})),e.props.chatwidget.getIn(["onlineData","dep_forms"])!=t.value&&e.initOfflineFormCall(t.value))}))}},{key:"componentDidMount",value:function(){E.a.prefillFields(this)}},{key:"handleContentChangeCustom",value:function(t){this.props.dispatch({type:"CUSTOM_FIELDS_ITEM",data:{id:t.field.get("index"),value:t.value}})}},{key:"goToChat",value:function(){this.props.dispatch({type:"attr_set",attr:["isOfflineMode"],data:!1})}},{key:"componentDidUpdate",value:function(t,e,a){if(document.getElementById("id-container-fluid")){var i=0;document.getElementById("widget-header-content")&&(i=document.getElementById("widget-header-content").offsetHeight),E.a.sendMessageParent("widgetHeight",[{height:document.getElementById("id-container-fluid").offsetHeight+i+10}])}}},{key:"render",value:function(){var t=this,e=this.props.t;if(!0===this.props.chatwidget.getIn(["offlineData","fetched"])&&!0===this.props.chatwidget.getIn(["offlineData","disabled"]))return b.a.createElement("div",{className:"alert alert-danger m-2",role:"alert"},e("start_chat.cant_start_a_chat"));if(!1===this.props.chatwidget.getIn(["offlineData","fetched"]))return null;if(this.props.chatwidget.getIn(["offlineData","fields"]).size>0)var a=this.props.chatwidget.getIn(["offlineData","fields"]).map((function(e){return b.a.createElement(I.a,{chatUI:t.props.chatwidget.get("chat_ui"),isInvalid:t.props.chatwidget.hasIn(["validationErrors",e.get("identifier")]),attrPrefill:{attr_prefill_admin:t.props.chatwidget.get("attr_prefill_admin"),attr_prefill:t.props.chatwidget.get("attr_prefill")},defaultValueField:t.state[e.get("name")]||e.get("value"),onChangeContent:t.handleContentChange,field:e})}));else a="";if(this.props.chatwidget.getIn(["customData","fields"]).size>0)var i=this.props.chatwidget.getIn(["customData","fields"]).map((function(e){return b.a.createElement(I.a,{chatUI:t.props.chatwidget.get("chat_ui"),key:e.get("identifier"),isInvalid:t.props.chatwidget.hasIn(["validationErrors",e.get("identifier")]),defaultValueField:e.get("value"),onChangeContent:t.handleContentChangeCustom,field:e})}));else i="";return 0==this.props.chatwidget.get("processStatus")||1==this.props.chatwidget.get("processStatus")?b.a.createElement("div",{id:"id-container-fluid"},this.props.chatwidget.get("leave_message")&&this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&b.a.createElement("div",{className:"py-2 px-3 offline-intro-operator",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),this.props.chatwidget.get("leave_message")&&this.props.chatwidget.hasIn(["chat_ui","offline_intro"])&&""!=this.props.chatwidget.getIn(["chat_ui","offline_intro"])&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","offline_intro"])}}),!this.props.chatwidget.get("leave_message")&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro"},this.props.chatwidget.getIn(["chat_ui","chat_unavailable"])),this.props.chatwidget.get("leave_message")&&b.a.createElement("div",{className:"container-fluid"},b.a.createElement("form",{onSubmit:this.handleSubmit,className:"offline-form"},b.a.createElement("div",{className:"row pt-2"},a,i,this.props.chatwidget.hasIn(["offlineData","department"])&&b.a.createElement(D.a,{defaultValueField:this.state.DepartamentID,setDefaultValue:this.props.chatwidget.get("departmentDefault"),onChangeContent:this.handleContentChange,isInvalid:this.props.chatwidget.hasIn(["validationErrors","department"]),departments:this.props.chatwidget.getIn(["offlineData","department"])})),(!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])||""!==i||""!==a)&&b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-12 pb-2"},b.a.createElement("button",{type:"submit",disabled:1==this.props.chatwidget.get("processStatus"),className:"btn btn-secondary btn-sm"},1==this.props.chatwidget.get("processStatus")&&b.a.createElement("i",{className:"material-icons"},""),this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||e("start_chat.leave_a_message")),!0===this.props.chatwidget.get("isOnline")&&!0===this.props.chatwidget.get("isOfflineMode")&&b.a.createElement("button",{type:"button",onClick:this.goToChat,className:"float-right btn btn-sm btn-link text-muted"},"« ",e("button.back_to_chat"))))))):2==this.props.chatwidget.get("processStatus")?b.a.createElement("div",{id:"id-container-fluid"},this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&b.a.createElement("div",{className:"py-2 px-3 offline-intro-operator",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),this.props.chatwidget.hasIn(["chat_ui","offline_intro"])&&""!=this.props.chatwidget.getIn(["chat_ui","offline_intro"])&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","offline_intro"])}}),b.a.createElement("div",{className:"container-fluid"},b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-12"},b.a.createElement("p",{className:"pt-2"},this.props.chatwidget.getIn(["chat_ui","thank_feedback"])||e("start_chat.thank_you_for_feedback")))))):void 0}}]),e}(_.Component))||i;e.default=Object(y.b)()(S)}}]); +//# sourceMappingURL=4.80f011fffa0f91545942.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js.map new file mode 100644 index 0000000000..e84ca5def6 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./src/components/OfflineChat.js"],"names":["OfflineChat","connect","store","chatwidget","props","state","initOfflineFormCall","handleSubmit","bind","handleContentChange","handleContentChangeCustom","goToChat","dep_default","this","dispatch","initOfflineForm","get","event","fields","hasFile","formData","FormData","append","name","getIn","helperFunctions","getTimeZone","window","location","href","substring","protocol","length","customFields","getCustomFieldsSubmit","submitData","JSON","stringify","submitOfflineForm","preventDefault","obj","currentState","id","value","setState","size","map","dep","data","prefillFields","field","type","attr","prevProps","prevState","snapshot","document","getElementById","headerContent","offsetHeight","sendMessageParent","t","className","role","mappedFields","chatUI","isInvalid","hasIn","attrPrefill","defaultValueField","onChangeContent","mappedFieldsCustom","key","dangerouslySetInnerHTML","__html","onSubmit","setDefaultValue","departments","disabled","onClick","Component","withTranslation"],"mappings":"2hBAeMA,EANLC,aAAQ,SAACC,GACN,MAAO,CACHC,WAAYD,EAAMC,c,eAMtB,WAAYC,GAAO,0BACf,4BAAMA,KAEDC,MAAQ,GAEb,EAAKC,sBAEL,EAAKC,aAAe,EAAKA,aAAaC,KAAlB,QACpB,EAAKC,oBAAsB,EAAKA,oBAAoBD,KAAzB,QAC3B,EAAKE,0BAA4B,EAAKA,0BAA0BF,KAA/B,QACjC,EAAKG,SAAW,EAAKA,SAASH,KAAd,QAVD,E,iEAaCI,GAEhBC,KAAKT,MAAMU,SAASC,YAAgB,CAChC,WAAaF,KAAKT,MAAMD,WAAWa,IAAI,cACvC,MAAUH,KAAKT,MAAMD,WAAWa,IAAI,SACpC,KAASH,KAAKT,MAAMD,WAAWa,IAAI,QACnC,OAAWH,KAAKT,MAAMD,WAAWa,IAAI,UACrC,WAAeH,KAAKT,MAAMD,WAAWa,IAAI,cACzC,OAAW,EACX,YAAiBJ,GAAeC,KAAKT,MAAMD,WAAWa,IAAI,sBAAwB,O,mCAI7EC,GAET,IAAIC,EAASL,KAAKR,MACdc,GAAU,EACRC,EAAW,IAAIC,cAES,IAAnBH,EAAM,OACbC,GAAU,EACVC,EAASE,OAAO,OAAQJ,EAAM,KAAUA,EAAM,KAASK,OAG3DL,EAAM,MAAYL,KAAKT,MAAMD,WAAWa,IAAI,UAC5CE,EAAO,WAAaL,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,UAAYX,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,OAC9GN,EAAM,UAAgBL,KAAKT,MAAMD,WAAWqB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AAMD,WAAWqB,MAAM,CAAC,UAAU,sBAA8B,yBAAKsC,UAAU,mCAAmCW,wBAAyB,CAACC,OAAO7D,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,wBAE9PX,KAAKT,MAAMD,WAAWgE,MAAM,CAAC,UAAU,mBAAiF,IAA5DtD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,mBAA2B,uBAAGsC,UAAU,qDAAqDW,wBAAyB,CAACC,OAAO7D,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,qBAErQ,yBAAKsC,UAAU,mBACX,yBAAKA,UAAU,OACX,yBAAKA,UAAU,UACX,uBAAGA,UAAU,QAAQjD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,oBAAsBqC,EAAE,+CAXrG,M,GAzLWmB,e,EA+MXC,wBAAkBjF","file":"4.80f011fffa0f91545942.ie.js","sourcesContent":["import React, { Component } from 'react';\nimport { connect } from \"react-redux\";\nimport ChatField from './ChatField';\nimport StartChat from './StartChat';\nimport { withTranslation } from 'react-i18next';\nimport { initOfflineForm, submitOfflineForm } from \"../actions/chatActions\"\nimport { helperFunctions } from \"../lib/helperFunctions\";\nimport ChatDepartment from './ChatDepartment';\n\n@connect((store) => {\n return {\n chatwidget: store.chatwidget\n };\n})\n\nclass OfflineChat extends Component {\n\n constructor(props) {\n super(props);\n\n this.state = {};\n \n this.initOfflineFormCall();\n\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleContentChange = this.handleContentChange.bind(this);\n this.handleContentChangeCustom = this.handleContentChangeCustom.bind(this);\n this.goToChat = this.goToChat.bind(this);\n }\n\n initOfflineFormCall(dep_default){\n // Init offline form with all attributes\n this.props.dispatch(initOfflineForm({\n 'department':this.props.chatwidget.get('department'),\n 'theme' : this.props.chatwidget.get('theme'),\n 'mode' : this.props.chatwidget.get('mode'),\n 'bot_id' : this.props.chatwidget.get('bot_id'),\n 'trigger_id' : this.props.chatwidget.get('trigger_id'),\n 'online' : 0,\n 'dep_default' : (dep_default || this.props.chatwidget.get('departmentDefault') || 0),\n }));\n }\n\n handleSubmit(event) {\n\n var fields = this.state;\n var hasFile = false;\n const formData = new FormData();\n\n if (typeof fields['File'] !== 'undefined') {\n hasFile = true;\n formData.append(\"File\", fields['File'], fields['File'].name);\n }\n\n fields['jsvar'] = this.props.chatwidget.get('jsVars');\n fields['captcha_' + this.props.chatwidget.getIn(['captcha','hash'])] = this.props.chatwidget.getIn(['captcha','ts']);\n fields['tscaptcha'] = this.props.chatwidget.getIn(['captcha','ts']);\n fields['user_timezone'] = helperFunctions.getTimeZone();\n fields['URLRefer'] = window.location.href.substring(window.location.protocol.length);\n fields['r'] = this.props.chatwidget.get('ses_ref');\n\n if (this.props.chatwidget.get('operator') != '') {\n fields['operator'] = this.props.chatwidget.get('operator');\n }\n \n if (this.props.chatwidget.get('priority') !== null) {\n fields['priority'] = this.props.chatwidget.get('priority');\n }\n\n const customFields = helperFunctions.getCustomFieldsSubmit(this.props.chatwidget.getIn(['customData','fields']));\n if (customFields !== null) {\n fields = {...fields, ...customFields};\n }\n\n let submitData = {\n 'department': this.props.chatwidget.get('department'),\n 'theme' : this.props.chatwidget.get('theme'),\n 'mode' : this.props.chatwidget.get('mode'),\n 'vid' : this.props.chatwidget.get('vid'),\n 'fields' : fields\n };\n\n if (hasFile) {\n formData.append('document', JSON.stringify(submitData));\n }\n\n this.props.dispatch(submitOfflineForm(hasFile ? formData : submitData));\n event.preventDefault();\n }\n\n handleContentChange(obj) {\n var currentState = this.state;\n currentState[obj.id] = obj.value;\n this.setState(currentState);\n\n if (obj.id == 'DepartamentID') {\n if (this.props.chatwidget.getIn(['offlineData','department','departments']).size > 0){\n this.props.chatwidget.getIn(['offlineData','department','departments']).map(dep => {\n if (dep.get('value') == obj.value) {\n if (dep.get('online') == true) {\n this.props.dispatch({'type' : 'dep_default', data : obj.value});\n this.props.dispatch({'type' : 'onlineStatus', data : true});\n }\n\n // Update online fields settings if different department\n if (this.props.chatwidget.getIn(['onlineData','dep_forms']) != obj.value) {\n this.initOfflineFormCall(obj.value);\n }\n\n }\n })\n }\n }\n }\n\n componentDidMount() {\n helperFunctions.prefillFields(this);\n }\n\n handleContentChangeCustom(obj) {\n this.props.dispatch({'type' : 'CUSTOM_FIELDS_ITEM', data : {id : obj.field.get('index'), value : obj.value}});\n }\n\n goToChat() {\n this.props.dispatch({type : 'attr_set', attr : ['isOfflineMode'], data: false});\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (document.getElementById('id-container-fluid')) {\n\n var headerContent = 0;\n\n if (document.getElementById('widget-header-content')){\n headerContent = document.getElementById('widget-header-content').offsetHeight;\n }\n\n helperFunctions.sendMessageParent('widgetHeight', [{\n 'height' : document.getElementById('id-container-fluid').offsetHeight + headerContent + 10\n }]);\n }\n }\n \n render() {\n\n const { t } = this.props;\n\n if (this.props.chatwidget.getIn(['offlineData','fetched']) === true && this.props.chatwidget.getIn(['offlineData','disabled']) === true) {\n return (\n
\n {t('start_chat.cant_start_a_chat')}\n
\n )\n }\n\n if (this.props.chatwidget.getIn(['offlineData','fetched']) === false)\n {\n return null;\n }\n\n if (this.props.chatwidget.getIn(['offlineData','fields']).size > 0) {\n var mappedFields = this.props.chatwidget.getIn(['offlineData','fields']).map(field =>);\n } else {\n var mappedFields = \"\";\n }\n\n if (this.props.chatwidget.getIn(['customData','fields']).size > 0) {\n var mappedFieldsCustom = this.props.chatwidget.getIn(['customData','fields']).map(field =>);\n } else {\n var mappedFieldsCustom = \"\";\n }\n\n if (this.props.chatwidget.get('processStatus') == 0 || this.props.chatwidget.get('processStatus') == 1) {\n return (\n
\n {this.props.chatwidget.get('leave_message') && this.props.chatwidget.hasIn(['chat_ui','operator_profile']) && this.props.chatwidget.getIn(['chat_ui','operator_profile']) != '' &&
}\n\n {this.props.chatwidget.get('leave_message') && this.props.chatwidget.hasIn(['chat_ui','offline_intro']) && this.props.chatwidget.getIn(['chat_ui','offline_intro']) != '' &&

}\n\n {!this.props.chatwidget.get('leave_message') &&

{this.props.chatwidget.getIn(['chat_ui','chat_unavailable'])}

}\n\n {this.props.chatwidget.get('leave_message') &&\n
\n
\n
\n {mappedFields}\n {mappedFieldsCustom}\n {this.props.chatwidget.hasIn(['offlineData','department']) && }\n
\n {(!this.props.chatwidget.hasIn(['chat_ui','hstr_btn']) || mappedFieldsCustom !== \"\" || mappedFields !== \"\") &&
\n
\n \n {this.props.chatwidget.get('isOnline') === true && this.props.chatwidget.get('isOfflineMode') === true && }\n
\n
}\n
\n
}\n \n \n
\n )\n } else if (this.props.chatwidget.get('processStatus') == 2) {\n return (\n
\n\n {this.props.chatwidget.hasIn(['chat_ui','operator_profile']) && this.props.chatwidget.getIn(['chat_ui','operator_profile']) != '' &&
}\n\n {this.props.chatwidget.hasIn(['chat_ui','offline_intro']) && this.props.chatwidget.getIn(['chat_ui','offline_intro']) != '' &&

}\n\n
\n
\n
\n

{this.props.chatwidget.getIn(['chat_ui','thank_feedback']) || t('start_chat.thank_you_for_feedback')}

\n
\n
\n
\n\n
\n )\n }\n }\n}\n\nexport default withTranslation()(OfflineChat);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js new file mode 100644 index 0000000000..adb8aebd2a --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[5],{511:function(t,e,a){"use strict";a.r(e);var i,s=a(6),o=a.n(s),n=a(7),p=a.n(n),r=a(9),c=a.n(r),d=a(10),h=a.n(d),g=a(3),l=a.n(g),m=a(11),v=a.n(m),w=a(12),u=a.n(w),I=a(0),_=a.n(I),f=a(24),b=a(5),E=a(2),y=a(86),N=Object(f.b)((function(t){return{chatwidget:t.chatwidget}}))(i=function(t){function e(t){var a;return o()(this,e),a=c()(this,h()(e).call(this,t)),u()(l()(a),"state",{shown:!1}),a.hideInvitation=a.hideInvitation.bind(l()(a)),a.fullInvitation=a.fullInvitation.bind(l()(a)),a.setBotPayload=a.setBotPayload.bind(l()(a)),a}return v()(e,t),p()(e,[{key:"componentDidMount",value:function(){var t=this;E.a.sendMessageParent("showInvitation",[{name:this.props.chatwidget.getIn(["proactive","data","invitation_name"])}]),this.props.chatwidget.getIn(["proactive","data","play_sound"])&&E.a.emitEvent("play_sound",[{type:"new_invitation",sound_on:!0===this.props.chatwidget.getIn(["proactive","data","play_sound"]),widget_open:this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||document.hasFocus()}]),this.props.chatwidget.hasIn(["proactive","data","full_widget"])&&!this.props.chatwidget.get("isMobile")||document.getElementById("id-invitation-height")&&setTimeout((function(){document.getElementById("id-invitation-height")&&(E.a.sendMessageParent("widgetHeight",[{force_width:t.props.chatwidget.hasIn(["proactive","data","message_width"])?t.props.chatwidget.getIn(["proactive","data","message_width"])+40:240,force_height:document.getElementById("id-invitation-height").offsetHeight+20,force_bottom:t.props.chatwidget.hasIn(["proactive","data","message_bottom"])?t.props.chatwidget.getIn(["proactive","data","message_bottom"]):75,force_right:t.props.chatwidget.hasIn(["proactive","data","message_right"])?t.props.chatwidget.getIn(["proactive","data","message_right"]):75}]),t.setState({shown:!0}))}),50)}},{key:"componentWillUnmount",value:function(){E.a.sendMessageParent("widgetHeight",[{reset_height:!0}])}},{key:"hideInvitation",value:function(t){this.props.dispatch(Object(b.f)()),t.preventDefault(),t.stopPropagation()}},{key:"fullInvitation",value:function(){E.a.sendMessageParentDirect("hideInvitation",[{full:!0,name:this.props.chatwidget.getIn(["proactive","data","invitation_name"])}]),this.props.dispatch({type:"FULL_INVITATION"})}},{key:"setBotPayload",value:function(t){this.props.setBotPayload(t),this.fullInvitation()}},{key:"render",value:function(){var t=this;this.props.chatwidget.hasIn(["proactive","data","full_widget"])&&!this.props.chatwidget.get("isMobile")&&this.fullInvitation();var e="";return!1===this.state.shown?e+=" invisible":e+=" fade-in",_.a.createElement("div",{id:"id-invitation-height",className:e},this.props.chatwidget.hasIn(["proactive","data","close_above_msg"])&&_.a.createElement("div",{className:"text-right"},_.a.createElement("button",{title:"Close",onClick:function(e){return t.hideInvitation(e)},id:"invitation-close-btn",className:"btn btn-sm rounded"},_.a.createElement("i",{className:"material-icons mr-0"},""))),_.a.createElement("div",{className:"p-2 pointer clearfix proactive-need-help",id:"proactive-wrapper",style:{width:this.props.chatwidget.hasIn(["proactive","data","message_width"])?this.props.chatwidget.getIn(["proactive","data","message_width"]):200},onClick:this.fullInvitation},!this.props.chatwidget.hasIn(["proactive","data","close_above_msg"])&&_.a.createElement("button",{title:"Close",onClick:function(e){return t.hideInvitation(e)},id:"invitation-close-btn",className:"float-right btn btn-sm rounded"},_.a.createElement("i",{className:"material-icons mr-0"},"")),this.props.chatwidget.hasIn(["proactive","data","photo_left_column"])&&this.props.chatwidget.getIn(["proactive","data","photo"])&&_.a.createElement("div",{className:"d-flex"},_.a.createElement("div",{className:"proactive-image"},_.a.createElement("img",{width:"30",alt:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),title:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),className:"mr-2 rounded",src:this.props.chatwidget.getIn(["proactive","data","photo"])})),_.a.createElement("div",{className:"flex-grow-1"},!this.props.chatwidget.hasIn(["proactive","data","hide_op_name"])&&_.a.createElement("div",{className:"fs14"},_.a.createElement("b",null,this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]))),_.a.createElement("div",{id:"inv-msg-wrapper"},_.a.createElement("p",{className:"fs13 mb-0 inv-msg-cnt",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["proactive","data","message"])}}),this.props.chatwidget.hasIn(["proactive","data","bot_intro"])&&_.a.createElement(y.a,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["proactive","data","message_full"])})))),(!this.props.chatwidget.hasIn(["proactive","data","photo_left_column"])||!this.props.chatwidget.getIn(["proactive","data","photo"]))&&_.a.createElement("div",null,_.a.createElement("div",{className:"fs14"},this.props.chatwidget.getIn(["proactive","data","photo"])&&_.a.createElement("img",{width:"30",height:"30",alt:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),title:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),className:"mr-2 rounded",src:this.props.chatwidget.getIn(["proactive","data","photo"])}),!this.props.chatwidget.hasIn(["proactive","data","hide_op_name"])&&_.a.createElement("b",null,this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]))),_.a.createElement("div",{id:"inv-msg-wrapper"},_.a.createElement("p",{className:"fs13 mb-0 inv-msg-cnt",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["proactive","data","message"])}}),this.props.chatwidget.hasIn(["proactive","data","bot_intro"])&&_.a.createElement(y.a,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["proactive","data","message_full"])})))))}}]),e}(I.Component))||i;e.default=N}}]); +//# sourceMappingURL=5.1bd04e3cb154d7fc49cd.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map new file mode 100644 index 0000000000..2a6f12a656 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./src/components/ProactiveInvitation.js"],"names":["ProactiveInvitation","connect","store","chatwidget","props","shown","hideInvitation","bind","fullInvitation","setBotPayload","helperFunctions","sendMessageParent","name","this","getIn","emitEvent","get","document","hasFocus","hasIn","getElementById","setTimeout","offsetHeight","setState","e","dispatch","preventDefault","stopPropagation","sendMessageParentDirect","params","className","state","id","title","onClick","style","width","alt","src","dangerouslySetInnerHTML","__html","content","height","Component"],"mappings":"8RAYMA,EANLC,aAAQ,SAACC,GACN,MAAO,CACHC,WAAYD,EAAMC,c,eAUtB,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAJX,CACJC,OAAO,IAKP,EAAKC,eAAiB,EAAKA,eAAeC,KAApB,QACtB,EAAKC,eAAiB,EAAKA,eAAeD,KAApB,QACtB,EAAKE,cAAgB,EAAKA,cAAcF,KAAnB,QAJN,E,iEAOC,WAChBG,IAAgBC,kBAAkB,iBAAkB,CAAC,CAACC,KAAMC,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAY,OAAO,uBAExGD,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAY,OAAO,gBAChDJ,IAAgBK,UAAU,aAAc,CAAC,CAAC,KAAS,iBAAkB,UAAiF,IAAnEF,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAY,OAAO,eAA0B,YAAkBD,KAAKT,MAAMD,WAAWa,IAAI,UAAiD,UAArCH,KAAKT,MAAMD,WAAWa,IAAI,SAAwBC,SAASC,cAG9QL,KAAKT,MAAMD,WAAWgB,MAAM,CAAC,YAAY,OAAO,kBAAoBN,KAAKT,MAAMD,WAAWa,IAAI,aAC5FC,SAASG,eAAe,yBACxBC,YAAW,WACHJ,SAASG,eAAe,0BACxBV,IAAgBC,kBAAkB,eAAgB,CAAC,CAC/C,YAAiB,EAAKP,MAAMD,WAAWgB,MAAM,CAAC,YAAY,OAAO,kBAAoB,EAAKf,MAAMD,WAAWW,MAAM,CAAC,YAAY,OAAO,kBAAoB,GAAK,IAC9J,aAAiBG,SAASG,eAAe,wBAAwBE,aAAe,GAChF,aAAkB,EAAKlB,MAAMD,WAAWgB,MAAM,CAAC,YAAY,O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,wBAA0BN,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,YAC7H,6BACI,yBAAKgB,UAAU,QACVjB,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,WAAa,yBAAKsB,MAAM,KAAKM,OAAO,KACtBL,IAAKxB,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAAoBD,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAC7HmB,MAAOpB,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAAoBD,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAC/HgB,UAAU,eACVQ,IAAKzB,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,aAEtHD,KAAKT,MAAMD,WAAWgB,MAAM,CAAC,YAAY,OAAO,kBAAoB,2BAAIN,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAAoBD,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,oBAEtM,yBAAKkB,GAAG,mBACJ,uBAAGF,UAAU,wBAAwBS,wBAAyB,CAACC,OAAQ3B,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,eACxHD,KAAKT,MAAMD,WAAWgB,MAAM,CAAC,YAAY,OAAO,eAAiB,kBAAC,IAAD,CAAqBV,cAAeI,KAAKJ,cAAegC,QAAS5B,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,2B,GA5HvL6B,e,EAwInB3C","file":"5.1bd04e3cb154d7fc49cd.ie.js","sourcesContent":["import React, { Component } from 'react';\nimport { connect } from \"react-redux\";\nimport { hideInvitation } from \"../actions/chatActions\"\nimport { helperFunctions } from \"../lib/helperFunctions\";\nimport ChatBotIntroMessage from './ChatBotIntroMessage';\n\n@connect((store) => {\n return {\n chatwidget: store.chatwidget\n };\n})\n\nclass ProactiveInvitation extends Component {\n\n state = {\n shown: false\n }\n\n constructor(props) {\n super(props);\n this.hideInvitation = this.hideInvitation.bind(this);\n this.fullInvitation = this.fullInvitation.bind(this);\n this.setBotPayload = this.setBotPayload.bind(this);\n }\n\n componentDidMount() {\n helperFunctions.sendMessageParent('showInvitation', [{name: this.props.chatwidget.getIn(['proactive','data','invitation_name'])}]);\n\n if (this.props.chatwidget.getIn(['proactive','data','play_sound'])) {\n helperFunctions.emitEvent('play_sound', [{'type' : 'new_invitation', 'sound_on' : (this.props.chatwidget.getIn(['proactive','data','play_sound']) === true), 'widget_open' : ((this.props.chatwidget.get('shown') && this.props.chatwidget.get('mode') == 'widget') || document.hasFocus())}]);\n }\n\n if (!(this.props.chatwidget.hasIn(['proactive','data','full_widget']) && !this.props.chatwidget.get('isMobile'))) {\n if (document.getElementById('id-invitation-height')) {\n setTimeout(()=> {\n if (document.getElementById('id-invitation-height')) {\n helperFunctions.sendMessageParent('widgetHeight', [{\n 'force_width' : (this.props.chatwidget.hasIn(['proactive','data','message_width']) ? this.props.chatwidget.getIn(['proactive','data','message_width']) + 40 : 240),\n 'force_height' : document.getElementById('id-invitation-height').offsetHeight + 20,\n 'force_bottom' : (this.props.chatwidget.hasIn(['proactive','data','message_bottom']) ? this.props.chatwidget.getIn(['proactive','data','message_bottom']) : 75),\n 'force_right' : (this.props.chatwidget.hasIn(['proactive','data','message_right']) ? this.props.chatwidget.getIn(['proactive','data','message_right']) : 75),\n }]);\n this.setState({shown : true});\n }\n }, 50);\n }\n }\n }\n\n componentWillUnmount() {\n helperFunctions.sendMessageParent('widgetHeight', [{'reset_height' : true}]);\n }\n\n hideInvitation(e) {\n this.props.dispatch(hideInvitation());\n e.preventDefault();\n e.stopPropagation();\n }\n\n fullInvitation() {\n helperFunctions.sendMessageParentDirect('hideInvitation', [{'full' : true, name: this.props.chatwidget.getIn(['proactive','data','invitation_name'])}]);\n this.props.dispatch({\n 'type' : 'FULL_INVITATION'\n });\n }\n\n setBotPayload(params) {\n // Set payload parameter\n this.props.setBotPayload(params);\n\n // Set auto start\n // This way it's faster just user might see blank screen while submiting\n // So just decided to show full invitation and submit in the background.\n /*this.props.dispatch({\n 'type' : 'attr_set',\n 'attr' : ['chat_ui','auto_start'],\n 'data' : true,\n });*/\n\n // Show full invitation show auto submit will work\n this.fullInvitation();\n }\n\n render() {\n\n if (this.props.chatwidget.hasIn(['proactive','data','full_widget']) && !this.props.chatwidget.get('isMobile')) {\n this.fullInvitation();\n }\n\n let className = \"\";\n if (this.state.shown === false) {\n className += \" invisible\";\n } else {\n className += \" fade-in\";\n }\n\n return (\n
\n\n {this.props.chatwidget.hasIn(['proactive','data','close_above_msg']) &&
}\n\n
\n\n {!this.props.chatwidget.hasIn(['proactive','data','close_above_msg']) && }\n\n {this.props.chatwidget.hasIn(['proactive','data','photo_left_column']) && this.props.chatwidget.getIn(['proactive','data','photo']) &&
\n\n
\n {this.props.chatwidget.getIn(['proactive','data','name_support'])\n
\n\n
\n {!this.props.chatwidget.hasIn(['proactive','data','hide_op_name']) &&
\n {this.props.chatwidget.getIn(['proactive','data','name_support']) || this.props.chatwidget.getIn(['proactive','data','extra_profile'])}\n
}\n
\n

\n {this.props.chatwidget.hasIn(['proactive','data','bot_intro']) && }\n
\n
\n\n
}\n\n {(!this.props.chatwidget.hasIn(['proactive', 'data', 'photo_left_column']) || !this.props.chatwidget.getIn(['proactive', 'data', 'photo'])) &&\n
\n
\n {this.props.chatwidget.getIn(['proactive', 'data', 'photo']) && {this.props.chatwidget.getIn(['proactive',}\n\n {!this.props.chatwidget.hasIn(['proactive','data','hide_op_name']) && {this.props.chatwidget.getIn(['proactive', 'data', 'name_support']) || this.props.chatwidget.getIn(['proactive', 'data', 'extra_profile'])}}\n
\n
\n

\n {this.props.chatwidget.hasIn(['proactive','data','bot_intro']) && }\n
\n
\n }\n\n\n
\n
\n );\n }\n}\n\nexport default ProactiveInvitation;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js new file mode 100644 index 0000000000..e34772bade --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[6],{514:function(e,t,i){"use strict";i.r(t);var a=i(141),s=i.n(a),n=i(198),r=i.n(n),o=i(6),c=i.n(o),l=i(7),u=i.n(l),d=i(9),h=i.n(d),p=i(10),m=i.n(p),f=i(3),g=i.n(f),v=i(11),w=i.n(v),b=i(12),y=i.n(b),R=i(0),k=i.n(R);function U(){function e(e,t){return new Promise((i,a)=>{const s=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer",s.onload=()=>{i(WebAssembly.instantiate(s.response,t))},s.onerror=a,s.send()})}let t=null,i=5242880;function a(e){const t=i;return i+=e,t}function s(e){postMessage({type:"internal-error",data:e})}let n=null,r=null,o=null;onmessage=i=>{const c=i.data;switch(c.type){case"init":const{wasmURL:i,shimURL:u}=c.data;Promise.resolve().then(()=>(self.WebAssembly&&!function(){const e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)}()&&delete self.WebAssembly,self.WebAssembly||importScripts(u),t=new WebAssembly.Memory({initial:256,maximum:256}),{memory:t,pow:Math.pow,exit:s,powf:Math.pow,exp:Math.exp,sqrtf:Math.sqrt,cos:Math.cos,log:Math.log,sin:Math.sin,sbrk:a})).then(t=>function(t,i){if(!WebAssembly.instantiateStreaming)return e(t,i);const a=fetch(t,{credentials:"same-origin"});return WebAssembly.instantiateStreaming(a,i).catch(a=>{if(a.message&&a.message.indexOf("Argument 0 must be provided and must be a Response")>0)return e(t,i);throw a})}(i,{env:t})).then(e=>{n=e.instance.exports,postMessage({type:"init",data:null})}).catch(e=>{postMessage({type:"init-error",data:e.toString()})});break;case"start":if(!function(e){if(r=n.vmsg_init(e),!r)return!1;const i=new Uint32Array(t.buffer,r,1)[0];return o=new Float32Array(t.buffer,i),!0}(c.data))return postMessage({type:"error",data:"vmsg_init"});break;case"data":if(l=c.data,o.set(l),!(n.vmsg_encode(r,l.length)>=0))return postMessage({type:"error",data:"vmsg_encode"});break;case"stop":const d=function(){if(n.vmsg_flush(r)<0)return null;const e=new Uint32Array(t.buffer,r+4,1)[0],i=new Uint32Array(t.buffer,r+8,1)[0],a=new Uint8Array(t.buffer,e,i),s=new Blob([a],{type:"audio/mpeg"});return n.vmsg_free(r),r=null,o=null,s}();if(!d)return postMessage({type:"error",data:"vmsg_flush"});postMessage({type:"stop",data:d})}var l}}class L{constructor(e={},t=null){this.wasmURL=new URL(e.wasmURL||"/static/js/vmsg.wasm",location).href,this.shimURL=new URL(e.shimURL||"/static/js/wasm-polyfill.js",location).href,this.onStop=t,this.pitch=e.pitch||0,this.stream=null,this.audioCtx=null,this.gainNode=null,this.pitchFX=null,this.encNode=null,this.worker=null,this.workerURL=null,this.blob=null,this.blobURL=null,this.resolve=null,this.reject=null,Object.seal(this)}close(){this.encNode&&this.encNode.disconnect(),this.encNode&&(this.encNode.onaudioprocess=null),this.stream&&this.stopTracks(),this.audioCtx&&this.audioCtx.close(),this.worker&&this.worker.terminate(),this.workerURL&&URL.revokeObjectURL(this.workerURL),this.blobURL&&URL.revokeObjectURL(this.blobURL)}initAudio(){return(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?function(e){return navigator.mediaDevices.getUserMedia(e)}:function(e){const t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(i,a){t.call(navigator,e,i,a)})):Promise.reject(new Error("getUserMedia is not implemented in this browser"))})({audio:!0}).then(e=>{this.stream=e;const t=this.audioCtx=new(window.AudioContext||window.webkitAudioContext),i=t.createMediaStreamSource(e),a=this.gainNode=(t.createGain||t.createGainNode).call(t);a.gain.value=1,i.connect(a);const s=this.pitchFX=new N(t);s.setPitchOffset(this.pitch);const n=this.encNode=(t.createScriptProcessor||t.createJavaScriptNode).call(t,0,1,1);s.output.connect(n),a.connect(0===this.pitch?n:s.input)})}initWorker(){if(!this.stream)throw new Error("missing audio initialization");const e=new Blob(["(",U.toString(),")()"],{type:"application/javascript"}),t=this.workerURL=URL.createObjectURL(e),i=this.worker=new Worker(t),{wasmURL:a,shimURL:s}=this;return i.postMessage({type:"init",data:{wasmURL:a,shimURL:s}}),new Promise((e,t)=>{i.onmessage=i=>{const a=i.data;switch(a.type){case"init":e();break;case"init-error":t(new Error(a.data));break;case"error":case"internal-error":console.error("Worker error:",a.data),this.reject&&this.reject(a.data);break;case"stop":this.blob=a.data,this.blobURL=URL.createObjectURL(a.data),this.onStop&&this.onStop(),this.resolve&&this.resolve(this.blob)}}})}init(){return this.initAudio().then(this.initWorker.bind(this))}startRecording(){if(!this.stream)throw new Error("missing audio initialization");if(!this.worker)throw new Error("missing worker initialization");this.blob=null,this.blobURL&&URL.revokeObjectURL(this.blobURL),this.blobURL=null,this.resolve=null,this.reject=null,this.worker.postMessage({type:"start",data:this.audioCtx.sampleRate}),this.encNode.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);this.worker.postMessage({type:"data",data:t})},this.encNode.connect(this.audioCtx.destination)}stopRecording(){if(!this.stream)throw new Error("missing audio initialization");if(!this.worker)throw new Error("missing worker initialization");return this.encNode.disconnect(),this.encNode.onaudioprocess=null,this.stopTracks(),this.worker.postMessage({type:"stop",data:null}),new Promise((e,t)=>{this.resolve=e,this.reject=t})}stopTracks(){this.stream.getTracks&&this.stream.getTracks().forEach(e=>e.stop())}}var G=L;function x(e,t,i,a){for(var s=t*e.sampleRate,n=s+(t-2*i)*e.sampleRate,r=e.createBuffer(1,n,e.sampleRate),o=r.getChannelData(0),c=0;c=l?Math.sqrt(1-(u-l)/o):1,r[u]=d}for(u=a;u0?(this.mod1Gain.gain.value=0,this.mod2Gain.gain.value=0,this.mod3Gain.gain.value=1,this.mod4Gain.gain.value=1):(this.mod1Gain.gain.value=1,this.mod2Gain.gain.value=1,this.mod3Gain.gain.value=0,this.mod4Gain.gain.value=0),this.setDelay(.1*Math.abs(e))};var M=i(25),S=new G({wasmURL:window.lhcChat.staticJS.chunk_js+"/vmsg.8c4a15f2.wasm",shimURL:"https://unpkg.com/wasm-polyfill.js@0.2.0/wasm-polyfill.js"}),P=function(e){function t(e){var i;return c()(this,t),i=h()(this,m()(t).call(this,e)),y()(g()(i),"state",{isLoading:!1,isRecording:!1,isPlaying:!1,recording:null,audioDuration:0,currentTime:0}),i.startRecording=i.startRecording.bind(g()(i)),i.stopRecording=i.stopRecording.bind(g()(i)),i.playRecord=i.playRecord.bind(g()(i)),i.stopPlayRecord=i.stopPlayRecord.bind(g()(i)),i.sendRecord=i.sendRecord.bind(g()(i)),i.durationInterval=null,i.playInterval=null,i}var i,a;return w()(t,e),u()(t,[{key:"startRecording",value:(a=r()(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stopPlayRecord(),this.setState({isLoading:!0,audioDuration:0,recording:null,isPlaying:!1,currentTime:0}),e.prev=2,e.next=5,S.initAudio();case 5:return e.next=7,S.initWorker();case 7:S.startRecording(),this.setState({isLoading:!1,isRecording:!0}),this.durationInterval=setInterval((function(){t.setState({audioDuration:t.state.audioDuration+1}),t.state.audioDuration>=t.props.maxSeconds&&t.stopRecording()}),1e3),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),alert("Sorry but voice messages are not supported on your browser!"),this.setState({isLoading:!1});case 16:case"end":return e.stop()}}),e,this,[[2,12]])}))),function(){return a.apply(this,arguments)})},{key:"stopRecording",value:(i=r()(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.stopRecording();case 2:t=e.sent,this.audio=new Audio,this.audio.src=URL.createObjectURL(t),this.setState({isLoading:!1,isRecording:!1,recording:t}),clearInterval(this.durationInterval);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"playRecord",value:function(){var e=this;this.audio.currentTime=0,this.audio.play(),this.setState({isPlaying:!0}),this.playInterval=setInterval((function(){e.setState({currentTime:Math.round(e.audio.currentTime)}),(e.audio.ended||e.audio.paused)&&e.stopPlayRecord()}),1e3)}},{key:"stopPlayRecord",value:function(){this.state.isPlaying&&(clearInterval(this.playInterval),this.audio.currentTime=0,this.audio.pause(),this.setState({isPlaying:!1,currentTime:0}))}},{key:"sendRecord",value:function(){var e=this,t=this.props.t;this.props.progress(t("file.uploading"));var i=new XMLHttpRequest,a=new FormData;a.append("files",this.state.recording,"record.mp3"),i.open("POST",this.props.base_url+"/file/uploadfile/"+this.props.chat_id+"/"+this.props.hash),i.upload.addEventListener("load",(function(t){e.props.progress("100%"),e.props.onCompletion(),e.props.cancel()})),i.send(a)}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){this.stopPlayRecord(),this.state.isRecording&&S.stopRecording()}},{key:"pad",value:function(e){return e<10?"0"+e:e}},{key:"render",value:function(){var e=this,t=this.state,i=(t.isLoading,t.isRecording),a=t.recording,s=t.isPlaying,n=this.props.t;return k.a.createElement("div",{className:"text-nowrap"},k.a.createElement("i",{className:"material-icons pointer text-danger fs25",title:n("voice.cancel_voice_message"),onClick:function(){return e.props.cancel()}},""),!i&&k.a.createElement("i",{className:"material-icons fs25 pointer text-danger mr-0",title:n("voice.record_voice_message"),onClick:this.startRecording},""),i&&k.a.createElement("i",{className:"material-icons fs25 pointer text-danger mr-0",title:n("voice.stop_recording"),onClick:this.stopRecording},""),a&&!1===s&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.play_recorded"),onClick:this.playRecord},""),a&&!0===s&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.stop_playing_recorded"),onClick:this.stopPlayRecord},""),k.a.createElement("span",{className:"fs12 px-1"},i?"":s?this.pad(this.state.currentTime)+":":"",i||!a?this.props.maxSeconds-this.state.audioDuration+" s.":this.pad(this.state.audioDuration)+(s?"":"s.")),a&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.send"),onClick:this.sendRecord},""))}}]),t}(R.PureComponent);t.default=Object(M.b)()(P)}}]); +//# sourceMappingURL=6.5e9f23d9c05330e9214e.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js.map new file mode 100644 index 0000000000..7855800e9e --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./node_modules/vmsg/vmsg.js","webpack://LHCReactAPP/./src/components/VoiceMessage.js"],"names":["inlineWorker","fetchAndInstantiateFallback","url","imports","Promise","resolve","reject","req","XMLHttpRequest","open","responseType","onload","WebAssembly","instantiate","response","onerror","send","memory","dynamicTop","sbrk","increment","oldDynamicTop","exit","status","postMessage","type","data","FFI","ref","pcm_l","onmessage","e","msg","wasmURL","shimURL","then","self","bin","Uint8Array","mod","Module","Instance","exports","test","testSafariWebAssemblyBug","importScripts","Memory","initial","TOTAL_MEMORY","maximum","pow","Math","powf","exp","sqrtf","sqrt","cos","log","sin","Runtime","instantiateStreaming","fetch","credentials","catch","err","message","indexOf","fetchAndInstantiate","env","wasm","instance","toString","rate","vmsg_init","pcm_l_ref","Uint32Array","buffer","Float32Array","set","vmsg_encode","length","blob","vmsg_flush","mp3_ref","size","mp3","Blob","vmsg_free","Recorder","opts","onStop","this","URL","location","href","pitch","stream","audioCtx","gainNode","pitchFX","encNode","worker","workerURL","blobURL","Object","seal","disconnect","onaudioprocess","stopTracks","close","terminate","revokeObjectURL","navigator","mediaDevices","getUserMedia","constraints","oldGetUserMedia","webkitGetUserMedia","mozGetUserMedia","call","Error","audio","window","AudioContext","webkitAudioContext","sourceNode","createMediaStreamSource","createGain","createGainNode","gain","value","connect","Jungle","setPitchOffset","createScriptProcessor","createJavaScriptNode","output","input","createObjectURL","Worker","console","error","initAudio","initWorker","bind","sampleRate","samples","inputBuffer","getChannelData","destination","getTracks","forEach","track","stop","createDelayTimeBuffer","context","activeTime","fadeTime","shiftUp","length1","createBuffer","p","i","mod1","createBufferSource","mod2","mod3","mod4","shiftDownBuffer","shiftUpBuffer","loop","mod1Gain","mod2Gain","mod3Gain","mod4Gain","modGain1","modGain2","delay1","createDelay","createDelayNode","delay2","delayTime","fade1","fade2","fadeBuffer","fadeLength","fadeIndex1","fadeIndex2","createFadeBuffer","mix1","mix2","t","currentTime","t2","start","setDelay","prototype","setTargetAtTime","mult","abs","recorder","vmsg","lhcChat","VoiceMessage","props","isLoading","isRecording","isPlaying","recording","audioDuration","startRecording","stopRecording","playRecord","stopPlayRecord","sendRecord","durationInterval","playInterval","setState","setInterval","state","maxSeconds","alert","Audio","src","clearInterval","play","round","ended","paused","pause","progress","formData","FormData","append","base_url","chat_id","hash","upload","addEventListener","event","onCompletion","cancel","n","className","title","onClick","pad","PureComponent","withTranslation"],"mappings":"kSAOA,SAASA,IAkBP,SAASC,EAA4BC,EAAKC,GACxC,OAAO,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAM,IAAIC,eAChBD,EAAIE,KAAK,MAAOP,GAChBK,EAAIG,aAAe,cACnBH,EAAII,OAAS,KACXN,EAAQO,YAAYC,YAAYN,EAAIO,SAAUX,KAEhDI,EAAIQ,QAAUT,EACdC,EAAIS,SAQR,IAAIC,EAAS,KACTC,EAJgB,QAMpB,SAASC,EAAKC,GACZ,MAAMC,EAAgBH,EAEtB,OADAA,GAAcE,EACPC,EAKT,SAASC,EAAKC,GACZC,YAAY,CAACC,KAAM,iBA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0CAA0CC,MAAOrD,EAAE,8BAA+BsD,QAAS,kBAAM,EAAKzC,MAAMqC,WAAzH,MAEEnC,GAAe,uBAAGqC,UAAU,+CAA+CC,MAAOrD,EAAE,8BAA+BsD,QAAS1J,KAAKuH,gBAAlH,KAEhBJ,GAAe,uBAAGqC,UAAU,+CAA+CC,MAAOrD,EAAE,wBAAyBsD,QAAS1J,KAAKwH,eAA5G,KAEfH,IAA2B,IAAdD,GAAuB,uBAAGoC,UAAU,gDAAgDC,MAAOrD,EAAE,uBAAwBsD,QAAS1J,KAAKyH,YAA5G,KAEpCJ,IAA2B,IAAdD,GAAsB,uBAAGoC,UAAU,gDAAgDC,MAAOrD,EAAE,+BAAgCsD,QAAS1J,KAAK0H,gBAApH,KAEpC,0BAAM8B,UAAU,aAAarC,EAAc,GAAMC,EAAYpH,KAAK2J,IAAI3J,KAAKgI,MAAM3B,aAAe,IAAM,GAAKc,IAAgBE,EAAarH,KAAKiH,MAAMgB,WAAajI,KAAKgI,MAAMV,cAAiB,MAAQtH,KAAK2J,IAAI3J,KAAKgI,MAAMV,gBAAmBF,EAAmB,GAAP,OAEtPC,GAAa,uBAAGmC,UAAU,gDAAgDC,MAAOrD,EAAE,cAAesD,QAAS1J,KAAK2H,YAAnG,U,GA7ICiC,iBAmJZC,wBAAkB7C","file":"6.5e9f23d9c05330e9214e.ie.js","sourcesContent":["/* eslint-disable */\n\nfunction pad2(n) {\n n |= 0;\n return n < 10 ? `0${n}` : `${Math.min(n, 99)}`;\n}\n\nfunction inlineWorker() {\n // TODO(Kagami): Cache compiled module in IndexedDB? It works in FF\n // and Edge, see: https://github.com/mdn/webassembly-examples/issues/4\n // Though gzipped WASM module currently weights ~70kb so it should be\n // perfectly cached by the browser itself.\n function fetchAndInstantiate(url, imports) {\n if (!WebAssembly.instantiateStreaming) return fetchAndInstantiateFallback(url, imports);\n const req = fetch(url, {credentials: \"same-origin\"});\n return WebAssembly.instantiateStreaming(req, imports).catch(err => {\n // https://github.com/Kagami/vmsg/issues/11\n if (err.message && err.message.indexOf(\"Argument 0 must be provided and must be a Response\") > 0) {\n return fetchAndInstantiateFallback(url, imports);\n } else {\n throw err;\n }\n });\n }\n\n function fetchAndInstantiateFallback(url, imports) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest();\n req.open(\"GET\", url);\n req.responseType = \"arraybuffer\";\n req.onload = () => {\n resolve(WebAssembly.instantiate(req.response, imports));\n };\n req.onerror = reject;\n req.send();\n });\n }\n\n // Must be in sync with emcc settings!\n const TOTAL_STACK = 5 * 1024 * 1024;\n const TOTAL_MEMORY = 16 * 1024 * 1024;\n const WASM_PAGE_SIZE = 64 * 1024;\n let memory = null;\n let dynamicTop = TOTAL_STACK;\n // TODO(Kagami): Grow memory?\n function sbrk(increment) {\n const oldDynamicTop = dynamicTop;\n dynamicTop += increment;\n return oldDynamicTop;\n }\n // TODO(Kagami): LAME calls exit(-1) on internal error. Would be nice\n // to provide custom DEBUGF/ERRORF for easier debugging. Currenty\n // those functions do nothing.\n function exit(status) {\n postMessage({type: \"internal-error\", data: status});\n }\n\n let FFI = null;\n let ref = null;\n let pcm_l = null;\n function vmsg_init(rate) {\n ref = FFI.vmsg_init(rate);\n if (!ref) return false;\n const pcm_l_ref = new Uint32Array(memory.buffer, ref, 1)[0];\n pcm_l = new Float32Array(memory.buffer, pcm_l_ref);\n return true;\n }\n function vmsg_encode(data) {\n pcm_l.set(data);\n return FFI.vmsg_encode(ref, data.length) >= 0;\n }\n function vmsg_flush() {\n if (FFI.vmsg_flush(ref) < 0) return null;\n const mp3_ref = new Uint32Array(memory.buffer, ref + 4, 1)[0];\n const size = new Uint32Array(memory.buffer, ref + 8, 1)[0];\n const mp3 = new Uint8Array(memory.buffer, mp3_ref, size);\n const blob = new Blob([mp3], {type: \"audio/mpeg\"});\n FFI.vmsg_free(ref);\n ref = null;\n pcm_l = null;\n return blob;\n }\n\n // https://github.com/brion/min-wasm-fail\n function testSafariWebAssemblyBug() {\n const bin = new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]);\n const mod = new WebAssembly.Module(bin);\n const inst = new WebAssembly.Instance(mod, {});\n // test storing to and loading from a non-zero location via a parameter.\n // Safari on iOS 11.2.5 returns 0 unexpectedly at non-zero locations\n return (inst.exports.test(4) !== 0);\n }\n\n onmessage = (e) => {\n const msg = e.data;\n switch (msg.type) {\n case \"init\":\n const { wasmURL, shimURL } = msg.data;\n Promise.resolve().then(() => {\n if (self.WebAssembly && !testSafariWebAssemblyBug()) {\n delete self.WebAssembly;\n }\n if (!self.WebAssembly) {\n importScripts(shimURL);\n }\n memory = new WebAssembly.Memory({\n initial: TOTAL_MEMORY / WASM_PAGE_SIZE,\n maximum: TOTAL_MEMORY / WASM_PAGE_SIZE,\n });\n return {\n memory: memory,\n pow: Math.pow,\n exit: exit,\n powf: Math.pow,\n exp: Math.exp,\n sqrtf: Math.sqrt,\n cos: Math.cos,\n log: Math.log,\n sin: Math.sin,\n sbrk: sbrk,\n };\n }).then(Runtime => {\n return fetchAndInstantiate(wasmURL, {env: Runtime})\n }).then(wasm => {\n FFI = wasm.instance.exports;\n postMessage({type: \"init\", data: null});\n }).catch(err => {\n postMessage({type: \"init-error\", data: err.toString()});\n });\n break;\n case \"start\":\n if (!vmsg_init(msg.data)) return postMessage({type: \"error\", data: \"vmsg_init\"});\n break;\n case \"data\":\n if (!vmsg_encode(msg.data)) return postMessage({type: \"error\", data: \"vmsg_encode\"});\n break;\n case \"stop\":\n const blob = vmsg_flush();\n if (!blob) return postMessage({type: \"error\", data: \"vmsg_flush\"});\n postMessage({type: \"stop\", data: blob});\n break;\n }\n };\n}\n\nexport class Recorder {\n constructor(opts = {}, onStop = null) {\n // Can't use relative URL in blob worker, see:\n // https://stackoverflow.com/a/22582695\n this.wasmURL = new URL(opts.wasmURL || \"/static/js/vmsg.wasm\", location).href;\n this.shimURL = new URL(opts.shimURL || \"/static/js/wasm-polyfill.js\", location).href;\n this.onStop = onStop;\n this.pitch = opts.pitch || 0;\n this.stream = null;\n this.audioCtx = null;\n this.gainNode = null;\n this.pitchFX = null;\n this.encNode = null;\n this.worker = null;\n this.workerURL = null;\n this.blob = null;\n this.blobURL = null;\n this.resolve = null;\n this.reject = null;\n Object.seal(this);\n }\n\n close() {\n if (this.encNode) this.encNode.disconnect();\n if (this.encNode) this.encNode.onaudioprocess = null;\n if (this.stream) this.stopTracks();\n if (this.audioCtx) this.audioCtx.close();\n if (this.worker) this.worker.terminate();\n if (this.workerURL) URL.revokeObjectURL(this.workerURL);\n if (this.blobURL) URL.revokeObjectURL(this.blobURL);\n }\n\n // Without pitch shift:\n // [sourceNode] -> [gainNode] -> [encNode] -> [audioCtx.destination]\n // |\n // -> [worker]\n // With pitch shift:\n // [sourceNode] -> [gainNode] -> [pitchFX] -> [encNode] -> [audioCtx.destination]\n // |\n // -> [worker]\n initAudio() {\n const getUserMedia = navigator.mediaDevices && navigator.mediaDevices.getUserMedia\n ? function(constraints) {\n return navigator.mediaDevices.getUserMedia(constraints);\n }\n : function(constraints) {\n const oldGetUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n if (!oldGetUserMedia) {\n return Promise.reject(new Error(\"getUserMedia is not implemented in this browser\"));\n }\n return new Promise(function(resolve, reject) {\n oldGetUserMedia.call(navigator, constraints, resolve, reject);\n });\n };\n\n return getUserMedia({audio: true}).then((stream) => {\n this.stream = stream;\n const audioCtx = this.audioCtx = new (window.AudioContext\n || window.webkitAudioContext)();\n\n const sourceNode = audioCtx.createMediaStreamSource(stream);\n const gainNode = this.gainNode = (audioCtx.createGain\n || audioCtx.createGainNode).call(audioCtx);\n gainNode.gain.value = 1;\n sourceNode.connect(gainNode);\n\n const pitchFX = this.pitchFX = new Jungle(audioCtx);\n pitchFX.setPitchOffset(this.pitch);\n\n const encNode = this.encNode = (audioCtx.createScriptProcessor\n || audioCtx.createJavaScriptNode).call(audioCtx, 0, 1, 1);\n pitchFX.output.connect(encNode);\n\n gainNode.connect(this.pitch === 0 ? encNode : pitchFX.input);\n });\n }\n\n initWorker() {\n if (!this.stream) throw new Error(\"missing audio initialization\");\n // https://stackoverflow.com/a/19201292\n const blob = new Blob(\n [\"(\", inlineWorker.toString(), \")()\"],\n {type: \"application/javascript\"});\n const workerURL = this.workerURL = URL.createObjectURL(blob);\n const worker = this.worker = new Worker(workerURL);\n const { wasmURL, shimURL } = this;\n worker.postMessage({type: \"init\", data: {wasmURL, shimURL}});\n return new Promise((resolve, reject) => {\n worker.onmessage = (e) => {\n const msg = e.data;\n switch (msg.type) {\n case \"init\":\n resolve();\n break;\n case \"init-error\":\n reject(new Error(msg.data));\n break;\n // TODO(Kagami): Error handling.\n case \"error\":\n case \"internal-error\":\n console.error(\"Worker error:\", msg.data);\n if (this.reject) this.reject(msg.data);\n break;\n case \"stop\":\n this.blob = msg.data;\n this.blobURL = URL.createObjectURL(msg.data);\n if (this.onStop) this.onStop();\n if (this.resolve) this.resolve(this.blob);\n break;\n }\n }\n });\n }\n\n init() {\n return this.initAudio().then(this.initWorker.bind(this));\n }\n\n startRecording() {\n if (!this.stream) throw new Error(\"missing audio initialization\");\n if (!this.worker) throw new Error(\"missing worker initialization\");\n this.blob = null;\n if (this.blobURL) URL.revokeObjectURL(this.blobURL);\n this.blobURL = null;\n this.resolve = null;\n this.reject = null;\n this.worker.postMessage({type: \"start\", data: this.audioCtx.sampleRate});\n this.encNode.onaudioprocess = (e) => {\n const samples = e.inputBuffer.getChannelData(0);\n this.worker.postMessage({type: \"data\", data: samples});\n };\n this.encNode.connect(this.audioCtx.destination);\n }\n\n stopRecording() {\n if (!this.stream) throw new Error(\"missing audio initialization\");\n if (!this.worker) throw new Error(\"missing worker initialization\");\n this.encNode.disconnect();\n this.encNode.onaudioprocess = null;\n this.stopTracks();\n this.worker.postMessage({type: \"stop\", data: null});\n return new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n stopTracks() {\n // Might be missed in Safari and old FF/Chrome per MDN.\n if (this.stream.getTracks) {\n // Hide browser's recording indicator.\n this.stream.getTracks().forEach((track) => track.stop());\n }\n }\n}\n\nexport class Form {\n constructor(opts = {}, resolve, reject) {\n this.recorder = new Recorder(opts, this.onStop.bind(this));\n this.resolve = resolve;\n this.reject = reject;\n this.backdrop = null;\n this.popup = null;\n this.recordBtn = null;\n this.stopBtn = null;\n this.timer = null;\n this.audio = null;\n this.saveBtn = null;\n this.tid = 0;\n this.start = 0;\n Object.seal(this);\n\n this.recorder.initAudio()\n .then(() => this.drawInit())\n .then(() => this.recorder.initWorker())\n .then(() => this.drawAll())\n .catch((err) => this.drawError(err));\n }\n\n drawInit() {\n if (this.backdrop) return;\n const backdrop = this.backdrop = document.createElement(\"div\");\n backdrop.className = \"vmsg-backdrop\";\n backdrop.addEventListener(\"click\", () => this.close(null));\n\n const popup = this.popup = document.createElement(\"div\");\n popup.className = \"vmsg-popup\";\n popup.addEventListener(\"click\", (e) => e.stopPropagation());\n\n const progress = document.createElement(\"div\");\n progress.className = \"vmsg-progress\";\n for (let i = 0; i < 3; i++) {\n const progressDot = document.createElement(\"div\");\n progressDot.className = \"vmsg-progress-dot\";\n progress.appendChild(progressDot);\n }\n popup.appendChild(progress);\n\n backdrop.appendChild(popup);\n document.body.appendChild(backdrop);\n }\n\n drawTime(msecs) {\n const secs = Math.round(msecs / 1000);\n this.timer.textContent = pad2(secs / 60) + \":\" + pad2(secs % 60);\n }\n\n drawAll() {\n this.drawInit();\n this.clearAll();\n\n const recordRow = document.createElement(\"div\");\n recordRow.className = \"vmsg-record-row\";\n this.popup.appendChild(recordRow);\n\n const recordBtn = this.recordBtn = document.createElement(\"button\");\n recordBtn.className = \"vmsg-button vmsg-record-button\";\n recordBtn.textContent = \"●\";\n recordBtn.addEventListener(\"click\", () => this.startRecording());\n recordRow.appendChild(recordBtn);\n\n const stopBtn = this.stopBtn = document.createElement(\"button\");\n stopBtn.className = \"vmsg-button vmsg-stop-button\";\n stopBtn.style.display = \"none\";\n stopBtn.textContent = \"■\";\n stopBtn.addEventListener(\"click\", () => this.stopRecording());\n recordRow.appendChild(stopBtn);\n\n const audio = this.audio = new Audio();\n audio.autoplay = true;\n\n const timer = this.timer = document.createElement(\"span\");\n timer.className = \"vmsg-timer\";\n timer.addEventListener(\"click\", () => {\n if (audio.paused) {\n if (this.recorder.blobURL) {\n audio.src = this.recorder.blobURL;\n }\n } else {\n audio.pause();\n }\n });\n this.drawTime(0);\n recordRow.appendChild(timer);\n\n const saveBtn = this.saveBtn = document.createElement(\"button\");\n saveBtn.className = \"vmsg-button vmsg-save-button\";\n saveBtn.textContent = \"✓\";\n saveBtn.disabled = true;\n saveBtn.addEventListener(\"click\", () => this.close(this.recorder.blob));\n recordRow.appendChild(saveBtn);\n\n const gainWrapper = document.createElement(\"div\");\n gainWrapper.className = \"vmsg-slider-wrapper vmsg-gain-slider-wrapper\";\n const gainSlider = document.createElement(\"input\");\n gainSlider.className = \"vmsg-slider vmsg-gain-slider\";\n gainSlider.setAttribute(\"type\", \"range\");\n gainSlider.min = 0;\n gainSlider.max = 2;\n gainSlider.step = 0.2;\n gainSlider.value = 1;\n gainSlider.onchange = () => {\n const gain = +gainSlider.value;\n this.recorder.gainNode.gain.value = gain;\n };\n gainWrapper.appendChild(gainSlider);\n this.popup.appendChild(gainWrapper);\n\n const pitchWrapper = document.createElement(\"div\");\n pitchWrapper.className = \"vmsg-slider-wrapper vmsg-pitch-slider-wrapper\";\n const pitchSlider = document.createElement(\"input\");\n pitchSlider.className = \"vmsg-slider vmsg-pitch-slider\";\n pitchSlider.setAttribute(\"type\", \"range\");\n pitchSlider.min = -1;\n pitchSlider.max = 1;\n pitchSlider.step = 0.2;\n pitchSlider.value = this.recorder.pitch;\n pitchSlider.onchange = () => {\n const pitch = +pitchSlider.value;\n this.recorder.pitchFX.setPitchOffset(pitch);\n this.recorder.gainNode.disconnect();\n this.recorder.gainNode.connect(\n pitch === 0 ? this.recorder.encNode : this.recorder.pitchFX.input\n );\n };\n pitchWrapper.appendChild(pitchSlider);\n this.popup.appendChild(pitchWrapper);\n }\n\n drawError(err) {\n console.error(err);\n this.drawInit();\n this.clearAll();\n const error = document.createElement(\"div\");\n error.className = \"vmsg-error\";\n error.textContent = err.toString();\n this.popup.appendChild(error);\n }\n\n clearAll() {\n if (!this.popup) return;\n this.popup.innerHTML = \"\";\n }\n\n close(blob) {\n if (this.audio) this.audio.pause();\n if (this.tid) clearTimeout(this.tid);\n this.recorder.close();\n this.backdrop.remove();\n if (blob) {\n this.resolve(blob);\n } else {\n this.reject(new Error(\"No record made\"));\n }\n }\n\n onStop() {\n this.recordBtn.style.display = \"\";\n this.stopBtn.style.display = \"none\";\n this.stopBtn.disabled = false;\n this.saveBtn.disabled = false;\n }\n\n startRecording() {\n this.audio.pause();\n this.start = Date.now();\n this.updateTime();\n this.recordBtn.style.display = \"none\";\n this.stopBtn.style.display = \"\";\n this.saveBtn.disabled = true;\n this.recorder.startRecording();\n }\n\n stopRecording() {\n clearTimeout(this.tid);\n this.tid = 0;\n this.stopBtn.disabled = true;\n this.recorder.stopRecording();\n }\n\n updateTime() {\n // NOTE(Kagami): We can do this in `onaudioprocess` but that would\n // run too often and create unnecessary DOM updates.\n this.drawTime(Date.now() - this.start);\n this.tid = setTimeout(() => this.updateTime(), 300);\n }\n}\n\nlet shown = false;\n\n/**\n * Record a new voice message.\n *\n * @param {Object=} opts - Options\n * @param {string=} opts.wasmURL - URL of the module\n * (\"/static/js/vmsg.wasm\" by default)\n * @param {string=} opts.shimURL - URL of the WebAssembly polyfill\n * (\"/static/js/wasm-polyfill.js\" by default)\n * @param {number=} opts.pitch - Initial pitch shift ([-1, 1], 0 by default)\n * @return {Promise.} A promise that contains recorded blob when fulfilled.\n */\nexport function record(opts) {\n return new Promise((resolve, reject) => {\n if (shown) throw new Error(\"Record form is already opened\");\n shown = true;\n new Form(opts, resolve, reject);\n // Use `.finally` once it's available in Safari and Edge.\n }).then(result => {\n shown = false;\n return result;\n }, err => {\n shown = false;\n throw err;\n });\n}\n\n/**\n * All available public items.\n */\nexport default { Recorder, Form, record };\n\n// Borrowed from and slightly modified:\n// https://github.com/cwilso/Audio-Input-Effects/blob/master/js/jungle.js\n\n// Copyright 2012, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nconst delayTime = 0.100;\nconst fadeTime = 0.050;\nconst bufferTime = 0.100;\n\nfunction createFadeBuffer(context, activeTime, fadeTime) {\n var length1 = activeTime * context.sampleRate;\n var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n var length = length1 + length2;\n var buffer = context.createBuffer(1, length, context.sampleRate);\n var p = buffer.getChannelData(0);\n\n var fadeLength = fadeTime * context.sampleRate;\n\n var fadeIndex1 = fadeLength;\n var fadeIndex2 = length1 - fadeLength;\n\n // 1st part of cycle\n for (var i = 0; i < length1; ++i) {\n var value;\n\n if (i < fadeIndex1) {\n value = Math.sqrt(i / fadeLength);\n } else if (i >= fadeIndex2) {\n value = Math.sqrt(1 - (i - fadeIndex2) / fadeLength);\n } else {\n value = 1;\n }\n\n p[i] = value;\n }\n\n // 2nd part\n for (var i = length1; i < length; ++i) {\n p[i] = 0;\n }\n\n return buffer;\n}\n\nfunction createDelayTimeBuffer(context, activeTime, fadeTime, shiftUp) {\n var length1 = activeTime * context.sampleRate;\n var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n var length = length1 + length2;\n var buffer = context.createBuffer(1, length, context.sampleRate);\n var p = buffer.getChannelData(0);\n\n // 1st part of cycle\n for (var i = 0; i < length1; ++i) {\n if (shiftUp)\n // This line does shift-up transpose\n p[i] = (length1-i)/length;\n else\n // This line does shift-down transpose\n p[i] = i / length1;\n }\n\n // 2nd part\n for (var i = length1; i < length; ++i) {\n p[i] = 0;\n }\n\n return buffer;\n}\n\nfunction Jungle(context) {\n this.context = context;\n // Create nodes for the input and output of this \"module\".\n var input = (context.createGain || context.createGainNode).call(context);\n var output = (context.createGain || context.createGainNode).call(context);\n this.input = input;\n this.output = output;\n\n // Delay modulation.\n var mod1 = context.createBufferSource();\n var mod2 = context.createBufferSource();\n var mod3 = context.createBufferSource();\n var mod4 = context.createBufferSource();\n this.shiftDownBuffer = createDelayTimeBuffer(context, bufferTime, fadeTime, false);\n this.shiftUpBuffer = createDelayTimeBuffer(context, bufferTime, fadeTime, true);\n mod1.buffer = this.shiftDownBuffer;\n mod2.buffer = this.shiftDownBuffer;\n mod3.buffer = this.shiftUpBuffer;\n mod4.buffer = this.shiftUpBuffer;\n mod1.loop = true;\n mod2.loop = true;\n mod3.loop = true;\n mod4.loop = true;\n\n // for switching between oct-up and oct-down\n var mod1Gain = (context.createGain || context.createGainNode).call(context);\n var mod2Gain = (context.createGain || context.createGainNode).call(context);\n var mod3Gain = (context.createGain || context.createGainNode).call(context);\n mod3Gain.gain.value = 0;\n var mod4Gain = (context.createGain || context.createGainNode).call(context);\n mod4Gain.gain.value = 0;\n\n mod1.connect(mod1Gain);\n mod2.connect(mod2Gain);\n mod3.connect(mod3Gain);\n mod4.connect(mod4Gain);\n\n // Delay amount for changing pitch.\n var modGain1 = (context.createGain || context.createGainNode).call(context);\n var modGain2 = (context.createGain || context.createGainNode).call(context);\n\n var delay1 = (context.createDelay || context.createDelayNode).call(context);\n var delay2 = (context.createDelay || context.createDelayNode).call(context);\n mod1Gain.connect(modGain1);\n mod2Gain.connect(modGain2);\n mod3Gain.connect(modGain1);\n mod4Gain.connect(modGain2);\n modGain1.connect(delay1.delayTime);\n modGain2.connect(delay2.delayTime);\n\n // Crossfading.\n var fade1 = context.createBufferSource();\n var fade2 = context.createBufferSource();\n var fadeBuffer = createFadeBuffer(context, bufferTime, fadeTime);\n fade1.buffer = fadeBuffer\n fade2.buffer = fadeBuffer;\n fade1.loop = true;\n fade2.loop = true;\n\n var mix1 = (context.createGain || context.createGainNode).call(context);\n var mix2 = (context.createGain || context.createGainNode).call(context);\n mix1.gain.value = 0;\n mix2.gain.value = 0;\n\n fade1.connect(mix1.gain);\n fade2.connect(mix2.gain);\n\n // Connect processing graph.\n input.connect(delay1);\n input.connect(delay2);\n delay1.connect(mix1);\n delay2.connect(mix2);\n mix1.connect(output);\n mix2.connect(output);\n\n // Start\n var t = context.currentTime + 0.050;\n var t2 = t + bufferTime - fadeTime;\n mod1.start(t);\n mod2.start(t2);\n mod3.start(t);\n mod4.start(t2);\n fade1.start(t);\n fade2.start(t2);\n\n this.mod1 = mod1;\n this.mod2 = mod2;\n this.mod1Gain = mod1Gain;\n this.mod2Gain = mod2Gain;\n this.mod3Gain = mod3Gain;\n this.mod4Gain = mod4Gain;\n this.modGain1 = modGain1;\n this.modGain2 = modGain2;\n this.fade1 = fade1;\n this.fade2 = fade2;\n this.mix1 = mix1;\n this.mix2 = mix2;\n this.delay1 = delay1;\n this.delay2 = delay2;\n\n this.setDelay(delayTime);\n}\n\nJungle.prototype.setDelay = function(delayTime) {\n this.modGain1.gain.setTargetAtTime(0.5*delayTime, 0, 0.010);\n this.modGain2.gain.setTargetAtTime(0.5*delayTime, 0, 0.010);\n};\n\nJungle.prototype.setPitchOffset = function(mult) {\n if (mult>0) { // pitch up\n this.mod1Gain.gain.value = 0;\n this.mod2Gain.gain.value = 0;\n this.mod3Gain.gain.value = 1;\n this.mod4Gain.gain.value = 1;\n } else { // pitch down\n this.mod1Gain.gain.value = 1;\n this.mod2Gain.gain.value = 1;\n this.mod3Gain.gain.value = 0;\n this.mod4Gain.gain.value = 0;\n }\n this.setDelay(delayTime*Math.abs(mult));\n};\n","import React, { PureComponent } from 'react';\nimport vmsg from \"vmsg\";\nimport { withTranslation } from 'react-i18next';\n\nconst recorder = new vmsg.Recorder({\n wasmURL: window.lhcChat['staticJS']['chunk_js']+ \"/\" + 'vmsg.8c4a15f2.wasm',\n shimURL: \"https://unpkg.com/wasm-polyfill.js@0.2.0/wasm-polyfill.js\"\n});\n\nclass VoiceMessage extends PureComponent {\n\n state = {\n isLoading: false,\n isRecording: false,\n isPlaying: false,\n recording: null,\n audioDuration: 0,\n currentTime: 0\n };\n\n constructor(props) {\n super(props);\n this.startRecording = this.startRecording.bind(this);\n this.stopRecording = this.stopRecording.bind(this);\n this.playRecord = this.playRecord.bind(this);\n this.stopPlayRecord = this.stopPlayRecord.bind(this);\n this.sendRecord = this.sendRecord.bind(this);\n\n // Intervals\n this.durationInterval = null;\n this.playInterval = null;\n }\n\n async startRecording() {\n this.stopPlayRecord();\n this.setState({ isLoading: true, audioDuration : 0, recording: null, isPlaying: false, currentTime : 0});\n try {\n await recorder.initAudio();\n await recorder.initWorker();\n recorder.startRecording();\n this.setState({ isLoading: false, isRecording: true });\n this.durationInterval = setInterval(() => {\n this.setState({ audioDuration: this.state.audioDuration + 1 });\n\n // Do not allow to record longer message than defined messages length.\n if (this.state.audioDuration >= this.props.maxSeconds) {\n this.stopRecording();\n }\n\n }, 1000);\n } catch (e) {\n alert('Sorry but voice messages are not supported on your browser!');\n this.setState({ isLoading: false });\n }\n }\n\n async stopRecording(){\n const blob = await recorder.stopRecording();\n\n this.audio = new Audio();\n this.audio.src = URL.createObjectURL(blob);\n\n this.setState({\n isLoading: false,\n isRecording: false,\n recording: blob\n });\n\n clearInterval(this.durationInterval);\n }\n\n playRecord() {\n this.audio.currentTime = 0;\n this.audio.play();\n this.setState({isPlaying : true});\n\n this.playInterval = setInterval(\n () => {\n this.setState({currentTime: Math.round(this.audio.currentTime)});\n if (this.audio.ended || this.audio.paused) {\n this.stopPlayRecord();\n }\n },\n 1000);\n }\n\n stopPlayRecord() {\n if (this.state.isPlaying) {\n clearInterval(this.playInterval);\n this.audio.currentTime = 0;\n this.audio.pause();\n this.setState({isPlaying : false, currentTime: 0});\n }\n }\n\n sendRecord() {\n const { t } = this.props;\n\n this.props.progress(t('file.uploading'));\n\n const req = new XMLHttpRequest();\n const formData = new FormData();\n formData.append(\"files\", this.state.recording, \"record.mp3\");\n req.open(\"POST\", this.props.base_url + '/file/uploadfile/' + this.props.chat_id + '/' + this.props.hash);\n req.upload.addEventListener(\"load\", event => {\n this.props.progress('100%');\n this.props.onCompletion();\n this.props.cancel();\n });\n req.send(formData);\n }\n\n componentDidMount() {\n\n }\n\n componentWillUnmount() {\n\n // Stop playing if anything is playing\n this.stopPlayRecord();\n\n // Stop recordng if it's recording\n if (this.state.isRecording) {\n recorder.stopRecording();\n }\n }\n\n pad(n) {\n return (n < 10) ? (\"0\" + n) : n;\n }\n\n render() {\n\n const {isLoading, isRecording, recording, isPlaying } = this.state;\n\n const { t } = this.props;\n\n return
\n this.props.cancel()}>\n\n {!isRecording && }\n\n {isRecording && }\n\n {recording && isPlaying === false && }\n\n {recording && isPlaying === true && }\n\n {isRecording ? '' : (isPlaying ? this.pad(this.state.currentTime) + ':' : '')}{isRecording || !recording ? (this.props.maxSeconds - this.state.audioDuration) + \" s.\" : this.pad(this.state.audioDuration) + (!isPlaying ? 's.' : '')}\n\n {recording && }\n\n
;\n }\n}\n\nexport default withTranslation()(VoiceMessage);"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js new file mode 100644 index 0000000000..5cf9892055 --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js @@ -0,0 +1,2 @@ +(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[7],{481:function(t,e,a){"use strict";a.r(e),a.d(e,"nodeJSChat",(function(){return d}));var n=a(6),i=a.n(n),s=a(7),c=a.n(s),h=a(2),o=a(5),d=new(function(){function t(){var e=this;i()(this,t),this.socket=null,h.a.eventEmitter.addListener("endedChat",(function(){null!==e.socket&&e.socket.destroy()}))}return c()(t,[{key:"bootstrap",value:function(t,e,n){var i=n(),s=i.chatwidget.getIn(["chatData","id"]),c=(i.chatwidget.getIn(["chatData","hash"]),i.chatwidget.getIn(["chat_ui","sync_interval"])),d={hostname:t.hostname,path:t.path,autoReconnectOptions:{initialDelay:5e3,randomness:5e3}};""!=t.port&&(d.port=parseInt(t.port)),1==t.secure&&(d.secure=!0),t.instance_id>0&&t.instance_id;var r=a(490),g=this.socket=r.connect(d),_=null;function l(e){1==e.status?t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:e.msg}):g.publish("chat_"+s,{op:"vt",msg:e.msg}):t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vts"}):g.publish("chat_"+s,{op:"vts"})}function u(e){t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:"✉️ "+e.msg}):g.publish("chat_"+s,{op:"vt",msg:"✉️ "+e.msg})}function p(e){t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:"📕️ error happened while sending visitor message, please inform your administrator!"}):g.publish("chat_"+s,{op:"vt",msg:"📕️ error happened while sending visitor message, please inform your administrator!"})}function m(){if(null!==_)try{_.destroy()}catch(t){}h.a.eventEmitter.removeListener("visitorTyping",l),h.a.eventEmitter.removeListener("messageSend",u),h.a.eventEmitter.removeListener("messageSendError",p),e({type:"CHAT_UI_UPDATE",data:{sync_interval:c}}),e({type:"CHAT_REMOVE_OVERRIDE",data:"typing"})}function w(){(_=t.instance_id>0?g.subscribe("chat_"+t.instance_id+"_"+s):g.subscribe("chat_"+s)).on("subscribeFail",(function(t){console.error("Failed to subscribe to the sample channel due to error: "+t)})),_.on("subscribe",(function(){g.publish(t.instance_id>0?"chat_"+t.instance_id+"_"+s:"chat_"+s,{op:"vi_online",status:!0})})),_.watch((function(a){if("ot"==a.op)1==a.data.status?e({type:"chat_status_changed",data:{text:a.data.ttx}}):e({type:"chat_status_changed",data:{text:""}});else if("cmsg"==a.op||"schange"==a.op){var i=n();i.chatwidget.hasIn(["chatData","id"])&&e(Object(o.d)({chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),lmgsid:i.chatwidget.getIn(["chatLiveData","lmsgid"]),theme:i.chatwidget.get("theme")}))}else if("umsg"==a.op){var s=n();s.chatwidget.hasIn(["chatData","id"])&&Object(o.s)({msg_id:a.msid,id:s.chatwidget.getIn(["chatData","id"]),hash:s.chatwidget.getIn(["chatData","hash"])})(e,n)}else if("schange"==a.op||"cclose"==a.op){var c=n();c.chatwidget.hasIn(["chatData","id"])&&e(Object(o.b)({chat_id:c.chatwidget.getIn(["chatData","id"]),hash:c.chatwidget.getIn(["chatData","hash"]),mode:c.chatwidget.get("mode"),theme:c.chatwidget.get("theme")}))}else if("vo"==a.op){var h=n();h.chatwidget.hasIn(["chatData","id"])&&g.publish(t.instance_id>0?"chat_"+t.instance_id+"_"+h.chatwidget.getIn(["chatData","id"]):"chat_"+h.chatwidget.getIn(["chatData","id"]),{op:"vi_online",status:!0})}})),h.a.eventEmitter.addListener("visitorTyping",l),h.a.eventEmitter.addListener("messageSend",u),h.a.eventEmitter.addListener("messageSendError",p),e({type:"CHAT_UI_UPDATE",data:{sync_interval:1e4}}),e({type:"CHAT_ADD_OVERRIDE",data:"typing"})}g.on("error",(function(t){console.error(t)})),g.on("close",(function(){m()})),g.on("deauthenticate",(function(){var e=n(),a=e.chatwidget.getIn(["chatData","id"]);window.lhcAxios.post(window.lhcChat.base_url+"nodejshelper/tokenvisitor/"+a+"/"+e.chatwidget.getIn(["chatData","hash"]),null,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){g.emit("login",{hash:e.data,chanelName:t.instance_id>0?"chat_"+t.instance_id+"_"+a:"chat_"+a},(function(t){t&&(console.log(t),m())}))}))})),g.on("connect",(function(e){if(e.isAuthenticated&&s>0)w();else{var a=n(),i=a.chatwidget.getIn(["chatData","id"]);window.lhcAxios.post(window.lhcChat.base_url+"nodejshelper/tokenvisitor/"+i+"/"+a.chatwidget.getIn(["chatData","hash"]),null,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){g.emit("login",{hash:e.data,chanelName:t.instance_id>0?"chat_"+t.instance_id+"_"+i:"chat_"+i},(function(t){t?(console.log(t),g.destroy()):w()}))}))}}))}}]),t}())}}]); +//# sourceMappingURL=7.24e095ac1eddde957959.ie.js.map \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js.map b/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js.map new file mode 100644 index 0000000000..d41312471c --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://LHCReactAPP/./src/extensions/nodejs/nodeJSChat.js"],"names":["nodeJSChat","this","socket","helperFunctions","eventEmitter","addListener","destroy","params","dispatch","getState","state","chatId","chatwidget","getIn","syncDefault","socketOptions","hostname","path","autoReconnectOptions","initialDelay","randomness","port","parseInt","secure","instance_id","socketCluster","require","connect","sampleChannel","visitorTypingListener","data","status","publish","msg","messageSend","messageSendError","disconnect","e","removeListener","sync_interval","connectVisitor","subscribe","on","err","console","error","watch","op","text","ttx","hasIn","fetchMessages","get","updateMessage","msid","checkChatStatus","chat_id","window","lhcAxios","post","lhcChat","headers","then","response","emit","hash","chanelName","log","isAuthenticated"],"mappings":"oNAmOMA,EAAa,I,WA/Nf,aAAc,uBACVC,KAAKC,OAAS,KAGdC,IAAgBC,aAAaC,YAAY,aAAa,WAC9B,OAAhB,EAAKH,QACL,EAAKA,OAAOI,a,8CAKdC,EAAQC,EAAUC,GAExB,IAAMC,EAAQD,IACRE,EAASD,EAAME,WAAWC,MAAM,CAAC,WAAW,OAE5CC,GADWJ,EAAME,WAAWC,MAAM,CAAC,WAAW,SAChCH,EAAME,WAAWC,MAAM,CAAC,UAAU,mBAElDE,EAAgB,CAChBC,SAAUT,EAAOS,SACjBC,KAAMV,EAAOU,KACbC,qBAAsB,CAACC,aAAc,IAAMC,WAAY,MAGxC,IAAfb,EAAOc,OACPN,EAAcM,KAAOC,SAASf,EAAOc,OAGpB,GAAjBd,EAAOgB,SACPR,EAAcQ,QAAS,GAKvBhB,EAAOiB,YAAc,GACCjB,EAAOiB,YAKjC,IAAIC,EAAgBC,EAAQ,KAExBxB,EAASD,KAAKC,OAASuB,EAAcE,QAAQZ,GAE7Ca,EAAgB,KAMrB,SAASC,EAAsBC,GAEP,GAAfA,EAAKC,OACDxB,EAAOiB,YAAc,EACrBtB,EAAO8B,QAAQ,QAAQzB,EAAOiB,YAAY,IAAIb,EAAO,CAAC,GAAK,KAAK,I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AACC,GACnN7D,EAAO8D,KAAK,QAAS,CAACC,KAAMF,EAASjC,KAAMoC,WAAa3D,EAAOiB,YAAc,EAAK,QAAQjB,EAAOiB,YAAY,IAAIgC,EAAY,QAAQA,IAAa,SAAUb,GACpJA,GACAC,QAAQuB,IAAIxB,GACZzC,EAAOI,WAEPkC,kB","file":"7.24e095ac1eddde957959.ie.js","sourcesContent":["import { helperFunctions } from \"../../lib/helperFunctions\";\nimport { fetchMessages, checkChatStatus, updateMessage } from \"../../actions/chatActions\"\n\nclass _nodeJSChat {\n constructor() {\n this.socket = null;\n\n // On chat close event close connection\n helperFunctions.eventEmitter.addListener('endedChat', () => {\n if (this.socket !== null) {\n this.socket.destroy();\n }\n });\n }\n\n bootstrap(params, dispatch, getState) {\n\n const state = getState();\n const chatId = state.chatwidget.getIn(['chatData','id']);\n const chatHash = state.chatwidget.getIn(['chatData','hash']);\n const syncDefault = state.chatwidget.getIn(['chat_ui','sync_interval']);\n\n var socketOptions = {\n hostname: params.hostname,\n path: params.path,\n autoReconnectOptions: {initialDelay: 5000, randomness: 5000}\n }\n\n if (params.port != '') {\n socketOptions.port = parseInt(params.port);\n }\n\n if (params.secure == 1) {\n socketOptions.secure = true;\n }\n\n var chanelName;\n\n if (params.instance_id > 0) {\n chanelName = ('chat_'+params.instance_id+'_'+chatId);\n } else{\n chanelName = ('chat_'+chatId);\n }\n\n var socketCluster = require('socketcluster-client');\n\n var socket = this.socket = socketCluster.connect(socketOptions);\n \n var sampleChannel = null;\n \n socket.on('error', function (err) {\n console.error(err);\n });\n\n function visitorTypingListener(data)\n {\n if (data.status == true){\n if (params.instance_id > 0) {\n socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vt','msg':data.msg});\n } else {\n socket.publish('chat_'+chatId,{'op':'vt','msg':data.msg});\n }\n } else {\n if (params.instance_id > 0) {\n socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vts'});\n } else {\n socket.publish('chat_'+chatId,{'op':'vts'});\n }\n }\n }\n\n function messageSend(data)\n {\n if (params.instance_id > 0) {\n socket.publish('chat_'+params.instance_id+'_'+chatId, {'op':'vt','msg':'✉️ ' + data.msg});\n } else {\n socket.publish('chat_'+chatId,{'op':'vt', 'msg':'✉️ ' + data.msg});\n }\n }\n\n function messageSendError(data)\n {\n if (params.instance_id > 0) {\n socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vt','msg':'📕️ error happened while sending visitor message, please inform your administrator!'});\n } else {\n socket.publish('chat_'+chatId, {'op':'vt','msg':'📕️ error happened while sending visitor message, please inform your administrator!'});\n }\n }\n\n function disconnect() {\n if (sampleChannel !== null) {\n try {\n sampleChannel.destroy();\n } catch (e) {\n\n }\n }\n\n helperFunctions.eventEmitter.removeListener('visitorTyping', visitorTypingListener);\n helperFunctions.eventEmitter.removeListener('messageSend', messageSend);\n helperFunctions.eventEmitter.removeListener('messageSendError', messageSendError);\n\n dispatch({\n 'type': 'CHAT_UI_UPDATE',\n 'data': {sync_interval: syncDefault}\n });\n\n dispatch({\n 'type': 'CHAT_REMOVE_OVERRIDE',\n 'data': \"typing\"\n });\n }\n\n socket.on('close', function() {\n disconnect();\n });\n\n function connectVisitor(){\n if (params.instance_id > 0) {\n sampleChannel = socket.subscribe('chat_'+params.instance_id+'_'+chatId);\n } else {\n sampleChannel = socket.subscribe('chat_' + chatId);\n }\n\n sampleChannel.on('subscribeFail', function (err) {\n console.error('Failed to subscribe to the sample channel due to error: ' + err);\n });\n\n sampleChannel.on('subscribe', function () {\n socket.publish((params.instance_id > 0 ? 'chat_'+params.instance_id+'_'+chatId : 'chat_'+chatId), {'op':'vi_online', status: true});\n });\n\n sampleChannel.watch(function (op) {\n if (op.op == 'ot') { // Operator Typing Message\n if (op.data.status == true) {\n dispatch({\n 'type': 'chat_status_changed',\n 'data': {text: op.data.ttx}\n });\n } else {\n dispatch({\n 'type': 'chat_status_changed',\n 'data': {text: ''}\n });\n }\n } else if (op.op == 'cmsg' || op.op == 'schange') {\n const state = getState();\n if (state.chatwidget.hasIn(['chatData','id'])){\n dispatch(fetchMessages({\n 'chat_id': state.chatwidget.getIn(['chatData','id']),\n 'hash' : state.chatwidget.getIn(['chatData','hash']),\n 'lmgsid' : state.chatwidget.getIn(['chatLiveData','lmsgid']),\n 'theme' : state.chatwidget.get('theme')\n }));\n }\n } else if (op.op == 'umsg') {\n const state = getState();\n if (state.chatwidget.hasIn(['chatData','id'])) {\n updateMessage({'msg_id' : op.msid,'id' : state.chatwidget.getIn(['chatData','id']), 'hash' : state.chatwidget.getIn(['chatData','hash'])})(dispatch, getState);\n }\n } else if (op.op == 'schange' || op.op == 'cclose') {\n const state = getState();\n if (state.chatwidget.hasIn(['chatData','id'])){\n dispatch(checkChatStatus({\n 'chat_id': state.chatwidget.getIn(['chatData','id']),\n 'hash' : state.chatwidget.getIn(['chatData','hash']),\n 'mode' : state.chatwidget.get('mode'),\n 'theme' : state.chatwidget.get('theme')\n }));\n }\n } else if (op.op == 'vo') {\n const state = getState();\n if (state.chatwidget.hasIn(['chatData','id'])) {\n socket.publish((params.instance_id > 0 ? 'chat_'+params.instance_id+'_'+state.chatwidget.getIn(['chatData','id']) : 'chat_'+state.chatwidget.getIn(['chatData','id'])) ,{'op':'vi_online', status: true});\n }\n }\n });\n\n helperFunctions.eventEmitter.addListener('visitorTyping', visitorTypingListener);\n helperFunctions.eventEmitter.addListener('messageSend', messageSend);\n helperFunctions.eventEmitter.addListener('messageSendError', messageSendError);\n\n dispatch({\n 'type': 'CHAT_UI_UPDATE',\n 'data': {sync_interval: 10000}\n });\n\n dispatch({\n 'type': 'CHAT_ADD_OVERRIDE',\n 'data': \"typing\"\n });\n }\n\n socket.on('deauthenticate', function(){\n const state = getState();\n let chat_id = state.chatwidget.getIn(['chatData','id']);\n window.lhcAxios.post(window.lhcChat['base_url'] + \"nodejshelper/tokenvisitor/\"+chat_id+\"/\"+state.chatwidget.getIn(['chatData','hash']), null, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n socket.emit('login', {hash:response.data, chanelName: (params.instance_id > 0 ? ('chat_'+params.instance_id+'_'+chat_id) : ('chat_'+chat_id)) }, function (err) {\n if (err) {\n console.log(err);\n disconnect();\n }\n });\n });\n });\n\n socket.on('connect', function (status) {\n if (status.isAuthenticated && chatId > 0) {\n connectVisitor();\n } else {\n const state = getState();\n let chat_id = state.chatwidget.getIn(['chatData','id']);\n window.lhcAxios.post(window.lhcChat['base_url'] + \"nodejshelper/tokenvisitor/\"+chat_id+\"/\"+state.chatwidget.getIn(['chatData','hash']), null, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n socket.emit('login', {hash: response.data, chanelName: (params.instance_id > 0 ? ('chat_'+params.instance_id+'_'+chat_id) : ('chat_'+chat_id)) }, function (err) {\n if (err) {\n console.log(err);\n socket.destroy();\n } else {\n connectVisitor();\n }\n });\n });\n }\n });\n }\n}\n\nconst nodeJSChat = new _nodeJSChat();\nexport { nodeJSChat };"],"sourceRoot":""} \ No newline at end of file diff --git a/lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js b/lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js new file mode 100644 index 0000000000..5ba0fc49bd --- /dev/null +++ b/lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js @@ -0,0 +1,66 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LHCReactAPP=e():t.LHCReactAPP=e()}(window,(function(){return function(t){function e(e){for(var n,i,a=e[0],o=e[1],s=0,c=[];s0){var e={name_items:[],values_req:[],value_items:[],value_types:[],encattr:[],value_show:[]};return t.forEach((function(t){e.value_items.push(t.get("value")),e.name_items.push(t.get("name")),e.values_req.push(!0===t.get("required")?"t":"f"),e.encattr.push(!0===t.get("encrypted")?"t":""),e.value_types.push(t.get("type")),e.value_show.push(t.get("show"))})),e}return null}},{key:"prefillFields",value:function(t){var e=t.props.chatwidget.get("attr_prefill");e.length>0&&e.forEach((function(e){t.setState(e)}))}},{key:"logJSError",value:function(t){var e;(e={}).location=location&&location.href?location.href:"",e.message=window.navigator.userAgent,e.stack=t.stack,e.stack=e.stack.replace(/(\r\n|\n|\r)/gm,"");var n=new XMLHttpRequest;n.open("POST",window.lhcChat.base_url+"audit/logjserror",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send("data="+encodeURIComponent(JSON.stringify(e)))}}]),t}());window.lhcHelperfunctions=s},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"f",(function(){return hideInvitation})),__webpack_require__.d(__webpack_exports__,"k",(function(){return minimizeWidget})),__webpack_require__.d(__webpack_exports__,"c",(function(){return endChat})),__webpack_require__.d(__webpack_exports__,"e",(function(){return getProducts})),__webpack_require__.d(__webpack_exports__,"v",(function(){return voteAction})),__webpack_require__.d(__webpack_exports__,"r",(function(){return transferToHumanAction})),__webpack_require__.d(__webpack_exports__,"j",(function(){return initProactive})),__webpack_require__.d(__webpack_exports__,"n",(function(){return storeSubscriber})),__webpack_require__.d(__webpack_exports__,"t",(function(){return updateTriggerClicked})),__webpack_require__.d(__webpack_exports__,"q",(function(){return subscribeNotifications})),__webpack_require__.d(__webpack_exports__,"h",(function(){return initOfflineForm})),__webpack_require__.d(__webpack_exports__,"i",(function(){return initOnlineForm})),__webpack_require__.d(__webpack_exports__,"p",(function(){return submitOnlineForm})),__webpack_require__.d(__webpack_exports__,"o",(function(){return submitOfflineForm})),__webpack_require__.d(__webpack_exports__,"g",(function(){return initChatUI})),__webpack_require__.d(__webpack_exports__,"s",(function(){return updateMessage})),__webpack_require__.d(__webpack_exports__,"m",(function(){return parseScript})),__webpack_require__.d(__webpack_exports__,"d",(function(){return fetchMessages})),__webpack_require__.d(__webpack_exports__,"b",(function(){return checkChatStatus})),__webpack_require__.d(__webpack_exports__,"l",(function(){return pageUnload})),__webpack_require__.d(__webpack_exports__,"a",(function(){return addMessage})),__webpack_require__.d(__webpack_exports__,"u",(function(){return userTyping}));var axios__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(20),axios__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(13);window.lhcAxios=axios__WEBPACK_IMPORTED_MODULE_0___default.a;var syncStatus={msg:!1,status:!1,error_counter:0,auto_close_timeout:null},defaultHeaders={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function closeWidget(){return function(t){t({type:"closeWidget"})}}function abtractAction(t){return function(e){e(t)}}function hideInvitation(){return function(t,e){var n=e();_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("closeWidget",[{sender:"closeButton"}]),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("cancelInvitation",[{name:n.chatwidget.getIn(["proactive","data","invitation_name"])}]),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/chatwidgetclosed/(vid)/"+n.chatwidget.get("vid"),null,defaultHeaders).then((function(e){t({type:"HIDE_INVITATION"})})).catch((function(t){console.log(t)}))}}function minimizeWidget(t){return function(e,n){!0===n().chatwidget.getIn(["proactive","has"])?hideInvitation()(e,n):_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("closeWidget",[{sender:"closeButton"}]),!t||"popup"!=window.lhcChat.mode&&"embed"!=window.lhcChat.mode||(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.removeSessionStorage("_chat"),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.removeSessionStorage("_reset_chat"),window.close())}}function endChat(t,e){return e=e||"t",function(n,r){clearTimeout(syncStatus.auto_close_timeout),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/chatwidgetclosed/(eclose)/"+e+"/(hash)/"+t.chat.id+"_"+t.chat.hash+"/(vid)/"+t.vid+"/(close)/"+(t.noClose?"0":"1"),null,defaultHeaders).then((function(e){t.noClose?n({type:"INIT_CLOSE",data:t}):"popup"==window.lhcChat.mode?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.removeSessionStorage("_chat"),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.removeSessionStorage("_reset_chat"),window.close(),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("endedChat",[{chat_id:t.chat.id,hash:t.chat.hash}])):_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{show_start:t.show_start,sender:"endButton"}])})).catch((function(t){console.log(t)}))}}function getProducts(t){return function(e){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/getproducts/"+t.dep_id,null,defaultHeaders).then((function(t){e({type:"INIT_PRODUCTS",data:t.data})})).catch((function(t){console.log(t)}))}}function voteAction(t){return axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/voteaction/"+t.id+"/"+t.hash+"/"+t.type,null,defaultHeaders)}function transferToHumanAction(t){return axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/transfertohuman/"+t.id+"/"+t.hash,null,defaultHeaders)}function initProactive(t){return function(e,n){var r=n(),i={invitation:t.invitation,vid_id:t.vid_id,uts:(new Date).getTime()};r.chatwidget.get("theme")&&(i.theme=r.chatwidget.get("theme")),r.chatwidget.get("vid")&&(i.vid=r.chatwidget.get("vid")),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/getinvitation",i,defaultHeaders).then((function(t){t.data.chat_id&&t.data.chat_hash?(e({type:"ONLINE_SUBMITTED",data:{success:!0,chatData:{id:t.data.chat_id,hash:t.data.chat_hash}}}),showMessageSnippet({id:t.data.chat_id,hash:t.data.chat_hash})(e,n)):e({type:"PROACTIVE",data:t.data})}))}}function showMessageSnippet(t){return function(e,n){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/getmessagesnippet",t,defaultHeaders).then((function(t){_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("msgSnippet",[t.data]);var e=n();_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent("play_sound",[{type:"new_chat",sound_on:!0===e.chatwidget.getIn(["usersettings","soundOn"]),widget_open:!1}])})).catch((function(t){}))}}function storeSubscriber(t){return function(e,n){var r=n(),i="/(action)/sub";r.chatwidget.hasIn(["chatData","id"])&&r.chatwidget.hasIn(["chatData","hash"])&&(i=i+"/(hash)/"+r.chatwidget.getIn(["chatData","id"])+"_"+r.chatwidget.getIn(["chatData","hash"])),r.chatwidget.get("theme")&&(i=i+"/(theme)/"+r.chatwidget.get("theme")),r.chatwidget.get("vid")&&(i=i+"/(vid)/"+r.chatwidget.get("vid")),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"notifications/subscribe"+i,{data:t},defaultHeaders).then((function(t){r.chatwidget.hasIn(["chatData","id"])&&r.chatwidget.hasIn(["chatData","hash"])&&e(fetchMessages({chat_id:r.chatwidget.getIn(["chatData","id"]),hash:r.chatwidget.getIn(["chatData","hash"]),lmgsid:r.chatwidget.getIn(["chatLiveData","lmsgid"]),theme:r.chatwidget.get("theme")}))}))}}function updateTriggerClicked(t,e){return function(n,r){var i=r();return axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"genericbot/"+(t.mainType?t.mainType:"buttonclicked")+"/"+i.chatwidget.getIn(["chatData","id"])+"/"+i.chatwidget.getIn(["chatData","hash"])+t.type,e,defaultHeaders)}}function subscribeNotifications(t){return function(t,e){var n=e();_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("subscribeEvent",[{pk:n.chatwidget.getIn(["chat_ui","notifications_pk"])}])}}function initOfflineForm(t){return function(e){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/onlinesettings",t,defaultHeaders).then((function(t){e({type:"OFFLINE_FIELDS_UPDATED",data:t.data})})).catch((function(t){e({type:"OFFLINE_FIELDS_REJECTED",data:t})}))}}function initOnlineForm(t){return function(e){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/onlinesettings",t,defaultHeaders).then((function(t){t.data.paid.continue&&!0===t.data.paid.continue?e({type:"ONLINE_SUBMITTED",data:{success:!0,chatData:{id:t.data.paid.id,hash:t.data.paid.hash}}}):e({type:"ONLINE_FIELDS_UPDATED",data:t.data})})).catch((function(t){e({type:"ONLINE_FIELDS_REJECTED",data:t})}))}}function getCaptcha(t,e,n){var r=new Date,i=Math.round(r.getTime()/1e3);axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"captcha/captchastring/fake/"+i,null,defaultHeaders).then((function(r){t({type:"captcha",data:{hash:r.data.result,ts:i}}),n.fields["captcha_"+r.data.result]=i,n.fields.tscaptcha=i,n.fields.tscaptcha_resubmit?delete n.fields.tscaptcha_resubmit:(n.fields.tscaptcha_resubmit=1,e(n)(t))}))}function submitOnlineForm(t){return function(e){e({type:"ONLINE_SUBMITTING"}),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/submitonline",t,defaultHeaders).then((function(n){!1===n.data.success&&n.data.errors.captcha&&(getCaptcha(e,submitOnlineForm,t),!t.fields.tscaptcha_resubmit)||(e({type:"ONLINE_SUBMITTED",data:n.data}),n.data.t&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("botTrigger",[{trigger:n.data.t}]))})).catch((function(t){e({type:"ONLINE_SUBMITT_REJECTED",data:t})}))}}function submitOfflineForm(t){return function(e){e({type:"OFFLINE_SUBMITTING"}),axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/submitoffline",t,{headers:{"Content-Type":"multipart/form-data"}}).then((function(n){!1===n.data.success&&n.data.errors.captcha&&(getCaptcha(e,submitOfflineForm,t),!t.fields.tscaptcha_resubmit)||e({type:"OFFLINE_SUBMITTED",data:n.data})})).catch((function(t){e({type:"OFFLINE_SUBMITT_REJECTED",data:t})}))}}function updateUISettings(t){return function(e,n){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/uisettings",t,defaultHeaders).then((function(t){e({type:"REFRESH_UI_COMPLETED",data:t.data})})).catch((function(t){console.log(t),e({type:"REFRESH_UI_REJECTED",data:t})}))}}function initChatUI(t){return syncStatus.status=!1,function(e,n){axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/initchat",t,defaultHeaders).then((function(t){e({type:"INIT_CHAT_SUBMITTED",data:t.data}),t.data.init_calls&&t.data.init_calls.forEach((function(t){"nodeJSChat"===t.extension?Promise.all([__webpack_require__.e(1),__webpack_require__.e(7)]).then(__webpack_require__.bind(null,481)).then((function(r){r.nodeJSChat.bootstrap(t.params,e,n)})):t.extension}))})).catch((function(t){console.log(t),e({type:"INIT_CHAT_REJECTED",data:t})}))}}function processResponseCheckStatus(t,e,n){t.op&&t.op.forEach((function(t){var r=t.split(":")[0];if("lhc_chat_redirect"==r)_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("location",[t.split(":")[1].replace(new RegExp("__SPLIT__","g"),":")]);else if("lhc_screenshot"==r){var i=e(),a="";i.chatwidget.hasIn(["chatData","id"])&&(a=a+"/(hash)/"+i.chatwidget.getIn(["chatData","id"])+"_"+i.chatwidget.getIn(["chatData","hash"])),i.chatwidget.get("vid")&&(a=a+"/(vid)/"+i.chatwidget.get("vid")),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("screenshot",[window.lhcChat.base_url+"file/storescreenshot"+a])}else if("lhc_cobrowse"==r)_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("screenshare",[]);else if("lhc_cobrowse_cmd"==r)_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("screenshareCommand",[t]);else if("lhc_ui_refresh"==r){var o=e();updateUISettings({id:o.chatwidget.getIn(["chatData","id"]),hash:o.chatwidget.getIn(["chatData","hash"])})(n,e)}else if(-1!==r.indexOf("lhinst.updateMessageRow")){var s=e();updateMessage({msg_id:r.replace("lhinst.updateMessageRow(","").replace(")",""),id:s.chatwidget.getIn(["chatData","id"]),hash:s.chatwidget.getIn(["chatData","hash"])})(n,e)}}))}function updateMessage(t){return function(e,n){var r=this;n();axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/fetchmessage",t,defaultHeaders).then((function(t){var e=document.getElementById("msg-"+t.data.id);if(null!==e){var n=e.className;e.outerHTML=t.data.msg,e.className=n;var i=document.getElementById("messages-scroll");null!==i&&(i.scrollTop=i.scrollHeight+1e3);var a=document.getElementById("msg-"+t.data.id).getElementsByTagName("script"),o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value,d={};if(f.hasAttributes())for(var p=f.attributes,h=p.length-1;h>=0;h--)d[p[h].name]=p[h].value;f.attribs=d,parseScript(f,r)}}catch(t){s=!0,u=t}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}})).catch((function(t){console.log(t)}))}}function parseScript(domNode,inst){var attr=domNode.attribs||domNode;if("lhinst.disableVisitorEditor"==attr["data-bot-action"])inst.disableEditor=!0;else if("lhinst.setDelay"==attr["data-bot-action"])inst.delayData.push(JSON.parse(attr["data-bot-args"]));else if("execute-js"==attr["data-bot-action"])if(attr["data-bot-extension"]){var args={};void 0!==attr["data-bot-args"]&&(args=JSON.parse(attr["data-bot-args"])),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent("extensionExecute",[attr["data-bot-extension"],[args]])}else if(attr["data-bot-emit"]){var args={};void 0!==attr["data-bot-args"]&&(args=JSON.parse(attr["data-bot-args"])),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent(attr["data-bot-emit"],[args])}else if(attr["data-bot-event"])inst.props[attr["data-bot-event"]]();else if(attr.src){var th=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",attr.src),th.appendChild(s)}else void 0!==domNode.children[0]&&void 0!==domNode.children[0].data&&eval(domNode.children[0].data)}function isNetworkError(t){return!!t.isAxiosError&&!t.response}function fetchMessages(t){return function(e,n){1!=syncStatus.msg&&(syncStatus.msg=!0,axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/fetchmessages",t,defaultHeaders).then((function(r){syncStatus.msg=!1,e({type:"FETCH_MESSAGES_SUBMITTED",data:r.data}),processResponseCheckStatus(r.data,n,e),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent("chat.fetch_messages",[r.data,e,n]),(r.data.cs||r.data.closed&&!0===r.data.closed)&&axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/checkchatstatus",t,defaultHeaders).then((function(t){t.data.deleted?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),clearTimeout(syncStatus.auto_close_timeout)):(e({type:"CHECK_CHAT_STATUS_FINISHED",data:t.data}),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent("chat.check_status",[t.data,e,n])),t.data.closed&&!0===t.data.closed&&!t.data.deleted&&setAutoClose(n)})).catch((function(t){e({type:"CHECK_CHAT_STATUS_REJECTED",data:t})}))})).catch((function(t){isNetworkError(t)&&e({type:"NO_CONNECTION",data:!0}),syncStatus.msg=!1})))}}function checkChatStatus(t){return function(e,n){1!=syncStatus.status&&(syncStatus.status=!0,axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/checkchatstatus",t,defaultHeaders).then((function(t){t.data.deleted?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),clearTimeout(syncStatus.auto_close_timeout)):(syncStatus.status=!1,e({type:"CHECK_CHAT_STATUS_FINISHED",data:t.data}),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.emitEvent("chat.check_status",[t.data,e,n])),t.data.closed&&!0===t.data.closed&&!t.data.deleted&&setAutoClose(n)})).catch((function(t){syncStatus.status=!1})))}}function setAutoClose(t){var e=t();e.chatwidget.hasIn(["chat_ui","open_timeout"])&&(clearTimeout(syncStatus.auto_close_timeout),syncStatus.auto_close_timeout=setTimeout((function(){_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),clearTimeout(syncStatus.auto_close_timeout)}),1e3*e.chatwidget.getIn(["chat_ui","open_timeout"])))}function pageUnload(){return function(t,e){var n=e(),r=!1,i=n.chatwidget.hasIn(["chatLiveData","status_sub"])&&(n.chatwidget.getIn(["chatLiveData","status_sub"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.d||n.chatwidget.getIn(["chatLiveData","status_sub"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.e||n.chatwidget.getIn(["chatLiveData","status_sub"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.f&&(n.chatwidget.getIn(["chatLiveData","uid"])>0||n.chatwidget.getIn(["chatLiveData","status"])===_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.b)),a=n.chatwidget.getIn(["chatLiveData","status"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.c&&n.chatwidget.getIn(["chatLiveData","uid"])>0;(1==i||a)&&n.chatwidget.hasIn(["chat_ui","survey_id"])&&(n.chatwidget.hasIn(["chat_ui","survey_button"])&&1!==n.chatwidget.getIn(["chat_ui_state","show_survey"])&&1!=i||(r=!0)),n.chatwidget.hasIn(["chat_ui","close_on_unload"])&&"embed"==n.chatwidget.get("mode")&&(!1!==n.chatwidget.get("isMobile")&&!0!==r||_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}])),"popup"==n.chatwidget.get("mode")&&1==r&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),n.chatwidget.hasIn(["chatData","id"])&&n.chatwidget.hasIn(["chatData","hash"])?axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/userclosechat/"+n.chatwidget.getIn(["chatData","id"])+"/"+n.chatwidget.getIn(["chatData","hash"]),null,defaultHeaders):!0===n.chatwidget.getIn(["proactive","has"])&&"popup"==window.lhcChat.mode&&window.opener&&hideInvitation()(t,e)}}function checkErrorCounter(){2==syncStatus.error_counter&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("reloadWidget",[])}function addMessage(t){return function(e,n){try{_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSend",[{chat_id:t.id,hash:t.hash,msg:t.msg}])}catch(t){_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(t))})}axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"widgetrestapi/addmsguser",t,defaultHeaders).then((function(r){(r.data.error||n().chatwidget.getIn(["chatLiveData","error"]))&&e({type:"ADD_MESSAGES_SUBMITTED",data:{r:r.data.r,msg:t.msg}}),fetchMessages({theme:t.theme,chat_id:t.id,lmgsid:t.lmgsid,hash:t.hash})(e,n),r.data.t&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("botTrigger",[{trigger:r.data.t}]),void 0===r.data.r||!0===r.data.error&&!0===r.data.system?(syncStatus.error_counter++,2==syncStatus.error_counter&&(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(r)+"\nRD:"+JSON.stringify(r.data)+"\nRH:"+JSON.stringify(r.headers)+"\nRS:"+JSON.stringify(r.status))}),checkErrorCounter()),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:t.id,hash:t.hash,msg:JSON.stringify(r.data)}])):syncStatus.error_counter=0})).catch((function(r){if(isNetworkError(r))e({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_CONNECTION",msg:t.msg}}),e({type:"NO_CONNECTION",data:!0});else{syncStatus.error_counter++;var i=null;i=r.response?JSON.stringify(JSON.stringify(r)+"\nRD:"+JSON.stringify(r.response.data)+"\nRH:"+JSON.stringify(r.response.headers)+"\nRS:"+JSON.stringify(r.response.status)):(r.request,JSON.stringify(JSON.stringify(r))),2==syncStatus.error_counter?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:i}),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:t.id,hash:t.hash,msg:i}]),checkErrorCounter()):(e({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_FAILED",msg:t.msg}}),addMessage(t)(e,n))}}))}}function userTyping(t,e){return function(n,r){var i=r();"true"===t?_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!0,msg:e}]):_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!1}]),i.chatwidget.get("overrides").contains("typing")||axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(window.lhcChat.base_url+"chat/usertyping/"+i.chatwidget.getIn(["chatData","id"])+"/"+i.chatwidget.getIn(["chatData","hash"])+"/"+t,{msg:e},defaultHeaders).then((function(t){})).catch((function(t){console.log(t)}))}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r,i=n(137),a=n(16),o=n(8),s=n(14),u=n(23),c=n(83),l=n(31),f=n(28),d=n(21).f,p=n(46),h=n(63),g=n(17),v=n(73),m=o.Int8Array,_=m&&m.prototype,y=o.Uint8ClampedArray,b=y&&y.prototype,w=m&&p(m),E=_&&p(_),S=Object.prototype,x=S.isPrototypeOf,k=g("toStringTag"),T=v("TYPED_ARRAY_TAG"),O=i&&!!h&&"Opera"!==c(o.opera),I=!1,C={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},A=function(t){return s(t)&&u(C,c(t))};for(r in C)o[r]||(O=!1);if((!O||"function"!=typeof w||w===Function.prototype)&&(w=function(){throw TypeError("Incorrect invocation")},O))for(r in C)o[r]&&h(o[r],w);if((!O||!E||E===S)&&(E=w.prototype,O))for(r in C)o[r]&&h(o[r].prototype,E);if(O&&p(b)!==E&&h(b,E),a&&!u(E,k))for(r in I=!0,d(E,k,{get:function(){return s(this)?this[T]:void 0}}),C)o[r]&&l(o[r],T,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:I&&T,aTypedArray:function(t){if(A(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(h){if(x.call(w,t))return t}else for(var e in C)if(u(C,r)){var n=o[e];if(n&&(t===n||x.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n){if(a){if(n)for(var r in C){var i=o[r];i&&u(i.prototype,t)&&delete i.prototype[t]}E[t]&&!n||f(E,t,n?e:O&&_[t]||e)}},exportTypedArrayStaticMethod:function(t,e,n){var r,i;if(a){if(h){if(n)for(r in C)(i=o[r])&&u(i,t)&&delete i[t];if(w[t]&&!n)return;try{return f(w,t,n?e:O&&m[t]||e)}catch(t){}}for(r in C)!(i=o[r])||i[t]&&!n||f(i,t,e)}},isView:function(t){var e=c(t);return"DataView"===e||u(C,e)},isTypedArray:A,TypedArray:w,TypedArrayPrototype:E}},function(t,e,n){t.exports=n(441)},function(t,e,n){var r=n(16),i=n(144),a=n(15),o=n(44),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(a(t),e=o(e,!0),a(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(30);t.exports=function(t){return Object(r(t))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return z}));var r=n(0),i=n.n(r),a=(n(436),i.a.createContext(null));var o=function(t){t()},s={notify:function(){}};function u(){var t=o,e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t((function(){for(var t=e;t;)t.callback(),t=t.next}))},get:function(){for(var t=[],n=e;n;)t.push(n),n=n.next;return t},subscribe:function(t){var r=!0,i=n={callback:t,next:null,prev:n};return i.prev?i.prev.next=i:e=i,function(){r&&null!==e&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var c=function(){function t(t,e){this.store=t,this.parentSub=e,this.unsubscribe=null,this.listeners=s,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var e=t.prototype;return e.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},e.notifyNestedSubs=function(){this.listeners.notify()},e.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},e.isSubscribed=function(){return Boolean(this.unsubscribe)},e.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=u())},e.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=s)},t}();var l=function(t){var e=t.store,n=t.context,o=t.children,s=Object(r.useMemo)((function(){var t=new c(e);return t.onStateChange=t.notifyNestedSubs,{store:e,subscription:t}}),[e]),u=Object(r.useMemo)((function(){return e.getState()}),[e]);Object(r.useEffect)((function(){var t=s.subscription;return t.trySubscribe(),u!==e.getState()&&t.notifyNestedSubs(),function(){t.tryUnsubscribe(),t.onStateChange=null}}),[s,u]);var l=n||a;return i.a.createElement(l.Provider,{value:s},o)};function f(){return(f=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}var p=n(142),h=n.n(p),g=n(139),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,m=[],_=[null,null];function y(t,e){var n=t[1];return[e.payload,n+1]}function b(t,e,n){v((function(){return t.apply(void 0,e)}),n)}function w(t,e,n,r,i,a,o){t.current=r,e.current=i,n.current=!1,a.current&&(a.current=null,o())}function E(t,e,n,r,i,a,o,s,u,c){if(t){var l=!1,f=null,d=function(){if(!l){var t,n,d=e.getState();try{t=r(d,i.current)}catch(t){n=t,f=t}n||(f=null),t===a.current?o.current||u():(a.current=t,s.current=t,o.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=d,n.trySubscribe(),d();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var S=function(){return[null,0]};function x(t,e){void 0===e&&(e={});var n=e,o=n.getDisplayName,s=void 0===o?function(t){return"ConnectAdvanced("+t+")"}:o,u=n.methodName,l=void 0===u?"connectAdvanced":u,p=n.renderCountProp,v=void 0===p?void 0:p,x=n.shouldHandleStateChanges,k=void 0===x||x,T=n.storeKey,O=void 0===T?"store":T,I=(n.withRef,n.forwardRef),C=void 0!==I&&I,A=n.context,P=void 0===A?a:A,D=d(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),M=P;return function(e){var n=e.displayName||e.name||"Component",a=s(n),o=f({},D,{getDisplayName:s,methodName:l,renderCountProp:v,shouldHandleStateChanges:k,storeKey:O,displayName:a,wrappedComponentName:n,WrappedComponent:e}),u=D.pure;var p=u?r.useMemo:function(t){return t()};function x(n){var a=Object(r.useMemo)((function(){var t=n.forwardedRef,e=d(n,["forwardedRef"]);return[n.context,t,e]}),[n]),s=a[0],u=a[1],l=a[2],h=Object(r.useMemo)((function(){return s&&s.Consumer&&Object(g.isContextConsumer)(i.a.createElement(s.Consumer,null))?s:M}),[s,M]),v=Object(r.useContext)(h),x=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(v)&&Boolean(v.store);var T=x?n.store:v.store,O=Object(r.useMemo)((function(){return function(e){return t(e.dispatch,o)}(T)}),[T]),I=Object(r.useMemo)((function(){if(!k)return _;var t=new c(T,x?null:v.subscription),e=t.notifyNestedSubs.bind(t);return[t,e]}),[T,x,v]),C=I[0],A=I[1],P=Object(r.useMemo)((function(){return x?v:f({},v,{subscription:C})}),[x,v,C]),D=Object(r.useReducer)(y,m,S),L=D[0][0],N=D[1];if(L&&L.error)throw L.error;var R=Object(r.useRef)(),j=Object(r.useRef)(l),F=Object(r.useRef)(),U=Object(r.useRef)(!1),B=p((function(){return F.current&&l===j.current?F.current:O(T.getState(),l)}),[T,L,l]);b(w,[j,R,U,l,B,F,A]),b(E,[k,T,C,O,j,R,U,F,A,N],[T,C,O]);var z=Object(r.useMemo)((function(){return i.a.createElement(e,f({},B,{ref:u}))}),[u,e,B]);return Object(r.useMemo)((function(){return k?i.a.createElement(h.Provider,{value:P},z):z}),[h,z,P])}var T=u?i.a.memo(x):x;if(T.WrappedComponent=e,T.displayName=a,C){var I=i.a.forwardRef((function(t,e){return i.a.createElement(T,f({},t,{forwardedRef:e}))}));return I.displayName=a,I.WrappedComponent=e,h()(I,e)}return h()(T,e)}}function k(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function T(t,e){if(k(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=e[r](t);if(i)return i}return function(e,r){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function U(t,e){return t===e}function B(t){var e=void 0===t?{}:t,n=e.connectHOC,r=void 0===n?x:n,i=e.mapStateToPropsFactories,a=void 0===i?D:i,o=e.mapDispatchToPropsFactories,s=void 0===o?P:o,u=e.mergePropsFactories,c=void 0===u?L:u,l=e.selectorFactory,p=void 0===l?j:l;return function(t,e,n,i){void 0===i&&(i={});var o=i,u=o.pure,l=void 0===u||u,h=o.areStatesEqual,g=void 0===h?U:h,v=o.areOwnPropsEqual,m=void 0===v?T:v,_=o.areStatePropsEqual,y=void 0===_?T:_,b=o.areMergedPropsEqual,w=void 0===b?T:b,E=d(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),S=F(t,a,"mapStateToProps"),x=F(e,s,"mapDispatchToProps"),k=F(n,c,"mergeProps");return r(p,f({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:S,initMapDispatchToProps:x,initMergeProps:k,pure:l,areStatesEqual:g,areOwnPropsEqual:m,areStatePropsEqual:y,areMergedPropsEqual:w},E))}}var z=B();var H,q=n(108);H=q.unstable_batchedUpdates,o=H},function(t,e,n){"use strict";n.d(e,"b",(function(){return j})),n.d(e,"a",(function(){return S}));var r=n(58),i=n.n(r),a=n(12),o=n.n(a),s=(n(71),n(0)),u=n.n(s),c=(n(201),n(6)),l=n.n(c),f=n(7),d=n.n(f);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};m=h({},m,{},t)}(t.options.react),function(t){g=t}(t)}};function x(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if(!e.languages||!e.languages.length)return T("i18n.languages were undefined or empty",e.languages),!0;var r=e.languages[0],i=!!e.options&&e.options.fallbackLng,a=e.languages[e.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t))&&(!!e.hasResourceBundle(r,t)||(!e.services.backendConnector.backend||!(!o(r,t)||i&&!o(a,t))))}function C(t){return t.displayName||t.name||("string"==typeof t&&t.length>0?t:"Unknown")}var A=n(48),P=n.n(A);function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=e.i18n,r=Object(s.useContext)(_),i=y()&&r||{},a=i.i18n,o=i.defaultNS,u=n||a||E();if(u&&!u.reportNamespaces&&(u.reportNamespaces=new w),!u){T("You will need pass in an i18next instance by using initReactI18next");var c=function(t){return Array.isArray(t)?t[t.length-1]:t},l=[c,{},!1];return l.t=c,l.i18n={},l.ready=!1,l}var f=M({},b(),{},u.options.react,{},e),d=f.useSuspense,p=t||o||u.options&&u.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],u.reportNamespaces.addUsedNamespaces&&u.reportNamespaces.addUsedNamespaces(p);var h=(u.isInitialized||u.initializedStoreOnce)&&p.every((function(t){return I(t,u,f)}));function g(){return{t:u.getFixedT(null,"fallback"===f.nsMode?p:p[0])}}var v=Object(s.useState)(g()),m=P()(v,2),S=m[0],x=m[1];Object(s.useEffect)((function(){var t=!0,e=f.bindI18n,n=f.bindI18nStore;function r(){t&&x(g())}return h||d||O(u,p,(function(){t&&x(g())})),e&&u&&u.on(e,r),n&&u&&u.store.on(n,r),function(){t=!1,e&&u&&e.split(" ").forEach((function(t){return u.off(t,r)})),n&&u&&n.split(" ").forEach((function(t){return u.store.off(t,r)}))}}),[p.join()]);var k=[S.t,u,h];if(k.t=S.t,k.i18n=u,k.ready=h,h)return k;if(!h&&!d)return k;throw new Promise((function(t){O(u,p,(function(){x(g()),t()}))}))}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function R(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return function(n){function r(r){var a=r.forwardedRef,o=i()(r,["forwardedRef"]),s=L(t,o),c=P()(s,3),l=R({},o,{t:c[0],i18n:c[1],tReady:c[2]});return e.withRef&&a?l.ref=a:!e.withRef&&a&&(l.forwardedRef=a),u.a.createElement(n,l)}r.displayName="withI18nextTranslation(".concat(C(n),")"),r.WrappedComponent=n;return e.withRef?u.a.forwardRef((function(t,e){return u.a.createElement(r,Object.assign({},t,{forwardedRef:e}))})):r}}},function(t,e,n){var r=n(55),i=n(72),a=n(22),o=n(18),s=n(79),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,l=4==t,f=6==t,d=5==t||f;return function(p,h,g,v){for(var m,_,y=a(p),b=i(y),w=r(h,g,3),E=o(b.length),S=0,x=v||s,k=e?x(p,E):n?x(p,0):void 0;E>S;S++)if((d||S in b)&&(_=w(m=b[S],S,y),t))if(e)k[S]=_;else if(_)switch(t){case 3:return!0;case 5:return m;case 6:return S;case 2:u.call(k,m)}else if(l)return!1;return f?-1:c||l?l:k}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(t,e,n){var r=n(16),i=n(88),a=n(53),o=n(37),s=n(44),u=n(23),c=n(144),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=o(t),e=s(e,!0),c)try{return l(t,e)}catch(t){}if(u(t,e))return a(!i.f.call(t,e),t[e])}},function(t,e,n){var r=n(8),i=n(31),a=n(23),o=n(113),s=n(114),u=n(32),c=u.get,l=u.enforce,f=String(String).split("String");(t.exports=function(t,e,n,s){var u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||a(n,"name")||i(n,"name",e),l(n).source=f.join("string"==typeof e?e:"")),t!==r?(u?!d&&t[e]&&(c=!0):delete t[e],c?t[e]=n:i(t,e,n)):c?t[e]=n:o(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){var r=n(467),i=n(475),a={decodeEntities:!0,lowerCaseAttributeNames:!1};function o(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");return r(i(t,a),e)}o.domToReact=r,o.htmlToDOM=i,t.exports=o},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(16),i=n(21),a=n(53);t.exports=r?function(t,e,n){return i.f(t,e,a(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r,i,a,o=n(146),s=n(8),u=n(14),c=n(31),l=n(23),f=n(89),d=n(74),p=s.WeakMap;if(o){var h=new p,g=h.get,v=h.has,m=h.set;r=function(t,e){return m.call(h,t,e),e},i=function(t){return g.call(h,t)||{}},a=function(t){return v.call(h,t)}}else{var _=f("state");d[_]=!0,r=function(t,e){return c(t,_,e),e},i=function(t){return l(t,_)?t[_]:{}},a=function(t){return l(t,_)}}t.exports={set:r,get:i,has:a,enforce:function(t){return a(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(75),i=n(23),a=n(152),o=n(21).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||o(e,t,{value:a.f(t)})}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(16),i=n(4),a=n(23),o=Object.defineProperty,s={},u=function(t){throw t};t.exports=function(t,e){if(a(s,t))return s[t];e||(e={});var n=[][t],c=!!a(e,"ACCESSORS")&&e.ACCESSORS,l=a(e,0)?e[0]:u,f=a(e,1)?e[1]:void 0;return s[t]=!!n&&!i((function(){if(c&&!r)return!0;var t={length:-1};c?o(t,1,{enumerable:!0,get:u}):t[1]=1,n.call(t,l,f)}))}},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e"+o+""}},function(t,e,n){var r=n(4);t.exports=function(t){return r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},function(t,e,n){"use strict";var r=n(186),i=Object.prototype.toString;function a(t){return"[object Array]"===i.call(t)}function o(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n0?r:n)(t)}},function(t,e,n){var r=n(14);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=!1},function(t,e,n){var r=n(23),i=n(22),a=n(89),o=n(123),s=a("IE_PROTO"),u=Object.prototype;t.exports=o?Object.getPrototypeOf:function(t){return t=i(t),r(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(21).f,i=n(23),a=n(17)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},function(t,e,n){var r=n(464),i=n(465),a=n(466);t.exports=function(t,e){return r(t)||i(t,e)||a()}},function(t,e,n){var r,i=n(15),a=n(120),o=n(117),s=n(74),u=n(150),c=n(112),l=n(89),f=l("IE_PROTO"),d=function(){},p=function(t){return"