(()=>{var t={713:function(t,e,n){var r,o;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}t=n.nmd(t),function(s){var u={function:!0,object:!0};function c(t){return t&&t.Object===Object?t:null}var a=u[i(e)]&&e&&!e.nodeType?e:null,h=u[i(t)]&&t&&!t.nodeType?t:null,p=c(a&&h&&"object"===(void 0===n.g?"undefined":i(n.g))&&n.g),l=c(u["undefined"==typeof self?"undefined":i(self)]&&self),f=c(u["undefined"==typeof window?"undefined":i(window)]&&window),d=(h&&h.exports,c(u[i(this)]&&this)),v=p||f!==(d&&d.window)&&f||l||d||Function("return this")();"function"==typeof storygize_amd_define&&n.amdO?(r=[n(998)],o=function(t,e){return s(v,e,t)}.apply(e,r),void 0===o||(t.exports=o)):"object"===i(t)&&t&&t.exports===a?t.exports=s(v,t.exports,n(998)):v.Rx=s(v,{},v.Rx)}.call(this,(function(t,e,n,r){n.Observable;var o=n.ObservableBase,s=n.internals.AbstractObserver,u=(n.Observer.create,n.Observable.create,n.Disposable.create,n.Disposable),c=n.CompositeDisposable,a=n.BinaryDisposable,h=n.SingleAssignmentDisposable,p=n.Subject,l=n.Scheduler,f=n.DOM={},d={}.hasOwnProperty,v=(n.helpers.noop,n.helpers.isFunction),b=n.internals.inherits,y={e:{}};function m(t){if(!v(t))throw new TypeError("fn must be a function");return e=t,function(){try{return e.apply(this,arguments)}catch(t){return y.e=t,y}};var e}function w(t,e,n,r){this._e=t,this._n=e,this._fn=n,this._u=r,this._e.addEventListener(this._n,this._fn,this._u),this.isDisposed=!1}function g(t,e,n,r){var o=new c,i=Object.prototype.toString;if("[object NodeList]"===i.call(t)||"[object HTMLCollection]"===i.call(t))for(var s=0,u=t.length;s=200&&r<=300||0===r||""===r?(e.onNext(u(n,t,i)),e.onCompleted()):e.onError(i.normalizeError(n,t,"error")),o.isDone=!0};try{n=i.createXHR()}catch(t){return e.onError(t)}try{i.user?n.open(i.method,i.url,i.async,i.user,i.password):n.open(i.method,i.url,i.async);var a=i.headers;for(var h in a)d.call(a,h)&&n.setRequestHeader(h,a[h]);n.timeout=i.timeout,n.ontimeout=function(t){i.progressObserver&&i.progressObserver.onError(t),e.onError(s(t,n,"timeout"))},n.upload||!("withCredentials"in n)&&t.XDomainRequest?(n.onload=function(t){i.progressObserver&&(i.progressObserver.onNext(t),i.progressObserver.onCompleted()),c(n,t)},i.progressObserver&&(n.onprogress=function(t){i.progressObserver.onNext(t)}),n.onerror=function(t){i.progressObserver&&i.progressObserver.onError(t),e.onError(s(t,n,"error")),o.isDone=!0},n.onabort=function(t){i.progressObserver&&i.progressObserver.onError(t),e.onError(s(t,n,"abort")),o.isDone=!0}):n.onreadystatechange=function(t){4===n.readyState&&c(n,t)};var p=i.headers["Content-Type"]||i.headers["Content-type"]||i.headers["content-type"];if(i.hasContent&&"application/x-www-form-urlencoded"===p&&"string"!=typeof i.body){var l=[];for(var f in i.body)d.call(i.body,f)&&l.push(f+"="+i.body[f]);i.body=l.join("&")}n.send(i.hasContent&&i.body||null)}catch(t){e.onError(t)}return new r(o,n)},r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._state.isDone||4===this._xhr.readyState||this._xhr.abort())},n}(o),x=f.ajax=function(e){var n={method:"GET",crossDomain:!1,async:!0,headers:{},responseType:"text",timeout:0,createXHR:function(){return this.crossDomain?function(){var e=new t.XMLHttpRequest;if("withCredentials"in e)return e.withCredentials=!0,e;if(t.XDomainRequest)return new XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(t.XMLHttpRequest)return new t.XMLHttpRequest;var e;try{for(var n=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(e=n[r],new t.ActiveXObject(e))break}catch(t){}return new t.ActiveXObject(e)}catch(t){throw new Error("XMLHttpRequest is not supported by your browser")}}()},normalizeError:O,normalizeSuccess:S};if("string"==typeof e)n.url=e;else for(var o in e)d.call(e,o)&&(n[o]=e[o]);return n.crossDomain||n.headers["X-Requested-With"]||(n.headers["X-Requested-With"]="XMLHttpRequest"),n.hasContent=n.body!==r,new k(n)};f.post=function(t,e){var n;return"string"==typeof t?n={url:t,body:e,method:"POST"}:"object"===i(t)&&((n=t).method="POST"),x(n)},f.get=function(t){var e;return"string"==typeof t?e={url:t}:"object"===i(t)&&(e=t),x(e)},f.getJSON=function(e){if(!t.JSON&&"function"!=typeof t.JSON.parse)throw new TypeError("JSON is not supported in your runtime.");return x({url:e,responseType:"json"}).map((function(t){return t.response}))};var D,j=(D="document"in t&&t.document.createElement("div"),function(t){D.appendChild(t),D.innerHTML=""}),N=function(e){function n(t){this._settings=t,e.call(this)}function r(t){this._script=t,this.isDisposed=!1}return b(n,e),n.id=0,n.prototype.subscribeCore=function(e){var o={jsonp:"JSONPCallback",async:!0,jsonpCallback:"rxjsjsonpCallbackscallback_"+(n.id++).toString(36)};if("string"==typeof this._settings)o.url=this._settings;else for(var i in this._settings)d.call(this._settings,i)&&(o[i]=this._settings[i]);var s=t.document.createElement("script");s.type="text/javascript",s.async=o.async,s.src=o.url.replace(o.jsonp,o.jsonpCallback),t[o.jsonpCallback]=function(e){t[o.jsonpCallback].called=!0,t[o.jsonpCallback].data=e};s.onload=s.onreadystatechanged=s.onerror=function(n){"load"!==n.type||t[o.jsonpCallback].called||(n={type:"error"});var r="error"===n.type?400:200,i=t[o.jsonpCallback].data;200===r?(e.onNext({status:r,responseType:"jsonp",response:i,originalEvent:n}),e.onCompleted()):e.onError({type:"error",status:r,originalEvent:n})};var u=t.document.getElementsByTagName("head")[0]||t.document.documentElement;return u.insertBefore(s,u.firstChild),new r(s)},r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._script.onload=this._script.onreadystatechanged=this._script.onerror=null,j(this._script),this._script=null)},n}(o);function P(t,e,n,r){t&&(e&&(e.onNext(),e.onCompleted()),n?t.close(n,r):t.close())}f.jsonpRequest=function(t){return new N(t)};var A=function(t){function e(e,n,r,o,i){this._state=e,this._url=n,this._protocol=r,this._open=o,this._close=i,t.call(this)}function n(t,e,n,r,o){this._socket=t,this._msgFn=e,this._errFn=n,this._closeFn=r,this._close=o,this.isDisposed=!1}return b(e,t),n.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,P(this._socket,this._close),this._socket.removeEventListener("message",this._msgFn,!1),this._socket.removeEventListener("error",this._errFn,!1),this._socket.removeEventListener("close",this._closeFn,!1))},e.prototype.subscribeCore=function(t){this._state.socket=this._protocol?new WebSocket(this._url,this._protocol):new WebSocket(this._url);var e,r,o=(e=this._open,r=this._state.socket,function t(n){e.onNext(n),e.onCompleted(),r.removeEventListener("open",t,!1)}),i=function(t){return function(e){t.onNext(e)}}(t),s=function(t){return function(e){t.onError(e)}}(t),u=function(t){return function(e){if(1e3!==e.code||!e.wasClean)return t.onError(e);t.onCompleted()}}(t);return this._open&&this._state.socket.addEventListener("open",o,!1),this._state.socket.addEventListener("message",i,!1),this._state.socket.addEventListener("error",s,!1),this._state.socket.addEventListener("close",u,!1),new n(this._state.socket,i,s,u,this._close)},e}(o),T=function(t){function e(e,n){this._state=e,this._close=n,t.call(this)}return b(e,t),e.prototype.next=function(t){this._state.socket&&this._state.socket.readyState===WebSocket.OPEN&&this._state.socket.send(t)},e.prototype.error=function(t){if(!t.code)throw new Error('no code specified. be sure to pass { code: ###, reason: "" } to onError()');P(this._state.socket,this._close,t.code,t.reason||"")},e.prototype.completed=function(){P(this._state.socket,this._close,1e3,"")},e}(s);f.fromWebSocket=function(t,e,n,r){if(!WebSocket)throw new TypeError("WebSocket not implemented in your runtime.");var o={socket:null};return p.create(new T(o,r),new A(o,t,e,n,r))};var I=function(t){function e(e){this._state=e,t.call(this)}return b(e,t),e.prototype.next=function(t){this._state.worker&&this._state.worker.postMessage(t)},e.prototype.error=function(t){throw t},e.prototype.completed=function(){},e}(s),q=function(e){function n(t,n){this._state=t,this._url=n,e.call(this)}function r(t,e,n){this._w=t,this._msgFn=e,this._errFn=n,this.isDisposed=!1}return b(n,e),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._w.terminate(),this._w.removeEventListener("message",this._msgFn,!1),this._w.removeEventListener("error",this._errFn,!1))},n.prototype.subscribeCore=function(e){this._state.worker=new t.Worker(this._url);var n=function(t){return function(e){t.onNext(e)}}(e),o=function(t){return function(e){t.onError(e)}}(e);return this._state.worker.addEventListener("message",n,!1),this._state.worker.addEventListener("error",o,!1),new r(this._state.worker,n,o)},n}(o);f.fromWorker=function(e){if(!t.Worker)throw new TypeError("Worker not implemented in your runtime.");var n={worker:null};return p.create(new I(n),new q(n,e))};var F=function(e){function n(t,n){this._target=t,this._options=n,e.call(this)}function r(t){this._m=t,this.isDisposed=!1}return b(n,e),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._m.disconnect())},n.prototype.subscribeCore=function(e){var n,o=(n=function(t){e.onNext(t)},new(t.MutationObserver||t.WebKitMutationObserver)(n));return o.observe(this._target,this._options),new r(o)},n}(o);f.fromMutationObserver=function(e,n){if(!t.MutationObserver&&!t.WebKitMutationObserver)throw new TypeError("MutationObserver not implemented in your runtime.");return new F(e,n)};var L=function(e){function n(t){this._opts=t,e.call(this)}return b(n,e),n.prototype.subscribeCore=function(e){t.navigator.geolocation.getCurrentPosition((function(t){e.onNext(t),e.onCompleted()}),(function(t){e.onError(t)}),this._opts)},n}(o),M=function(e){function n(t){this._opts=t,e.call(this)}function r(t){this._id=t,this.isDisposed=!1}return b(n,e),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,t.navigator.geolocation.clearWatch(this._id))},n.prototype.subscribeCore=function(e){return new r(t.navigator.geolocation.watchPosition((function(t){e.onNext(t)}),(function(t){e.onError(t)}),this._opts))},n}(o);n.DOM.geolocation={getCurrentPosition:function(e){if(!t.navigator&&!t.navigation.geolocation)throw new TypeError("geolocation not available");return new L(e)},watchPosition:function(e){if(!t.navigator&&!t.navigation.geolocation)throw new TypeError("geolocation not available");return new M(e).publish().refCount()}};var R,V,U=function(e){function n(t,n,r,o){this._readerFn=t,this._file=n,this._progressObserver=r,this._encoding=o,e.call(this)}function r(t,e,n,r,o){this._r=t,this._po=e,this._lFn=n,this._eFn=r,this._pFn=o,this.isDisposed=!1}return b(n,e),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._r.readyState===t.FileReader.LOADING&&this._r.abort(),this._r.removeEventListener("load",this._lFn,!1),this._r.removeEventListener("error",this._eFn,!1),this._po&&this._r.removeEventListener("progress",this._pFn,!1))},n.prototype.subscribeCore=function(e){var n=new t.FileReader,o=function(t,e){return function(n){e&&e.onCompleted(),t.onNext(n.target.result),t.onCompleted()}}(e,this._progressObserver),i=function(t){return function(e){t.onError(e.target.error)}}(e),s=function(t){return function(e){t.onNext(e)}}(this._progressObserver);return n.addEventListener("load",o,!1),n.addEventListener("error",i,!1),this._progressObserver&&n.addEventListener("progress",s,!1),n[this._readerFn](this._file,this._encoding),new r(n,this._progressObserver,o,i,s)},n}(o);return f.fromReader=function(e,n){if(!t.FileReader)throw new TypeError("FileReader not implemented in your runtime.");return{asArrayBuffer:function(){return new U("readAsArrayBuffer",e,n)},asBinaryString:function(){return new U("readAsBinaryString",e,n)},asDataURL:function(){return new U("readAsDataURL",e,n)},asText:function(t){return new U("readAsText",e,n,t)}}},t.requestAnimationFrame?(R=t.requestAnimationFrame,V=t.cancelAnimationFrame):t.mozRequestAnimationFrame?(R=t.mozRequestAnimationFrame,V=t.mozCancelAnimationFrame):t.webkitRequestAnimationFrame?(R=t.webkitRequestAnimationFrame,V=t.webkitCancelAnimationFrame):t.msRequestAnimationFrame?(R=t.msRequestAnimationFrame,V=t.msCancelAnimationFrame):t.oRequestAnimationFrame?(R=t.oRequestAnimationFrame,V=t.oCancelAnimationFrame):(R=function(e){t.setTimeout(e,1e3/60)},V=t.clearTimeout),l.requestAnimationFrame=new(function(e){function n(){e.call(this)}function r(t,e,n,r){return function(){!t.isDisposed&&t.setDisposable(u._fixup(e(n,r)))}}function o(t,e){this._id=e,this._method=t,this.isDisposed=!1}return b(n,e),o.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._method.call(null,this._id))},n.prototype.schedule=function(t,e){var n=new h,i=R(r(n,e,this,t));return new a(n,new o(V,i))},n.prototype._scheduleFuture=function(e,n,i){if(0===n)return this.schedule(e,i);var s=new h,u=t.setTimeout(r(s,i,this,e),n);return new a(s,new o(t.clearTimeout,u))},n}(l)),l.microtask=function(){var e,n=1,r={},o=!1;function i(t){delete r[t]}function s(e){if(o)t.setTimeout((function(){s(e)}),0);else{var n=r[e];if(n){o=!0;try{n()}catch(t){throw t}finally{i(e),o=!1}}}}var c=t.MutationObserver||t.WebKitMutationObserver;if(c){var p="drainqueue_",f=new c((function(t){t.forEach((function(t){s(t.attributeName.substring(11))}))})),d=t.document.createElement("div");f.observe(d,{attributes:!0}),e=function(t){var e=n++;return r[e]=t,d.setAttribute(p+e,"drainQueue"),e}}else if("function"==typeof t.setImmediate)e=function(e){var o=n++;return r[o]=e,t.setImmediate((function(){s(o)})),o};else if(function(){if(!t.postMessage||t.importScripts)return!1;var e=!1,n=t.onmessage;return t.onmessage=function(){e=!0},t.postMessage("","*"),t.onmessage=n,e}()){var v=function(t){"string"==typeof t.data&&t.data.substring(0,y.length)===y&&s(t.data.substring(y.length))},y="ms.rx.schedule"+Math.random();t.addEventListener?t.addEventListener("message",v,!1):t.attachEvent&&t.attachEvent("onmessage",v),e=function(e){var o=n++;return r[o]=e,t.postMessage(y+o,"*"),o}}else if(t.MessageChannel){var m=new t.MessageChannel;m.port1.onmessage=function(t){s(t.data)},e=function(t){var e=n++;return r[e]=t,m.port2.postMessage(e),e}}else e="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(e){var o=t.document.createElement("script"),i=n++;return r[i]=e,o.onreadystatechange=function(){s(i),o.onreadystatechange=null,o.parentNode.removeChild(o),o=null},t.document.documentElement.appendChild(o),i}:function(e){var o=n++;return r[o]=e,t.setTimeout((function(){s(o)}),0),o};return new(function(n){function r(){n.call(this)}function o(t,e,n,r){return function(){!t.isDisposed&&t.setDisposable(u._fixup(e(n,r)))}}function s(t,e){this._id=e,this._method=t,this.isDisposed=!1}return b(r,n),s.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._method.call(null,this._id))},r.prototype.schedule=function(t,n){var r=new h,u=e(o(r,n,this,t));return new a(r,new s(i,u))},r.prototype._scheduleFuture=function(e,n,r){if(0===n)return this.schedule(e,r);var i=new h,u=t.setTimeout(o(i,r,this,e),n);return new a(i,new s(t.clearTimeout,u))},r}(l))}(),n}))},889:(t,e,n)=>{var r;t=n.nmd(t);var o=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(t,e){if(!r[t]){r[t]={};for(var n=0;n>>8,n[2*r+1]=s%256}return n},decompressFromUint8Array:function(e){if(null==e)return i.decompress(e);for(var n=new Array(e.length/2),r=0,o=n.length;r>=1}else{for(o=1,r=0;r>=1}0==--p&&(p=Math.pow(2,f),f++),delete u[h]}else for(o=s[h],r=0;r>=1;0==--p&&(p=Math.pow(2,f),f++),s[a]=l++,h=String(c)}if(""!==h){if(Object.prototype.hasOwnProperty.call(u,h)){if(h.charCodeAt(0)<256){for(r=0;r>=1}else{for(o=1,r=0;r>=1}0==--p&&(p=Math.pow(2,f),f++),delete u[h]}else for(o=s[h],r=0;r>=1;0==--p&&(p=Math.pow(2,f),f++)}for(o=2,r=0;r>=1;for(;;){if(v<<=1,b==e-1){d.push(n(v));break}b++}return d.join("")},decompress:function(t){return null==t?"":""==t?null:i._decompress(t.length,32768,(function(e){return t.charCodeAt(e)}))},_decompress:function(e,n,r){var o,i,s,u,c,a,h,p=[],l=4,f=4,d=3,v="",b=[],y={val:r(0),position:n,index:1};for(o=0;o<3;o+=1)p[o]=o;for(s=0,c=Math.pow(2,2),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;switch(s){case 0:for(s=0,c=Math.pow(2,8),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;h=t(s);break;case 1:for(s=0,c=Math.pow(2,16),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;h=t(s);break;case 2:return""}for(p[3]=h,i=h,b.push(h);;){if(y.index>e)return"";for(s=0,c=Math.pow(2,d),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;switch(h=s){case 0:for(s=0,c=Math.pow(2,8),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;p[f++]=t(s),h=f-1,l--;break;case 1:for(s=0,c=Math.pow(2,16),a=1;a!=c;)u=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),s|=(u>0?1:0)*a,a<<=1;p[f++]=t(s),h=f-1,l--;break;case 2:return b.join("")}if(0==l&&(l=Math.pow(2,d),d++),p[h])v=p[h];else{if(h!==f)return null;v=i+i.charAt(0)}b.push(v),p[f++]=i+v.charAt(0),i=v,0==--l&&(l=Math.pow(2,d),d++)}}};return i}();"function"==typeof storygize_amd_define&&n.amdO?void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r):null!=t&&(t.exports=o)},998:function(t,e,n){var r;t=n.nmd(t),function(o){var i={function:!0,object:!0};function s(t){return t&&t.Object===Object?t:null}var u,c=i[typeof e]&&e&&!e.nodeType?e:null,a=i.object&&t&&!t.nodeType?t:null,h=s(c&&a&&"object"==typeof n.g&&n.g),p=s(i[typeof self]&&self),l=s(i[typeof window]&&window),f=a&&a.exports===c?c:null,d=s(i[typeof this]&&this),v=h||l!==(d&&d.window)&&l||p||d||Function("return this")(),b={internals:{},config:{Promise:v.Promise},helpers:{}},y=b.helpers.noop=function(){},m=b.helpers.identity=function(t){return t},w=b.helpers.defaultNow=Date.now,g=b.helpers.defaultComparer=function(t,e){return Et(t,e)},_=b.helpers.defaultSubComparer=function(t,e){return t>e?1:t=A&&r<=Fr}function L(t){return-1!==t.indexOf("(module.js:")||-1!==t.indexOf("(node.js:")}function M(){if(j)try{throw new Error}catch(n){var t=n.stack.split("\n"),e=R(t[0].indexOf("@")>0?t[1]:t[2]);if(!e)return;return P=e[0],e[1]}}function R(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(t);return r?[r[1],Number(r[2])]:void 0}var V=b.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};V.prototype=Object.create(Error.prototype),V.prototype.name="EmptyError";var U=b.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};U.prototype=Object.create(Error.prototype),U.prototype.name="ObjectDisposedError";var z=b.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};z.prototype=Object.create(Error.prototype),z.prototype.name="ArgumentOutOfRangeError";var H=b.NotSupportedError=function(t){this.message=t||"This operation is not supported",Error.call(this)};H.prototype=Object.create(Error.prototype),H.prototype.name="NotSupportedError";var B=b.NotImplementedError=function(t){this.message=t||"This operation is not implemented",Error.call(this)};B.prototype=Object.create(Error.prototype),B.prototype.name="NotImplementedError";var W=b.helpers.notImplemented=function(){throw new B},X=(b.helpers.notSupported=function(){throw new H},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");v.Set&&"function"==typeof(new v.Set)["@@iterator"]&&(X="@@iterator");var K=b.doneEnumerator={done:!0,value:o},J=b.helpers.isIterable=function(t){return t&&t[X]!==o},Q=b.helpers.isArrayLike=function(t){return t&&t.length!==o};b.helpers.iterator=X;var $=b.internals.bindCallback=function(t,e,n){if(void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},Y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],G=Y.length,Z="[object Arguments]",tt="[object Array]",et="[object Boolean]",nt="[object Date]",rt="[object Error]",ot="[object Number]",it="[object Object]",st="[object RegExp]",ut="[object String]",ct=Object.prototype.toString,at=Object.prototype.hasOwnProperty,ht=ct.call(arguments)==Z,pt=Error.prototype,lt=Object.prototype,ft=String.prototype,dt=lt.propertyIsEnumerable;try{!(ct.call(document)==it&&!({toString:0}+""))}catch(t){!0}var vt={};vt[tt]=vt[nt]=vt[ot]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},vt[et]=vt[ut]={constructor:!0,toString:!0,valueOf:!0},vt[rt]=vt["[object Function]"]=vt[st]={constructor:!0,toString:!0},vt[it]={constructor:!0};var bt={};!function(){var t=function(){this.x=1},e=[];for(var n in t.prototype={valueOf:1,y:1},new t)e.push(n);for(n in arguments);bt.enumErrorProps=dt.call(pt,"message")||dt.call(pt,"name"),bt.enumPrototypes=dt.call(t,"prototype"),bt.nonEnumArgs=0!=n,bt.nonEnumShadows=!/valueOf/.test(e)}(1);var yt=b.internals.isObject=function(t){var e=typeof t;return t&&("function"==e||"object"==e)||!1};function mt(t){var e=[];if(!yt(t))return e;bt.nonEnumArgs&&t.length&&_t(t)&&(t=St.call(t));var n=bt.enumPrototypes&&"function"==typeof t,r=bt.enumErrorProps&&(t===pt||t instanceof Error);for(var o in t)n&&"prototype"==o||r&&("message"==o||"name"==o)||e.push(o);if(bt.nonEnumShadows&&t!==lt){var i=t.constructor,s=-1,u=G;if(t===(i&&i.prototype))var c=t===ft?ut:t===pt?rt:ct.call(t),a=vt[c];for(;++s-1}));return n.pop(),r.pop(),f}var St=Array.prototype.slice,Ot=b.internals.inherits=function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n},kt=b.internals.addProperties=function(t){for(var e=[],n=1,r=arguments.length;n0;){var t=e.dequeue();!t.isCancelled()&&t.invoke()}}function r(){t.call(this)}return Ot(r,t),r.prototype.schedule=function(t,r){var o=new Vt(this,t,r,this.now());if(e)e.enqueue(o);else{(e=new ne(4)).enqueue(o);var i=x(n)();e=null,i===k&&D(i.e)}return o.disposable},r.prototype.scheduleRequired=function(){return!e},r}(Ut),Qt=Ut.currentThread=new Jt,$t=(b.internals.SchedulePeriodicRecursive=function(){function t(t,e,n,r){this._scheduler=t,this._state=e,this._period=n,this._action=r}return t.prototype.start=function(){var t=new Ft;return this._cancel=t,t.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,function(t){return function(e,n){n(0,t._period);var r=x(t._action)(t._state);r===k&&(t._cancel.dispose(),D(r.e)),t._state=r}}(this))),t},t}(),function(){var t,e=y;if(v.setTimeout)t=v.setTimeout,e=v.clearTimeout;else{if(!v.WScript)throw new H;t=function(t,e){v.WScript.Sleep(e),t()}}return{setTimeout:t,clearTimeout:e}}()),Yt=$t.setTimeout,Gt=$t.clearTimeout;!function(){var t=1,e={},n=!1;function r(t){if(n)Yt((function(){r(t)}),0);else{var o=e[t];if(o){n=!0;var i=x(o)();Wt(t),n=!1,i===k&&D(i.e)}}}Wt=function(t){delete e[t]};var o=new RegExp("^"+String(ct).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=h&&f&&h.setImmediate)&&!o.test(i)&&i;if(S(i))Bt=function(n){var o=t++;return e[o]=n,i((function(){r(o)})),o};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Bt=function(n){var o=t++;return e[o]=n,process.nextTick((function(){r(o)})),o};else if(function(){if(!v.postMessage||v.importScripts)return!1;var t=!1,e=v.onmessage;return v.onmessage=function(){t=!0},v.postMessage("","*"),v.onmessage=e,t}()){var s="ms.rx.schedule"+Math.random();v.addEventListener("message",(function(t){"string"==typeof t.data&&t.data.substring(0,s.length)===s&&r(t.data.substring(s.length))}),!1),Bt=function(n){var r=t++;return e[r]=n,v.postMessage(s+currentId,"*"),r}}else if(v.MessageChannel){var u=new v.MessageChannel;u.port1.onmessage=function(t){r(t.data)},Bt=function(n){var r=t++;return e[r]=n,u.port2.postMessage(r),r}}else Bt="document"in v&&"onreadystatechange"in v.document.createElement("script")?function(n){var o=v.document.createElement("script"),i=t++;return e[i]=n,o.onreadystatechange=function(){r(i),o.onreadystatechange=null,o.parentNode.removeChild(o),o=null},v.document.documentElement.appendChild(o),i}:function(n){var o=t++;return e[o]=n,Yt((function(){r(o)}),0),o}}();var Zt=function(t){function e(){t.call(this)}function n(t,e,n,r){return function(){!t.isDisposed&&t.setDisposable(Nt._fixup(e(n,r)))}}function r(t,e){this._id=e,this._method=t,this.isDisposed=!1}return Ot(e,t),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._method.call(null,this._id))},e.prototype.schedule=function(t,e){var o=new Ft,i=Bt(n(o,e,this,t));return new Mt(o,new r(Wt,i))},e.prototype._scheduleFuture=function(t,e,o){if(0===e)return this.schedule(t,o);var i=new Ft,s=Yt(n(i,o,this,t),e);return new Mt(i,new r(Gt,s))},e}(Ut),te=Ut.default=Ut.async=new Zt;function ee(t,e){this.id=t,this.value=e}ee.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var ne=b.internals.PriorityQueue=function(t){this.items=new Array(t),this.length=0},re=ne.prototype;re.isHigherPriority=function(t,e){return this.items[t].compareTo(this.items[e])<0},re.percolate=function(t){if(!(t>=this.length||t<0)){var e=t-1>>1;if(!(e<0||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},re.heapify=function(t){if(+t||(t=0),!(t>=this.length||t<0)){var e=2*t+1,n=2*t+2,r=t;if(e0&&(t=!this.isAcquired,this.isAcquired=!0),t&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,(function(t,e){var n;if(t.queue.length>0){n=t.queue.shift();var r=x(n)();if(r===k)return t.queue=[],t.hasFaulted=!0,D(r.e);e(t)}else t.isAcquired=!1})))},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.disposable.dispose()},e}(de),me=b.ObservableBase=function(t){function e(t,e){var n,r=e[0],o=e[1],i=x(o.subscribeCore).call(o,r);i!==k||r.fail(k.e)||D(k.e),r.setDisposable((n=i)&&S(n.dispose)?n:S(n)?Pt(n):At)}function n(){t.call(this)}return Ot(n,t),n.prototype._subscribe=function(t){var n=new jr(t),r=[n,this];return Qt.scheduleRequired()?Qt.schedule(r,e):e(0,r),n},n.prototype.subscribeCore=W,n}(be),we=b.FlatMapObservable=function(t){function e(e,n,r,o){this.resultSelector=S(r)?r:null,this.selector=$(S(n)?n:function(){return n},o,3),this.source=e,t.call(this)}function n(t,e,n,r){this.i=0,this.selector=e,this.resultSelector=n,this.source=r,this.o=t,de.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.selector,this.resultSelector,this))},Ot(n,de),n.prototype._wrapResult=function(t,e,n){return this.resultSelector?t.map((function(t,r){return this.resultSelector(e,t,n,r)}),this):t},n.prototype.next=function(t){var e=this.i++,n=x(this.selector)(t,e,this.source);if(n===k)return this.o.onError(n.e);C(n)&&(n=cr(n)),(Q(n)||J(n))&&(n=be.from(n)),this.o.onNext(this._wrapResult(n,t,e))},n.prototype.error=function(t){this.o.onError(t)},n.prototype.onCompleted=function(){this.o.onCompleted()},e}(me),ge=b.internals.Enumerable=function(){};function _e(t){this._s=t,this.isDisposed=!1}_e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var Ee=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e,n){this._o=t,this._s=e,this._e=n,de.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){var e={isDisposed:!1},r=new Lt,o=Qt.scheduleRecursive(this.sources[X](),(function(o,i){if(!e.isDisposed){var s=x(o.next).call(o);if(s===k)return t.onError(s.e);if(s.done)return t.onCompleted();var u=s.value;C(u)&&(u=cr(u));var c=new Ft;r.setDisposable(c),c.setDisposable(u.subscribe(new n(t,i,o)))}}));return new Rt([r,o,new _e(e)])},Ot(n,de),n.prototype.onNext=function(t){this._o.onNext(t)},n.prototype.onError=function(t){this._o.onError(t)},n.prototype.onCompleted=function(){this._s(this._e)},e}(me);ge.prototype.concat=function(){return new Ee(this)};var Ce=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e){this._o=t,this._recurse=e,de.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){var e=this.sources[X](),r={isDisposed:!1},o=new Lt,i=Qt.scheduleRecursive(null,(function(i,s){if(!r.isDisposed){var u=x(e.next).call(e);if(u===k)return t.onError(u.e);if(u.done)return null!==i?t.onError(i):t.onCompleted();var c=u.value;C(c)&&(c=cr(c));var a=new Ft;o.setDisposable(a),a.setDisposable(c.subscribe(new n(t,s)))}}));return new Rt([o,i,new _e(r)])},Ot(n,de),n.prototype.next=function(t){this._o.onNext(t)},n.prototype.error=function(t){this._recurse(t)},n.prototype.completed=function(){this._o.onCompleted()},e}(me);ge.prototype.catchError=function(){return new Ce(this)},ge.prototype.catchErrorWhen=function(t){var e=this;return new Dr((function(n){var r=new Pr,o=new Pr,i=t(r).subscribe(o),s=e[X](),u={isDisposed:!1},c=new Lt,a=Qt.scheduleRecursive(null,(function(t,e){if(!u.isDisposed){var i=x(s.next).call(s);if(i===k)return n.onError(i.e);if(i.done)n.onCompleted();else{var a=i.value;C(a)&&(a=cr(a));var h=new Ft,p=new Ft;c.setDisposable(new Mt(p,h)),h.setDisposable(a.subscribe((function(t){n.onNext(t)}),(function(t){p.setDisposable(o.subscribe(e,(function(t){n.onError(t)}),(function(){n.onCompleted()}))),r.onNext(t)}),(function(){n.onCompleted()})))}}}));return new Rt([i,c,a,new _e(u)])}))};var Se=function(t){function e(t,e){this.v=t,this.c=null==e?-1:e}function n(t){this.v=t.v,this.l=t.c}return Ot(e,t),e.prototype[X]=function(){return new n(this)},n.prototype.next=function(){return 0===this.l?K:(this.l>0&&this.l--,{done:!1,value:this.v})},e}(ge),Oe=ge.repeat=function(t,e){return new Se(t,e)},ke=function(t){function e(t,e,n){this.s=t,this.fn=e?$(e,n,3):null}function n(t){this.i=-1,this.s=t.s,this.l=this.s.length,this.fn=t.fn}return Ot(e,t),e.prototype[X]=function(){return new n(this)},n.prototype.next=function(){return++this.iFe)return Fe;return e}(t),this._i=0}Le.prototype[X]=function(){return new Me(this._s)},Me.prototype[X]=function(){return this},Me.prototype.next=function(){return this._i0)&&(t.onNext(e),n>0&&n--),0===n)return t.onCompleted();r(n)}))},be.repeat=function(t,e,n){return Ht(n)||(n=Qt),new Ge(t,e,n)};var tn=function(t){function e(e,n){this.value=e,this.scheduler=n,t.call(this)}function n(t,e,n){this.observer=t,this.value=e,this.scheduler=n}function r(t,e){var n=e[0],r=e[1];return r.onNext(n),r.onCompleted(),At}return Ot(e,t),e.prototype.subscribeCore=function(t){return new n(t,this.value,this.scheduler).run()},n.prototype.run=function(){var t=[this.value,this.observer];return this.scheduler===Kt?r(0,t):this.scheduler.schedule(t,r)},e}(me),en=(be.return=be.just=function(t,e){return Ht(e)||(e=Kt),new tn(t,e)},function(t){function e(e,n){this.error=e,this.scheduler=n,t.call(this)}function n(t,e){this.o=t,this.p=e}function r(t,e){var n=e[0];e[1].onError(n)}return Ot(e,t),e.prototype.subscribeCore=function(t){return new n(t,this).run()},n.prototype.run=function(){return this.p.scheduler.schedule([this.p.error,this.o],r)},e}(me)),nn=be.throw=function(t,e){return Ht(e)||(e=Kt),new en(t,e)},rn=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){var e=new Ft,n=new Lt;return n.setDisposable(e),e.setDisposable(this.source.subscribe(new on(t,n,this._fn))),n},e}(me),on=function(t){function e(e,n,r){this._o=e,this._s=n,this._fn=r,t.call(this)}return Ot(e,t),e.prototype.next=function(t){this._o.onNext(t)},e.prototype.completed=function(){return this._o.onCompleted()},e.prototype.error=function(t){var e=x(this._fn)(t);if(e===k)return this._o.onError(e.e);C(e)&&(e=cr(e));var n=new Ft;this._s.setDisposable(n),n.setDisposable(e.subscribe(this._o))},e}(de);oe.catch=function(t){return S(t)?new rn(this,t):sn([this,t])};var sn=be.catch=function(){var t;if(Array.isArray(arguments[0]))t=arguments[0];else{var e=arguments.length;t=new Array(e);for(var n=0;n0?t.handleSubscribe(t.q.shift()):(t.activeCount--,t.done&&0===t.activeCount&&t.o.onCompleted())}},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return!this.isStopped&&(this.isStopped=!0,this.parent.o.onError(t),!0)},t}();oe.merge=function(t){return"number"!=typeof t?bn(this,t):new dn(this,t)};var bn=be.merge=function(){var t,e,n=[],r=arguments.length;if(arguments[0])if(Ht(arguments[0]))for(t=arguments[0],e=1;e0}function r(t){return t.shift()}return Ot(e,t),e.prototype.next=function(t){if(this._q[this._i].push(t),this._q.every(n)){var e=this._q.map(r),o=x(this._p._cb).apply(null,e);if(o===k)return this._o.onError(o.e);this._o.onNext(o)}else this._d.filter((i=this._i,function(t,e){return e!==i})).every(m)&&this._o.onCompleted();var i},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._d[this._i]=!0,this._d.every(m)&&this._o.onCompleted()},e}(de);function un(){return!1}function Nn(){return[]}function cn(){for(var t=arguments.length,e=new Array(t),n=0;n0}))){var u=i.map((function(t){return t.shift()})),c=x(r).apply(o,u);if(c===k)return t.onError(c.e);t.onNext(c)}else s.filter((function(t,e){return e!==n})).every(m)&&t.onCompleted()}),(function(e){t.onError(e)}),(function(){s[n]=!0,s.every(m)&&t.onCompleted()}))),u[n]=a}(c);return new Dt(u)}),o)},oe.asObservable=function(){return new Dr((t=this,function(e){return t.subscribe(e)}),this);var t};var Tn=function(t){function e(e){this.source=e,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new In(t))},e}(me),In=function(t){function e(e){this._o=e,t.call(this)}return Ot(e,t),e.prototype.next=function(t){t.accept(this._o)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(de);oe.dematerialize=function(){return new Tn(this)};var qn=function(t){function e(e,n,r){this.source=e,this.keyFn=n,this.comparer=r,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new Fn(t,this.keyFn,this.comparer))},e}(me),Fn=function(t){function e(e,n,r){this.o=e,this.keyFn=n,this.comparer=r,this.hasCurrentKey=!1,this.currentKey=null,t.call(this)}return Ot(e,t),e.prototype.next=function(t){var e,n=t;return S(this.keyFn)&&(n=x(this.keyFn)(t))===k?this.o.onError(n.e):this.hasCurrentKey&&(e=x(this.comparer)(this.currentKey,n))===k?this.o.onError(e.e):void(this.hasCurrentKey&&e||(this.hasCurrentKey=!0,this.currentKey=n,this.o.onNext(t)))},e.prototype.error=function(t){this.o.onError(t)},e.prototype.completed=function(){this.o.onCompleted()},e}(de);oe.distinctUntilChanged=function(t,e){return e||(e=g),new qn(this,t,e)};var Ln=function(t){function e(e,n,r,o){this.source=e,this._oN=n,this._oE=r,this._oC=o,t.call(this)}function n(t,e){this.o=t,this.t=!e._oN||S(e._oN)?fe(e._oN||y,e._oE||y,e._oC||y):e._oN,this.isStopped=!1,de.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this))},Ot(n,de),n.prototype.next=function(t){var e=x(this.t.onNext).call(this.t,t);e===k&&this.o.onError(e.e),this.o.onNext(t)},n.prototype.error=function(t){var e=x(this.t.onError).call(this.t,t);if(e===k)return this.o.onError(e.e);this.o.onError(t)},n.prototype.completed=function(){var t=x(this.t.onCompleted).call(this.t);if(t===k)return this.o.onError(t.e);this.o.onCompleted()},e}(me);oe.do=oe.tap=oe.doAction=function(t,e,n){return new Ln(this,t,e,n)},oe.doOnNext=oe.tapOnNext=function(t,e){return this.tap(void 0!==e?function(n){t.call(e,n)}:t)},oe.doOnError=oe.tapOnError=function(t,e){return this.tap(y,void 0!==e?function(n){t.call(e,n)}:t)},oe.doOnCompleted=oe.tapOnCompleted=function(t,e){return this.tap(y,null,void 0!==e?function(){t.call(e)}:t)},oe.finally=function(t){var e=this;return new Dr((function(n){var r=x(e.subscribe).call(e,n);return r===k?(t(),D(r.e)):Pt((function(){var e=x(r.dispose).call(r);t(),e===k&&D(e.e)}))}),this)};var Mn=function(t){function e(e){this.source=e,t.call(this)}function n(t){this.o=t,this.isStopped=!1}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t))},n.prototype.onNext=y,n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return!this.isStopped&&(this.isStopped=!0,this.observer.onError(t),!0)},e}(me);oe.ignoreElements=function(){return new Mn(this)};var Rn=function(t){function e(e,n){this.source=e,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new Vn(t))},e}(me),Vn=function(t){function e(e){this._o=e,t.call(this)}return Ot(e,t),e.prototype.next=function(t){this._o.onNext(ae(t))},e.prototype.error=function(t){this._o.onNext(he(t)),this._o.onCompleted()},e.prototype.completed=function(){this._o.onNext(pe()),this._o.onCompleted()},e}(de);oe.materialize=function(){return new Rn(this)},oe.repeat=function(t){return Oe(this,t).concat()},oe.retry=function(t){return Oe(this,t).catchError()},oe.retryWhen=function(t){return Oe(this).catchErrorWhen(t)};var Un=function(t){function e(e,n,r,o){this.source=e,this.accumulator=n,this.hasSeed=r,this.seed=o,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new zn(t,this))},e}(me),zn=function(t){function e(e,n){this._o=e,this._p=n,this._fn=n.accumulator,this._hs=n.hasSeed,this._s=n.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,t.call(this)}return Ot(e,t),e.prototype.next=function(t){if(!this._hv&&(this._hv=!0),this._ha?this._a=x(this._fn)(this._a,t,this._i,this._p):(this._a=this._hs?x(this._fn)(this._s,t,this._i,this._p):t,this._ha=!0),this._a===k)return this._o.onError(this._a.e);this._o.onNext(this._a),this._i++},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),this._o.onCompleted()},e}(de);oe.scan=function(){var t,e=!1;return 2===arguments.length&&(e=!0,t=arguments[1]),new Un(this,arguments[0],e,t)};var Hn=function(t){function e(e,n){this.source=e,this._c=n,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new Bn(t,this._c))},e}(me),Bn=function(t){function e(e,n){this._o=e,this._c=n,this._q=[],t.call(this)}return Ot(e,t),e.prototype.next=function(t){this._q.push(t),this._q.length>this._c&&this._o.onNext(this._q.shift())},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(de);oe.skipLast=function(t){if(t<0)throw new z;return new Hn(this,t)},oe.startWith=function(){var t,e=0;arguments.length&&Ht(arguments[0])?(t=arguments[0],e=1):t=Kt;for(var n=[],r=e,o=arguments.length;rthis._c&&this._q.shift()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},e}(de);oe.takeLast=function(t){if(t<0)throw new z;var e=this;return new Dr((function(n){return e.subscribe(new Wn(n,t))}),e)},oe.flatMapConcat=oe.concatMap=function(t,e,n){return new we(this,t,e,n).merge(1)};var Xn=function(t){function e(e,n,r){this.source=e,this.selector=$(n,r,3),t.call(this)}function n(t,e,n){this.o=t,this.selector=e,this.source=n,this.i=0,de.call(this)}return Ot(e,t),e.prototype.internalMap=function(t,n){return new e(this.source,function(t,e){return function(n,r,o){return t.call(this,e.selector(n,r,o),r,o)}}(t,this),n)},e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.selector,this))},Ot(n,de),n.prototype.next=function(t){var e=x(this.selector)(t,this.i++,this.source);if(e===k)return this.o.onError(e.e);this.o.onNext(e)},n.prototype.error=function(t){this.o.onError(t)},n.prototype.completed=function(){this.o.onCompleted()},e}(me);oe.map=oe.select=function(t,e){var n="function"==typeof t?t:function(){return t};return this instanceof Xn?this.internalMap(n,e):new Xn(this,n,e)},oe.pluck=function(){var t=arguments.length,e=new Array(t);if(0===t)throw new Error("List of properties cannot be empty.");for(var n=0;n0&&(this.o.onNext(t),this.r<=0&&this.o.onCompleted())},onError:function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},onCompleted:function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(t){return!this.isStopped&&(this.isStopped=!0,this.o.onError(t),!0)}},e}(me);oe.take=function(t,e){if(t<0)throw new z;return 0===t?Te(e):new $n(this,t)};var Yn=function(t){function e(e,n){this.source=e,this._fn=n,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new Gn(t,this))},e}(me),Gn=function(t){function e(e,n){this._o=e,this._p=n,this._i=0,this._r=!0,t.call(this)}return Ot(e,t),e.prototype.next=function(t){if(this._r&&(this._r=x(this._p._fn)(t,this._i++,this._p),this._r===k))return this._o.onError(this._r.e);this._r?this._o.onNext(t):this._o.onCompleted()},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(de);oe.takeWhile=function(t,e){var n=$(t,e,3);return new Yn(this,n)};var Zn=function(t){function e(e,n,r){this.source=e,this.predicate=$(n,r,3),t.call(this)}function n(t,e,n){this.o=t,this.predicate=e,this.source=n,this.i=0,de.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.predicate,this))},e.prototype.internalFilter=function(t,n){return new e(this.source,function(t,e){return function(n,r,o){return e.predicate(n,r,o)&&t.call(this,n,r,o)}}(t,this),n)},Ot(n,de),n.prototype.next=function(t){var e=x(this.predicate)(t,this.i++,this.source);if(e===k)return this.o.onError(e.e);e&&this.o.onNext(t)},n.prototype.error=function(t){this.o.onError(t)},n.prototype.completed=function(){this.o.onCompleted()},e}(me);function tr(t,e,n,r){var o=new Ar;return r.push(function(t,e,n){return function(){for(var r=arguments.length,o=new Array(r),i=0;i0){var s=n.now();(o=new Date(o.getTime()+i)).getTime()<=s&&(o=new Date(s+i))}r.onNext(t),e(t+1,new Date(o))}))}))}function dr(t,e,n){return t===e?new Dr((function(t){return n.schedulePeriodic(0,e,(function(e){return t.onNext(e),e+1}))})):Ne((function(){return fr(new Date(n.now()+t),e,n)}))}var vr=be.interval=function(t,e){return dr(t,t,Ht(e)?e:te)};be.timer=function(t,e,n){var r;return Ht(n)||(n=te),null!=e&&"number"==typeof e?r=e:Ht(e)&&(n=e),(t instanceof Date||"number"==typeof t)&&r===o?function(t,e){return new lr(t,e)}(t,n):t instanceof Date&&r!==o?fr(t.getTime(),e,n):dr(t,r,n)};function br(t,e,n){return new Dr((function(r){var o,i=!1,s=new Lt,u=null,c=[],a=!1;return o=t.materialize().timestamp(n).subscribe((function(t){var o,h;"E"===t.value.kind?((c=[]).push(t),u=t.value.error,h=!a):(c.push({value:t.value,timestamp:t.timestamp+e}),h=!i,i=!0),h&&(null!==u?r.onError(u):(o=new Ft,s.setDisposable(o),o.setDisposable(n.scheduleRecursiveFuture(null,e,(function(t,e){var o,s,h,p;if(null===u){a=!0;do{h=null,c.length>0&&c[0].timestamp-n.now()<=0&&(h=c.shift().value),null!==h&&h.accept(r)}while(null!==h);p=!1,s=0,c.length>0?(p=!0,s=Math.max(0,c[0].timestamp-n.now())):i=!1,a=!1,null!==(o=u)?r.onError(o):p&&e(null,s)}})))))})),new Mt(o,s)}),t)}oe.delay=function(){var t=arguments[0];if("number"==typeof t||t instanceof Date){var e=t,n=arguments[1];return Ht(n)||(n=te),e instanceof Date?function(t,e,n){return Ne((function(){return br(t,e-n.now(),n)}))}(this,e,n):br(this,e,n)}if(be.isObservable(t)||S(t))return function(t,e,n){var r,o;return S(e)?o=e:(r=e,o=n),new Dr((function(e){var n=new Dt,i=!1,s=new Lt;function u(){s.setDisposable(t.subscribe((function(t){var r=x(o)(t);if(r===k)return e.onError(r.e);var i=new Ft;n.add(i),i.setDisposable(r.subscribe((function(){e.onNext(t),n.remove(i),c()}),(function(t){e.onError(t)}),(function(){e.onNext(t),n.remove(i),c()})))}),(function(t){e.onError(t)}),(function(){i=!0,s.dispose(),c()})))}function c(){i&&0===n.length&&e.onCompleted()}return r?s.setDisposable(r.subscribe(u,(function(t){e.onError(t)}),u)):u(),new Mt(s,n)}),this)}(this,t,arguments[1]);throw new Error("Invalid arguments")};var yr=function(t){function e(e,n,r){Ht(r)||(r=te),this.source=e,this._dt=n,this._s=r,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){var e=new Lt;return new Mt(this.source.subscribe(new mr(t,this.source,this._dt,this._s,e)),e)},e}(me),mr=function(t){function e(e,n,r,o,i){this._o=e,this._s=n,this._d=r,this._scheduler=o,this._c=i,this._v=null,this._hv=!1,this._id=0,t.call(this)}return Ot(e,t),e.prototype.next=function(t){this._hv=!0,this._v=t;var e=++this._id,n=new Ft;this._c.setDisposable(n),n.setDisposable(this._scheduler.scheduleFuture(this,this._d,(function(n,r){r._hv&&r._id===e&&r._o.onNext(t),r._hv=!1})))},e.prototype.error=function(t){this._c.dispose(),this._o.onError(t),this._hv=!1,this._id++},e.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},e}(de);oe.debounce=function(){if(S(arguments[0]))return e=arguments[0],new Dr((function(n){var r,o=!1,i=new Lt,s=0,u=t.subscribe((function(t){var u=x(e)(t);if(u===k)return n.onError(u.e);C(u)&&(u=cr(u)),o=!0,r=t;var c=++s,a=new Ft;i.setDisposable(a),a.setDisposable(u.subscribe((function(){o&&s===c&&n.onNext(r),o=!1,a.dispose()}),(function(t){n.onError(t)}),(function(){o&&s===c&&n.onNext(r),o=!1,a.dispose()})))}),(function(t){i.dispose(),n.onError(t),o=!1,s++}),(function(){i.dispose(),o&&n.onNext(r),n.onCompleted(),o=!1,s++}));return new Mt(u,i)}),t=this);if("number"==typeof arguments[0])return new yr(this,arguments[0],arguments[1]);throw new Error("Invalid arguments");var t,e};var wr=function(t){function e(e,n){this.source=e,this._s=n,t.call(this)}return Ot(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new gr(t,this._s))},e}(me),gr=function(t){function e(e,n){this._o=e,this._s=n,t.call(this)}return Ot(e,t),e.prototype.next=function(t){this._o.onNext({value:t,timestamp:this._s.now()})},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._o.onCompleted()},e}(de);function _r(t,e){return new Dr((function(n){var r,o=!1,i=!1;function s(){i&&(i=!1,n.onNext(r)),o&&n.onCompleted()}var u=new Ft;return u.setDisposable(t.subscribe((function(t){i=!0,r=t}),(function(t){n.onError(t)}),(function(){o=!0,u.dispose()}))),new Mt(u,e.subscribe(s,(function(t){n.onError(t)}),s))}),t)}oe.timestamp=function(t){return Ht(t)||(t=te),new wr(this,t)},oe.sample=oe.throttleLatest=function(t,e){return Ht(e)||(e=te),_r(this,"number"==typeof t?vr(t,e):t)};var Er=b.TimeoutError=function(t){this.message=t||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};Er.prototype=Object.create(Error.prototype),oe.timeout=function(){var t,e,n,r,o=arguments[0];if(o instanceof Date||"number"==typeof o)return t=this,e=o,r=arguments[2],Ht(n=arguments[1])&&(r=n,n=nn(new Er)),n instanceof Error&&(n=nn(n)),Ht(r)||(r=te),be.isObservable(n)||(n=nn(new Er)),new Dr((function(o){var i=0,s=new Ft,u=new Lt,c=!1,a=new Lt;function h(){var t=i;a.setDisposable(r.scheduleFuture(null,e,(function(){(c=i===t)&&(C(n)&&(n=cr(n)),u.setDisposable(n.subscribe(o)))})))}return u.setDisposable(s),h(),s.setDisposable(t.subscribe((function(t){c||(i++,o.onNext(t),h())}),(function(t){c||(i++,o.onError(t))}),(function(){c||(i++,o.onCompleted())}))),new Mt(u,a)}),t);if(be.isObservable(o)||S(o))return function(t,e,n,r){return S(e)&&(r=n,n=e,e=Xe()),be.isObservable(r)||(r=nn(new Er)),new Dr((function(o){var i=new Lt,s=new Lt,u=new Ft;i.setDisposable(u);var c=0,a=!1;function h(t){var e=c,n=new Ft;function u(){return a=e===c}s.setDisposable(n),n.setDisposable(t.subscribe((function(){u()&&i.setDisposable(r.subscribe(o)),n.dispose()}),(function(t){u()&&o.onError(t)}),(function(){u()&&i.setDisposable(r.subscribe(o))})))}function p(){var t=!a;return t&&c++,t}return h(e),u.setDisposable(t.subscribe((function(t){if(p()){o.onNext(t);var e=x(n)(t);if(e===k)return o.onError(e.e);h(C(e)?cr(e):e)}}),(function(t){p()&&o.onError(t)}),(function(){p()&&o.onCompleted()}))),new Mt(i,s)}),t)}(this,o,arguments[1],arguments[2]);throw new Error("Invalid arguments")},oe.throttle=function(t,e){Ht(e)||(e=te);var n=+t||0;if(n<=0)throw new RangeError("windowDuration cannot be less or equal zero.");var r=this;return new Dr((function(t){var o=0;return r.subscribe((function(r){var i=e.now();(0===o||i-o>=n)&&(o=i,t.onNext(r))}),(function(e){t.onError(e)}),(function(){t.onCompleted()}))}),r)};var Cr=function(t){function e(e,n){this.source=e,this.controller=new Pr,n&&n.subscribe?this.pauser=this.controller.merge(n):this.pauser=this.controller,t.call(this)}return Ot(e,t),e.prototype._subscribe=function(t){var e=this.source.publish(),n=e.subscribe(t),r=At,o=this.pauser.distinctUntilChanged().subscribe((function(t){t?r=e.connect():(r.dispose(),r=At)}));return new Rt([n,r,o])},e.prototype.pause=function(){this.controller.onNext(!1)},e.prototype.resume=function(){this.controller.onNext(!0)},e}(be);oe.pausable=function(t){return new Cr(this,t)};var Sr=function(t){function e(e,n){this.source=e,this.controller=new Pr,n&&n.subscribe?this.pauser=this.controller.merge(n):this.pauser=this.controller,t.call(this)}return Ot(e,t),e.prototype._subscribe=function(t){var e,n,r,i,s=[];function u(){for(;s.length>0;)t.onNext(s.shift())}return(n=this.source,r=this.pauser.startWith(!1).distinctUntilChanged(),i=function(t,e){return{data:t,shouldFire:e}},new Dr((function(t){var e,o=[!1,!1],s=!1,u=!1,c=new Array(2);function a(n,r){if(c[r]=n,o[r]=!0,s||(s=o.every(m))){if(e)return t.onError(e);var a=x(i).apply(null,c);if(a===k)return t.onError(a.e);t.onNext(a)}u&&c[1]&&t.onCompleted()}return new Mt(n.subscribe((function(t){a(t,0)}),(function(n){c[1]?t.onError(n):e=n}),(function(){u=!0,c[1]&&t.onCompleted()})),r.subscribe((function(t){a(t,1)}),(function(e){t.onError(e)}),(function(){u=!0,a(!0,1)})))}),n)).subscribe((function(n){e!==o&&n.shouldFire!==e?(e=n.shouldFire,n.shouldFire&&u()):(e=n.shouldFire,n.shouldFire?t.onNext(n.data):s.push(n.data))}),(function(e){u(),t.onError(e)}),(function(){u(),t.onCompleted()}))},e.prototype.pause=function(){this.controller.onNext(!1)},e.prototype.resume=function(){this.controller.onNext(!0)},e}(be);oe.pausableBuffered=function(t){return new Sr(this,t)};var Or=function(t){function e(e,n,r){t.call(this),this.subject=new kr(n,r),this.source=e.multicast(this.subject).refCount()}return Ot(e,t),e.prototype._subscribe=function(t){return this.source.subscribe(t)},e.prototype.request=function(t){return this.subject.request(null==t?-1:t)},e}(be),kr=function(t){function e(e,n){null==e&&(e=!0),t.call(this),this.subject=new Pr,this.enableQueue=e,this.queue=e?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=n||Qt}return Ot(e,t),kt(e.prototype,le,{_subscribe:function(t){return this.subject.subscribe(t)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(ie.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(t){this.hasFailed=!0,this.error=t,this.enableQueue&&0!==this.queue.length?this.queue.push(ie.createOnError(t)):(this.subject.onError(t),this.disposeCurrentRequest())},onNext:function(t){this.requestedCount<=0?this.enableQueue&&this.queue.push(ie.createOnNext(t)):(0==this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(t))},_processRequest:function(t){if(this.enableQueue)for(;this.queue.length>0&&(t>0||"N"!==this.queue[0].kind);){var e=this.queue.shift();e.accept(this.subject),"N"===e.kind?t--:(this.disposeCurrentRequest(),this.queue=[])}return t},request:function(t){this.disposeCurrentRequest();var e=this;return this.requestedDisposable=this.scheduler.schedule(t,(function(t,n){var r=e._processRequest(n);if(!(e.hasCompleted||e.hasFailed)&&r>0)return e.requestedCount=r,Pt((function(){e.requestedCount=0}))})),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),e}(be);oe.controlled=function(t,e){return t&&Ht(t)&&(e=t,t=!0),null==t&&(t=!0),new Or(this,t,e)},oe.pipe=function(t){var e=this.pausableBuffered();function n(){e.resume()}return t.addListener("drain",n),e.subscribe((function(n){!t.write(String(n))&&e.pause()}),(function(e){t.emit("error",e)}),(function(){!t._isStdio&&t.end(),t.removeListener("drain",n)})),e.resume(),t};var xr=function(t){function e(e,n){this._o=e,this._xform=n,t.call(this)}return Ot(e,t),e.prototype.next=function(t){var e=x(this._xform["@@transducer/step"]).call(this._xform,this._o,t);e===k&&this._o.onError(e.e)},e.prototype.error=function(t){this._o.onError(t)},e.prototype.completed=function(){this._xform["@@transducer/result"](this._o)},e}(de);oe.transduce=function(t){var e=this;return new Dr((function(n){var r=t(function(t){return{"@@transducer/init":function(){return t},"@@transducer/step":function(t,e){return t.onNext(e)},"@@transducer/result":function(t){return t.onCompleted()}}}(n));return e.subscribe(new xr(n,r))}),e)};var Dr=b.AnonymousObservable=function(t){function e(t,e){var n,r=e[0],o=e[1],i=x(o.__subscribe).call(o,r);i!==k||r.fail(k.e)||D(k.e),r.setDisposable((n=i)&&S(n.dispose)?n:S(n)?Pt(n):At)}function n(e,n){this.source=n,this.__subscribe=e,t.call(this)}return Ot(n,t),n.prototype._subscribe=function(t){var n=new jr(t),r=[n,this];return Qt.scheduleRequired()?Qt.schedule(r,e):e(0,r),n},n}(be),jr=function(t){function e(e){t.call(this),this.observer=e,this.m=new Ft}Ot(e,t);var n=e.prototype;return n.next=function(t){var e=x(this.observer.onNext).call(this.observer,t);e===k&&(this.dispose(),D(e.e))},n.error=function(t){var e=x(this.observer.onError).call(this.observer,t);this.dispose(),e===k&&D(e.e)},n.completed=function(){var t=x(this.observer.onCompleted).call(this.observer);this.dispose(),t===k&&D(t.e)},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(de),Nr=function(t,e){this._s=t,this._o=e};Nr.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var t=this._s.observers.indexOf(this._o);this._s.observers.splice(t,1),this._o=null}};var Pr=b.Subject=function(t){function e(){t.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Ot(e,t),kt(e.prototype,le.prototype,{_subscribe:function(t){return It(this),this.isStopped?this.hasError?(t.onError(this.error),At):(t.onCompleted(),At):(this.observers.push(t),new Nr(this,t))},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(It(this),!this.isStopped){this.isStopped=!0;for(var t=0,e=O(this.observers),n=e.length;t0},onCompleted:function(){var t;if(It(this),!this.isStopped){this.isStopped=!0;var e=O(this.observers),n=e.length;if(this.hasValue)for(t=0;t0},onCompleted:function(){if(It(this),!this.isStopped){this.isStopped=!0;for(var t=0,e=O(this.observers),n=e.length;t0},_trim:function(t){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&t-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(t){if(It(this),!this.isStopped){var e=this.scheduler.now();this.q.push({interval:e,value:t}),this._trim(e);for(var n=0,r=O(this.observers),o=r.length;n{!function(){"use strict";function e(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!1,value:n})}var n="__immutable_invariants_hold";function r(t){return"object"!=typeof t||(null===t||t.hasOwnProperty(n))}function o(t){return!(null===t||"object"!=typeof t||t instanceof Array||t instanceof Date)}var i=["setPrototypeOf"],s=(i.concat(["push","pop","sort","splice","shift","unshift","reverse"]),["keys"].concat(["map","filter","slice","concat","reduce","reduceRight"]));function u(t){var e=new Error(t);return e.__proto__=u,e}function c(t,r){return e(t,n,!0),t}function a(t,n){var r=t[n];e(t,n,(function(){return g(r.apply(t,arguments))}))}function h(t){for(var n in s){if(s.hasOwnProperty(n))a(t,s[n])}e(t,"flatMap",p),e(t,"asObject",d),e(t,"asMutable",f);for(var r=0,o=t.length;r{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n");return n+L(t)}(r),u={};return"string"==typeof i&&i&&(u.img=i),"string"==typeof s&&s&&(u.selector=s),"string"==typeof o&&o&&(u.h=o),V(t.time,t.rawEvent).merge(u)}function L(t){var e=t.id,n=t.className,r=t.tagName?t.tagName.toLowerCase():"";return e&&(r+="#"+e),n&&n.replace&&(r+="."+n.replace(/\s+/g,".")),r}function M(t){return t?"a"===(t.tagName&&t.tagName.toLowerCase())?t:M(t.parentNode):t}function R(t,e){return v()({t:t.time.getTime(),active:Boolean(e),eventTrigger:"string"==typeof t.name?t.name:""})}function V(t,e){return v()({t:t.getTime(),cX:Math.round(e.clientX),cY:Math.round(e.clientY),pX:Math.round(e.pageX),pY:Math.round(e.pageY)})}var U={},z=function(){return P((function t(){j(this,t)}),null,[{key:"getId",value:function(t){var e=U[t];if(e)return e;var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return U[t]=n,n}},{key:"clearIdForTest",value:function(){U={}}}])}(),H=function(){function t(){j(this,t)}return P(t,null,[{key:"getStoreKey",value:function(t){return"".concat("storygize-visit","::").concat(t||"unresolved")}},{key:"getVisitData",value:function(e){try{var n=localStorage.getItem(t.getStoreKey(e));return n&&JSON.parse(n)}catch(t){return}}},{key:"clearVisitData",value:function(e){e.forEach((function(e){localStorage.removeItem(t.getStoreKey(e))}))}},{key:"_setVisitData",value:function(e,n,r){localStorage.setItem(t.getStoreKey(r),JSON.stringify({id:e,t0:n}))}},{key:"updateLastActive",value:function(e,n,r){t.updateLastActiveForCompanies(e,[{visitId:n,companyUuid:r}])}},{key:"updateLastActiveForCompanies",value:function(e,n){try{var r=e.now().getTime();n.forEach((function(e){var n=e.visitId,o=e.companyUuid;t._setVisitData(n,r,o)}))}catch(t){}}},{key:"getVisitUuid",value:function(e,n){try{var r=t.getVisitData(n),o=e.now().getTime(),i=!Boolean(r),s=!(!r||!r.t0)&&o-r.t0>36e5;(i||s)&&t._setVisitData(E(),o,n);var u=t.getVisitData(n);return u&&u.id}catch(t){return}}}])}();function B(t,e){return e.isEmpty=!1,t.merge(e)}function W(){try{return window.location.href}catch(t){return null}}function X(){try{var t=document.referrer;return t===window.location.href||""===t?null:t}catch(t){return null}}var K=function(){return P((function t(e,n,r){j(this,t),D(this,"timeoutSequence",[5e3,1e4,15e3,3e4,6e4]),D(this,"clock",void 0),D(this,"window",void 0),D(this,"jsLoadDelayMs",void 0),D(this,"firstEventDelayMs",void 0),D(this,"isInIframe",void 0),D(this,"seed",void 0),this.clock=e,this.window=r||window,this.isInIframe=this.window.self!==this.window.top;var o=e.now();this.seed=v()({active:!1,time:o,begin:o.getTime(),engaged:0,focus:[],activeChangedEvents:[],clicks:[],moves:[],scrolls:[],dimensions:[this.getBrowserDimensions(o)],isEmpty:!0,timeOnPage:0,isInIframe:this.isInIframe,pageHasMultipleEngagementTags:n,isPageView:!1})}),[{key:"maintainVisitIdsAndClickId",value:function(t,e){var n=t.currentClickId,r=t.companyUuid;k.getLastVisitClickId(r)!==n&&(H.clearVisitData(e),k.setLastVisitClickId(r,n))}},{key:"createPerfNavObserver",value:function(){var t=this;try{var e=new PerformanceObserver((function(n){try{var r=n.getEntriesByType("navigation");if(r.length&&r[0].toJSON().loadEventEnd){var o=r[0];t.jsLoadDelayMs=Math.round(window.performance.now()-o.toJSON().loadEventEnd),e.disconnect()}}catch(t){e.disconnect()}}));e.observe({type:"navigation",buffered:!0})}catch(t){}}},{key:"captureMovement",value:function(t,e){var n={};return"move"===e.name?(n.moves=t.moves.concat([V(e.time,e.rawEvent)]),B(t,n)):"touch-start"===e.name||"touch-move"===e.name?(n.moves=t.moves.concat([V(e.time,e.rawEvent.touches[0])]),B(t,n)):t}},{key:"captureScroll",value:function(t,e){var n={},r=this.window.document;if("scroll"===e.name){var o=Math.round(r.documentElement.scrollTop||r.body.parentNode?.parentElement?.scrollTop||r.body.scrollTop),i=Math.round(r.documentElement.scrollLeft||r.body.parentNode?.parentElement?.scrollLeft||r.body.scrollLeft),s={t:e.time.getTime(),sT:o!=o?0:o,sL:i!=i?0:i};return n.scrolls=t.scrolls.concat([s]),B(t,n)}return t}},{key:"safeMin",value:function(t,e){return t&&e?Math.min(t,e):e||t}},{key:"getBrowserDimensions",value:function(t){var e=this.window.document,n=this.safeMin(this.window.innerWidth,e.documentElement.clientWidth),r=Math.round(n),o=this.safeMin(this.window.innerHeight,e.documentElement.clientHeight),i=Math.round(o),s=Math.round(e.body.scrollWidth),u=Math.round(e.body.scrollHeight);return{t:t.getTime(),cW:r!=r?0:r,cH:i!=i?0:i,pW:s!=s?0:s,pH:u!=u?0:u}}},{key:"captureClicks",value:function(t,e){var n={};return"click"===e.name?(n.clicks=t.clicks.concat([F(e)]),B(t,n)):t}},{key:"detectSleep",value:function(t,e){if(q(t.time,e.time)>this.timeoutSequence[0]){var n={time:this.clock.now()};return n.timeOnPage=t.timeOnPage+q(t.time,e.time),this.timeoutSequence.length>1&&(this.timeoutSequence=this.timeoutSequence.slice(1)),B(t,n)}return t}},{key:"calculateEngagement",value:function(t,e){var n={};return"reset"!==e.name&&"timer"!==e.name?(n.active="blur"!==e.name,n.time=e.time,n.timeOnPage=t.timeOnPage+q(t.time,e.time),t.active&&(n.engaged=t.engaged+q(t.time,e.time)),B(t,n)):t}},{key:"captureDimensions",value:function(t,e){var n={};return"resize"===e.name?(n.dimensions=t.dimensions.concat([this.getBrowserDimensions(e.time)]),B(t,n)):t}},{key:"captureFocusChange",value:function(t,e,n){var r={};return t.active&&!n.active||!t.active&&n.active?(r.focus=t.focus.concat([e.time.getTime()]),r.activeChangedEvents=t.activeChangedEvents.concat([R(e,t.active)]),B(t,r)):t}},{key:"handleReset",value:function(t,e){var n={};if("reset"===e.name){var r=e.rawEvent;return n.clicks=t.clicks.slice(r.clicks),n.moves=t.moves.slice(r.moves),n.scrolls=t.scrolls.slice(r.scrolls),n.focus=t.focus.slice(r.focus),n.dimensions=t.dimensions.slice(r.dimensions),n.activeChangedEvents=t.activeChangedEvents.slice(r.activeChangedEvents),n.isEmpty=!0,t.merge(n)}return t}},{key:"getInitialPageView",value:function(){return this.display(this.seed.merge({referer:X(),location:W(),isPageView:!0}))}},{key:"maybeOutputData",value:function(t){return t.isEmpty?I.empty():I.just(this.display(t))}},{key:"display",value:function(t){return this.addAdditionalDataToState(t).merge({firstEventDelayMs:this.firstEventDelayMs,jsLoadDelayMs:this.jsLoadDelayMs,time:t.time.getTime(),end:this.clock.now().getTime(),maxEngagementReached:t.engaged>=T,maxTimeOnPageReached:t.timeOnPage>=T})}},{key:"process",value:function(t){return t.scan(function(){for(var t=arguments.length,e=new Array(t),n=0;nthis.sendInterval}},{key:"trackWithDeltas",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){};if(!t)return e(null,new Error("cannot track no state"));var n=this.lastEngaged,r=this.lastTimeOnPage;this.lastEngaged=t.engaged,this.lastTimeOnPage=t.timeOnPage;var o=void 0===n?t.engaged:t.engaged-n,i=void 0===r?t.timeOnPage:t.timeOnPage-r,s=t.merge({engagedDelta:o,timeOnPageDelta:i});this.updateVisitLastActive(t),this.tracker.track(s)?(this.lastSent=this.clock.now(),e({time:new Date(t.time),name:"reset",rawEvent:{clicks:t.clicks&&t.clicks.length,focus:t.focus&&t.focus.length,scrolls:t.scrolls&&t.scrolls.length,dimensions:t.dimensions&&t.dimensions.length,moves:t.moves&&t.moves.length,activeChangedEvents:t.activeChangedEvents&&t.activeChangedEvents.length}},null)):e(null,new Error("problem tracking engagement"))}}])}();function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function bt(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:window.document,i=t;t.startsWith("https://")||t.startsWith("https://")||(i=t.startsWith("localhost:")?"https://".concat(t):"https://".concat(t)),r=e?"identity.dev.js?local_hax=storygize":n?"identity.dev.js":"identity.min.js";var s=o.createElement("iframe");s.width="0",s.height="0",s.style.display="none",s.style.border="none",s.src="".concat(i,"/a/").concat(r),o.body.appendChild(s)}}],(e=null)&&_t(t.prototype,e),n&&_t(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function Ot(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 kt(t){for(var e=1;e1,i]),c=u,h=!1,(a=Ut(a="receivedClickId"))in c?Object.defineProperty(c,a,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[a]=h;var p=t.now();if(u.isInIframe)try{r.companyUuids.forEach((function(t){var e=window.sessionStorage.getItem("scid:".concat(t))||k.getLastVisitClickId(t);e&&(r.updateClickId(t,e),u.receivedClickId=!0,u.maintainVisitIdsAndClickId({currentClickId:e,companyUuid:t},r.companyUuids))})),u.firstEventDelayMs=0}catch(c){}else{r.companyUuids.forEach((function(t){var e=n.getClickIdFromStgzClCid(t)||k.getLastVisitClickId(t);if(e){u.receivedClickId=!0,u.firstEventDelayMs=0;try{r.updateClickId(t,e),u.maintainVisitIdsAndClickId({currentClickId:e,companyUuid:t},r.companyUuids)}catch(t){}}}));var l=function(t){try{var e="".concat(s?"http":"https","://").concat(o),n=t.data.scid,i=t.data.clickId,c=t.data&&r.companyUuids.includes(n)&&"string"==typeof i;t.origin===e&&c&&(u.receivedClickId=!0,r.updateClickId(n,i),u.firstEventDelayMs=u.clock.now().getTime()-p.getTime(),window.removeEventListener("message",l),u.maintainVisitIdsAndClickId({currentClickId:i,companyUuid:n},r.companyUuids))}catch(t){}};window.addEventListener("message",l)}return u.createPerfNavObserver(),u.seed=u.seed.merge({firstEventDelayMs:u.firstEventDelayMs,jsLoadDelayMs:u.jsLoadDelayMs}),u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}(e,t),n=e,(r=[{key:"addAdditionalDataToState",value:function(t){return t}}])&&Ft(n.prototype,r),o&&Ft(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(K);function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function Bt(t,e){for(var n=0;n