!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.io=b():a.io=b()}(this,function(){return function(a){function c(e){if(b[e]){return b[e].exports}var d=b[e]={exports:{},id:e,loaded:!1};return a[e].call(d.exports,d,d.exports,c),d.loaded=!0,d.exports}var b={};return c.m=a,c.c=b,c.p="",c(0)}([function(q,j,b){function g(y,u){"object"===("undefined"==typeof y?"undefined":h(y))&&(u=y,y=void 0),u=u||{};var c,i=v(y),x=i.source,p=i.id,s=i.path,o=m[p]&&s in m[p].nsps,w=u.forceNew||u["force new connection"]||!1===u.multiplex||o;return w?(d("ignoring socket cache for %s",x),c=k(x,u)):(m[p]||(d("new io instance for %s",x),m[p]=k(x,u)),c=m[p]),i.query&&!u.query?u.query=i.query:u&&"object"===h(u.query)&&(u.query=f(u.query)),c.socket(i.path,u)}function f(a){var i=[];for(var c in a){a.hasOwnProperty(c)&&i.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]))}return i.join("&")}var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},v=b(1),l=b(7),k=b(13),d=b(3)("socket.io-client");q.exports=j=g;var m=j.managers={};j.protocol=l.protocol,j.connect=g,j.Manager=b(13),j.Socket=b(39)},function(a,c,b){(function(f){function h(i,k){var l=i;k=k||f.location,null==i&&(i=k.protocol+"//"+k.host),"string"==typeof i&&("/"===i.charAt(0)&&(i="/"===i.charAt(1)?k.protocol+i:k.host+i),/^(https?|wss?):\/\//.test(i)||(d("protocol-less url %s",i),i="undefined"!=typeof k?k.protocol+"//"+i:"https://"+i),d("parse %s",i),l=g(i)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";var j=l.host.indexOf(":")!==-1,e=j?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+e+":"+l.port,l.href=l.protocol+"://"+e+(k&&k.port===l.port?"":":"+l.port),l}var g=b(2),d=b(3)("socket.io-client:url");a.exports=h}).call(c,function(){return this}())},function(a,c){var b=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,d=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];a.exports=function(h){var k=h,l=h.indexOf("["),g=h.indexOf("]");l!=-1&&g!=-1&&(h=h.substring(0,l)+h.substring(l,g).replace(/:/g,";")+h.substring(g,h.length));for(var j=b.exec(h||""),f={},m=14;m--;){f[d[m]]=j[m]||""}return l!=-1&&g!=-1&&(f.source=k,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f}},function(a,c,b){(function(k){function h(){return !("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance" in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function e(m){var p=this.useColors;if(m[0]=(p?"%c":"")+this.namespace+(p?" %c":" ")+m[0]+(p?"%c ":" ")+"+"+c.humanize(this.diff),p){var s="color: "+this.color;m.splice(1,0,s,"color: inherit");var q=0,l=0;m[0].replace(/%[a-zA-Z%]/g,function(i){"%%"!==i&&(q++,"%c"===i&&(l=q))}),m.splice(l,0,s)}}function f(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function d(i){try{null==i?c.storage.removeItem("debug"):c.storage.debug=i}catch(l){}}function j(){var i;try{i=c.storage.debug}catch(l){}return !i&&"undefined"!=typeof k&&"env" in k&&(i=k.env.DEBUG),i}function g(){try{return window.localStorage}catch(i){}}c=a.exports=b(5),c.log=f,c.formatArgs=e,c.save=d,c.load=j,c.useColors=h,c.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:g(),c.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],c.formatters.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}},c.enable(j())}).call(c,b(4))},function(G,A){function b(){throw new Error("setTimeout has not been defined")}function k(){throw new Error("clearTimeout has not been defined")}function j(a){if(F===setTimeout){return setTimeout(a,0)}if((F===b||!F)&&setTimeout){return F=setTimeout,setTimeout(a,0)}try{return F(a,0)}catch(c){try{return F.call(null,a,0)}catch(c){return F.call(this,a,0)}}}function w(a){if(x===clearTimeout){return clearTimeout(a)}if((x===k||!x)&&clearTimeout){return x=clearTimeout,clearTimeout(a)}try{return x(a)}catch(c){try{return x.call(null,a)}catch(c){return x.call(this,a)}}}function H(){D&&v&&(D=!1,v.length?B=v.concat(B):q=-1,B.length&&E())}function E(){if(!D){var a=j(H);D=!0;for(var c=B.length;c;){for(v=B,B=[];++q1){for(var c=1;c10000)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(a);if(i){var c=parseFloat(i[1]),o=(i[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return c*m;case"days":case"day":case"d":return c*d;case"hours":case"hour":case"hrs":case"hr":case"h":return c*k;case"minutes":case"minute":case"mins":case"min":case"m":return c*l;case"seconds":case"second":case"secs":case"sec":case"s":return c*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function g(a){return a>=d?Math.round(a/d)+"d":a>=k?Math.round(a/k)+"h":a>=l?Math.round(a/l)+"m":a>=v?Math.round(a/v)+"s":a+"ms"}function f(a){return h(a,d,"day")||h(a,k,"hour")||h(a,l,"minute")||h(a,v,"second")||a+" ms"}function h(a,i,c){if(!(a0){return b(c)}if("number"===a&&isNaN(c)===!1){return n["long"]?f(c):g(c)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))}},function(E,x,b){function k(){}function j(a){var c=""+a.type;return x.BINARY_EVENT!==a.type&&x.BINARY_ACK!==a.type||(c+=a.attachments+"-"),a.nsp&&"/"!==a.nsp&&(c+=a.nsp+","),null!=a.id&&(c+=a.id),null!=a.data&&(c+=JSON.stringify(a.data)),v("encoded %j as %s",a,c),c}function q(a,d){function c(f){var h=z.deconstructPacket(f),l=j(h.packet),e=h.buffers;e.unshift(l),d(e)}z.removeBlobs(a,c)}function F(){this.reconstructor=null}function C(c){var e=0,h={type:Number(c.charAt(0))};if(null==x.types[h.type]){return D()}if(x.BINARY_EVENT===h.type||x.BINARY_ACK===h.type){for(var f="";"-"!==c.charAt(++e)&&(f+=c.charAt(e),e!=c.length);){}if(f!=Number(f)||"-"!==c.charAt(e)){throw new Error("Illegal attachments")}h.attachments=Number(f)}if("/"===c.charAt(e+1)){for(h.nsp="";++e;){var a=c.charAt(e);if(","===a){break}if(h.nsp+=a,e===c.length){break}}}else{h.nsp="/"}var d=c.charAt(e+1);if(""!==d&&Number(d)==d){for(h.id="";++e;){var a=c.charAt(e);if(null==a||Number(a)!=a){--e;break}if(h.id+=c.charAt(e),e===c.length){break}}h.id=Number(h.id)}return c.charAt(++e)&&(h=A(h,c.substr(e))),v("decoded %s as %j",c,h),h}function A(a,d){try{a.data=JSON.parse(d)}catch(c){return D()}return a}function g(a){this.reconPack=a,this.buffers=[]}function D(){return{type:x.ERROR,data:"parser error"}}var v=b(3)("socket.io-parser"),w=b(8),m=b(9),z=b(11),B=b(12);x.protocol=4,x.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],x.CONNECT=0,x.DISCONNECT=1,x.EVENT=2,x.ACK=3,x.ERROR=4,x.BINARY_EVENT=5,x.BINARY_ACK=6,x.Encoder=k,x.Decoder=F,k.prototype.encode=function(a,c){if(a.type!==x.EVENT&&a.type!==x.ACK||!m(a.data)||(a.type=a.type===x.EVENT?x.BINARY_EVENT:x.BINARY_ACK),v("encoding packet %j",a),x.BINARY_EVENT===a.type||x.BINARY_ACK===a.type){q(a,c)}else{var d=j(a);c([d])}},w(F.prototype),F.prototype.add=function(a){var c;if("string"==typeof a){c=C(a),x.BINARY_EVENT===c.type||x.BINARY_ACK===c.type?(this.reconstructor=new g(c),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",c)):this.emit("decoded",c)}else{if(!B(a)&&!a.base64){throw new Error("Unknown type: "+a)}if(!this.reconstructor){throw new Error("got binary data when not reconstructing a packet")}c=this.reconstructor.takeBinaryData(a),c&&(this.reconstructor=null,this.emit("decoded",c))}},F.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},g.prototype.takeBinaryData=function(a){if(this.buffers.push(a),this.buffers.length===this.reconPack.attachments){var c=z.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),c}return null},g.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(a,c,b){function f(e){if(e){return d(e)}}function d(g){for(var h in f.prototype){g[h]=f.prototype[h]}return g}a.exports=f,f.prototype.on=f.prototype.addEventListener=function(g,h){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(h),this},f.prototype.once=function(g,i){function h(){this.off(g,h),i.apply(this,arguments)}return h.fn=i,this.on(g,h),this},f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(g,i){if(this._callbacks=this._callbacks||{},0==arguments.length){return this._callbacks={},this}var h=this._callbacks["$"+g];if(!h){return this}if(1==arguments.length){return delete this._callbacks["$"+g],this}for(var k,j=0;j0&&!this.encoding){var a=this.packetBuffer.shift();this.packet(a)}},k.prototype.cleanup=function(){v("cleanup");for(var a=this.subs.length,d=0;d=this._reconnectionAttempts){v("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1}else{var d=this.backoff.duration();v("will wait %dms before reconnect attempt",d),this.reconnecting=!0;var c=setTimeout(function(){a.skipReconnect||(v("attempting reconnect"),a.emitAll("reconnect_attempt",a.backoff.attempts),a.emitAll("reconnecting",a.backoff.attempts),a.skipReconnect||a.open(function(f){f?(v("reconnect attempt error"),a.reconnecting=!1,a.reconnect(),a.emitAll("reconnect_error",f.data)):(v("reconnect success"),a.onreconnect())}))},d);this.subs.push({destroy:function(){clearTimeout(c)}})}},k.prototype.onreconnect=function(){var a=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",a)}},function(a,c,b){a.exports=b(15)},function(a,c,b){a.exports=b(16),a.exports.parser=b(23)},function(a,c,b){(function(q){function j(e,f){if(!(this instanceof j)){return new j(e,f)}f=f||{},e&&"object"==typeof e&&(f=e,e=null),e?(e=v(e),f.hostname=e.host,f.secure="https"===e.protocol||"wss"===e.protocol,f.port=e.port,e.query&&(f.query=e.query)):f.host&&(f.hostname=v(f.host).host),this.secure=null!=f.secure?f.secure:q.location&&"https:"===location.protocol,f.hostname&&!f.port&&(f.port=this.secure?"443":"80"),this.agent=f.agent||!1,this.hostname=f.hostname||(q.location?location.hostname:"localhost"),this.port=f.port||(q.location&&location.port?location.port:this.secure?443:80),this.query=f.query||{},"string"==typeof this.query&&(this.query=m.decode(this.query)),this.upgrade=!1!==f.upgrade,this.path=(f.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!f.forceJSONP,this.jsonp=!1!==f.jsonp,this.forceBase64=!!f.forceBase64,this.enablesXDR=!!f.enablesXDR,this.timestampParam=f.timestampParam||"t",this.timestampRequests=f.timestampRequests,this.transports=f.transports||["polling","websocket"],this.transportOptions=f.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=f.policyPort||843,this.rememberUpgrade=f.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=f.onlyBinaryUpgrades,this.perMessageDeflate=!1!==f.perMessageDeflate&&(f.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=f.pfx||null,this.key=f.key||null,this.passphrase=f.passphrase||null,this.cert=f.cert||null,this.ca=f.ca||null,this.ciphers=f.ciphers||null,this.rejectUnauthorized=void 0===f.rejectUnauthorized||f.rejectUnauthorized,this.forceNode=!!f.forceNode;var h="object"==typeof q&&q;h.global===h&&(f.extraHeaders&&Object.keys(f.extraHeaders).length>0&&(this.extraHeaders=f.extraHeaders),f.localAddress&&(this.localAddress=f.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function g(f){var i={};for(var h in f){f.hasOwnProperty(h)&&(i[h]=f[h])}return i}var k=b(17),w=b(8),t=b(3)("engine.io-client:socket"),r=b(37),d=b(23),v=b(2),l=b(38),m=b(31);a.exports=j,j.priorWebsocketSuccess=!1,w(j.prototype),j.protocol=d.protocol,j.Socket=j,j.Transport=b(22),j.transports=b(17),j.parser=b(23),j.prototype.createTransport=function(f){t('creating transport "%s"',f);var i=g(this.query);i.EIO=d.protocol,i.transport=f;var h=this.transportOptions[f]||{};this.id&&(i.sid=this.id);var o=new k[f]({query:i,socket:this,agent:h.agent||this.agent,hostname:h.hostname||this.hostname,port:h.port||this.port,secure:h.secure||this.secure,path:h.path||this.path,forceJSONP:h.forceJSONP||this.forceJSONP,jsonp:h.jsonp||this.jsonp,forceBase64:h.forceBase64||this.forceBase64,enablesXDR:h.enablesXDR||this.enablesXDR,timestampRequests:h.timestampRequests||this.timestampRequests,timestampParam:h.timestampParam||this.timestampParam,policyPort:h.policyPort||this.policyPort,pfx:h.pfx||this.pfx,key:h.key||this.key,passphrase:h.passphrase||this.passphrase,cert:h.cert||this.cert,ca:h.ca||this.ca,ciphers:h.ciphers||this.ciphers,rejectUnauthorized:h.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:h.perMessageDeflate||this.perMessageDeflate,extraHeaders:h.extraHeaders||this.extraHeaders,forceNode:h.forceNode||this.forceNode,localAddress:h.localAddress||this.localAddress,requestTimeout:h.requestTimeout||this.requestTimeout,protocols:h.protocols||void 0});return o},j.prototype.open=function(){var f;if(this.rememberUpgrade&&j.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1){f="websocket"}else{if(0===this.transports.length){var i=this;return void setTimeout(function(){i.emit("error","No transports available")},0)}f=this.transports[0]}this.readyState="opening";try{f=this.createTransport(f)}catch(h){return this.transports.shift(),void this.open()}f.open(),this.setTransport(f)},j.prototype.setTransport=function(f){t("setting transport %s",f.name);var h=this;this.transport&&(t("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=f,f.on("drain",function(){h.onDrain()}).on("packet",function(e){h.onPacket(e)}).on("error",function(e){h.onError(e)}).on("close",function(){h.onClose("transport close")})},j.prototype.probe=function(F){function C(){if(B.onlyBinaryUpgrades){var f=!this.supportsBinary&&B.transport.supportsBinary;A=A||f}A||(t('probe transport "%s" opened',F),E.send([{type:"ping",data:"probe"}]),E.once("packet",function(i){if(!A){if("pong"===i.type&&"probe"===i.data){if(t('probe transport "%s" pong',F),B.upgrading=!0,B.emit("upgrading",E),!E){return}j.priorWebsocketSuccess="websocket"===E.name,t('pausing current transport "%s"',B.transport.name),B.transport.pause(function(){A||"closed"!==B.readyState&&(t("changing transport and sending upgrade packet"),x(),B.setTransport(E),E.send([{type:"upgrade"}]),B.emit("upgrade",E),E=null,B.upgrading=!1,B.flush())})}else{t('probe transport "%s" failed',F);var h=new Error("probe error");h.transport=E.name,B.emit("upgradeError",h)}}}))}function n(){A||(A=!0,x(),E.close(),E=null)}function y(f){var h=new Error("probe error: "+f);h.transport=E.name,n(),t('probe transport "%s" failed because of error: %s',F,f),B.emit("upgradeError",h)}function z(){y("transport closed")}function G(){y("socket closed")}function D(e){E&&e.name!==E.name&&(t('"%s" works - aborting "%s"',e.name,E.name),n())}function x(){E.removeListener("open",C),E.removeListener("error",y),E.removeListener("close",z),B.removeListener("close",G),B.removeListener("upgrading",D)}t('probing transport "%s"',F);var E=this.createTransport(F,{probe:1}),A=!1,B=this;j.priorWebsocketSuccess=!1,E.once("open",C),E.once("error",y),E.once("close",z),this.once("close",G),this.once("upgrading",D),E.open()},j.prototype.onOpen=function(){if(t("socket open"),this.readyState="open",j.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){t("starting upgrade probes");for(var f=0,h=this.upgrades.length;f1?{type:M[k],data:f.substring(1)}:{type:M[k]}:j}var d=new Uint8Array(f),k=d[0],g=J(f,1);return F&&"blob"===h&&(g=new F([g])),{type:M[k],data:g}},c.decodeBase64Packet=function(d,g){var f=M[d.charAt(0)];if(!A){return{type:f,data:{base64:!0,data:d.substr(1)}}}var h=A.decode(d.substr(1));return"blob"===g&&F&&(h=new F([h])),{type:f,data:h}},c.encodePayload=function(f,h,l){function k(i){return i.length+":"+i}function d(i,m){c.encodePacket(i,!!g&&h,!1,function(n){m(null,k(n))})}"function"==typeof h&&(l=h,h=null);var g=H(f);return h&&g?F&&!I?c.encodePayloadAsBlob(f,l):c.encodePayloadAsArrayBuffer(f,l):f.length?void L(f,d,function(i,m){return l(m.join(""))}):l("0:")},c.decodePayload=function(O,d,k){if("string"!=typeof O){return c.decodePayloadAsBinary(O,d,k)}"function"==typeof d&&(k=d,d=null);var g;if(""===O){return k(j,0,1)}for(var l,P,w="",v=0,f=O.length;v0;){for(var T=new Uint8Array(k),Q=0===T[0],P="",g=1;255!==T[g];g++){if(P.length>310){return m(j,0,1)}P+=T[g]}k=J(k,2+P.length),P=parseInt(P);var R=J(k,0,P);if(Q){try{R=String.fromCharCode.apply(null,new Uint8Array(R))}catch(y){var v=new Uint8Array(R);R="";for(var g=0;gl&&(h=l),j>=l||j>=h||0===l){return new ArrayBuffer(0)}for(var k=new Uint8Array(f),d=new Uint8Array(h-j),g=j,c=0;g=55296&&l<=56319&&m65535&&(i-=65536,k+=F(i>>>10&1023|55296),i=56320|1023&i),k+=F(i)}return k}function B(g,h){if(g>=55296&&g<=57343){if(h){throw Error("Lone surrogate U+"+g.toString(16).toUpperCase()+" is not a scalar value")}return !1}return !0}function j(g,h){return F(g>>h&63|128)}function H(g,i){if(0==(4294967168&g)){return F(g)}var h="";return 0==(4294965248&g)?h=F(g>>6&31|192):0==(4294901760&g)?(B(g,i)||(g=65533),h=F(g>>12&15|224),h+=j(g,6)):0==(4292870144&g)&&(h=F(g>>18&7|240),h+=j(g,12),h+=j(g,6)),h+=F(63&g|128)}function t(k,m){m=m||{};for(var l,u=!1!==m.strict,p=I(k),h=p.length,g=-1,s="";++g=G){throw Error("Invalid byte index")}var g=255&x[C];if(C++,128==(192&g)){return 63&g}throw Error("Invalid continuation byte")}function o(h){var l,k,p,m,g;if(C>G){throw Error("Invalid byte index")}if(C==G){return !1}if(l=255&x[C],C++,0==(128&l)){return l}if(192==(224&l)){if(k=z(),g=(31&l)<<6|k,g>=128){return g}throw Error("Invalid continuation byte")}if(224==(240&l)){if(k=z(),p=z(),g=(15&l)<<12|k<<6|p,g>=2048){return B(g,h)?g:65533}throw Error("Invalid continuation byte")}if(240==(248&l)&&(k=z(),p=z(),m=z(),g=(7&l)<<18|k<<12|p<<6|m,g>=65536&&g<=1114111)){return g}throw Error("Invalid UTF-8 detected")}function A(g,i){i=i||{};var h=!1!==i.strict;x=I(g),G=x.length,C=0;for(var l,k=[];(l=o(h))!==!1;){k.push(l)}return E(k)}var D="object"==typeof c&&c,n=("object"==typeof e&&e&&e.exports==D&&e,"object"==typeof f&&f);n.global!==n&&n.window!==n||(r=n);var x,G,C,F=String.fromCharCode,q={version:"2.1.2",encode:t,decode:A};d=function(){return q}.call(c,b,c,e),!(void 0!==d&&(e.exports=d))}(this)}).call(c,b(28)(a),function(){return this}())},function(a,b){a.exports=function(c){return c.webpackPolyfill||(c.deprecate=function(){},c.paths=[],c.children=[],c.webpackPolyfill=1),c}},function(a,b){!function(){for(var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=new Uint8Array(256),e=0;e>2],f+=c[(3&k[g])<<4|k[g+1]>>4],f+=c[(15&k[g+1])<<2|k[g+2]>>6],f+=c[63&k[g+2]]}return j%3===2?f=f.substring(0,f.length-1)+"=":j%3===1&&(f=f.substring(0,f.length-2)+"=="),f},b.decode=function(w){var m,j,g,k,x,r=0.75*w.length,q=w.length,f=0;"="===w[w.length-1]&&(r--,"="===w[w.length-2]&&r--);var v=new ArrayBuffer(r),l=new Uint8Array(v);for(m=0;m>4,l[f++]=(15&g)<<4|k>>2,l[f++]=(3&k)<<6|63&x}return v}}()},function(a,b){(function(j){function h(c){for(var p=0;p0);return c}function g(a){var c=0;for(m=0;m';w=document.createElement(n)}catch(i){w=document.createElement("iframe"),w.name=q.iframeId,w.src="javascript:0"}w.id=q.iframeId,q.form.appendChild(w),q.iframe=w}var q=this;if(!this.form){var w,C=document.createElement("form"),z=document.createElement("textarea"),A=this.iframeId="eio_iframe_"+this.index;C.className="socketio",C.style.position="absolute",C.style.top="-1000px",C.style.left="-1000px",C.target=A,C.method="POST",C.setAttribute("accept-charset","utf-8"),z.name="d",C.appendChild(z),document.body.appendChild(C),this.form=C,this.area=z}this.form.action=this.uri(),v(),B=B.replace(h,"\\\n"),this.area.value=B.replace(l,"\\n");try{this.form.submit()}catch(x){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===q.iframe.readyState&&p()}:this.iframe.onload=p}}).call(c,function(){return this}())},function(a,c,b){(function(t){function j(f){var h=f&&f.forceBase64;h&&(this.supportsBinary=!1),this.perMessageDeflate=f.perMessageDeflate,this.usingBrowserWebSocket=q&&!f.forceNode,this.protocols=f.protocols,this.usingBrowserWebSocket||(k=g),m.call(this,f)}var g,m=b(22),y=b(23),w=b(31),v=b(32),d=b(33),x=b(3)("engine.io-client:websocket"),q=t.WebSocket||t.MozWebSocket;if("undefined"==typeof window){try{g=b(36)}catch(r){}}var k=q;k||"undefined"!=typeof window||(k=g),a.exports=j,v(j,m),j.prototype.name="websocket",j.prototype.supportsBinary=!0,j.prototype.doOpen=function(){if(this.check()){var f=this.uri(),i=this.protocols,h={agent:this.agent,perMessageDeflate:this.perMessageDeflate};h.pfx=this.pfx,h.key=this.key,h.passphrase=this.passphrase,h.cert=this.cert,h.ca=this.ca,h.ciphers=this.ciphers,h.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(h.headers=this.extraHeaders),this.localAddress&&(h.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?i?new k(f,i):new k(f):new k(f,i,h)}catch(l){return this.emit("error",l)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},j.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(f){e.onData(f.data)},this.ws.onerror=function(f){e.onError("websocket error",f)}},j.prototype.write=function(h){function l(){s.emit("flush"),setTimeout(function(){s.writable=!0,s.emit("drain")},0)}var s=this;this.writable=!1;for(var p=h.length,f=0,e=p;f0&&d.jitter<=1?d.jitter:0,this.attempts=0}a.exports=b,b.prototype.duration=function(){var d=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var g=Math.random(),f=Math.floor(g*this.jitter*d);d=0==(1&Math.floor(10*g))?d-f:d+f}return 0|Math.min(d,this.max)},b.prototype.reset=function(){this.attempts=0},b.prototype.setMin=function(d){this.ms=d},b.prototype.setMax=function(d){this.max=d},b.prototype.setJitter=function(d){this.jitter=d}}])});function BasketClient(){var a=this;this.getBasket=function(){socket_bo.emit("Basket.getBasket")};this.objBasket=function(c){$(".loading").hide();if(c!==null){try{BasketModel.clearProducts();for(var b in c){BasketModel.addProduct(c[b])}}catch(d){}}};this.setBasketQty=function(b){console.log(b);socket_bo.emit("Basket.setBasketQty",b)};this.setBasketComment=function(b){console.log(b);socket_bo.emit("Basket.setBasketComments",b)}}var socket_bo;var WS_Dependencies=new Array();var BasketClient=new BasketClient();function core(){socket_bo=io("//"+window.location.hostname+":"+window.location.port,{reconnection:true,reconnectionDelay:1000});socket_bo.on("initialise",function(a){console.log("[WS] Connected")});socket_bo.on("disconnect",function(){console.log("[WS] Disconnected")});socket_bo.on("error",console.error.bind(console));socket_bo.on("Basket.objBasket",function(a){BasketClient.objBasket(a)})}$(window).ready(function(){setTimeout(function(){core();initialise()},0);setInterval(function(){initialise()},30000)});function initialise(){BasketClient.getBasket()}function isConnected(){if(typeof socket_bo!=="undefined"&&io!==null){if(socket_bo.connected&&!socket_bo.disconnected){return true}}return false}function getCookie(d){var b=d+"=";var f=decodeURIComponent(document.cookie);var a=f.split(";");for(var e=0;e