neweb
Version:
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] [ • 136 kB
JavaScript
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=73)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(r){function o(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG),t}(e=t.exports=n(71)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&"%c"===t&&(i=++o)}),t.splice(i,0,r)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=o,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(o())}).call(this,n(72))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(25),o=n(11);e.default=class extends o.default{constructor(t){super(t)}getRootElement(){return super.getRootElement()}beforeMount(){this.props.tagName&&(this.tagName=this.props.tagName)}afterMount(){const t=this.props.events||{},e=this.props.attributes||{},n=this.props.properties||{};Object.keys(e).map(t=>{this.bindAttributeToProp(t,e[t])}),Object.keys(t).map(e=>{this.bindEventToProp(e,t[e])}),Object.keys(n).map(t=>{this.bindPropertyToProp(t,n[t])}),this.props.innerHTML&&this.addSubscription(this.props.innerHTML,t=>{const e=this.rootElement.cloneNode(!1);e.innerHTML=t,r(this.rootElement,e)})}bindAttributeToProp(t,e){this.addSubscription(e,e=>{this.rootElement.setAttribute(t,e)})}bindInnerHtmlToProp(t){this.addSubscription(t,t=>{this.rootElement.innerHTML=t})}bindEventToProp(t,e){const n="function"==typeof e?e:t=>{e.next(t)};this.document.addEventListener(this.rootElement,t,n,!1)}bindPropertyToProp(t,e){this.addSubscription(e,e=>{this.rootElement[t]=e})}}},function(t,e,n){(function(t){var r,o=n(40),i=n(18),s=n(38),c=n(37),a=n(36);t&&t.ArrayBuffer&&(r=n(34));var u="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),h="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),l=u||h;e.protocol=3;var p=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},f=o(p),d={type:"error",data:"parser error"},y=n(33);function m(t,e,n){for(var r=new Array(t.length),o=c(t.length,n),i=function(t,n,o){e(n,function(e,n){r[t]=n,o(e,r)})},s=0;s<t.length;s++)i(s,t[s],o)}e.encodePacket=function(n,r,o,i){"function"==typeof r&&(i=r,r=!1),"function"==typeof o&&(i=o,o=null);var s=void 0===n.data?void 0:n.data.buffer||n.data;if(t.ArrayBuffer&&s instanceof ArrayBuffer)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=p[t.type];for(var c=0;c<i.length;c++)s[c+1]=i[c];return r(s.buffer)}(n,r,i);if(y&&s instanceof t.Blob)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(l)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,n,!0,r)},o.readAsArrayBuffer(t.data)}(t,n,r);var o=new Uint8Array(1);o[0]=p[t.type];var i=new y([o.buffer,t.data]);return r(i)}(n,r,i);if(s&&s.base64)return function(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}(n,i);var c=p[n.type];return void 0!==n.data&&(c+=o?a.encode(String(n.data),{strict:!1}):String(n.data)),i(""+c)},e.encodeBase64Packet=function(n,r){var o,i="b"+e.packets[n.type];if(y&&n.data instanceof t.Blob){var s=new FileReader;return s.onload=function(){var t=s.result.split(",")[1];r(i+t)},s.readAsDataURL(n.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(t){for(var c=new Uint8Array(n.data),a=new Array(c.length),u=0;u<c.length;u++)a[u]=c[u];o=String.fromCharCode.apply(null,a)}return i+=t.btoa(o),r(i)},e.decodePacket=function(t,n,r){if(void 0===t)return d;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&!1===(t=function(t){try{t=a.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return d;var o=t.charAt(0);return Number(o)==o&&f[o]?t.length>1?{type:f[o],data:t.substring(1)}:{type:f[o]}:d}o=new Uint8Array(t)[0];var i=s(t,1);return y&&"blob"===n&&(i=new y([i])),{type:f[o],data:i}},e.decodeBase64Packet=function(t,e){var n=f[t.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:t.substr(1)}};var o=r.decode(t.substr(1));return"blob"===e&&y&&(o=new y([o])),{type:n,data:o}},e.encodePayload=function(t,n,r){"function"==typeof n&&(r=n,n=null);var o=i(t);if(n&&o)return y&&!l?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r);if(!t.length)return r("0:");m(t,function(t,r){e.encodePacket(t,!!o&&n,!1,function(t){r(null,function(t){return t.length+":"+t}(t))})},function(t,e){return r(e.join(""))})},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===t)return r(d,0,1);for(var i,s,c="",a=0,u=t.length;a<u;a++){var h=t.charAt(a);if(":"===h){if(""===c||c!=(i=Number(c)))return r(d,0,1);if(c!=(s=t.substr(a+1,i)).length)return r(d,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),d.type===o.type&&d.data===o.data)return r(d,0,1);if(!1===r(o,a+i,u))return}a+=i,c=""}else c+=h}return""!==c?r(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));m(t,function(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})},function(t,e){var r=e.reduce(function(t,e){var n;return t+(n="string"==typeof e?e.length:e.byteLength).toString().length+n+2},0),o=new Uint8Array(r),i=0;return e.forEach(function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}o[i++]=e?0:1;var c=n.byteLength.toString();for(s=0;s<c.length;s++)o[i++]=parseInt(c[s]);o[i++]=255;for(r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),n(o.buffer)})},e.encodePayloadAsBlob=function(t,n){m(t,function(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);t=r.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,y){var c=new y([e.buffer,s.buffer,t]);n(null,c)}})},function(t,e){return n(new y(e))})},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var o=t,i=[];o.byteLength>0;){for(var c=new Uint8Array(o),a=0===c[0],u="",h=1;255!==c[h];h++){if(u.length>310)return r(d,0,1);u+=c[h]}o=s(o,2+u.length),u=parseInt(u);var l=s(o,0,u);if(a)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(t){var p=new Uint8Array(l);l="";for(h=0;h<p.length;h++)l+=String.fromCharCode(p[h])}i.push(l),o=s(o,u)}var f=i.length;i.forEach(function(t,o){r(e.decodePacket(t,n,!0),o,f)})}}).call(this,n(0))},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<r.length;o++)if((n=r[o])===e||n.fn===e){r.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,e);return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObservable=function(t){return t&&"function"==typeof t.subscribe},e.isComponent=function(t){return t&&!0===t.__neweb_component},e.nodesToMap=function(t){const e=[];for(const n of t)e.push(n);return e},e.getElementAttributes=function(t){const e={};for(let n=0;n<t.attributes.length;n++)e[t.attributes[n].name]=t.attributes[n].value;return e},e.domNodeToJson=function t(e){const n={nodeType:e.nodeType},r=e;if(void 0!==r.tagName?n.tagName=r.tagName.toLowerCase():e.nodeName&&(n.nodeName=e.nodeName),e.nodeValue&&(n.nodeValue=e.nodeValue),r.attributes){n.attributes={};const t=r.attributes;if(t)for(let e=0;e<length;e++){const r=t[e];n.attributes[r.nodeName]=r.nodeValue}}const o=e.childNodes;if(o&&o.length>0){n.childNodes=[];const e=o.length;for(let r=0;r<e;r++)n.childNodes[r]=t(o[r])}return n}},function(t,e,n){var r=n(3),o=n(4);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=i,o(i.prototype),i.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=r.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){(function(e){var r=n(42);t.exports=function(t){var n=t.xdomain,o=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!n||r))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!o&&i)return new XDomainRequest}catch(t){}if(!n)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}}).call(this,n(0))},function(t,e,n){var r=n(1)("socket.io-parser"),o=n(4),i=n(45),s=n(23),c=n(22);function a(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=a,e.Decoder=l;var u=e.ERROR+'"encode error"';function h(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var o=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===o)return u;n+=o}return r("encoded %j as %s",t,n),n}function l(){this.reconstructor=null}function p(t){this.reconPack=t,this.buffers=[]}function f(t){return{type:e.ERROR,data:"parser error: "+t}}a.prototype.encode=function(t,n){(r("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)?function(t,e){i.removeBlobs(t,function(t){var n=i.deconstructPacket(t),r=h(n.packet),o=n.buffers;o.unshift(r),e(o)})}(t,n):n([h(t)])},o(l.prototype),l.prototype.add=function(t){var n;if("string"==typeof t)n=function(t){var n=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return f("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var i="";"-"!==t.charAt(++n)&&(i+=t.charAt(n),n!=t.length););if(i!=Number(i)||"-"!==t.charAt(n))throw new Error("Illegal attachments");o.attachments=Number(i)}if("/"===t.charAt(n+1))for(o.nsp="";++n;){var c=t.charAt(n);if(","===c)break;if(o.nsp+=c,n===t.length)break}else o.nsp="/";var a=t.charAt(n+1);if(""!==a&&Number(a)==a){for(o.id="";++n;){var c=t.charAt(n);if(null==c||Number(c)!=c){--n;break}if(o.id+=t.charAt(n),n===t.length)break}o.id=Number(o.id)}if(t.charAt(++n)){var u=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(n)),h=!1!==u&&(o.type===e.ERROR||s(u));if(!h)return f("invalid payload");o.data=u}return r("decoded %s as %j",t,o),o}(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!c(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",n))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(25),o=n(62),i=n(7);class s{constructor(t){this.elements={},this.hasRender=!0,this.isMounted=!1,this.__neweb_component=!0,this.subscriptions=[],this.props=t||{},this.props.document?this.documentValue=this.props.document:s.document&&(this.documentValue=s.document)}static setDocument(t){s.document=t}get document(){if(!this.documentValue)throw new Error("Document should be setted");return this.documentValue}setDocument(t){this.documentValue=t}mount(t){if(this.isMounted)throw new Error("Component already inited");this.isMounted=!0,t&&this.saveMountElement(t),this.beforeMount();const e=this.props.template?this.props.template:this.getTemplate();e?this.setRootElementByTemplate(e):this.rootElement||(this.rootElement=this.render()),this.afterMount(),this.getRootElement().onUpdateElement=(t=>{this.rootElement=t}),this.rootElement.$component=this}dispose(){this.subscriptions.map(t=>t.unsubscribe),Object.keys(this.elements).map(t=>this.elements[t].dispose()),delete this.rootElement.$component}getElements(){return this.elements}getRootElement(){return this.rootElement}saveMountElement(t){this.tagName=t.tagName,this.children=i.nodesToMap(t.childNodes),this.mountAttributes=i.getElementAttributes(t)}getTemplate(){}setRootElementByTemplate(t){this.rootElement=this.createElementfromTemplate(t)}addElement(t,e){if(this.elements[t])throw new Error("Element with name "+t+" already existing");this.elements[t]=e}render(){const t=this.document.createElement(this.tagName?this.tagName:"div");return this.children&&this.children.map(e=>t.appendChild(e)),this.mountAttributes&&Object.keys(this.mountAttributes).map(e=>{t.setAttribute(e,this.mountAttributes[e])}),t}beforeMount(){}afterMount(){}beforeDispose(){}afterDispose(){}createElementfromTemplate(t){return o.fromString(this.document,t,this.getElements())}update(){r(this.rootElement,this.render())}addSubscription(t,e){i.isObservable(t)?this.subscriptions.push(t.subscribe(e)):e(t)}}e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11);e.Component=r.default;var o=n(61);e.Document=o.default;var i=n(60);e.TextNode=i.default;var s=n(59);e.Link=s.default;var c=n(58);e.ListComponent=c.default;var a=n(57);e.ParentComponent=a.default;var u=n(2);e.ElementComponent=u.default;var h=n(56);e.HtmlComponent=h.default;var l=n(55);e.InputComponent=l.default;var p=n(54);e.BooleanInputComponent=p.default,function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(53))},function(t,e){var n=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},function(t,e){t.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},function(t,e,n){var r=n(10),o=n(4),i=n(29),s=n(14),c=n(13),a=n(1)("socket.io-client:socket"),u=n(6),h=n(18);t.exports=f;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=o.prototype.emit;function f(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}o(f.prototype),f.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",c(this,"onopen")),s(t,"packet",c(this,"onpacket")),s(t,"close",c(this,"onclose"))]}},f.prototype.open=f.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},f.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},f.prototype.emit=function(t){if(l.hasOwnProperty(t))return p.apply(this,arguments),this;var e=i(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:h(e))?r.BINARY_EVENT:r.EVENT,data:e,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(a("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},f.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},f.prototype.onopen=function(){if(a("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"==typeof this.query?u.encode(this.query):this.query;a("sending connect packet with query %s",t),this.packet({type:r.CONNECT,query:t})}else this.packet({type:r.CONNECT})},f.prototype.onclose=function(t){a("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},f.prototype.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(t);break;case r.ACK:case r.BINARY_ACK:this.onack(t);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",t.data)}},f.prototype.onevent=function(t){var e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},f.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var o=i(arguments);a("sending ack %j",o),e.packet({type:h(o)?r.BINARY_ACK:r.ACK,id:t,data:o})}}},f.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(a("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):a("bad ack %s",t.id)},f.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},f.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},f.prototype.ondisconnect=function(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},f.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},f.prototype.close=f.prototype.disconnect=function(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},f.prototype.compress=function(t){return this.flags.compress=t,this},f.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){"use strict";var r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,s={},c=0,a=0;function u(t){var e="";do{e=o[t%i]+e,t=Math.floor(t/i)}while(t>0);return e}function h(){var t=u(+new Date);return t!==r?(c=0,r=t):t+"."+u(c++)}for(;a<i;a++)s[o[a]]=a;h.encode=u,h.decode=function(t){var e=0;for(a=0;a<t.length;a++)e=e*i+s[t.charAt(a)];return e},t.exports=h},function(t,e,n){(function(e){var r=n(39),o=Object.prototype.toString,i="function"==typeof e.Blob||"[object BlobConstructor]"===o.call(e.Blob),s="function"==typeof e.File||"[object FileConstructor]"===o.call(e.File);t.exports=function t(n){if(!n||"object"!=typeof n)return!1;if(r(n)){for(var o=0,c=n.length;o<c;o++)if(t(n[o]))return!0;return!1}if("function"==typeof e.Buffer&&e.Buffer.isBuffer&&e.Buffer.isBuffer(n)||"function"==typeof e.ArrayBuffer&&n instanceof ArrayBuffer||i&&n instanceof Blob||s&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return t(n.toJSON(),!0);for(var a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&t(n[a]))return!0;return!1}}).call(this,n(0))},function(t,e,n){var r=n(8),o=n(6),i=n(3),s=n(5),c=n(17),a=n(1)("engine.io-client:polling");t.exports=h;var u=null!=new(n(9))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),r.call(this,t)}s(h,r),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e=this;function n(){a("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(a("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){a("pre-pause polling complete"),--r||n()})),this.writable||(a("we are currently writing - waiting to pause"),r++,this.once("drain",function(){a("pre-pause writing complete"),--r||n()}))}else n()},h.prototype.poll=function(){a("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;a("polling got data %s",t);i.decodePayload(t,this.socket.binaryType,function(t,n,r){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():a('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){a("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(a("transport open - closing"),e()):(a("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};i.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=o.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){(function(t){var r=n(9),o=n(41),i=n(32),s=n(31);e.polling=function(e){var n=!1,s=!1,c=!1!==e.jsonp;if(t.location){var a="https:"===location.protocol,u=location.port;u||(u=a?443:80),n=e.hostname!==location.hostname||u!==e.port,s=e.secure!==a}if(e.xdomain=n,e.xscheme=s,"open"in new r(e)&&!e.forceJSONP)return new o(e);if(!c)throw new Error("JSONP disabled");return new i(e)},e.websocket=s}).call(this,n(0))},function(t,e,n){var r=n(44),o=n(15),i=n(4),s=n(10),c=n(14),a=n(13),u=n(1)("socket.io-client:manager"),h=n(16),l=n(28),p=Object.prototype.hasOwnProperty;function f(t,e){if(!(this instanceof f))return new f(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new l({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||s;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=f,f.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},f.prototype.updateSocketIds=function(){for(var t in this.nsps)p.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},f.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},i(f.prototype),f.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},f.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},f.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},f.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},f.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},f.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},f.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},f.prototype.open=f.prototype.connect=function(t,e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var i=c(n,"open",function(){o.onopen(),t&&t()}),s=c(n,"error",function(e){if(u("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",e),t){var n=new Error("Connection error");n.data=e,t(n)}else o.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;u("connect attempt will timeout after %d",a);var h=setTimeout(function(){u("connect attempt timed out after %d",a),i.destroy(),n.close(),n.emit("error","timeout"),o.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(i),this.subs.push(s),this},f.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(c(t,"data",a(this,"ondata"))),this.subs.push(c(t,"ping",a(this,"onping"))),this.subs.push(c(t,"pong",a(this,"onpong"))),this.subs.push(c(t,"error",a(this,"onerror"))),this.subs.push(c(t,"close",a(this,"onclose"))),this.subs.push(c(this.decoder,"decoded",a(this,"ondecoded")))},f.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},f.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},f.prototype.ondata=function(t){this.decoder.add(t)},f.prototype.ondecoded=function(t){this.emit("packet",t)},f.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},f.prototype.socket=function(t,e){var n=this.nsps[t];if(!n){n=new o(this,t,e),this.nsps[t]=n;var r=this;n.on("connecting",i),n.on("connect",function(){n.id=r.generateId(t)}),this.autoConnect&&i()}function i(){~h(r.connecting,n)||r.connecting.push(n)}return n},f.prototype.destroy=function(t){var e=h(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},f.prototype.packet=function(t){u("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()}))},f.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},f.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e<t;e++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},f.prototype.close=f.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},f.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},f.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},f.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){(function(e){t.exports=function(t){return n&&e.Buffer.isBuffer(t)||r&&(t instanceof e.ArrayBuffer||o(t))};var n="function"==typeof e.Buffer&&"function"==typeof e.Buffer.isBuffer,r="function"==typeof e.ArrayBuffer,o=r&&"function"==typeof e.ArrayBuffer.isView?e.ArrayBuffer.isView:function(t){return t.buffer instanceof e.ArrayBuffer}}).call(this,n(0))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");-1!=o&&-1!=i&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=n.exec(t||""),c={},a=14;a--;)c[r[a]]=s[a]||"";return-1!=o&&-1!=i&&(c.source=e,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c}},function(t,e,n){"use strict";var r,o="http://www.w3.org/1999/xhtml",i="undefined"==typeof document?void 0:document,s=i?i.body||i.createElement("div"):{},c=s.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:s.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};function a(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function u(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}var h={OPTION:function(t,e){u(t,e,"selected")},INPUT:function(t,e){u(t,e,"checked"),u(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),c(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var r=t.firstChild;if(r){var o=r.nodeValue;if(o==n||!n&&o==t.placeholder)return;r.nodeValue=n}},SELECT:function(t,e){if(!c(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(c(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},l=1,p=3,f=8;function d(){}function y(t){return t.id}var m=function(t){return function(e,n,s){if(s||(s={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var c=n;(n=i.createElement("html")).innerHTML=c}else u=n,!r&&i.createRange&&(r=i.createRange()).selectNode(i.body),r&&r.createContextualFragment?m=r.createContextualFragment(u):(m=i.createElement("body")).innerHTML=u,n=m.childNodes[0];var u,m,v,b=s.getNodeKey||y,g=s.onBeforeNodeAdded||d,w=s.onNodeAdded||d,x=s.onBeforeElUpdated||d,E=s.onElUpdated||d,_=s.onBeforeNodeDiscarded||d,C=s.onNodeDiscarded||d,k=s.onBeforeElChildrenUpdated||d,S=!0===s.childrenOnly,A={};function N(t){v?v.push(t):v=[t]}function T(t,e,n){!1!==_(t)&&(e&&e.removeChild(t),C(t),function t(e,n){if(e.nodeType===l)for(var r=e.firstChild;r;){var o=void 0;n&&(o=b(r))?N(o):(C(r),r.firstChild&&t(r,n)),r=r.nextSibling}}(t,n))}function P(t){w(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=b(e);if(r){var o=A[r];o&&a(e,o)&&(e.parentNode.replaceChild(o,e),j(o,e))}P(e),e=n}}function j(r,o,s){var c,u=b(o);if(u&&delete A[u],!n.isSameNode||!n.isSameNode(e)){if(!s){if(!1===x(r,o))return;if(t(r,o),E(r),!1===k(r,o))return}if("TEXTAREA"!==r.nodeName){var d,y,m,v,w=o.firstChild,_=r.firstChild;t:for(;w;){for(m=w.nextSibling,d=b(w);_;){if(y=_.nextSibling,w.isSameNode&&w.isSameNode(_)){w=m,_=y;continue t}c=b(_);var C=_.nodeType,S=void 0;if(C===w.nodeType&&(C===l?(d?d!==c&&((v=A[d])?_.nextSibling===v?S=!1:(r.insertBefore(v,_),y=_.nextSibling,c?N(c):T(_,r,!0),_=v):S=!1):c&&(S=!1),(S=!1!==S&&a(_,w))&&j(_,w)):C!==p&&C!=f||(S=!0,_.nodeValue!==w.nodeValue&&(_.nodeValue=w.nodeValue))),S){w=m,_=y;continue t}c?N(c):T(_,r,!0),_=y}if(d&&(v=A[d])&&a(v,w))r.appendChild(v),j(v,w);else{var O=g(w);!1!==O&&(O&&(w=O),w.actualize&&(w=w.actualize(r.ownerDocument||i)),r.appendChild(w),P(w))}w=m,_=y}for(;_;)y=_.nextSibling,(c=b(_))?N(c):T(_,r,!0),_=y}var M=h[r.nodeName];M&&M(r,o)}}!function t(e){if(e.nodeType===l)for(var n=e.firstChild;n;){var r=b(n);r&&(A[r]=n),t(n),n=n.nextSibling}}(e);var O,M,B=e,I=B.nodeType,R=n.nodeType;if(!S)if(I===l)R===l?a(e,n)||(C(e),B=function(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}(e,(O=n.nodeName,(M=n.namespaceURI)&&M!==o?i.createElementNS(M,O):i.createElement(O)))):B=n;else if(I===p||I===f){if(R===I)return B.nodeValue!==n.nodeValue&&(B.nodeValue=n.nodeValue),B;B=n}if(B===n)C(e);else if(j(B,n,S),v)for(var F=0,D=v.length;F<D;F++){var L=A[v[F]];L&&T(L,L.parentNode,!1)}return!S&&B!==e&&e.parentNode&&(B.actualize&&(B=B.actualize(e.ownerDocument||i)),e.parentNode.replaceChild(B,e)),B}}(function(t,e){var n,r,o,i,s,a=e.attributes;for(n=a.length-1;n>=0;--n)o=(r=a[n]).name,i=r.namespaceURI,s=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==s&&t.setAttributeNS(i,o,s)):t.getAttribute(o)!==s&&t.setAttribute(o,s);for(n=(a=t.attributes).length-1;n>=0;--n)!1!==(r=a[n]).specified&&(o=r.name,(i=r.namespaceURI)?(o=r.localName||o,c(e,i,o)||t.removeAttributeNS(i,o)):c(e,null,o)||t.removeAttribute(o))});t.exports=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INITIAL_VAR="__initial",e.REQUIRE_FUNC_NAME="loadModule",function(t){t.FrameControllerData="frame-controller-data",t.NewPage="new-page",t.Initialize="initialize",t.FrameControllerDispatch="frame-controller-dispatch",t.Navigate="navigate",t.Error="error"}(e.RemoteMessageType||(e.RemoteMessageType={}))},function(t,e,n){"use strict";n.r(e);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.assign;function i(t){return"function"==typeof t}var s=!1,c={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;s=t},get useDeprecatedSynchronousErrorHandling(){return s}};function a(t){setTimeout(function(){throw t})}var u={closed:!0,next:function(t){},error:function(t){if(c.useDeprecatedSynchronousErrorHandling)throw t;a(t)},complete:function(){}},h=Array.isArray||function(t){return t&&"number"==typeof t.length};function l(t){return null!=t&&"object"==typeof t}var p,f={e:{}};function d(){try{return p.apply(this,arguments)}catch(t){return f.e=t,f}}function y(t){return p=t,d}var m=function(t){function e(n){var r=t.call(this,n?n.length+" errors occurred during unsubscription:\n "+n.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"")||this;return r.errors=n,r.name="UnsubscriptionError",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(Error),v=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,o=this._unsubscribe,s=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var c=-1,a=r?r.length:0;n;)n.remove(this),n=++c<a&&r[c]||null;if(i(o))y(o).call(this)===f&&(e=!0,t=t||(f.e instanceof m?b(f.e.errors):[f.e]));if(h(s))for(c=-1,a=s.length;++c<a;){var u=s[c];if(l(u))if(y(u.unsubscribe).call(u)===f){e=!0,t=t||[];var p=f.e;p instanceof m?t=t.concat(b(p.errors)):t.push(p)}}if(e)throw new m(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function b(t){return t.reduce(function(t,e){return t.concat(e instanceof m?e.errors:e)},[])}var g="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber",w=function(t){function e(e,n,r){var o,i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=u;break;case 1:if(!e){i.destination=u;break}if("object"==typeof e){if((o=e)instanceof w||"syncErrorThrowable"in o&&o[g]){var s=e[g]();i.syncErrorThrowable=s.syncErrorThrowable,i.destination=s,s.add(i)}else i.syncErrorThrowable=!0,i.destination=new x(i,e);break}default:i.syncErrorThrowable=!0,i.destination=new x(i,e,n,r)}return i}return o(e,t),e.prototype[g]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(v),x=function(t){function e(e,n,r,o){var s,c=t.call(this)||this;c._parentSubscriber=e;var a=c;return i(n)?s=n:n&&(s=n.next,r=n.error,o=n.complete,n!==u&&(i((a=Object.create(n)).unsubscribe)&&c.add(a.unsubscribe.bind(a)),a.unsubscribe=c.unsubscribe.bind(c))),c._context=a,c._next=s,c._error=r,c._complete=o,c}return o(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=c.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):a(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;a(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};c.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.useDeprecatedSynchronousErrorHandling)throw t;a(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!c.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return c.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(a(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(w);var E="function"==typeof Symbol&&Symbol.observable||"@@observable";function _(){}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t)}function k(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:_}var S=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(t instanceof w)return t;if(t[g])return t[g]()}return t||e||n?new w(t,e,n):new w(u)}(t,e,n);if(r?r.call(o,this.source):o.add(this.source||!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),c.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){c.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=A(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[E]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:k(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=A(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function A(t){if(t||(t=c.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var N=function(t){function e(){var n=t.call(this,"object unsubscribed")||this;return n.name="ObjectUnsubscribedError",Object.setPrototypeOf(n,e.prototype),n}return o(e,t),e}(Error),T=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return o(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(v),P=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return o(e,t),e}(w),j=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return o(e,t),e.prototype[g]=function(){return new P(this)},e.prototype.lift=function(t){var e=new O(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new N;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new N;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new N;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new N;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new N;return this.hasError?(t.error(this.thrownError),v.EMPTY):this.isStopped?(t.complete(),v.EMPTY):(this.observers.push(t),new T(this,t))},e.prototype.asObservable=function(){var t=new S;return t.source=this,t},e.create=function(t,e){return new O(t,e)},e}(S),O=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return o(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):v.EMPTY},e}(j);var M=function(){functi