/*! For license information please see bundle.js.LICENSE.txt */ (()=>{var __webpack_modules__={6099:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r,i,o=n(655),a=n(4589),s=n(909),u=n(4594),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),l=new a.LL("app","Firebase",c),h="@firebase/app",f="[DEFAULT]",d=((i={})[h]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/app-check"]="fire-app-check",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),p=new u.Yd("@firebase/app"),m=function(){function t(t,e,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=(0,a.p$)(t),this.container=new s.H0(e.name),this._addComponent(new s.wA("app",(function(){return r}),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return r._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){var n;void 0===e&&(e=f),this.checkDestroyed_();var r=this.container.getProvider(t);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=f),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){p.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();m.prototype.name&&m.prototype.options||m.prototype.delete||console.log("dc");var y=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"==typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name=f);var s=o.name;if("string"!=typeof s||!s)throw l.create("bad-app-name",{appName:String(s)});if((0,a.r3)(e,s))throw l.create("duplicate-app",{appName:s});var u=new t(n,o,r);return e[s]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=d[t])&&void 0!==r?r:t;n&&(i+="-"+n);var a=i.match(/\s|\//),u=e.match(/\s|\//);if(a||u){var c=['Unable to register library "'+i+'" with version "'+e+'":'];return a&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),a&&u&&c.push("and"),u&&c.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void p.warn(c.join(" "))}o(new s.wA(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.Ub,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument");(0,u.Am)(t,e)},apps:null,SDK_VERSION:"8.10.0",INTERNAL:{registerComponent:o,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(t=t||f,!(0,a.r3)(e,t))throw l.create("no-app",{appName:t});return e[t]}function o(o){var s=o.name;if(n.has(s))return p.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===o.type?r[s]:null;if(n.set(s,o),"PUBLIC"===o.type){var u=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[s])throw l.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==o.serviceProps&&(0,a.ZB)(u,o.serviceProps),r[s]=u,t.prototype[s]=function(){for(var t=[],e=0;e=0&&p.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var _=y.initializeApp;y.initializeApp=function(){for(var t=[],e=0;e{"use strict";n.d(e,{H0:()=>u,wA:()=>o,zt:()=>s});var r=n(655),i=n(4589),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}(),a="[DEFAULT]",s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return t.prototype.get=function(t){var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.BH;if(this.instancesDeferred.set(e,n),this.isInitialized(e)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:e});r&&n.resolve(r)}catch(t){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e,n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),r=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(t){if(r)return null;throw t}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:a})}catch(t){}try{for(var i=(0,r.XA)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=(0,r.CR)(o.value,2),u=s[0],c=s[1],l=this.normalizeInstanceIdentifier(u);try{var h=this.getOrInitializeService({instanceIdentifier:l});c.resolve(h)}catch(t){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}},t.prototype.clearInstance=function(t){void 0===t&&(t=a),this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return(0,r.mG)(this,void 0,void 0,(function(){var t;return(0,r.Jh)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all((0,r.ev)((0,r.ev)([],(0,r.CR)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),(0,r.CR)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t=a),this.instances.has(t)},t.prototype.getOptions=function(t){return void 0===t&&(t=a),this.instancesOptions.get(t)||{}},t.prototype.initialize=function(t){var e,n;void 0===t&&(t={});var i=t.options,o=void 0===i?{}:i,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(this.name+"("+a+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var s=this.getOrInitializeService({instanceIdentifier:a,options:o});try{for(var u=(0,r.XA)(this.instancesDeferred.entries()),c=u.next();!c.done;c=u.next()){var l=(0,r.CR)(c.value,2),h=l[0],f=l[1];a===this.normalizeInstanceIdentifier(h)&&f.resolve(s)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return s},t.prototype.onInit=function(t,e){var n,r=this.normalizeInstanceIdentifier(e),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(t),this.onInitCallbacks.set(r,i);var o=this.instances.get(r);return o&&t(o,r),function(){i.delete(t)}},t.prototype.invokeOnInitCallbacks=function(t,e){var n,i,o=this.onInitCallbacks.get(e);if(o)try{for(var a=(0,r.XA)(o),s=a.next();!s.done;s=a.next()){var u=s.value;try{u(t,e)}catch(t){}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.getOrInitializeService=function(t){var e,n=t.instanceIdentifier,r=t.options,i=void 0===r?{}:r,o=this.instances.get(n);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:(e=n,e===a?void 0:e),options:i}),this.instances.set(n,o),this.instancesOptions.set(n,i),this.invokeOnInitCallbacks(o,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,o)}catch(t){}return o||null},t.prototype.normalizeInstanceIdentifier=function(t){return void 0===t&&(t=a),this.component?this.component.multipleInstances?t:a:t},t.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},t}(),u=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},9446:(t,e,n)=>{"use strict";var r=n(6099),i=n(909),o=n(4589),a=n(655),s=n(4594);t=n.hmd(t);var u="";function c(t){u=t}var l,h=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),(0,o.Pz)(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:(0,o.cI)(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),f=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return(0,o.r3)(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),d=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new h(e)}}catch(t){}return new f},p=d("localStorage"),m=d("sessionStorage"),y=new s.Yd("@firebase/database"),g=(l=1,function(){return l++}),v=function(t){var e=(0,o.dS)(t),n=new o.gQ;n.update(e);var r=n.digest();return o.US.encodeByteArray(r)},_=function(){for(var t=[],e=0;en?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function F(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var L=function(t){(0,o.hu)(!A(t),"Invalid JSON number");var e,n,r,i,a;0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));var s=[];for(a=52;a;a-=1)s.push(r%2?1:0),r=Math.floor(r/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=Math.floor(n/2);s.push(e?1:0),s.reverse();var u=s.join(""),c="";for(a=0;a<64;a+=8){var l=parseInt(u.substr(a,8),2).toString(16);1===l.length&&(l="0"+l),c+=l}return c.toLowerCase()},j=new RegExp("^-?(0*)\\d{1,10}$"),q=function(t){if(j.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},U=function(t){try{t()}catch(t){setTimeout((function(){var e=t.stack||"";throw E("Exception was thrown by user callback.",e),t}),Math.floor(0))}},B=function(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n},W=function(){function t(t,e){var n=this;this.appName_=t,this.appCheckProvider=e,this.appCheck=null==e?void 0:e.getImmediate({optional:!0}),this.appCheck||null==e||e.get().then((function(t){return n.appCheck=t}))}return t.prototype.getToken=function(t){var e=this;return this.appCheck?this.appCheck.getToken(t):new Promise((function(n,r){setTimeout((function(){e.appCheck?e.getToken(t).then(n,r):n(null)}),0)}))},t.prototype.addTokenChangeListener=function(t){var e;null===(e=this.appCheckProvider)||void 0===e||e.get().then((function(e){return e.addTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){E('Provided AppCheck credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly.')},t}(),z=function(){function t(t,e,n){var r=this;this.appName_=t,this.firebaseOptions_=e,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit((function(t){return r.auth_=t}))}return t.prototype.getToken=function(t){var e=this;return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(C("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})):new Promise((function(n,r){setTimeout((function(){e.auth_?e.getToken(t).then(n,r):n(null)}),0)}))},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)}))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',E(t)},t}(),H=function(){function t(t){this.accessToken=t}return t.prototype.getToken=function(t){return Promise.resolve({accessToken:this.accessToken})},t.prototype.addTokenChangeListener=function(t){t(this.accessToken)},t.prototype.removeTokenChangeListener=function(t){},t.prototype.notifyForInvalidToken=function(){},t.OWNER="owner",t}(),$=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Y="websocket",V="long_polling",G=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===a&&(a=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=t.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=p.get("host:"+t)||this._host}return t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain},Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&p.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){var t=this.secure?"https://":"http://",e=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+t+this.host+"/"+e},t}();function K(t,e,n){var r;if((0,o.hu)("string"==typeof e,"typeof type must == string"),(0,o.hu)("object"==typeof n,"typeof params must == object"),e===Y)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else{if(e!==V)throw new Error("Unknown connection type: "+e);r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?"}(function(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams})(t)&&(n.ns=t.namespace);var i=[];return F(n,(function(t,e){i.push(t+"="+e)})),r+i.join("&")}var Q=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),(0,o.r3)(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return(0,o.p$)(this.counters_)},t}(),Z={},J={};function X(t){var e=t.toString();return Z[e]||(Z[e]=new Q),Z[e]}var tt=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponsedocument.domain="'+document.domain+'";<\/script>');var s=""+a+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(t){C("frame writing exception"),t.stack&&C(t.stack),C(t)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||C("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)}),Math.floor(0)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+n.length<=1870;){var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e);var r=function(){n.outstandingRequests.delete(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;(0,o.Yr)()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){C("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(t){}}),Math.floor(1))},t}(),ot=null;"undefined"!=typeof MozWebSocket?ot=MozWebSocket:"undefined"!=typeof WebSocket&&(ot=WebSocket);var at=function(){function t(e,n,r,i,o,a,s){this.connId=e,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=k(this.connId),this.stats_=X(n),this.connURL=t.connectionURL_(n,a,s,i),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(t,e,n,r){var i={v:"5"};return!(0,o.Yr)()&&"undefined"!=typeof location&&location.hostname&&$.test(location.hostname)&&(i.r="f"),e&&(i.s=e),n&&(i.ls=n),r&&(i.ac=r),K(t,Y,i)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,p.set("previous_websocket_failure",!0);try{if((0,o.Yr)()){var r=this.nodeAdmin?"AdminNode":"Node",i={headers:{"User-Agent":"Firebase/5/"+u+"/"+process.platform+"/"+r,"X-Firebase-GMPID":this.applicationId||""}};this.authToken&&(i.headers.Authorization="Bearer "+this.authToken),this.appCheckToken&&(i.headers["X-Firebase-AppCheck"]=this.appCheckToken);var a=process.env,s=0===this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;s&&(i.proxy={origin:s}),this.mySock=new ot(this.connURL,[],i)}else i={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}},this.mySock=new ot(this.connURL,[],i)}catch(t){this.log_("Error instantiating WebSocket.");var c=t.message||t.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error. Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==ot&&!t.forceDisallow_},t.previouslyFailed=function(){return p.isInMemoryStorage||!0===p.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){p.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var n=(0,o.cI)(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if((0,o.hu)(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=(0,o.Pz)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=R(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),ut=function(){function t(t,e,n,r,i,o,a,s,u,c){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=u,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=k("c:"+this.id+":"),this.transportManager_=new st(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=B((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes. Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes. Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=D("t",t),n=D("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=D("t",t),n=D("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=D("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function mt(t){return t.pieces_.length-t.pieceNum_}function yt(t){var e=t.pieceNum_;return e=t.pieces_.length)return null;for(var e=[],n=t.pieceNum_;n0&&n.push(i[r])}return new ft(n,0)}function wt(t){return t.pieceNum_>=t.pieces_.length}function St(t,e){var n=pt(t),r=pt(e);if(null===n)return e;if(n===r)return St(yt(t),yt(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Ct(t,e){for(var n=vt(t,0),r=vt(e,0),i=0;imt(e))return!1;for(;n768)throw new Error(t.errorPrefix_+"has a key path longer than 768 bytes ("+t.byteLength_+").");if(t.parts_.length>32)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+At(t))}function At(t){return 0===t.parts_.length?"":"in property '"+t.parts_.join(".")+"'"}var Pt,Mt,Nt=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",e="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return(0,a.ZT)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return(0,o.hu)("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(lt),It=1e3,Dt=function(t){function e(n,r,i,a,s,u,c,l){var h=t.call(this)||this;if(h.repoInfo_=n,h.applicationId_=r,h.onDataUpdate_=i,h.onConnectStatus_=a,h.onServerInfoUpdate_=s,h.authTokenProvider_=u,h.appCheckTokenProvider_=c,h.authOverride_=l,h.id=e.nextPersistentConnectionId_++,h.log_=k("p:"+h.id+":"),h.interruptReasons_={},h.listens=new Map,h.outstandingPuts_=[],h.outstandingGets_=[],h.outstandingPutCount_=0,h.outstandingGetCount_=0,h.onDisconnectRequestQueue_=[],h.connected_=!1,h.reconnectDelay_=It,h.maxReconnectDelay_=3e5,h.securityDebugCallback_=null,h.lastSessionId=null,h.establishConnectionTimer_=null,h.visible_=!1,h.requestCBHash_={},h.requestNumber_=0,h.realtime_=null,h.authToken_=null,h.appCheckToken_=null,h.forceTokenRefresh_=!1,h.invalidAuthTokenCount_=0,h.invalidAppCheckTokenCount_=0,h.firstConnection_=!0,h.lastConnectionAttemptTime_=null,h.lastConnectionEstablishedTime_=null,l&&!(0,o.Yr)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return Nt.getInstance().on("visible",h.onVisible_,h),-1===n.host.indexOf("fblocal")&&ht.getInstance().on("online",h.onOnline_,h),h}return(0,a.ZT)(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r,a:t,b:e};this.log_((0,o.Pz)(i)),(0,o.hu)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.get=function(t){var e=this;this.initConnection_();var n=new o.BH,r={p:t._path.toString(),q:t._queryObject},i={action:"g",request:r,onComplete:function(t){var i=t.d;"ok"===t.s?(e.onDataUpdate_(r.p,i,!1,null),n.resolve(i)):n.reject(i)}};this.outstandingGets_.push(i),this.outstandingGetCount_++;var a=this.outstandingGets_.length-1;return this.connected_||setTimeout((function(){var t=e.outstandingGets_[a];void 0!==t&&i===t&&(delete e.outstandingGets_[a],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),e.log_("get "+a+" timed out on connection"),n.reject(new Error("Client is offline.")))}),3e3),this.connected_&&this.sendGet_(a),n.promise},e.prototype.listen=function(t,e,n,r){this.initConnection_();var i=t._queryIdentifier,a=t._path.toString();this.log_("Listen called for "+a+" "+i),this.listens.has(a)||this.listens.set(a,new Map),(0,o.hu)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),(0,o.hu)(!this.listens.get(a).has(i),"listen() called twice for same path/queryId.");var s={onComplete:r,hashFn:e,query:t,tag:n};this.listens.get(a).set(i,s),this.connected_&&this.sendListen_(s)},e.prototype.sendGet_=function(t){var e=this,n=this.outstandingGets_[t];this.sendRequest("g",n.request,(function(r){delete e.outstandingGets_[t],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),n.onComplete&&n.onComplete(r)}))},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);var a={p:i};t.tag&&(a.q=r._queryObject,a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,u=a.s;e.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===t&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,s))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"==typeof t&&(0,o.r3)(t,"w")){var n=(0,o.DV)(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e._queryParams.getIndex().toString()+'"',i=e._path.toString();E("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||(0,o.GJ)(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.refreshAppCheckToken=function(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(function(){}))},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=(0,o.w9)(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.tryAppCheck=function(){var t=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(function(e){var n=e.s,r=e.d||"error";"ok"===n?t.invalidAppCheckTokenCount_=0:t.onAppCheckRevoked_(n,r)}))},e.prototype.unlisten=function(t,e){var n=t._path.toString(),r=t._queryIdentifier;this.log_("Unlisten called for "+n+" "+r),(0,o.hu)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t._queryObject,e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){this.initConnection_();var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){if("ok"!==t.s){var n=t.d;e.log_("reportStats","Error sending stats: "+n)}}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+(0,o.Pz)(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"apc"===t?this.onAppCheckRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):x("Unrecognized action received from server: "+(0,o.Pz)(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;(0,o.hu)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=It,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=It,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&((new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=It),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime());var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){return(0,a.mG)(this,void 0,void 0,(function(){var t,n,r,i,s,u,c,l,h,f,d,p,m,y,g=this;return(0,a.Jh)(this,(function(v){switch(v.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null,t=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,s=this.lastSessionId,u=!1,c=null,l=function(){c?c.close():(u=!0,r())},h=function(t){(0,o.hu)(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(t)},this.realtime_={close:l,sendRequest:h},f=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(f),this.appCheckTokenProvider_.getToken(f)])];case 2:return d=a.CR.apply(void 0,[v.sent(),2]),p=d[0],m=d[1],u?C("getToken() completed but was canceled"):(C("getToken() completed. Creating connection."),this.authToken_=p&&p.accessToken,this.appCheckToken_=m&&m.token,c=new ut(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,n,r,(function(t){E(t+" ("+g.repoInfo_.toString()+")"),g.interrupt("server_kill")}),s)),[3,4];case 3:return y=v.sent(),this.log_("Failed to get token: "+y),u||(this.repoInfo_.nodeAdmin&&E(y),l()),[3,4];case 4:return[2]}}))}))},e.prototype.interrupt=function(t){C("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){C("Resuming connection for reason: "+t),delete this.interruptReasons_[t],(0,o.xb)(this.interruptReasons_)&&(this.reconnectDelay_=It,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onAppCheckRevoked_=function(t,e){C("App check token revoked: "+t+"/"+e),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t,e,n,r;this.tryAuth(),this.tryAppCheck();try{for(var i=(0,a.XA)(this.listens.values()),o=i.next();!o.done;o=i.next()){var s=o.value;try{for(var u=(n=void 0,(0,a.XA)(s.values())),c=u.next();!c.done;c=u.next()){var l=c.value;this.sendListen_(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}for(var h=0;h0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),qt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Bt.EMPTY_NODE,this.right=null!=o?o:Bt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Bt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Bt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Ut=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new qt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Bt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,qt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,qt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new jt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new jt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new jt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new jt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Ut,t}();function Wt(t,e){return N(t.name,e.name)}function zt(t,e){return N(t,e)}var Ht,$t,Yt,Vt,Gt,Kt=function(t){return"number"==typeof t?"number:"+L(t):"string:"+t},Qt=function(t){if(t.isLeafNode()){var e=t.val();(0,o.hu)("string"==typeof e||"number"==typeof e||"object"==typeof e&&(0,o.r3)(e,".sv"),"Priority must be a string or number.")}else(0,o.hu)(t===Mt||t.isEmpty(),"priority of unexpected type.");(0,o.hu)(t===Mt||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Zt=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,(0,o.hu)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Qt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return Ht},set:function(t){Ht=t},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return wt(e)?this:".priority"===pt(e)?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=pt(e);return null===r?n:n.isEmpty()&&".priority"!==r?this:((0,o.hu)(".priority"!==r||1===mt(e),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(yt(e),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+Kt(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?L(this.value_):this.value_,this.lazyHash_=v(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:((0,o.hu)(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),a=t.VALUE_TYPE_ORDER.indexOf(r);return(0,o.hu)(i>=0,"Unknown leaf type: "+n),(0,o.hu)(a>=0,"Unknown leaf type: "+r),i===a?"object"===r?0:this.value_0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===oe?-1:0},t.prototype.withIndex=function(e){if(e===Lt||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Lt||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(Jt),r=e.getIterator(Jt),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Lt?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),oe=new(function(t){function e(){return t.call(this,new Bt(zt),ie.EMPTY_NODE,re.Default)||this}return(0,a.ZT)(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return ie.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(ie));function ae(t,e){if(void 0===e&&(e=null),null===t)return ie.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),(0,o.hu)(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new Zt(t,ae(e));if(t instanceof Array){var n=ie.EMPTY_NODE;return F(t,(function(e,r){if((0,o.r3)(t,e)&&"."!==e.substring(0,1)){var i=ae(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(e,i))}})),n.updatePriority(ae(e))}var r=[],i=!1;if(F(t,(function(t,e){if("."!==t.substring(0,1)){var n=ae(e);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new Ot(t,n)))}})),0===r.length)return ie.EMPTY_NODE;var a=ee(r,Wt,(function(t){return t.name}),zt);if(i){var s=ee(r,Jt.getCompare());return new ie(a,ae(e),new re({".priority":s},{".priority":Jt}))}return new ie(a,ae(e),re.Default)}Object.defineProperties(Ot,{MIN:{value:new Ot(P,ie.EMPTY_NODE)},MAX:{value:new Ot(M,oe)}}),Ft.__EMPTY_NODE=ie.EMPTY_NODE,Zt.__childrenNodeConstructor=ie,Mt=oe,Yt=oe,function(t){$t=t}(ae);var se,ue,ce=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,(0,o.hu)(!wt(e)&&".priority"!==pt(e),"Can't create PathIndex with empty path or .priority key"),n}return(0,a.ZT)(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?N(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=ae(t),r=ie.EMPTY_NODE.updateChild(this.indexPath_,n);return new Ot(e,r)},e.prototype.maxPost=function(){var t=ie.EMPTY_NODE.updateChild(this.indexPath_,oe);return new Ot(M,t)},e.prototype.toString=function(){return vt(this.indexPath_,0).join("/")},e}(Rt),le=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.ZT)(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?N(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return Ot.MIN},e.prototype.maxPost=function(){return Ot.MAX},e.prototype.makePost=function(t,e){var n=ae(t);return new Ot(e,n)},e.prototype.toString=function(){return".value"},e}(Rt)),he="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",fe=(se=0,ue=[],function(t){var e,n=t===se;se=t;var r=new Array(8);for(e=7;e>=0;e--)r[e]=he.charAt(t%64),t=Math.floor(t/64);(0,o.hu)(0===t,"Cannot push at time == 0");var i=r.join("");if(n){for(e=11;e>=0&&63===ue[e];e--)ue[e]=0;ue[e]++}else for(e=0;e<12;e++)ue[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)i+=he.charAt(ue[e]);return(0,o.hu)(20===i.length,"nextPushId: Length should be 20."),i}),de=function(t){if("2147483647"===t)return"-";var e=q(t);if(null!=e)return""+(e+1);for(var n=new Array(t.length),r=0;r=0&&"z"===n[i];)i--;if(-1===i)return M;var o=n[i],a=he.charAt(he.indexOf(o)+1);return n[i]=a,n.slice(0,i+1).join("")},pe=function(t){if("-2147483648"===t)return P;var e=q(t);if(null!=e)return""+(e-1);for(var n=new Array(t.length),r=0;r=0)return null!=i&&i.trackChildChange(ve(e,n,f)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(ge(e,f));var m=u.updateImmediateChild(e,ie.EMPTY_NODE);return null!=d&&this.rangedFilter_.matches(d)?(null!=i&&i.trackChildChange(ye(d.name,d.node)),m.updateImmediateChild(d.name,d.node)):m}return n.isEmpty()?t:h&&a(l,c)>=0?(null!=i&&(i.trackChildChange(ge(l.name,l.node)),i.trackChildChange(ye(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(l.name,ie.EMPTY_NODE)):t},t}(),Se=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Jt}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.hasStartAfter=function(){return this.startAfterSet_},t.prototype.hasEndBefore=function(){return this.endBeforeSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_},t.prototype.getIndexStartValue=function(){return(0,o.hu)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return(0,o.hu)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:P},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return(0,o.hu)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return(0,o.hu)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:M},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return(0,o.hu)(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Jt},t.prototype.copy=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t}();function Ce(t,e,n){var r=t.copy();return r.startSet_=!0,void 0===e&&(e=null),r.indexStartValue_=e,null!=n?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function ke(t,e,n){var r=t.copy();return r.endSet_=!0,void 0===e&&(e=null),r.indexEndValue_=e,void 0!==n?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function xe(t,e){var n=t.copy();return n.index_=e,n}function Te(t){var e,n={};return t.isDefault()||(t.index_===Jt?e="$priority":t.index_===le?e="$value":t.index_===Lt?e="$key":((0,o.hu)(t.index_ instanceof ce,"Unrecognized index type!"),e=t.index_.toString()),n.orderBy=(0,o.Pz)(e),t.startSet_&&(n.startAt=(0,o.Pz)(t.indexStartValue_),t.startNameSet_&&(n.startAt+=","+(0,o.Pz)(t.indexStartName_))),t.endSet_&&(n.endAt=(0,o.Pz)(t.indexEndValue_),t.endNameSet_&&(n.endAt+=","+(0,o.Pz)(t.indexEndName_))),t.limitSet_&&(t.isViewFromLeft()?n.limitToFirst=t.limit_:n.limitToLast=t.limit_)),n}function Ee(t){var e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_)),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_)),t.limitSet_){e.l=t.limit_;var n=t.viewFrom_;""===n&&(n=t.isViewFromLeft()?"l":"r"),e.vf=n}return t.index_!==Jt&&(e.i=t.index_.toString()),e}var Ae=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.repoInfo_=e,o.onDataUpdate_=n,o.authTokenProvider_=r,o.appCheckTokenProvider_=i,o.log_=k("p:rest:"),o.listens_={},o}return(0,a.ZT)(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:((0,o.hu)(t._queryParams.isDefault(),"should have a tag if it's not a default query."),t._path.toString())},e.prototype.listen=function(t,n,r,i){var a=this,s=t._path.toString();this.log_("Listen called for "+s+" "+t._queryIdentifier);var u=e.getListenId_(t,r),c={};this.listens_[u]=c;var l=Te(t._queryParams);this.restRequest_(s+".json",l,(function(t,e){var n=e;404===t&&(n=null,t=null),null===t&&a.onDataUpdate_(s,n,!1,r),(0,o.DV)(a.listens_,u)===c&&i(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.get=function(t){var e=this,n=Te(t._queryParams),r=t._path.toString(),i=new o.BH;return this.restRequest_(r+".json",n,(function(t,n){var o=n;404===t&&(o=null,t=null),null===t?(e.onDataUpdate_(r,o,!1,null),i.resolve(o)):i.reject(new Error(o))})),i.promise},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;return void 0===e&&(e={}),e.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((function(i){var s=(0,a.CR)(i,2),u=s[0],c=s[1];u&&u.accessToken&&(e.auth=u.accessToken),c&&c.token&&(e.ac=c.token);var l=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+(0,o.xO)(e);r.log_("Sending REST request for "+l);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(n&&4===h.readyState){r.log_("REST Response for "+l+" received. status:",h.status,"response:",h.responseText);var t=null;if(h.status>=200&&h.status<300){try{t=(0,o.cI)(h.responseText)}catch(t){E("Failed to parse JSON response for "+l+": "+h.responseText)}n(null,t)}else 401!==h.status&&404!==h.status&&E("Got unsuccessful REST response for "+l+" Status: "+h.status),n(h.status);n=null}},h.open("GET",l,!0),h.send()}))},e}(ct),Pe=function(){function t(){this.rootNode_=ie.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}();function Me(){return{value:null,children:new Map}}function Ne(t,e,n){if(wt(e))t.value=n,t.children.clear();else if(null!==t.value)t.value=t.value.updateChild(e,n);else{var r=pt(e);t.children.has(r)||t.children.set(r,Me()),Ne(t.children.get(r),e=yt(e),n)}}function Ie(t,e){if(wt(e))return t.value=null,t.children.clear(),!0;if(null!==t.value){if(t.value.isLeafNode())return!1;var n=t.value;return t.value=null,n.forEachChild(Jt,(function(e,n){Ne(t,new ft(e),n)})),Ie(t,e)}if(t.children.size>0){var r=pt(e);return e=yt(e),t.children.has(r)&&Ie(t.children.get(r),e)&&t.children.delete(r),0===t.children.size}return!0}function De(t,e,n){null!==t.value?n(e,t.value):function(t,e){t.children.forEach((function(t,n){e(n,t)}))}(t,(function(t,r){De(r,new ft(e.toString()+"/"+t),n)}))}var Oe,Re=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=(0,a.pi)({},t);return this.last_&&F(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),Fe=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Re(t);var n=1e4+2e4*Math.random();B(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;F(e,(function(e,i){i>0&&(0,o.r3)(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),B(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}();function Le(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(Oe||(Oe={}));var je,qe=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=Oe.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}return t.prototype.operationForChild=function(e){if(wt(this.path)){if(null!=this.affectedTree.value)return(0,o.hu)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new ft(e));return new t(dt(),n,this.revert)}return(0,o.hu)(pt(this.path)===e,"operationForChild called for unrelated child."),new t(yt(this.path),this.affectedTree,this.revert)},t}(),Ue=function(){function t(t,e){this.source=t,this.path=e,this.type=Oe.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return wt(this.path)?new t(this.source,dt()):new t(this.source,yt(this.path))},t}(),Be=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=Oe.OVERWRITE}return t.prototype.operationForChild=function(e){return wt(this.path)?new t(this.source,dt(),this.snap.getImmediateChild(e)):new t(this.source,yt(this.path),this.snap)},t}(),We=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=Oe.MERGE}return t.prototype.operationForChild=function(e){if(wt(this.path)){var n=this.children.subtree(new ft(e));return n.isEmpty()?null:n.value?new Be(this.source,dt(),n.value):new t(this.source,dt(),n)}return(0,o.hu)(pt(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,yt(this.path),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),ze=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(wt(t))return this.isFullyInitialized()&&!this.filtered_;var e=pt(t);return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),He=function(t){this.query_=t,this.index_=this.query_._queryParams.getIndex()};function $e(t,e,n,r,i,a){var s=r.filter((function(t){return t.type===n}));s.sort((function(e,n){return function(t,e,n){if(null==e.childName||null==n.childName)throw(0,o.g5)("Should only compare child_ events.");var r=new Ot(e.childName,e.snapshotNode),i=new Ot(n.childName,n.snapshotNode);return t.index_.compare(r,i)}(t,e,n)})),s.forEach((function(n){var r=function(t,e,n){return"value"===e.type||"child_removed"===e.type||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}(t,n,a);i.forEach((function(i){i.respondsTo(n.type)&&e.push(i.createEvent(r,t.query_))}))}))}function Ye(t,e){return{eventCache:t,serverCache:e}}function Ve(t,e,n,r){return Ye(new ze(e,n,r),t.serverCache)}function Ge(t,e,n,r){return Ye(t.eventCache,new ze(e,n,r))}function Ke(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Qe(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}var Ze=function(){function t(t,e){void 0===e&&(je||(je=new Bt(I)),e=je),this.value=t,this.children=e}return t.fromObject=function(e){var n=new t(null);return F(e,(function(t,e){n=n.set(new ft(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:dt(),value:this.value};if(wt(t))return null;var n=pt(t),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(yt(t),e);return null!=i?{path:bt(new ft(n),i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(wt(e))return this;var n=pt(e),r=this.children.get(n);return null!==r?r.subtree(yt(e)):new t(null)},t.prototype.set=function(e,n){if(wt(e))return new t(n,this.children);var r=pt(e),i=(this.children.get(r)||new t(null)).set(yt(e),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(wt(e))return this.children.isEmpty()?new t(null):new t(null,this.children);var n=pt(e),r=this.children.get(n);if(r){var i=r.remove(yt(e)),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?new t(null):new t(this.value,o)}return this},t.prototype.get=function(t){if(wt(t))return this.value;var e=pt(t),n=this.children.get(e);return n?n.get(yt(t)):null},t.prototype.setTree=function(e,n){if(wt(e))return n;var r,i=pt(e),o=(this.children.get(i)||new t(null)).setTree(yt(e),n);return r=o.isEmpty()?this.children.remove(i):this.children.insert(i,o),new t(this.value,r)},t.prototype.fold=function(t){return this.fold_(dt(),t)},t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(bt(t,r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,dt(),e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(wt(t))return null;var i=pt(t),o=this.children.get(i);return o?o.findOnPath_(yt(t),bt(e,i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,dt(),e)},t.prototype.foreachOnPath_=function(e,n,r){if(wt(e))return this;this.value&&r(n,this.value);var i=pt(e),o=this.children.get(i);return o?o.foreachOnPath_(yt(e),bt(n,i),r):new t(null)},t.prototype.foreach=function(t){this.foreach_(dt(),t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(bt(t,n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){n.value&&t(e,n.value)}))},t}(),Je=function(){function t(t){this.writeTree_=t}return t.empty=function(){return new t(new Ze(null))},t}();function Xe(t,e,n){if(wt(e))return new Je(new Ze(n));var r=t.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,a=St(i,e);return o=o.updateChild(a,n),new Je(t.writeTree_.set(i,o))}var s=new Ze(n),u=t.writeTree_.setTree(e,s);return new Je(u)}function tn(t,e,n){var r=t;return F(n,(function(t,n){r=Xe(r,bt(e,t),n)})),r}function en(t,e){if(wt(e))return Je.empty();var n=t.writeTree_.setTree(e,new Ze(null));return new Je(n)}function nn(t,e){return null!=rn(t,e)}function rn(t,e){var n=t.writeTree_.findRootMostValueAndPath(e);return null!=n?t.writeTree_.get(n.path).getChild(St(n.path,e)):null}function on(t){var e=[],n=t.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(Jt,(function(t,n){e.push(new Ot(t,n))})):t.writeTree_.children.inorderTraversal((function(t,n){null!=n.value&&e.push(new Ot(t,n.value))})),e}function an(t,e){if(wt(e))return t;var n=rn(t,e);return new Je(null!=n?new Ze(n):t.writeTree_.subtree(e))}function sn(t){return t.writeTree_.isEmpty()}function un(t,e){return cn(dt(),t.writeTree_,e)}function cn(t,e,n){if(null!=e.value)return n.updateChild(t,e.value);var r=null;return e.children.inorderTraversal((function(e,i){".priority"===e?((0,o.hu)(null!==i.value,"Priority writes must always be leaf nodes"),r=i.value):n=cn(bt(t,e),i,n)})),n.getChild(t).isEmpty()||null===r||(n=n.updateChild(bt(t,".priority"),r)),n}function ln(t,e){return wn(e,t)}function hn(t,e){if(t.snap)return xt(t.path,e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&xt(bt(t.path,n),e))return!0;return!1}function fn(t){return t.visible}function dn(t,e,n){for(var r=Je.empty(),i=0;i1)return e;var d=yt(n),p=c.getNode().getImmediateChild(f).updateChild(d,r);u=".priority"===f?l.updatePriority(c.getNode(),p):l.updateChild(c.getNode(),f,p,d,Cn,null)}var m=Ge(e,u,c.isFullyInitialized()||wt(n),l.filtersNodes());return xn(t,m,n,i,new kn(i,m,o),s)}function En(t,e,n,r,i,o,a){var s,u,c=e.eventCache,l=new kn(i,e,o);if(wt(n))u=t.filter.updateFullNode(e.eventCache.getNode(),r,a),s=Ve(e,u,!0,t.filter.filtersNodes());else{var h=pt(n);if(".priority"===h)u=t.filter.updatePriority(e.eventCache.getNode(),r),s=Ve(e,u,c.isFullyInitialized(),c.isFiltered());else{var f=yt(n),d=c.getNode().getImmediateChild(h),p=void 0;if(wt(f))p=r;else{var m=l.getCompleteChild(h);p=null!=m?".priority"===gt(f)&&m.getChild(_t(f)).isEmpty()?m:m.updateChild(f,r):ie.EMPTY_NODE}s=d.equals(p)?e:Ve(e,t.filter.updateChild(c.getNode(),h,p,f,l,a),c.isFullyInitialized(),t.filter.filtersNodes())}}return s}function An(t,e){return t.eventCache.isCompleteForChild(e)}function Pn(t,e,n){return n.foreach((function(t,n){e=e.updateChild(t,n)})),e}function Mn(t,e,n,r,i,o,a,s){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;var u,c=e;u=wt(n)?r:new Ze(null).setTree(n,r);var l=e.serverCache.getNode();return u.children.inorderTraversal((function(n,r){if(l.hasChild(n)){var u=Pn(0,e.serverCache.getNode().getImmediateChild(n),r);c=Tn(t,c,new ft(n),u,i,o,a,s)}})),u.children.inorderTraversal((function(n,r){var u=!e.serverCache.isCompleteForChild(n)&&void 0===r.value;if(!l.hasChild(n)&&!u){var h=Pn(0,e.serverCache.getNode().getImmediateChild(n),r);c=Tn(t,c,new ft(n),h,i,o,a,s)}})),c}var Nn,In=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n,r=this.query_._queryParams,i=new _e(r.getIndex()),o=(n=r).loadsAllData()?new _e(n.getIndex()):n.hasLimit()?new we(n):new be(n);this.processor_=function(t){return{filter:t}}(o);var a=e.serverCache,s=e.eventCache,u=i.updateFullNode(ie.EMPTY_NODE,a.getNode(),null),c=o.updateFullNode(ie.EMPTY_NODE,s.getNode(),null),l=new ze(u,a.isFullyInitialized(),i.filtersNodes()),h=new ze(c,s.isFullyInitialized(),o.filtersNodes());this.viewCache_=Ye(h,l),this.eventGenerator_=new He(this.query_)}return Object.defineProperty(t.prototype,"query",{get:function(){return this.query_},enumerable:!1,configurable:!0}),t}();function Dn(t,e){var n=Qe(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!wt(e)&&!n.getImmediateChild(pt(e)).isEmpty())?n.getChild(e):null}function On(t){return 0===t.eventRegistrations_.length}function Rn(t,e,n){var r=[];if(n){(0,o.hu)(null==e,"A cancel should cancel all event registrations.");var i=t.query._path;t.eventRegistrations_.forEach((function(t){var e=t.createCancelEvent(n,i);e&&r.push(e)}))}if(e){for(var a=[],s=0;s0||!t.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(me(Ke(e)))}}(e,a,f),{viewCache:a,changes:f}}(t.processor_,s,e,n,r);return i=t.processor_,a=u.viewCache,(0,o.hu)(a.eventCache.getNode().isIndexed(i.filter.getIndex()),"Event snap not indexed"),(0,o.hu)(a.serverCache.getNode().isIndexed(i.filter.getIndex()),"Server snap not indexed"),(0,o.hu)(u.viewCache.serverCache.isFullyInitialized()||!s.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=u.viewCache,Ln(t,u.changes,u.viewCache.eventCache.getNode(),null)}function Ln(t,e,n,r){var i=r?[r]:t.eventRegistrations_;return function(t,e,n,r){var i=[],o=[];return e.forEach((function(e){var n;"child_changed"===e.type&&t.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push((n=e.childName,{type:"child_moved",snapshotNode:e.snapshotNode,childName:n}))})),$e(t,i,"child_removed",e,r,n),$e(t,i,"child_added",e,r,n),$e(t,i,"child_moved",o,r,n),$e(t,i,"child_changed",e,r,n),$e(t,i,"value",e,r,n),i}(t.eventGenerator_,e,n,i)}var jn,qn=function(){this.views=new Map};function Un(t,e,n,r){var i,s,u=e.source.queryId;if(null!==u){var c=t.views.get(u);return(0,o.hu)(null!=c,"SyncTree gave us an op for an invalid query."),Fn(c,e,n,r)}var l=[];try{for(var h=(0,a.XA)(t.views.values()),f=h.next();!f.done;f=h.next())c=f.value,l=l.concat(Fn(c,e,n,r))}catch(t){i={error:t}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l}function Bn(t,e,n,r,i){var o=e._queryIdentifier,a=t.views.get(o);if(!a){var s=mn(n,i?r:null),u=!1;s?u=!0:r instanceof ie?(s=yn(n,r),u=!1):(s=ie.EMPTY_NODE,u=!1);var c=Ye(new ze(s,u,!1),new ze(r,i,!1));return new In(e,c)}return a}function Wn(t){var e,n,r=[];try{for(var i=(0,a.XA)(t.views.values()),o=i.next();!o.done;o=i.next()){var s=o.value;s.query._queryParams.loadsAllData()||r.push(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function zn(t,e){var n,r,i=null;try{for(var o=(0,a.XA)(t.views.values()),s=o.next();!s.done;s=o.next()){var u=s.value;i=i||Dn(u,e)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}function Hn(t,e){if(e._queryParams.loadsAllData())return Vn(t);var n=e._queryIdentifier;return t.views.get(n)}function $n(t,e){return null!=Hn(t,e)}function Yn(t){return null!=Vn(t)}function Vn(t){var e,n;try{for(var r=(0,a.XA)(t.views.values()),i=r.next();!i.done;i=r.next()){var o=i.value;if(o.query._queryParams.loadsAllData())return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null}var Gn=1,Kn=function(t){this.listenProvider_=t,this.syncPointTree_=new Ze(null),this.pendingWriteTree_={visibleWrites:Je.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map};function Qn(t,e,n,r,i){return function(t,e,n,r,i){(0,o.hu)(r>t.lastWriteId,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:i}),i&&(t.visibleWrites=Xe(t.visibleWrites,e,n)),t.lastWriteId=r}(t.pendingWriteTree_,e,n,r,i),i?nr(t,new Be({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,n)):[]}function Zn(t,e,n){void 0===n&&(n=!1);var r=function(t,e){for(var n=0;n=0,"removeWrite called with nonexistent writeId.");var r=t.allWrites[n];t.allWrites.splice(n,1);for(var i=r.visible,a=!1,s=t.allWrites.length-1;i&&s>=0;){var u=t.allWrites[s];u.visible&&(s>=n&&hn(u,r.path)?i=!1:xt(r.path,u.path)&&(a=!0)),s--}return!!i&&(a?(function(t){t.visibleWrites=dn(t.allWrites,fn,dt()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}(t),!0):(r.snap?t.visibleWrites=en(t.visibleWrites,r.path):F(r.children,(function(e){t.visibleWrites=en(t.visibleWrites,bt(r.path,e))})),!0))}(t.pendingWriteTree_,e)){var i=new Ze(null);return null!=r.snap?i=i.set(dt(),!0):F(r.children,(function(t){i=i.set(new ft(t),!0)})),nr(t,new qe(r.path,i,n))}return[]}function Jn(t,e,n){return nr(t,new Be({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,n))}function Xn(t,e,n,r){var i=e._path,s=t.syncPointTree_.get(i),u=[];if(s&&("default"===e._queryIdentifier||$n(s,e))){var c=function(t,e,n,r){var i,s,u=e._queryIdentifier,c=[],l=[],h=Yn(t);if("default"===u)try{for(var f=(0,a.XA)(t.views.entries()),d=f.next();!d.done;d=f.next()){var p=(0,a.CR)(d.value,2),m=p[0],y=p[1];l=l.concat(Rn(y,n,r)),On(y)&&(t.views.delete(m),y.query._queryParams.loadsAllData()||c.push(y.query))}}catch(t){i={error:t}}finally{try{d&&!d.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}else(y=t.views.get(u))&&(l=l.concat(Rn(y,n,r)),On(y)&&(t.views.delete(u),y.query._queryParams.loadsAllData()||c.push(y.query)));return h&&!Yn(t)&&c.push(new((0,o.hu)(Nn,"Reference.ts has not been loaded"),Nn)(e._repo,e._path)),{removed:c,events:l}}(s,e,n,r);0===s.views.size&&(t.syncPointTree_=t.syncPointTree_.remove(i));var l=c.removed;u=c.events;var h=-1!==l.findIndex((function(t){return t._queryParams.loadsAllData()})),f=t.syncPointTree_.findOnPath(i,(function(t,e){return Yn(e)}));if(h&&!f){var d=t.syncPointTree_.subtree(i);if(!d.isEmpty())for(var p=function(t){return t.fold((function(t,e,n){if(e&&Yn(e))return[Vn(e)];var r=[];return e&&(r=Wn(e)),F(n,(function(t,e){r=r.concat(e)})),r}))}(d),m=0;m0&&!r&&(h?t.listenProvider_.stopListening(hr(e),null):l.forEach((function(e){var n=t.queryToTagMap.get(sr(e));t.listenProvider_.stopListening(hr(e),n)}))),function(t,e){for(var n=0;n0}function xr(t,e){F(t.node.children,(function(n,r){e(new br(n,t,r))}))}function Tr(t,e,n,r){n&&!r&&e(t),xr(t,(function(t){Tr(t,e,!0,r)})),n&&r&&e(t)}function Er(t){return new ft(null===t.parent?t.name:Er(t.parent)+"/"+t.name)}function Ar(t){null!==t.parent&&function(t,e,n){var r=function(t){return void 0===Sr(t)&&!kr(t)}(n),i=(0,o.r3)(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,Ar(t)):r||i||(t.node.children[e]=n.node,t.node.childCount++,Ar(t))}(t.parent,t.name,t)}var Pr=/[\[\].#$\/\u0000-\u001F\u007F]/,Mr=/[\[\].#$\u0000-\u001F\u007F]/,Nr=10485760,Ir=function(t){return"string"==typeof t&&0!==t.length&&!Pr.test(t)},Dr=function(t){return"string"==typeof t&&0!==t.length&&!Mr.test(t)},Or=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!A(t)||t&&"object"==typeof t&&(0,o.r3)(t,".sv")},Rr=function(t,e,n,r){r&&void 0===e||Fr((0,o.gK)(t,"value"),e,n)},Fr=function(t,e,n){var r=n instanceof ft?new Tt(n,t):n;if(void 0===e)throw new Error(t+"contains undefined "+At(r));if("function"==typeof e)throw new Error(t+"contains a function "+At(r)+" with contents = "+e.toString());if(A(e))throw new Error(t+"contains "+e.toString()+" "+At(r));if("string"==typeof e&&e.length>Nr/3&&(0,o.ug)(e)>Nr)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+At(r)+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var i=!1,a=!1;if(F(e,(function(e,n){if(".value"===e)i=!0;else if(".priority"!==e&&".sv"!==e&&(a=!0,!Ir(e)))throw new Error(t+" contains an invalid key ("+e+") "+At(r)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');var s,u;!function(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=(0,o.ug)(e),Et(t)}(r,e),Fr(t,n,r),u=(s=r).parts_.pop(),s.byteLength_-=(0,o.ug)(u),s.parts_.length>0&&(s.byteLength_-=1)})),i&&a)throw new Error(t+' contains ".value" child '+At(r)+" in addition to actual children.")}},Lr=function(t,e,n,r){if(!r||void 0!==e){var i=(0,o.gK)(t,"values");if(!e||"object"!=typeof e||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");var a=[];F(e,(function(t,e){var r=new ft(t);if(Fr(i,e,bt(n,r)),".priority"===gt(r)&&!Or(e))throw new Error(i+"contains an invalid value for '"+r.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(r)})),function(t,e){var n,r;for(n=0;n0&&(f=pi(t,a)),Gr(t.eventQueue_,f,s)}function ni(t,e){ri(t,"connected",e),!1===e&&function(t){li(t,"onDisconnectEvents");var e=ti(t),n=Me();De(t.onDisconnect_,dt(),(function(r,i){var o=gr(r,i,t.serverSyncTree_,e);Ne(n,r,o)}));var r=[];De(n,dt(),(function(e,n){r=r.concat(Jn(t.serverSyncTree_,e,n));var i=_i(t,e);pi(t,i)})),t.onDisconnect_=Me(),Gr(t.eventQueue_,dt(),r)}(t)}function ri(t,e,n){var r=new ft("/.info/"+e),i=ae(n);t.infoData_.updateSnapshot(r,i);var o=Jn(t.infoSyncTree_,r,i);Gr(t.eventQueue_,r,o)}function ii(t){return t.nextWriteId_++}function oi(t,e,n,r,i){li(t,"set",{path:e.toString(),value:n,priority:r});var o=ti(t),a=ae(n,r),s=er(t.serverSyncTree_,e),u=vr(a,s,o),c=ii(t),l=Qn(t.serverSyncTree_,e,u,c,!0);Yr(t.eventQueue_,l),t.server_.put(e.toString(),a.val(!0),(function(n,r){var o="ok"===n;o||E("set at "+e+" failed: "+n);var a=Zn(t.serverSyncTree_,c,!o);Gr(t.eventQueue_,e,a),hi(0,i,n,r)}));var h=_i(t,e);pi(t,h),Gr(t.eventQueue_,h,[])}function ai(t,e,n){t.server_.onDisconnectCancel(e.toString(),(function(r,i){"ok"===r&&Ie(t.onDisconnect_,e),hi(0,n,r,i)}))}function si(t,e,n,r){var i=ae(n);t.server_.onDisconnectPut(e.toString(),i.val(!0),(function(n,o){"ok"===n&&Ne(t.onDisconnect_,e,i),hi(0,r,n,o)}))}function ui(t,e,n){var r;r=".info"===pt(e._path)?Xn(t.infoSyncTree_,e,n):Xn(t.serverSyncTree_,e,n),Vr(t.eventQueue_,e._path,r)}function ci(t){t.persistentConnection_&&t.persistentConnection_.interrupt(Zr)}function li(t){for(var e=[],n=1;n0,"Sending zero length transaction queue"),n.every((function(t){return 0===t.status}))&&function(t,e,n){for(var r=n.map((function(t){return t.currentWriteId})),i=fi(t,e,r),a=i,s=i.hash(),u=0;u=25)f=!0,u="maxretry",i=i.concat(Zn(t.serverSyncTree_,l.currentWriteId,!0));else{var d=fi(t,l.path,a);l.currentInputSnapshot=d;var p=e[s].update(d.val());if(void 0!==p){Fr("transaction failed: Data returned ",p,l.path);var m=ae(p);"object"==typeof p&&null!=p&&(0,o.r3)(p,".priority")||(m=m.updatePriority(d.getPriority()));var y=l.currentWriteId,g=ti(t),v=vr(m,d,g);l.currentOutputSnapshotRaw=m,l.currentOutputSnapshotResolved=v,l.currentWriteId=ii(t),a.splice(a.indexOf(y),1),i=(i=i.concat(Qn(t.serverSyncTree_,l.path,v,l.currentWriteId,l.applyLocally))).concat(Zn(t.serverSyncTree_,y,!0))}else f=!0,u="nodata",i=i.concat(Zn(t.serverSyncTree_,l.currentWriteId,!0))}Gr(t.eventQueue_,n,i),i=[],f&&(e[s].status=2,c=e[s].unwatcher,setTimeout(c,Math.floor(0)),e[s].onComplete&&("nodata"===u?r.push((function(){return e[s].onComplete(null,!1,e[s].currentInputSnapshot)})):r.push((function(){return e[s].onComplete(new Error(u),!1,null)}))))},u=0;u0?n:void 0)}xr(e,(function(e){vi(t,e)}))}function _i(t,e){var n=Er(mi(t,e)),r=wr(t.transactionQueueTree_,e);return function(t,e,n){for(var r=t.parent;null!==r;){if(e(r))return!0;r=r.parent}}(r,(function(e){bi(t,e)})),bi(t,r),Tr(r,(function(e){bi(t,e)})),n}function bi(t,e){var n=Sr(e);if(n){for(var r=[],i=[],a=-1,s=0;s.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||T("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&E("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new G(n.host,n.secure,r,e,i,"",r!==n.subdomain),path:new ft(n.pathString)}},Si=function(t){var e="",n="",r="",i="",o="",s=!0,u="https",c=443;if("string"==typeof t){var l=t.indexOf("//");l>=0&&(u=t.substring(0,l-1),t=t.substring(l+2));var h=t.indexOf("/");-1===h&&(h=t.length);var f=t.indexOf("?");-1===f&&(f=t.length),e=t.substring(0,Math.min(h,f)),h0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(t){}e+="/"+i}return e}(t.substring(h,f)));var d=function(t){var e,n,r={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var i=(0,a.XA)(t.split("&")),o=i.next();!o.done;o=i.next()){var s=o.value;if(0!==s.length){var u=s.split("=");2===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):E("Invalid query segment '"+s+"' in query '"+t+"'")}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(t.substring(Math.min(t.length,f)));(l=e.indexOf(":"))>=0?(s="https"===u||"wss"===u,c=parseInt(e.substring(l+1),10)):l=e.length;var p=e.slice(0,l);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{var m=e.indexOf(".");r=e.substring(0,m).toLowerCase(),n=e.substring(m+1),o=r}"ns"in d&&(o=d.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:s,scheme:u,pathString:i,namespace:o}},Ci=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.ref;return"value"===this.eventType?t._path:t.parent._path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+(0,o.Pz)(this.snapshot.exportVal())},t}(),ki=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),xi=function(){function t(t,e){this.snapshotCallback=t,this.cancelCallback=e}return t.prototype.onValue=function(t,e){this.snapshotCallback.call(null,t,e)},t.prototype.onCancel=function(t){return(0,o.hu)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,t)},Object.defineProperty(t.prototype,"hasCancelCallback",{get:function(){return!!this.cancelCallback},enumerable:!1,configurable:!0}),t.prototype.matches=function(t){return this.snapshotCallback===t.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===t.snapshotCallback.userCallback&&this.snapshotCallback.context===t.snapshotCallback.context},t}(),Ti=function(){function t(t,e){this._repo=t,this._path=e}return t.prototype.cancel=function(){var t=new o.BH;return ai(this._repo,this._path,t.wrapCallback((function(){}))),t.promise},t.prototype.remove=function(){Wr("OnDisconnect.remove",this._path);var t=new o.BH;return si(this._repo,this._path,null,t.wrapCallback((function(){}))),t.promise},t.prototype.set=function(t){Wr("OnDisconnect.set",this._path),Rr("OnDisconnect.set",t,this._path,!1);var e=new o.BH;return si(this._repo,this._path,t,e.wrapCallback((function(){}))),e.promise},t.prototype.setWithPriority=function(t,e){Wr("OnDisconnect.setWithPriority",this._path),Rr("OnDisconnect.setWithPriority",t,this._path,!1),jr("OnDisconnect.setWithPriority",e,!1);var n=new o.BH;return function(t,e,n,r,i){var o=ae(n,r);t.server_.onDisconnectPut(e.toString(),o.val(!0),(function(n,r){"ok"===n&&Ne(t.onDisconnect_,e,o),hi(0,i,n,r)}))}(this._repo,this._path,t,e,n.wrapCallback((function(){}))),n.promise},t.prototype.update=function(t){Wr("OnDisconnect.update",this._path),Lr("OnDisconnect.update",t,this._path,!1);var e=new o.BH;return function(t,e,n,r){if((0,o.xb)(n))return C("onDisconnect().update() called with empty data. Don't do anything."),void hi(0,r,"ok",void 0);t.server_.onDisconnectMerge(e.toString(),n,(function(i,o){"ok"===i&&F(n,(function(n,r){var i=ae(r);Ne(t.onDisconnect_,bt(e,n),i)})),hi(0,r,i,o)}))}(this._repo,this._path,t,e.wrapCallback((function(){}))),e.promise},t}(),Ei=function(){function t(t,e,n,r){this._repo=t,this._path=e,this._queryParams=n,this._orderByCalled=r}return Object.defineProperty(t.prototype,"key",{get:function(){return wt(this._path)?null:gt(this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Ni(this._repo,this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryIdentifier",{get:function(){var t=Ee(this._queryParams),e=O(t);return"{}"===e?"default":e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryObject",{get:function(){return Ee(this._queryParams)},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(!((e=(0,o.m9)(e))instanceof t))return!1;var n=this._repo===e._repo,r=kt(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return n&&r&&i},t.prototype.toJSON=function(){return this.toString()},t.prototype.toString=function(){return this._repo.toString()+function(t){for(var e="",n=t.pieceNum_;nt.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:r,visible:!0}),t.visibleWrites=tn(t.visibleWrites,e,n),t.lastWriteId=r}(t.pendingWriteTree_,e,n,r);var i=Ze.fromObject(n);return nr(t,new We({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,i))}(t.serverSyncTree_,e,s,u);Yr(t.eventQueue_,c),t.server_.merge(e.toString(),n,(function(n,i){var o="ok"===n;o||E("update at "+e+" failed: "+n);var a=Zn(t.serverSyncTree_,u,!o),s=a.length>0?pi(t,e):e;Gr(t.eventQueue_,s,a),hi(0,r,n,i)})),F(n,(function(n){var r=_i(t,bt(e,n));pi(t,r)})),Gr(t.eventQueue_,e,[])}}(t._repo,t._path,e,n.wrapCallback((function(){}))),n.promise}function Wi(t){return function(t,e){var n=function(t,e){var n=e._path,r=null;t.syncPointTree_.foreachOnPath(n,(function(t,e){var i=St(t,n);r=r||zn(e,i)}));var i=t.syncPointTree_.get(n);i?r=r||zn(i,dt()):(i=new qn,t.syncPointTree_=t.syncPointTree_.set(n,i));var o=null!=r,a=o?new ze(r,!0,!1):null;return Ke(Bn(i,e,ln(t.pendingWriteTree_,e._path),o?a.getNode():ie.EMPTY_NODE,o).viewCache_)}(t.serverSyncTree_,e);return null!=n?Promise.resolve(n):t.server_.get(e).then((function(n){var r=ae(n).withIndex(e._queryParams.getIndex()),i=Jn(t.serverSyncTree_,e._path,r);return Vr(t.eventQueue_,e._path,i),Promise.resolve(r)}),(function(n){return li(t,"get for query "+(0,o.Pz)(e)+" failed: "+n),Promise.reject(new Error(n))}))}((t=(0,o.m9)(t))._repo,t).then((function(e){return new Ii(e,new Ni(t._repo,t._path),t._queryParams.getIndex())}))}var zi=function(){function t(t){this.callbackContext=t}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e._queryParams.getIndex();return new Ci("value",this,new Ii(t.snapshotNode,new Ni(e._repo,e._path),n))},t.prototype.getEventRunner=function(t){var e=this;return"cancel"===t.getEventType()?function(){return e.callbackContext.onCancel(t.error)}:function(){return e.callbackContext.onValue(t.snapshot,null)}},t.prototype.createCancelEvent=function(t,e){return this.callbackContext.hasCancelCallback?new ki(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))},t.prototype.hasAnyCallback=function(){return null!==this.callbackContext},t}(),Hi=function(){function t(t,e){this.eventType=t,this.callbackContext=e}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,this.eventType===e},t.prototype.createCancelEvent=function(t,e){return this.callbackContext.hasCancelCallback?new ki(this,t,e):null},t.prototype.createEvent=function(t,e){(0,o.hu)(null!=t.childName,"Child events should have a childName.");var n=Ri(new Ni(e._repo,e._path),t.childName),r=e._queryParams.getIndex();return new Ci(t.type,this,new Ii(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this;return"cancel"===t.getEventType()?function(){return e.callbackContext.onCancel(t.error)}:function(){return e.callbackContext.onValue(t.snapshot,t.prevName)}},t.prototype.matches=function(e){return e instanceof t&&this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext))},t.prototype.hasAnyCallback=function(){return!!this.callbackContext},t}();function $i(t,e,n,r,i){var o;if("object"==typeof r&&(o=void 0,i=r),"function"==typeof r&&(o=r),i&&i.onlyOnce){var a=n,s=function(e,n){ui(t._repo,t,c),a(e,n)};s.userCallback=n.userCallback,s.context=n.context,n=s}var u=new xi(n,o||void 0),c="value"===e?new zi(u):new Hi(e,u);return function(t,e,n){var r;r=".info"===pt(e._path)?tr(t.infoSyncTree_,e,n):tr(t.serverSyncTree_,e,n),Vr(t.eventQueue_,e._path,r)}(t._repo,t,c),function(){return ui(t._repo,t,c)}}function Yi(t,e,n,r){return $i(t,"value",e,n,r)}function Vi(t,e,n,r){return $i(t,"child_added",e,n,r)}function Gi(t,e,n,r){return $i(t,"child_changed",e,n,r)}function Ki(t,e,n,r){return $i(t,"child_moved",e,n,r)}function Qi(t,e,n,r){return $i(t,"child_removed",e,n,r)}function Zi(t,e,n){var r=null,i=n?new xi(n):null;"value"===e?r=new zi(i):e&&(r=new Hi(e,i)),ui(t._repo,t,r)}var Ji=function(){},Xi=function(t){function e(e,n){var r=t.call(this)||this;return r._value=e,r._key=n,r}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Rr("endAt",this._value,t._path,!0);var e=ke(t._queryParams,this._value,this._key);if(Mi(e),Pi(e),t._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Ei(t._repo,t._path,e,t._orderByCalled)},e}(Ji);function to(t,e){return Ur("endAt","key",e,!0),new Xi(t,e)}var eo=function(t){function e(e,n){var r=t.call(this)||this;return r._value=e,r._key=n,r}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Rr("endBefore",this._value,t._path,!1);var e,n,r,i,o=(e=t._queryParams,n=this._value,r=this._key,e.index_===Lt?("string"==typeof n&&(n=pe(n)),i=ke(e,n,r)):i=ke(e,n,null==r?P:pe(r)),i.endBeforeSet_=!0,i);if(Mi(o),Pi(o),t._queryParams.hasEnd())throw new Error("endBefore: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Ei(t._repo,t._path,o,t._orderByCalled)},e}(Ji);function no(t,e){return Ur("endBefore","key",e,!0),new eo(t,e)}var ro=function(t){function e(e,n){var r=t.call(this)||this;return r._value=e,r._key=n,r}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Rr("startAt",this._value,t._path,!0);var e=Ce(t._queryParams,this._value,this._key);if(Mi(e),Pi(e),t._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new Ei(t._repo,t._path,e,t._orderByCalled)},e}(Ji);function io(t,e){return void 0===t&&(t=null),Ur("startAt","key",e,!0),new ro(t,e)}var oo=function(t){function e(e,n){var r=t.call(this)||this;return r._value=e,r._key=n,r}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Rr("startAfter",this._value,t._path,!1);var e,n,r,i,o=(e=t._queryParams,n=this._value,r=this._key,e.index_===Lt?("string"==typeof n&&(n=de(n)),i=Ce(e,n,r)):i=Ce(e,n,null==r?M:de(r)),i.startAfterSet_=!0,i);if(Mi(o),Pi(o),t._queryParams.hasStart())throw new Error("startAfter: Starting point was already set (by another call to startAt, startAfter, or equalTo).");return new Ei(t._repo,t._path,o,t._orderByCalled)},e}(Ji);function ao(t,e){return Ur("startAfter","key",e,!0),new oo(t,e)}var so=function(t){function e(e){var n=t.call(this)||this;return n._limit=e,n}return(0,a.ZT)(e,t),e.prototype._apply=function(t){if(t._queryParams.hasLimit())throw new Error("limitToFirst: Limit was already set (by another call to limitToFirst or limitToLast).");return new Ei(t._repo,t._path,(e=t._queryParams,n=this._limit,(r=e.copy()).limitSet_=!0,r.limit_=n,r.viewFrom_="l",r),t._orderByCalled);var e,n,r},e}(Ji);function uo(t){if("number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("limitToFirst: First argument must be a positive integer.");return new so(t)}var co=function(t){function e(e){var n=t.call(this)||this;return n._limit=e,n}return(0,a.ZT)(e,t),e.prototype._apply=function(t){if(t._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new Ei(t._repo,t._path,(e=t._queryParams,n=this._limit,(r=e.copy()).limitSet_=!0,r.limit_=n,r.viewFrom_="r",r),t._orderByCalled);var e,n,r},e}(Ji);function lo(t){if("number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new co(t)}var ho=function(t){function e(e){var n=t.call(this)||this;return n._path=e,n}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Ai(t,"orderByChild");var e=new ft(this._path);if(wt(e))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");var n=new ce(e),r=xe(t._queryParams,n);return Pi(r),new Ei(t._repo,t._path,r,!0)},e}(Ji);function fo(t){if("$key"===t)throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if("$priority"===t)throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if("$value"===t)throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return Br("orderByChild","path",t,!1),new ho(t)}var po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Ai(t,"orderByKey");var e=xe(t._queryParams,Lt);return Pi(e),new Ei(t._repo,t._path,e,!0)},e}(Ji);function mo(){return new po}var yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Ai(t,"orderByPriority");var e=xe(t._queryParams,Jt);return Pi(e),new Ei(t._repo,t._path,e,!0)},e}(Ji);function go(){return new yo}var vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,a.ZT)(e,t),e.prototype._apply=function(t){Ai(t,"orderByValue");var e=xe(t._queryParams,le);return Pi(e),new Ei(t._repo,t._path,e,!0)},e}(Ji);function _o(){return new vo}var bo=function(t){function e(e,n){var r=t.call(this)||this;return r._value=e,r._key=n,r}return(0,a.ZT)(e,t),e.prototype._apply=function(t){if(Rr("equalTo",this._value,t._path,!1),t._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(t._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new Xi(this._value,this._key)._apply(new ro(this._value,this._key)._apply(t))},e}(Ji);function wo(t,e){return Ur("equalTo","key",e,!0),new bo(t,e)}function So(t){for(var e,n,r=[],i=1;i=0)t.server_=new Ae(t.repoInfo_,(function(e,n,r,i){ei(t,e,n,r,i)}),t.authTokenProvider_,t.appCheckProvider_),setTimeout((function(){return ni(t,!0)}),0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{(0,o.Pz)(n)}catch(t){throw new Error("Invalid authOverride provided: "+t)}}t.persistentConnection_=new Dt(t.repoInfo_,e,(function(e,n,r,i){ei(t,e,n,r,i)}),(function(e){ni(t,e)}),(function(e){!function(t,e){F(e,(function(e,n){ri(t,e,n)}))}(t,e)}),t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}var r,i;t.authTokenProvider_.addTokenChangeListener((function(e){t.server_.refreshAuthToken(e)})),t.appCheckProvider_.addTokenChangeListener((function(e){t.server_.refreshAppCheckToken(e.token)})),t.statsReporter_=(r=function(){return new Fe(t.stats_,t.server_)},i=t.repoInfo_.toString(),J[i]||(J[i]=r()),J[i]),t.infoData_=new Pe,t.infoSyncTree_=new Kn({startListening:function(e,n,r,i){var o=[],a=t.infoData_.getNode(e._path);return a.isEmpty()||(o=Jn(t.infoSyncTree_,e._path,a),setTimeout((function(){i("ok")}),0)),o},stopListening:function(){}}),ri(t,"connected",!1),t.serverSyncTree_=new Kn({startListening:function(e,n,r,i){return t.server_.listen(e,r,n,(function(n,r){var o=i(n,r);Gr(t.eventQueue_,e._path,o)})),[]},stopListening:function(e,n){t.server_.unlisten(e,n)}})}(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_root",{get:function(){return this._rootInternal||(this._rootInternal=new Ni(this._repo,dt())),this._rootInternal},enumerable:!1,configurable:!0}),t.prototype._delete=function(){var t,e,n;return null!==this._rootInternal&&(t=this._repo,e=this.app.name,(n=Co[e])&&n[t.key]===t||T("Database "+e+"("+t.repoInfo_+") has already been deleted."),ci(t),delete n[t.key],this._repoInternal=null,this._rootInternal=null),Promise.resolve()},t.prototype._checkNotDeleted=function(t){null===this._rootInternal&&T("Cannot call "+t+" on a deleted database.")},t}();function Eo(t){(t=(0,o.m9)(t))._checkNotDeleted("goOffline"),ci(t._repo)}function Ao(t){var e;(t=(0,o.m9)(t))._checkNotDeleted("goOnline"),(e=t._repo).persistentConnection_&&e.persistentConnection_.resume(Zr)}var Po={".sv":"timestamp"},Mo=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}();function No(t,e,n){var r;if(t=(0,o.m9)(t),Wr("Reference.transaction",t._path),".length"===t.key||".keys"===t.key)throw"Reference.transaction failed: "+t.key+" is a read-only object.";var i=null===(r=null==n?void 0:n.applyLocally)||void 0===r||r,a=new o.BH,s=Yi(t,(function(){}));return function(e,n,r,i,s,u){li(e,"transaction on "+n);var c={path:n,update:r,onComplete:function(e,n,r){var i=null;e?a.reject(e):(i=new Ii(r,new Ni(t._repo,t._path),Jt),a.resolve(new Mo(n,i)))},status:null,order:g(),applyLocally:u,retryCount:0,unwatcher:s,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},l=fi(e,n,void 0);c.currentInputSnapshot=l;var h=c.update(l.val());if(void 0===h)c.unwatcher(),c.currentOutputSnapshotRaw=null,c.currentOutputSnapshotResolved=null,c.onComplete&&c.onComplete(null,!1,c.currentInputSnapshot);else{Fr("transaction failed: Data returned ",h,c.path),c.status=0;var f=wr(e.transactionQueueTree_,n),d=Sr(f)||[];d.push(c),Cr(f,d);var p=void 0;"object"==typeof h&&null!==h&&(0,o.r3)(h,".priority")?(p=(0,o.DV)(h,".priority"),(0,o.hu)(Or(p),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):p=(er(e.serverSyncTree_,n)||ie.EMPTY_NODE).getPriority().val();var m=ti(e),y=ae(h,p),v=vr(y,l,m);c.currentOutputSnapshotRaw=y,c.currentOutputSnapshotResolved=v,c.currentWriteId=ii(e);var _=Qn(e.serverSyncTree_,n,v,c.currentWriteId,c.applyLocally);Gr(e.eventQueue_,n,_),di(e,e.transactionQueueTree_)}}(t._repo,t._path,e,0,s,i),a.promise}var Io=function(){function t(t){this._delegate=t}return t.prototype.cancel=function(t){(0,o.Dv)("OnDisconnect.cancel",0,1,arguments.length),(0,o.Wj)("OnDisconnect.cancel","onComplete",t,!0);var e=this._delegate.cancel();return t&&e.then((function(){return t(null)}),(function(e){return t(e)})),e},t.prototype.remove=function(t){(0,o.Dv)("OnDisconnect.remove",0,1,arguments.length),(0,o.Wj)("OnDisconnect.remove","onComplete",t,!0);var e=this._delegate.remove();return t&&e.then((function(){return t(null)}),(function(e){return t(e)})),e},t.prototype.set=function(t,e){(0,o.Dv)("OnDisconnect.set",1,2,arguments.length),(0,o.Wj)("OnDisconnect.set","onComplete",e,!0);var n=this._delegate.set(t);return e&&n.then((function(){return e(null)}),(function(t){return e(t)})),n},t.prototype.setWithPriority=function(t,e,n){(0,o.Dv)("OnDisconnect.setWithPriority",2,3,arguments.length),(0,o.Wj)("OnDisconnect.setWithPriority","onComplete",n,!0);var r=this._delegate.setWithPriority(t,e);return n&&r.then((function(){return n(null)}),(function(t){return n(t)})),r},t.prototype.update=function(t,e){if((0,o.Dv)("OnDisconnect.update",1,2,arguments.length),Array.isArray(t)){for(var n={},r=0;r{"use strict";function r(){for(var t=0,e=0,n=arguments.length;ed,Ub:()=>f,Yd:()=>h,in:()=>o});var o,a=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},u=o.INFO,c=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),l=function(t,e){for(var n=[],i=2;i=(null!=r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:s,args:i,type:e.name})}},r=0,i=a;r{"use strict";n.d(e,{BH:()=>d,DV:()=>M,Dv:()=>j,GJ:()=>A,LL:()=>w,Pz:()=>x,Sg:()=>p,UG:()=>y,UI:()=>I,US:()=>s,Wj:()=>U,Yr:()=>_,ZB:()=>f,b$:()=>v,cI:()=>k,dS:()=>W,g5:()=>o,gK:()=>q,gQ:()=>O,h$:()=>u,hu:()=>i,jU:()=>g,lb:()=>B,m9:()=>H,ne:()=>R,p$:()=>h,r3:()=>P,uI:()=>m,ug:()=>z,w9:()=>E,xO:()=>D,xb:()=>N});var r=n(655),i=function(t,e){if(!t)throw o(e)},o=function(t){return new Error("Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: "+t)},a=function(t){for(var e=[],n=0,r=0;r>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},s={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,h=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,d=63&c;u||(d=64,a||(f=64)),r.push(n[l],n[h],n[f],n[d])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(c),64!==s){var l=a<<4&240|s>>2;if(r.push(l),64!==u){var h=s<<6&192|u;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){var e=a(t);return s.encodeByteArray(e,!0)},c=function(t){return u(t).replace(/\./g,"")},l=function(t){try{return s.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function h(t){return f(void 0,t)}function f(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&"__proto__"!==n&&(t[n]=f(t[n],e[n]));return t}var d=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function p(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var a=(0,r.pi)({iss:"https://securetoken.google.com/"+n,aud:n,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},t);return[c(JSON.stringify({alg:"none",type:"JWT"})),c(JSON.stringify(a)),""].join(".")}function m(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"")}function y(){try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(t){return!1}}function g(){return"object"==typeof self&&self.self===self}function v(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function _(){return!1}var b=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,w.prototype.create),o}return(0,r.ZT)(e,t),e}(Error),w=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n"}))}var C=/\{\$([^}]+)}/g;function k(t){return JSON.parse(t)}function x(t){return JSON.stringify(t)}var T=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=k(l(o[0])||""),n=k(l(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(t){}return{header:e,claims:n,data:r,signature:i}},E=function(t){var e=T(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},A=function(t){var e=T(t).claims;return"object"==typeof e&&!0===e.admin};function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function N(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function I(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}function D(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],l=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++)r<40?r<20?(o=l^u&(c^l),a=1518500249):(o=u^c^l,a=1859775393):r<60?(o=u&c|l&(u|c),a=2400959708):(o=u^c^l,a=3395469782),i=(s<<5|s>>>27)+o+h+a+n[r]&4294967295,h=l,l=c,c=4294967295&(u<<30|u>>>2),u=s,s=i;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},t}();function R(t,e){var n=new F(t,e);return n.subscribe.bind(n)}var F=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];nn&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")};function q(t,e){return t+" failed: "+e+" argument "}function U(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(q(t,e)+"must be a valid function.")}function B(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(q(t,e)+"must be a valid context object.")}var W=function(t){for(var e=[],n=0,r=0;r=55296&&o<=56319){var a=o-55296;r++,i(r>6|192,e[n++]=63&o|128):o<65536?(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=63&o|128):(e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=63&o|128)}return e},z=function(t){for(var e=0,n=0;n=55296&&r<=56319?(e+=4,n++):e+=3}return e};function H(t){return t&&t._delegate?t._delegate:t}},7666:(t,e,n)=>{"use strict";function r(t){return"may"===t.toLowerCase()?t:t+"."}function i(t){return t.replace(/(\d{4}-\d{2}-\d{2})\s(\d{2}:)/,"$1T$2").replace(/GMT/,"").replace(/(T\d{2}.*)\s([+-]\d{4})/,"$1$2").replace(/([+-])(\d{2})(\d{2})/,"$1$2:$3")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(6148),a=n(6148),s=n(6148);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var d=function(){function t(e){var n,r,i,o,a;u(this,t),this.name=e,this.sendMap={},n=window,r=document,i="script",n.GoogleAnalyticsObject="ga",n.ga=n.ga||function(){(n.ga.q=n.ga.q||[]).push(arguments)},n.ga.l=1*new Date,o=r.createElement(i),a=r.getElementsByTagName(i)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",a.parentNode.insertBefore(o,a),ga("create","UA-60673836-2","auto"),this.pageview()}return l(t,[{key:"sendEvent",value:function(t,e,n){window.ga("send","event",this.name,t,e,n,{page:"/"+this.name,title:this.name})}},{key:"getIdentifier",value:function(t,e){return"".concat(t,":").concat(e)}},{key:"sendEventOnce",value:function(t,e,n){void 0===this.sendMap[this.getIdentifier(t,e,n)]&&(this.sendEvent(t,e,n),this.sendMap[this.getIdentifier(t,e,n)]=1),this.sendMap[this.getIdentifier(t,e,n)]++}},{key:"pageview",value:function(){window.ga("send","pageview",{page:"/"+this.name,title:this.name})}}]),t}(),p=function(){function t(e){var n=this;u(this,t),this.opts=e||{},["politics","sports","science","economics","life"].indexOf(this.opts.tag)>=0?this.url="https://fivethirtyeight.com/"+this.opts.tag+"/recirc/":this.url="https://fivethirtyeight.com/tag/"+(this.opts.tag||"2020-election")+"/recirc/",this.maxItems=this.opts.maxItems||5,document.readyState&&"loading"!=document.readyState?this.init():document.addEventListener("DOMContentLoaded",(function(){n.init()}))}return l(t,[{key:"init",value:function(){this.promisedXHR("GET",this.url).then(this.parseResponse.bind(this)).then(this.addItems.bind(this)).catch((function(t){console.log(t)}))}},{key:"addItems",value:function(t){for(var e=0,n=0;n=0&&this.opts.url&&i.indexOf(this.opts.url)>=0,a=0===r.getElementsByTagNameNS("*","thumbnail").length;if(!o&&!a&&(this.opts.addItem?this.opts.addItem(this.itemToObj(r),e):this.addItem(r,e),++e>=this.maxItems)){this.opts.addItem||(document.getElementById("related").style.display="block");break}}}},{key:"parseResponse",value:function(t){var e,n=t.target.responseText;return window.DOMParser?e=(new DOMParser).parseFromString(n,"text/xml"):((e=new ActiveXObject("Microsoft.XMLDOM")).async=!1,e.loadXML(n)),e}},{key:"promisedXHR",value:function(t,e){return new Promise((function(n,r){var i=new XMLHttpRequest;i.open(t,e),i.onload=n,i.onerror=r,i.send()}))}},{key:"itemToObj",value:function(t){return{title:t.getElementsByTagName("title")[0].textContent,author:t.getElementsByTagName("dc:creator")[0].textContent,date:t.getElementsByTagName("pubDate")[0].textContent,url:t.getElementsByTagName("link")[0].textContent,thumbnail:t.getElementsByTagNameNS("*","thumbnail")[0].getAttribute("url")+"?quality=90&strip=info"}}},{key:"addItem",value:function(t,e){var n=t.getElementsByTagName("link")[0].textContent,r=t.getElementsByTagName("title")[0].textContent,i=t.getElementsByTagNameNS("*","thumbnail")[0].getAttribute("url")+"?quality=90&strip=info",o=i+"&w=400",a=i+"&w=200",s=i+"&w=100",u=document.getElementById("related-"+(e+1).toString()),c=document.createElement("a"),l=new Image,h=document.createElement("h4"),f=document.createElement("a");c.href=n,c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex",-1),l.src=o,l.srcset=o+" 400w, "+a+" 200w, "+s+" 100w",l.sizes="(max-width: 767px) 100px, 200px",l.alt=r,c.appendChild(l),f.href=n,f.innerHTML=r,h.appendChild(f),u.innerHTML="",u.appendChild(c),u.appendChild(h)}}]),t}(),m=function(){function t(e){var n=this;u(this,t),this.opts=e||{},document.readyState&&"loading"!=document.readyState?this.init():document.addEventListener("DOMContentLoaded",(function(){n.init()}))}return l(t,[{key:"init",value:function(){var t=this;document.getElementById("twitter-sharer")&&(document.getElementById("twitter-sharer").onclick=function(){return window.open("https://twitter.com/intent/tweet?text="+t.opts.twittertext+"&url="+t.opts.url+"?ex_cid=story-twitter","","resizable,height=251,width=550"),!1}),document.getElementById("facebook-sharer")&&(document.getElementById("facebook-sharer").onclick=function(){return window.open("https://www.facebook.com/sharer/sharer.php?u="+t.opts.url+"%3Fex_cid=story-facebook","","resizable,height=354,width=626"),!1})}}]),t}(),y=n(8911),g=function(){function t(e){var n=this;u(this,t);var r=e||{};this.template=r.template,this.modelURL=r.modelURL||"https://projects.fivethirtyeight.com/interactive-recirc/interactive-recirc.json",this.insertBeforeSelector=r.insertBeforeSelector||"#related",this.projectName=r.projectName||"",this.analytics=r.analyticsInstance||{},this.recircGroupForTesting=r.recircGroupForTesting||"",document.readyState&&"loading"!=document.readyState?this.init():document.addEventListener("DOMContentLoaded",(function(){n.init()}))}return l(t,[{key:"init",value:function(){this.promisedXHR("GET",this.modelURL).then(this.filterProjects.bind(this)).then(this.sortProjects).then(this.formatAllTimestamps.bind(this)).then(this.compileTemplate.bind(this)).then(this.addAnalytics.bind(this)).catch((function(t){console.log(t)}))}},{key:"promisedXHR",value:function(t,e){return new Promise((function(n,r){var i=new XMLHttpRequest;i.open(t,e),i.onload=n,i.onerror=r,i.send()}))}},{key:"filterProjects",value:function(t){var e,n=this,r=JSON.parse(t.target.response);if(this.recircGroupForTesting){if(!r.map((function(t){return t.recircgroup})).includes(this.recircGroupForTesting))throw new Error("".concat(this.recircGroupForTesting," is not a valid recirc group name."));e=this.recircGroupForTesting}else{var i=r.filter((function(t){return t.shortname===n.projectName}))[0];if(!i)throw new Error("This project has not been added to a recirc group.");e=i.recircgroup}return r.filter((function(t){return t.recircgroup===e&&t.shortname!==n.projectName}))}},{key:"sortProjects",value:function(t){return t.sort((function(t,e){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()}))}},{key:"formatAllTimestamps",value:function(t){var e,n=f(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.timestamp=this.formatTimestamp(r)}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"formatTimestamp",value:function(t){var e=t.timestamp,n=new Date(e).getTime();return n>(new Date).getTime()-2592e5?y.ago(n):t.FTETimestamp}},{key:"compileTemplate",value:function(t){var e=this.template({projects:t});document.querySelector(this.insertBeforeSelector).insertAdjacentHTML("beforebegin",e)}},{key:"sendAnalytics",value:function(t,e){var n=e.currentTarget.dataset.project;this.sendEvent("interactiveRecirc",n)}},{key:"addAnalytics",value:function(){var t,e=f(document.querySelectorAll(".js-project"));try{for(e.s();!(t=e.n()).done;)t.value.addEventListener("click",this.sendAnalytics.bind(this.analytics,event))}catch(t){e.e(t)}finally{e.f()}}}]),t}(),v=n(7484),_=n(178),b=n(9387);function w(t,e,n){n=n||"America/New_York";var r=t?v(t):v();return t&&"string"==typeof t&&!t.includes("Z")&&-1===t.search(/[+-]\d\d:\d\d/)&&(r=v.tz(t,"America/New_York")),r.tz(n).format(e)}v.extend(_),v.extend(b);var S=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(this,t),this.data=e,this.parentEl=n,this.opts=i,this.xmlns="http://www.w3.org/2000/svg",this.title=this.opts.title||"",window.addEventListener("resize",(function(){return r.resizeChartFrame()}))}return l(t,[{key:"drawChartFrame",value:function(){return this.svgEl=document.createElementNS(this.xmlns,"svg"),this.svgEl.setAttribute("class","svg"),this.svgEl.setAttribute("role","img"),this.svgEl.setAttribute("aria-labelledby","title-".concat(this.parentEl.id)),this.svgTitle=document.createElementNS(this.xmlns,"title"),this.svgTitle.setAttribute("id","title-".concat(this.parentEl.id)),this.svgTitle.innerHTML=this.title,this.chartEl=document.createElementNS(this.xmlns,"g"),this.chartEl.setAttribute("class","chart"),this.parentEl.appendChild(this.svgEl),this.svgEl.appendChild(this.svgTitle),this.svgEl.appendChild(this.chartEl),this.resizeChartFrame(),this}},{key:"resizeChartFrame",value:function(){return this.isMobile=this.opts.isMobile||window.innerWidth<767,this.chartMargin=this.isMobile&&this.opts.marginMobile?this.opts.marginMobile:this.opts.margin,this.margin=Object.assign({top:15,right:15,bottom:15,left:15},this.chartMargin),this.height=(this.opts.height||this.parentEl.offsetHeight)-this.margin.top-this.margin.bottom,this.width=(this.opts.width||this.parentEl.offsetWidth)-this.margin.left-this.margin.right,this.svgEl.setAttribute("width",this.width+this.margin.left+this.margin.right),this.svgEl.setAttribute("height",this.height+this.margin.top+this.margin.bottom),this.chartEl.setAttribute("width",this.width),this.chartEl.setAttribute("height",this.height),this.chartEl.setAttribute("transform","translate(".concat(this.margin.left,",").concat(this.margin.top,")")),this}}]),t}(),C="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||Function("return this")()||{},k=Object.prototype,x=k.toString,T=k.hasOwnProperty,E=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],P=("[object Function]",function(t){return"[object Function]"===x.call(t)}),M=C.document&&C.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof M&&(P=function(t){return"function"==typeof t||!1});var N=P;var I,D=(I=function(t){if(!function(t){var e=typeof t;return"function"===e||"object"===e&&!!t}(t))return[];var e=[];for(var n in t)e.push(n);return E&&function(t,e){e=function(t){for(var e={},n=t.length,r=0;r/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var R=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\u2028|\u2029/g;function j(t){return"\\"+F[t]}var q=/^\s*(\w|\$)+\s*$/,U=function(){function t(e){u(this,t),this.tableEl=e,this.sortedCol=this.tableEl.querySelector(".sorted")?this.tableEl.querySelector(".sorted").dataset.col:null,this.sortedAsc=this.tableEl.querySelector(".sorted")?this.tableEl.querySelector(".sorted").dataset.asc:null}return l(t,[{key:"sortableTableHeaders",get:function(){return this.tableEl.querySelectorAll("thead > tr.sortable th:not(.nosort)")}},{key:"initTableSorter",value:function(){var t=this,e=function(t,e){return t.children[e].getAttribute("data-val")||t.children[e].innerText||t.children[e].textContent};this.sortableTableHeaders.forEach((function(n){return n.addEventListener("click",(function(r){var i=t.sortedCol;t.sortedCol=n.getAttribute("data-col"),i===t.sortedCol?t.sortedAsc=!t.sortedAsc:t.sortedAsc=n.dataset.asc;var o=t.tableEl.querySelector("tbody");Array.from(o.querySelectorAll("tr")).sort(function(t,n){return function(r,i){return o=e(n?r:i,t),a=e(n?i:r,t),""===o||""===a||isNaN(o)||isNaN(a)?o.toString().localeCompare(a):o-a;var o,a}}(Array.from(n.parentNode.children).indexOf(n),t.sortedAsc)).forEach((function(t){return o.appendChild(t)})),t.tableEl.querySelectorAll(".sorted").forEach((function(t){t.classList.remove("sorted"),t.classList.remove("desc"),t.classList.remove("asc")})),n.classList.add("sorted"),n.classList.add(t.sortedAsc?"asc":"desc")}))}))}}]),t}(),B={parseArchie:function(t){var e=0,n=JSON.stringify(t).replace(/\[footnote\](.*?)\[\/footnote\]/g,(function(t){e++;var n=t.replace("[footnote]","").concat(e,""));return n.replace("[/footnote]","")}));return JSON.parse(n)},handleClicks:function(){var t=document.querySelectorAll(".footnote-number"),e=function(t,e){"click"!==t.type&&13!==t.keyCode||(e.nextSibling.classList.contains("expanded")?(e.innerHTML=e.getAttribute("data-number"),e.nextSibling.classList.remove("expanded"),e.ariaLabel="Footnote ".concat(e.getAttribute("data-number"),". Select to expand footnote.")):(e.innerHTML="x",e.nextSibling.classList.add("expanded"),e.ariaLabel="Select to contract footnote ".concat(e.getAttribute("data-number"),".")))};t.forEach((function(t){t.addEventListener("click",(function(n){e(n,t)})),t.addEventListener("keypress",(function(n){e(n,t)}))}))}};e.Analytics=d,e.BaseChart=S,e.InteractiveRecirc=g,e.Recirc=p,e.SocialButtons=m,e.TableSorter=U,e.ampIframeSupport=function t(e){u(this,t),window.parent.postMessage({sentinel:"amp",type:"embed-size",height:document.body.scrollHeight},"*")},e.colors={BLACK:"#222222",WHITE:"#FFFFFF",GRAY_BACKGROUND:"#F0F0F0",GRAY_GRID:"#CDCDCD",GRAY_LIGHTEST:"#FAFAFA",GRAY_LIGHT:"#999999",GRAY:"#808285",GRAY_DARK:"#555555",GRAY_DARKEST:"#262626",PURPLE:"#6141D9",GREEN:"#2AAD53",BLUE:"#3255A4",YELLOW:"#FCCD26",RED:"#CC241A",ORANGE:"#F26C3B",GRAY_BYLINE:"#555555",LINKBLUE:"#008FD5",BLACK_PURE:"#000000",TEAL:"#40C1C9",PINK:"#D934A1"},e.dayjs=v,e.fixedRound=function(t,e){if(void 0===t)throw new Error;var n=Math.pow(10,e+1),r=Math.floor(t*n);return(10*Math.round(r/10)/n).toFixed(e)},e.footnotes=B,e.formatPublishTime=function(t){return r(w(t,"MMM"))+w(t," D, YYYY, ","America/New_York")+"at "+w(t,"h:mm A","America/New_York")},e.formatPublishTimeMeta=function(t){return w(t,"","America/New_York")},e.formatPublishTimePromo=function(t){return r(w(t,"MMM"))+w(t," D, YYYY","America/New_York")},e.formatTime=w,e.getAPDate=function(t,e){return o(new Date(i(t))).getAPDate(e)},e.getAPDateFTEStyle=function(t,e){return a(new Date(i(t))).getAPDate(e).split(".").join("")},e.getAPStateAbbrev=function(t){return{Alabama:"Ala.",Alaska:"Alaska",Arizona:"Ariz.",Arkansas:"Ark.",California:"Calif.",Colorado:"Colo.",Connecticut:"Conn.",Delaware:"Del.","District of Columbia":"D.C.",Florida:"Fla.",Georgia:"Ga.",Hawaii:"Hawaii",Idaho:"Idaho",Illinois:"Ill.",Indiana:"Ind.",Iowa:"Iowa",Kansas:"Kan.",Kentucky:"Ky.",Louisiana:"La.",Maine:"Maine",Maryland:"Md.",Massachusetts:"Mass.",Michigan:"Mich.",Minnesota:"Minn.",Mississippi:"Miss.",Missouri:"Mo.",Montana:"Mont.",Nebraska:"Neb.",Nevada:"Nev.","New Hampshire":"N.H.","New Jersey":"N.J.","New Mexico":"N.M.","New York":"N.Y.","North Carolina":"N.C.","North Dakota":"N.D.",Ohio:"Ohio",Oklahoma:"Okla.",Oregon:"Ore.",Pennsylvania:"Pa.","Rhode Island":"R.I.","South Carolina":"S.C.","South Dakota":"S.D.",Tennessee:"Tenn.",Texas:"Texas",Utah:"Utah",Vermont:"Vt.",Virginia:"Va.",Washington:"Wash.","West Virginia":"W.Va.",Wisconsin:"Wis.",Wyoming:"Wyo."}[t]},e.getAPTime=function(t,e){return s(new Date(i(t))).getAPTime(e)},e.imgSrc=function(t){var e="undefined"!=typeof staticUrl?staticUrl:this.staticUrl||"",n="undefined"!=typeof imageCache?imageCache:this.imageCache,r=n&&n[t]?n[t]:null;return"".concat(e,"images/").concat(t).concat(r?"?v=".concat(r):"")},e.monthAbbrevsAP={January:"Jan.",February:"Feb.",March:"March",April:"April",May:"May",June:"June",July:"July",August:"Aug.",September:"Sept.",October:"Oct.",November:"Nov.",December:"Dec."},e.punctuateMonthAbbrev=r,e.slugify=function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").trim()},e.standardizeTime=i,e.template=function(t,e){return function(t,e,n){e=D({},e,O.templateSettings);var r=RegExp([(e.escape||R).source,(e.interpolate||R).source,(e.evaluate||R).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(L,j),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!q.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(t){throw t.source=o,t}var u=function(t){return a.call(this,t,O)};return u.source="function("+s+"){\n"+o+"}",u}(t,{interpolate:/\{\{(.+?)\}\}/g})(e)},e.weekdayAbbrevs={Sunday:"Sun.",Monday:"Mon.",Tuesday:"Tues.",Wednesday:"Wed.",Thursday:"Thurs.",Friday:"Fri.",Saturday:"Sat."}},8911:module=>{"use strict";var timeago=function(){var o={second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6},obj={ago:function(t,e){var n,r=Math.round,i=" ago",a=function(t,n){return void 0===e?n+" "+t+(n>1?"s":"")+i:n+t.substring(0,1)},s=Date.now()-new Date(t).getTime();for(var u in s<0&&(s*=-1,i=" from now"),o){if(r(s){var r=n(7055);t.exports=function(t){var e,n="",i=t||{};return function(t,i,o,a,s,u,c){n=n+"

"+r.escape(null==(e=u)?"":e)+'

',s&&(n+=i?'':''),s&&i||(n=n+'

'+r.escape(null==(e=a)?"":e)+"

"),n=n+'
"}.call(this,"hasLost"in i?i.hasLost:"undefined"!=typeof hasLost?hasLost:void 0,"hasWon"in i?i.hasWon:"undefined"!=typeof hasWon?hasWon:void 0,"heat"in i?i.heat:"undefined"!=typeof heat?heat:void 0,"pct"in i?i.pct:"undefined"!=typeof pct?pct:void 0,"showCheck"in i?i.showCheck:"undefined"!=typeof showCheck?showCheck:void 0,"team"in i?i.team:"undefined"!=typeof team?team:void 0,"utils"in i?i.utils:"undefined"!=typeof utils?utils:void 0),n}},6616:(t,e,n)=>{var r=n(7055);t.exports=function(t){var e,n="",i=t||{};return function(t,i,o,a){o=a.dropdownLabels(i,t),n=n+'
'+r.escape(null==(e=t.dropdown_label)?"":e)+'
'}.call(this,"archie"in i?i.archie:"undefined"!=typeof archie?archie:void 0,"forecasts"in i?i.forecasts:"undefined"!=typeof forecasts?forecasts:void 0,"labels"in i?i.labels:"undefined"!=typeof labels?labels:void 0,"utils"in i?i.utils:"undefined"!=typeof utils?utils:void 0),n}},1627:(t,e,n)=>{var r=n(7055);t.exports=function(t){var e,n="",i=t||{};return function(t,i,o,a,s,u,c,l,h){c=h.matchesByDate(u),l=h.upcomingDates(c),(o=t.keys(c).filter((function(t){return l.indexOf(t)<0}))).reverse(),n+='
',function(){var t=l;if("number"==typeof t.length)for(var o=0,f=t.length;o

"+r.escape(null==(e=h.dayName(d))?"":e)+", "+r.escape(null==(e=h.longDate(d))?"":e)+"

",function(){var t=u;if("number"==typeof t.length)for(var o=0,c=t.length;o",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}else for(var o in c=0,t)c++,l=t[o],s=l.round&&"g"!=l.round,n=n+'
",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}.call(this),n+=""}else for(var o in f=0,t)f++,d=t[o],u=c[d],n=n+'

"+r.escape(null==(e=h.dayName(d))?"":e)+", "+r.escape(null==(e=h.longDate(d))?"":e)+"

",function(){var t=u;if("number"==typeof t.length)for(var o=0,c=t.length;o",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}else for(var o in c=0,t)c++,l=t[o],s=l.round&&"g"!=l.round,n=n+'
",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}.call(this),n+=""}.call(this),n=n+""+r.escape(null==(e=i.completed)?"":e)+"",function(){var t=o;if("number"==typeof t.length)for(var l=0,f=t.length;l

"+r.escape(null==(e=h.dayName(d))?"":e)+", "+r.escape(null==(e=h.longDate(d))?"":e)+"

",function(){var t=u;if("number"==typeof t.length)for(var o=0,c=t.length;o",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}else for(var o in c=0,t)c++,l=t[o],s=l.round&&"g"!=l.round,n=n+'
",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}.call(this),n+=""}else for(var l in f=0,t)f++,d=t[l],u=c[d],n=n+'

"+r.escape(null==(e=h.dayName(d))?"":e)+", "+r.escape(null==(e=h.longDate(d))?"":e)+"

",function(){var t=u;if("number"==typeof t.length)for(var o=0,c=t.length;o",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}else for(var o in c=0,t)c++,l=t[o],s=l.round&&"g"!=l.round,n=n+'
",s&&(n+=''),n=n+'",s||(n=n+'"),n=n+'",s&&(n+=''),n=n+'",s||(n=n+'"),n+='',n=(n="Switzerland"==l.team2?n+'":n+"")+'",s&&(n+=''),n=n+'",s||(n+=''),n+='
'+r.escape(null==(e=h.getRound(l))?"":e)+' โ€ขย '+r.escape(null==(e=h.formatMatchTimeStamp(l.datetime))?"":e)+"Eastern",a=!0,n+="'+r.escape(null==(e=i.match_card.score)?"":e)+' '+r.escape(null==(e=i.match_card.win_prob)?"":e)+"'+r.escape(null==(e=i.match_card.tie)?"":e)+"
'+r.escape(null==(e=l.team1)?"":e)+"'+r.escape(null==(e=h.score1(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob1(l)))?"":e)+"'+r.escape(null==(e=h.nicePct(h.probtie(l)))?"":e)+"
'+r.escape(null==(e=l.team2)?"":e)+"'+r.escape(null==(e=h.score2(l))?"":e)+'"+r.escape(null==(e=h.nicePct(h.prob2(l)))?"":e)+"
'}.call(this),n+=""}.call(this),n+=""}.call(this,"Object"in i?i.Object:"undefined"!=typeof Object?Object:void 0,"archie"in i?i.archie:"undefined"!=typeof archie?archie:void 0,"completedDates"in i?i.completedDates:"undefined"!=typeof completedDates?completedDates:void 0,"edt"in i?i.edt:"undefined"!=typeof edt?edt:void 0,"isKnockoutMatch"in i?i.isKnockoutMatch:"undefined"!=typeof isKnockoutMatch?isKnockoutMatch:void 0,"matches"in i?i.matches:"undefined"!=typeof matches?matches:void 0,"matchesByDate"in i?i.matchesByDate:"undefined"!=typeof matchesByDate?matchesByDate:void 0,"upcomingDates"in i?i.upcomingDates:"undefined"!=typeof upcomingDates?upcomingDates:void 0,"utils"in i?i.utils:"undefined"!=typeof utils?utils:void 0),n}},2762:(t,e,n)=>{var r=n(7055);t.exports=function(t){var e,n="",i=t||{};return function(t,i,o,a,s,u,c,l,h,f,d,p){f=f||p.getTeams(a),c=p.ratingScale(f,"offense"),o=p.ratingScale(f,"defense"),s=p.dayjs(d).isAfter(u),n=n+'
'+(null==(e=t.group_hed)?"":e)+' '+(null==(e=t.prob_round_16)?"":e)+''+(null==(e=t.prob_round_16_mobile)?"":e)+"'+(null==(e=t.prob_quarters)?"":e)+''+(null==(e=t.prob_quarters_mobile)?"":e)+"'+(null==(e=t.prob_semis)?"":e)+"'+(null==(e=t.prob_final)?"":e)+'",h=p.sortedKnockoutTeams(f),function(){var a=h;if("number"==typeof a.length)for(var u=0,f=a.length;u"+r.escape(null==(e=m.group)?"":e)+'"+r.escape(null==(e=p.simPct(m,"make_round_of_16",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_quarters",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_semis",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_final",d,i))?"":e)+'"}else for(var u in f=0,a)f++,m=a[u],n=n+""+r.escape(null==(e=m.group)?"":e)+'"+r.escape(null==(e=p.simPct(m,"make_round_of_16",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_quarters",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_semis",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"make_final",d,i))?"":e)+'"}.call(this),n+="
'+(null==(e=t.team_ratings)?"":e)+''+(null==(e=t.groups)?"":e)+''+(null==(e=t.prob_rounds)?"":e)+'
'+(null==(e=t.team)?"":e)+"'+(null==(e=t.spi)?"":e)+''+(null==(e=t.offense)?"":e)+''+(null==(e=t.defense)?"":e)+''+(null==(e=t.group_1)?"":e)+''+(null==(e=t.group_2)?"":e)+"'+(null==(e=t.prob_win)?"":e)+"
'+r.escape(null==(e=m.name)?"":e),s||(n=n+" "+r.escape(null==(e=m.current_points)?"":e)+" "+r.escape(null==(e=1==m.current_points?t.points_label.replace("s",""):t.points_label)?"":e)+''+r.escape(null==(e=l)?"":e)+""),n=n+"
"+r.escape(null==(e=p.fixedRound(m.global_rating,1))?"":e)+' "+r.escape(null==(e=p.fixedRound(m.global_o,1))?"":e)+'"+r.escape(null==(e=p.fixedRound(m.global_d,1))?"":e)+'"+r.escape(null==(e=p.simPct(m,"group_1",d,i))?"":e)+'"+r.escape(null==(e=p.simPct(m,"group_2",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"win_league",d,i))?"":e)+"
'+r.escape(null==(e=m.name)?"":e),s||(n=n+" "+r.escape(null==(e=m.current_points)?"":e)+" "+r.escape(null==(e=1==m.current_points?t.points_label.replace("s",""):t.points_label)?"":e)+''+r.escape(null==(e=l)?"":e)+""),n=n+"
"+r.escape(null==(e=p.fixedRound(m.global_rating,1))?"":e)+' "+r.escape(null==(e=p.fixedRound(m.global_o,1))?"":e)+'"+r.escape(null==(e=p.fixedRound(m.global_d,1))?"":e)+'"+r.escape(null==(e=p.simPct(m,"group_1",d,i))?"":e)+'"+r.escape(null==(e=p.simPct(m,"group_2",d,i))?"":e)+""+r.escape(null==(e=p.simPct(m,"win_league",d,i))?"":e)+"
"}.call(this,"archie"in i?i.archie:"undefined"!=typeof archie?archie:void 0,"clinches"in i?i.clinches:"undefined"!=typeof clinches?clinches:void 0,"dScale"in i?i.dScale:"undefined"!=typeof dScale?dScale:void 0,"forecasts"in i?i.forecasts:"undefined"!=typeof forecasts?forecasts:void 0,"isKnockout"in i?i.isKnockout:"undefined"!=typeof isKnockout?isKnockout:void 0,"knockoutDate"in i?i.knockoutDate:"undefined"!=typeof knockoutDate?knockoutDate:void 0,"oScale"in i?i.oScale:"undefined"!=typeof oScale?oScale:void 0,"pts"in i?i.pts:"undefined"!=typeof pts?pts:void 0,"sortedTeams"in i?i.sortedTeams:"undefined"!=typeof sortedTeams?sortedTeams:void 0,"teams"in i?i.teams:"undefined"!=typeof teams?teams:void 0,"timestamp"in i?i.timestamp:"undefined"!=typeof timestamp?timestamp:void 0,"utils"in i?i.utils:"undefined"!=typeof utils?utils:void 0),n}},2700:(t,e,n)=>{"use strict";var r=n(821),i=n(8305),o=n(1787);t.exports=function(t){var e=r(this),n=i(e.length);if(!o(t))throw new TypeError("Array#find: predicate must be a function");if(0!==n){var a;arguments.length>0&&(a=arguments[1]);for(var s,u=0;u{"use strict";var r=n(4289),i=n(1924),o=n(9619),a=n(2700),s=n(4656),u=n(4600),c=i("Array.prototype.slice"),l=s(),h=function(t,e){o(t);var n=c(arguments,1);return l.apply(t,n)};r(h,{getPolyfill:s,implementation:a,shim:u}),t.exports=h},4656:(t,e,n)=>{"use strict";t.exports=function(){return Array.prototype.find&&1!==[,1].find((function(){return!0}))?Array.prototype.find:n(2700)}},4600:(t,e,n)=>{"use strict";var r=n(4289),i=n(7272),o=n(4656);t.exports=function(){var t=o();return r(Array.prototype,{find:t},{find:function(){return Array.prototype.find!==t}}),i("find"),t}},6214:(t,e,n)=>{"use strict";var r=Array.prototype.slice;function i(t){return t}var o=1e-6;function a(t){return"translate("+(t+.5)+",0)"}function s(t){return"translate(0,"+(t+.5)+")"}function u(t){return function(e){return+t(e)}}function c(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(n){return+t(n)+e}}function l(){return!this.__axis}function h(t,e){var n=[],h=null,f=null,d=6,p=6,m=3,y=1===t||4===t?-1:1,g=4===t||2===t?"x":"y",v=1===t||3===t?a:s;function _(r){var a=null==h?e.ticks?e.ticks.apply(e,n):e.domain():h,s=null==f?e.tickFormat?e.tickFormat.apply(e,n):i:f,_=Math.max(d,0)+m,b=e.range(),w=+b[0]+.5,S=+b[b.length-1]+.5,C=(e.bandwidth?c:u)(e.copy()),k=r.selection?r.selection():r,x=k.selectAll(".domain").data([null]),T=k.selectAll(".tick").data(a,e).order(),E=T.exit(),A=T.enter().append("g").attr("class","tick"),P=T.select("line"),M=T.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(A),P=P.merge(A.append("line").attr("stroke","currentColor").attr(g+"2",y*d)),M=M.merge(A.append("text").attr("fill","currentColor").attr(g,y*_).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),r!==k&&(x=x.transition(r),T=T.transition(r),P=P.transition(r),M=M.transition(r),E=E.transition(r).attr("opacity",o).attr("transform",(function(t){return isFinite(t=C(t))?v(t):this.getAttribute("transform")})),A.attr("opacity",o).attr("transform",(function(t){var e=this.parentNode.__axis;return v(e&&isFinite(e=e(t))?e:C(t))}))),E.remove(),x.attr("d",4===t||2==t?p?"M"+y*p+","+w+"H0.5V"+S+"H"+y*p:"M0.5,"+w+"V"+S:p?"M"+w+","+y*p+"V0.5H"+S+"V"+y*p:"M"+w+",0.5H"+S),T.attr("opacity",1).attr("transform",(function(t){return v(C(t))})),P.attr(g+"2",y*d),M.attr(g,y*_).text(s),k.filter(l).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),k.each((function(){this.__axis=C}))}return _.scale=function(t){return arguments.length?(e=t,_):e},_.ticks=function(){return n=r.call(arguments),_},_.tickArguments=function(t){return arguments.length?(n=null==t?[]:r.call(t),_):n.slice()},_.tickValues=function(t){return arguments.length?(h=null==t?null:r.call(t),_):h&&h.slice()},_.tickFormat=function(t){return arguments.length?(f=t,_):f},_.tickSize=function(t){return arguments.length?(d=p=+t,_):d},_.tickSizeInner=function(t){return arguments.length?(d=+t,_):d},_.tickSizeOuter=function(t){return arguments.length?(p=+t,_):p},_.tickPadding=function(t){return arguments.length?(m=+t,_):m},_}function f(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function d(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}var p=n(3626),m=n(2662);function y(){}function g(t){return null==t?y:function(){return this.querySelector(t)}}function v(){return[]}function _(t){return null==t?v:function(){return this.querySelectorAll(t)}}function b(t){return function(){return this.matches(t)}}function w(t){return new Array(t.length)}function S(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function C(t,e,n,r,i,o){for(var a,s=0,u=e.length,c=o.length;se?1:t>=e?0:NaN}S.prototype={constructor:S,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var T="http://www.w3.org/1999/xhtml";const E={svg:"http://www.w3.org/2000/svg",xhtml:T,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function A(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),E.hasOwnProperty(e)?{space:E[e],local:t}:t}function P(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function N(t,e){return function(){this.setAttribute(t,e)}}function I(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function D(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function O(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function F(t){return function(){this.style.removeProperty(t)}}function L(t,e,n){return function(){this.style.setProperty(t,e,n)}}function j(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function q(t,e){return t.style.getPropertyValue(e)||R(t).getComputedStyle(t,null).getPropertyValue(e)}function U(t){return function(){delete this[t]}}function B(t,e){return function(){this[t]=e}}function W(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function z(t){return t.trim().split(/^|\s+/)}function H(t){return t.classList||new $(t)}function $(t){this._node=t,this._names=z(t.getAttribute("class")||"")}function Y(t,e){for(var n=H(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ft={},dt=null;function pt(t,e,n){return t=mt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function mt(t,e,n){return function(r){var i=dt;dt=r;try{t.call(this,this.__data__,e,n)}finally{dt=i}}}function yt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function gt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=w&&(w=b+1);!(_=g[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=x);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?F:"function"==typeof e?j:L)(t,e,null==n?"":n)):q(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?U:"function"==typeof e?W:B)(t,e)):this.node()[t]},classed:function(t,e){var n=z(t+"");if(arguments.length<2){for(var r=H(this.node()),i=-1,o=n.length;++iAt)if(Math.abs(l*s-u*c)>At&&i){var f=n-o,d=r-a,p=s*s+u*u,m=f*f+d*d,y=Math.sqrt(p),g=Math.sqrt(h),v=i*Math.tan((Tt-Math.acos((p+h-m)/(2*y*g)))/2),_=v/g,b=v/y;Math.abs(_-1)>At&&(this._+="L"+(t+_*c)+","+(e+_*l)),this._+="A"+i+","+i+",0,0,"+ +(l*f>c*d)+","+(this._x1=t+b*s)+","+(this._y1=e+b*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>At||Math.abs(this._y1-c)>At)&&(this._+="L"+u+","+c),n&&(h<0&&(h=h%Et+Et),h>Pt?this._+="A"+n+","+n+",0,1,"+l+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):h>At&&(this._+="A"+n+","+n+",0,"+ +(h>=Tt)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const It=Nt;function Dt(t){return function(){return t}}function Ot(t){this._context=t}function Rt(t){return new Ot(t)}function Ft(t){return t[0]}function Lt(t){return t[1]}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var jt=Array.prototype.slice;function qt(t,e){if((i=t.length)>1)for(var n,r,i,o=1,a=t[e[0]],s=a.length;o=0;)n[e]=e;return n}function Bt(t,e){return t[e]}var Wt={value:function(){}};function zt(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Yt(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(null,t),e=e._next;--Zt}()}finally{Zt=0,function(){for(var t,e,n=Kt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Kt=e);Qt=t,he(r)}(),ee=0}}function le(){var t=re.now(),e=t-te;e>1e3&&(ne-=e,te=t)}function he(t){Zt||(Jt&&(Jt=clearTimeout(Jt)),t-ee>24?(t<1/0&&(Jt=setTimeout(ce,t-re.now()-ne)),Xt&&(Xt=clearInterval(Xt))):(Xt||(te=re.now(),Xt=setInterval(le,1e3)),Zt=1,ie(ce)))}function fe(t,e,n){var r=new se;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}se.prototype=ue.prototype={constructor:se,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?oe():+n)+(null==e?0:+e),this._next||Qt===this||(Qt?Qt._next=this:Kt=this,Qt=this),this._call=t,this._time=n,he()},stop:function(){this._call&&(this._call=null,this._time=1/0,he())}};var de=Gt("start","end","cancel","interrupt"),pe=[];function me(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var c,l,h,f;if(1!==n.state)return s();for(c in i)if((f=i[c]).name===n.name){if(3===f.state)return fe(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function ge(t,e){var n=ve(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ve(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var _e,be,we,Se,Ce=180/Math.PI,ke={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xe(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:(0,p.Z)(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:(0,p.Z)(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:(0,p.Z)(t,n)},{i:s-2,x:(0,p.Z)(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ye:ge;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var Je=xt.prototype.constructor;function Xe(t){return function(){this.style.removeProperty(t)}}function tn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function en(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&tn(t,o,n)),r}return o._value=e,o}function nn(t){return function(e){this.textContent=t.call(this,e)}}function rn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&nn(r)),e}return r._value=t,r}var on=0;function an(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function sn(){return++on}var un=xt.prototype;an.prototype=function(t){return xt().transition(t)}.prototype={constructor:an,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=g(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}(this,t)}))},xt.prototype.transition=function(t){var e,n;t instanceof an?(e=t._id,t=t._name):(e=sn(),(n=cn).time=oe(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o=l;--h)s.point(y[h],g[h]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+t(f,c,u),g[c]=+n(f,c,u),s.point(e?+e(f,c,u):y[c],r?+r(f,c,u):g[c]))}if(d)return s=null,d+""||null}function c(){return function(){var t=Ft,e=Lt,n=Dt(!0),r=null,i=Rt,o=null;function a(a){var s,u,c,l=a.length,h=!1;for(null==r&&(o=i(c=It())),s=0;s<=l;++s)!(s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0}))}},{key:"_moveDown",value:function(t){if(!0!==this.is_standalone&&(t.style.display="flex",t.insertBefore(this.el,t.querySelector("h3").nextSibling),0==document.querySelectorAll("#live-matches-wrap .match-wrap").length&&document.querySelector("#live-matches-wrap").classList.remove("any-live"),t.querySelectorAll(".match-wrap").length==t.querySelectorAll("svg").length&&!window.production)){var e=document.querySelector("h2.completed");e.parentNode.insertBefore(t,e.nextSibling),e.classList.remove("hidden")}}},{key:"_setMatchObservers",value:function(){new MutationObserver((function(t){var e,n=fn(t);try{for(n.s();!(e=n.n()).done;){var r,i=e.value,o=fn(i.addedNodes);try{for(o.s();!(r=o.n()).done;)r.value.classList.add("fade-in")}catch(t){o.e(t)}finally{o.f()}var a,s=fn(i.removedNodes);try{for(s.s();!(a=s.n()).done;)a.value.classList.add("fade-out")}catch(t){s.e(t)}finally{s.f()}}}catch(t){n.e(t)}finally{n.f()}})).observe(document.querySelector("#live-matches-wrap"),{childList:!0})}},{key:"tween",value:function(t,e){return function(){var n=hn.select(this),r=hn.interpolateNumber(mn.cleanNum(n.text()),mn.cleanNum(t));return function(t){n.text(Math.round(r(t))+e)}}}},{key:"update",value:function(t){this.match=t,this.data=this.match.live_winprobs.winprobs,this.periods=[];var e=this.ht,n=this.data.filter((function(t){return 1==t.period})).length;1==this.match.live_winprobs.period&&n>e?e=n:1!=this.match.live_winprobs.period&&(e=n-1),this.periods.push(e);var r=this.data.filter((function(t){return t.period>=3})).length>0||"ET"==this.match.live_winprobs.period,i=this.data.filter((function(t){return 5==t.period})).length>0;if(r){var o=this.data.filter((function(t){return t.period<=2})).length;this.periods.push(o-1),i&&(n=this.data.filter((function(t){return t.period<=4})).length,this.periods.push(n-1))}var a=r?o+32:this.ft;(this.data.length>a||"FT"==this.match.live_winprobs.period)&&(a=this.data.length+(i&&"FT"!=this.match.live_winprobs.period?3:-1)),this.periods.push(a),this._drawXAxis();var s=hn.stack().keys(this.keys).order(hn.stackOrderNone);this.layers.data(s(this.data)).attr("d",this.area),this.d3El.select(".score1").html(mn.score1(t)),this.d3El.select(".score2").html(mn.score2(t));for(var u=[{el:".prob1",pct:mn.livePct(mn.prob1(this.match),this.match.live_winprobs.period)},{el:".prob2",pct:mn.livePct(mn.prob2(this.match),this.match.live_winprobs.period)},{el:".prob-tie",pct:mn.livePct(mn.probtie(this.match),this.match.live_winprobs.period)}],c=0;c1?l.transition().ease(hn.easeCubic).duration(1e3).tween("text",this.tween(u[c].pct,"%")):l.text(u[c].pct)}}var d=this.d3El.select(".time"),p=d.text(),m=mn.formatLiveTime(this.match.live_winprobs.period,this.match.live_winprobs.min),y=mn.cleanNum(p),g=mn.cleanNum(m);focused&&p.indexOf("'")>=0&&p.indexOf("+")<0&&m.indexOf("'")>=0&&m.indexOf("+")<0&&Math.abs(y-g)>1?d.transition().ease(hn.easeCubic).duration(1e3).tween("text",this.tween(m,"'")):d.html(m),this._move()}}])&&pn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gn(t,e){for(var n=0;n=0?n.bracketEl.querySelector("#champ-slot"):n.bracketEl.querySelector(".match-top[data-slot='".concat(o,"'], .match-bottom[data-slot='").concat(o,"']")).querySelector(".inner-team"),n.removeTeam(r)):n.advanceTeam(e.target)}})),t.addEventListener("mouseover",(function(e){t.querySelector(".inner-team-wrap")&&(n.unhighlightMatches(),n.highlightTeam(e.target),e.target.classList.add("highlighted"))})),t.addEventListener("mouseout",(function(t){n.unhighlightTeams(),n.highlightDefault(),t.target.classList.remove("highlighted")}))}))}var e,n;return e=t,n=[{key:"updateData",value:function(t,e){if(this.teams=t.teams,this.matches=t.matches,this.clinches=t.clinches||[],this.setClinchSlots(),this.teamsByName=En.indexBy(this.teams,"name"),!e)if(this.showFixedTeams(),this.hasFixedSlots())this.runSims();else if(this.selectedTeam){var n=this.bracketEl.querySelector('.team[data-team="'.concat(this.selectedTeam,'"] td[data-side="').concat(this.selectedSide,'"]'));null==n&&(n=this.bracketEl.querySelector('.team[data-team="'.concat(this.selectedTeam,'"] td[data-side="left"]'))),this.highlightDefault(),this.highlightTeam(n)}else this.selectedMatch?this.highlightMatch():this.highlightDefault()}},{key:"setClinchSlots",value:function(){var e=this;this.clinchedSlots={};for(var n={},r=0;r=0){var o=this.teams.filter((function(t){return t.name==i.team_id}))[0],a="".concat(o.group,"-").concat(i.typ),s=t.clinchToSlot[a];this.clinchedSlots[s]=i.team_id,this.fixedSlots[s]=i.team_id,n[i.team_id]=i.typ}}for(r=0;r=0){var u=n[i.team_id];o=this.teams.filter((function(t){return t.name==i.team_id}))[0],a="".concat(o.group,"-").concat(u,"-").concat(i.typ),s=t.clinchToSlot[a],this.clinchedSlots[s]=i.team_id,this.fixedSlots[s]=i.team_id}this.elimSlots={},this.bracketEl.querySelectorAll(".group-teams").forEach((function(t){var n=t.dataset.group;t.querySelectorAll(".team").forEach((function(t){var r=t.dataset.team,i=e.clinches.filter((function(t){return t.team_id==r&&t.typ.indexOf("_elim")>=0})).map((function(t){return"".concat(n,"-").concat(t.typ.replace("_elim",""))}));e.elimSlots[r]=i}))}))}},{key:"highlightMatch",value:function(e,n){var r=this;for(var i in e=e||this.bracketEl.querySelector(".match[data-match='"+this.selectedMatch+"']"),n||this.unhighlightMatches(),this.selectedMatch=e.dataset.match,e.parentElement.dataset.side,this.bracketEl.querySelectorAll(".group-teams .match-prob").forEach((function(t){t.style.display="table-cell"})),this.bracketEl.querySelectorAll(".group-teams .default-prob").forEach((function(t){t.style.display="none"})),this.bracketEl.querySelectorAll(".group-teams .team").forEach((function(t){var n=t.dataset.team,i=r.simOutput[n]||r.teamsByName[n],o=(t.parentElement.parentElement.dataset.side,"slot_"+r.selectedMatch+"_1"),a="slot_"+r.selectedMatch+"_2";if(r.slotsPossible[o][n]||r.slotsPossible[a][n]){var s="17"==r.selectedMatch?An.bracket_header_champ:"15"==r.selectedMatch?An.bracket_header_final:"".concat(An.bracket_header_fill," ").concat(e.dataset.matchLabel," ").concat(An.bracket_header_match);t.parentNode.parentNode.querySelector("th.match-prob").innerHTML=s;var u=(i[o]||0)+(i[a]||0);t.querySelector(".match-prob").innerHTML=Tn.bracketPct(u,r.fixedSlots[o]==n||r.fixedSlots[a]==n),t.querySelector(".match-prob").style.backgroundColor=Tn.cellColor(u),t.classList.remove("eliminated")}else t.querySelector(".match-prob").innerHTML="",t.querySelector(".match-prob").style.backgroundColor="#fff",t.classList.add("eliminated")})),this.bracketEl.querySelectorAll(".inner-team-wrap").forEach((function(t){var e="slot_"+r.selectedMatch+"_1",n="slot_"+r.selectedMatch+"_2",i=t.dataset.team;r.simOutput[i]||r.teamsByName[i],r.slotsPossible[e][i]||r.slotsPossible[n][i]||t.classList.add("not-available")})),17!=this.selectedMatch?(this.bracketEl.querySelector(".match-spacer[data-match='"+this.selectedMatch+"']").classList.add("selected"),this.bracketEl.querySelector(".match-top[data-match='"+this.selectedMatch+"']").classList.add("selected"),this.bracketEl.querySelector(".match-bottom[data-match='"+this.selectedMatch+"']").classList.add("selected")):this.bracketEl.querySelector(".champ-spacer").classList.add("selected"),t.prevMatches[this.selectedMatch])this.bracketEl.querySelector(".match-top[data-match='"+t.prevMatches[this.selectedMatch][i]+"']").classList.add("selected"),this.bracketEl.querySelector(".match-bottom[data-match='"+t.prevMatches[this.selectedMatch][i]+"']").classList.add("selected"),this.bracketEl.querySelector(".match-spacer[data-match='"+t.prevMatches[this.selectedMatch][i]+"']").classList.add("highlighted")}},{key:"unhighlightMatches",value:function(){this.selectedMatch=null,this.bracketEl.querySelectorAll(".match-spacer, .match-top, .match-bottom, .champ-spacer").forEach((function(t){t.classList.remove("selected"),t.classList.remove("highlighted")})),this.bracketEl.querySelectorAll("th.match-prob").forEach((function(t){t.innerHTML=""})),this.bracketEl.querySelectorAll(".inner-team-wrap").forEach((function(t){t.classList.remove("not-available")}))}},{key:"advanceTeam",value:function(e){if(!e.classList.contains("name")){var n=this.closest(e,"nextSlot"),r=this.closest(e,"team"),i="slot_17_1"==n?"slot_17_2":"slot_17_2"==n?"slot_17_1":null;this.clinchedSlots[n]||this.elimSlots[r].indexOf(t.slotToClinch[n])>=0||t.crossSlots[n]&&this.clinchedSlots[t.crossSlots[n]]==r||(t.crossSlots[n]&&this.fixedSlots[t.crossSlots[n]]==r&&this.removeTeamFromSlot(r,t.crossSlots[n]),this.fixedSlots[n]&&this.removeTeamFromSlot(this.fixedSlots[n],n),this.fixedSlots[i]&&this.removeTeamFromSlot(this.fixedSlots[i],i),this.fixedSlots[n]=r,this.setPossibleSlots(),this.updateSims(),this.setReset())}}},{key:"removeTeam",value:function(t){var e=this.closest(t,"team"),n=this.closest(t,"slot")||this.closest(t,"nextSlot");t.classList.contains("champ-slot")&&(n=(e=this.fixedSlots.slot_17_1||this.fixedSlots.slot_17_2)==this.fixedSlots.slot_17_1?"slot_17_1":"slot_17_2"),this.removeTeamFromSlot(e,n),this.setPossibleSlots(),this.updateSims(),this.setReset()}},{key:"removeTeamFromSlot",value:function(t,e){for(var n=[];e;){var r=this.bracketEl.querySelector(".match[data-slot='".concat(e,"']")),i=r?r.querySelector(".inner-team-wrap"):null,o=r&&i?i.dataset.team:null;e.indexOf("_17")>=0?n=n.concat(["slot_17_1","slot_17_2"]):o!=t||this.clinchedSlots[e]||(n.push(e),i.remove()),e=r?r.dataset.nextSlot:null}for(var a in n)delete this.fixedSlots[n[a]]}},{key:"highlightTeam",value:function(t){var e=this,n=this.closest(t,"team");if(n){n!=this.selectedTeam&&this.unhighlightTeams(),this.selectedTeam=n,this.selectedSide=this.closest(t,"side"),"both"==this.selectedSide?document.querySelectorAll("tr[data-team = '".concat(this.selectedTeam,"'] td.td-num")).forEach((function(t){t.classList.add("highlighted")})):document.querySelectorAll("tr[data-team = '".concat(this.selectedTeam,"'] td[data-side = ").concat(this.selectedSide,"]")).forEach((function(t){t.classList.add("highlighted")}));var r=this.simOutput[this.selectedTeam]||this.teamsByName[this.selectedTeam];this.bracketEl.querySelectorAll(".group-teams .team[data-team='".concat(this.selectedTeam,"'] .default-prob")).forEach((function(t){if("both"==e.selectedSide||t.dataset.side==e.selectedSide)for(var n=t.dataset.nextSlot;n&&-1==n.indexOf("_17");){var i=n,o=e.bracketEl.querySelector(".match[data-slot='".concat(n,"']"));n=o.dataset.slot?o.dataset.nextSlot:null;var a=o.querySelector(".inner-team");if(a&&a.dataset.team!=e.selectedTeam)break;if(!e.slotsPossible[i][e.selectedTeam])break;var s=e.slotsPossible[n][e.selectedTeam]?Tn.bracketPct(r[n],e.fixedSlots[n]==e.selectedTeam):"",u=Tn.cellColor(r[n]);if(o.querySelector(".inner-team")&&e.fixedSlots[o.dataset.slot]||(o.innerHTML=Pn({utils:Tn,heat:u,team:e.selectedTeam,pct:s,showCheck:e.fixedSlots[o.dataset.slot]==e.selectedTeam,hasWon:e.fixedSlots[n]==e.selectedTeam,hasLost:e.fixedSlots[n]&&e.fixedSlots[n]!=e.selectedTeam})),!e.slotsPossible[n][e.selectedTeam])break}})),this.bracketEl.querySelectorAll(".inner-team-wrap, tr.team").forEach((function(t){t.dataset.team==e.selectedTeam?t.classList.add("highlighted"):t.classList.add("not-available")}));var i=this.slotsPossible.slot_17_1[this.selectedTeam],o=this.slotsPossible.slot_17_2[this.selectedTeam],a="left"==this.selectedSide?i:"right"==this.selectedSide?o:i||o,s=this.fixedSlots.slot_17_1||this.fixedSlots.slot_17_2;if(a&&!s){var u=r["both"==this.selectedSide||"center"==this.selectedSide?"win_league":"left"==this.selectedSide?"slot_17_1":"slot_17_2"];this.bracketEl.querySelector("#champ-slot .champ-team").innerHTML=Pn({utils:Tn,heat:Tn.cellColor(u),team:this.selectedTeam,pct:Tn.bracketPct(u),showCheck:!1,hasWon:!1,hasLost:!1})}else s||(this.bracketEl.querySelector("#champ-slot .champ-team").innerHTML="")}}},{key:"unhighlightTeams",value:function(){var t=this;this.selectedTeam=null,this.bracketEl.querySelectorAll(".match-top .inner-team-wrap, .match-bottom .inner-team-wrap").forEach((function(e){var n=e.parentNode.dataset.slot;t.fixedSlots[n]||e.remove()})),this.bracketEl.querySelectorAll(".inner-team-wrap.highlighted, tr.team.highlighted, td.td-num.highlighted").forEach((function(t){t.classList.remove("highlighted")})),this.fixedSlots.slot_17_1||this.fixedSlots.slot_17_2||(this.bracketEl.querySelector("#champ-slot .champ-team").innerHTML="")}},{key:"highlightDefault",value:function(){var e=this;this.unhighlightMatches(),this.bracketEl.querySelectorAll(".group-teams .match-prob").forEach((function(t){t.style.display="none"})),this.bracketEl.querySelectorAll(".group-teams .default-prob").forEach((function(t){t.style.display="table-cell"})),this.bracketEl.querySelectorAll(".group-teams .team").forEach((function(n){var r=n.dataset.team,i=e.simOutput[r]||e.teamsByName[r];n.classList.remove("eliminated"),n.querySelectorAll(".default-prob").forEach((function(n){var o=n.dataset.nextSlot,a=e.slotsPossible[o][r]?Tn.bracketPct(i[o],e.fixedSlots[o]==r):"",s=n.querySelector(".pct"),u=n.querySelector(".checkbox");e.clinchedSlots[o]?(u.style.visibility="hidden",s.style.display="inline-block",s.innerHTML="โœ“"==a?"โœ“":""):e.fixedSlots[o]==r?(s.style.visibility="hidden",u.checked=!0):e.elimSlots[r].indexOf(t.slotToClinch[o])>=0?u.style.visibility="hidden":(s.style.display="inline-block",s.innerHTML=a,s.style.visibility="visible",u.checked=!1,e.clinchedSlots[t.crossSlots[o]]==r&&(u.style.visibility="hidden")),"hidden"==u.style.visibility?n.classList.add("noselect"):n.classList.remove("noselect"),n.style.backgroundColor=Tn.cellColor(i[o])}))}))}},{key:"initWorker",value:function(){var t=this;this.worker||(this.worker=new Worker(staticUrl+"/js/aggregator.js?v=6"),this.worker.postMessage({cmd:"init",matches:this.matches,forecast:this.teams,maxSims:2e4,outputInterval:100}),this.worker.addEventListener("message",(function(e){if("update"==e.data.cmd)if(t.simOutput=e.data.items,t.showFixedTeams(),t.selectedTeam){var n=t.bracketEl.querySelector('.team[data-team="'.concat(t.selectedTeam,'"] td[data-side="').concat(t.selectedSide,'"]'));null==n&&(n=t.bracketEl.querySelector('.team[data-team="'.concat(t.selectedTeam,'"] td[data-side="left"]'))),t.highlightDefault(),t.highlightTeam(n)}else t.selectedMatch?t.highlightMatch():t.highlightDefault()})))}},{key:"runSims",value:function(){this.initWorker(),this.worker.postMessage({cmd:"sim",obj:this.fixedSlots})}},{key:"stopSims",value:function(){this.initWorker(),this.worker.postMessage({cmd:"stop"})}},{key:"updateSims",value:function(){if(this.hasFixedSlots())this.runSims();else if(this.stopSims(),this.simOutput={},this.showFixedTeams(),this.highlightDefault(),this.selectedTeam){var t=this.bracketEl.querySelector('.team[data-team="'.concat(this.selectedTeam,'"] td[data-side="').concat(this.selectedSide,'"]'));this.highlightTeam(t)}}},{key:"showFixedTeams",value:function(){for(var t in this.fixedSlots){var e=this.fixedSlots[t];if(t.indexOf("_17")>=0)this.bracketEl.querySelector("#champ-slot .champ-team").innerHTML=Pn({utils:Tn,heat:"#35b0ab",team:e,pct:"",showCheck:!1,hasWon:!0,hasLost:!1});else{var n=this.bracketEl.querySelector(".match[data-slot='".concat(t,"']")),r=n.dataset.nextSlot,i=this.simOutput[e]||this.teamsByName[e],o=this.slotsPossible[r][e]?Tn.bracketPct(i[r],this.fixedSlots[r]==e):"",a=Tn.cellColor(i[r]),s=!this.clinchedSlots[r],u=this.fixedSlots[r]==e,c=this.fixedSlots[r]&&this.fixedSlots[r]!=e,l=n.querySelector("input:checked");if(!(s&&u&&l)){var h=n.querySelector(".inner-team-wrap"),f=!(!h||!h.querySelector(".checkbox"))==s;h&&h.dataset.team==e&&f?(u||c?h.classList.add("decided"):h.classList.remove("decided"),h.querySelector(".prob-fixed").innerHTML="โœ“"==o?"":o,h.style.backgroundColor=a,s&&(h.querySelector(".checkbox").checked="โœ“"==o)):n.innerHTML=Pn({utils:Tn,heat:a,team:this.fixedSlots[t],pct:o,showCheck:s,hasWon:u,hasLost:c})}}}}},{key:"setPossibleSlots",value:function(){for(var e=this,n=1;n<=17;n++)for(var r=1;r<=2;r++)this.slotsPossible["slot_".concat(n,"_").concat(r)]={};this.bracketEl.querySelectorAll(".group-teams .team .default-prob").forEach((function(n){for(var r=n.parentNode,i=n.dataset.nextSlot,o=r.dataset.team;i;){var a="slot_17_1"==i?"slot_17_2":"slot_17_2"==i?"slot_17_1":null;if(t.crossSlots[i]&&e.fixedSlots[t.crossSlots[i]]==o)break;if(e.fixedSlots[i]&&e.fixedSlots[i]!=o)break;if(a&&e.fixedSlots[a]&&e.fixedSlots[a]!=o)break;if(e.elimSlots[o].indexOf(t.slotToClinch[i])>=0)break;e.slotsPossible[i][o]=!0;var s=e.bracketEl.querySelector(".match[data-slot='".concat(i,"']"));i=s?s.dataset.nextSlot:null}}))}},{key:"slotLabel",value:function(t){var e=parseInt(t.dataset.match);return e<=8?Tn.slotLabel(e,t.classList.contains("match-top")?1:2):""}},{key:"hasFixedSlots",value:function(){return Object.keys(this.fixedSlots).length>Object.keys(this.clinchedSlots).length}},{key:"hasCustomSims",value:function(){return Object.keys(this.simOutput).length>0}},{key:"setReset",value:function(){var t=this.bracketEl.querySelector(".reset-btn");this.hasFixedSlots()?t.classList.add("active"):t.classList.remove("active")}},{key:"resetBracket",value:function(){for(var t in this.stopSims(),this.fixedSlots)this.clinchedSlots[t]||this.removeTeamFromSlot(this.fixedSlots[t],t);this.simOutput={},this.setPossibleSlots(),this.showFixedTeams(),this.bracketEl.querySelector("#champ-slot .champ-team").innerHTML="",this.highlightDefault(),this.setReset()}},{key:"closest",value:function(t,e){for(;t&&t.dataset;){if(t.dataset[e])return t.dataset[e];t=t.parentNode}return null}}],n&&xn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nn(t,e){for(var n=0;n=0){var i=new URL(window.location.href).searchParams.get("test");this.testName=i&&i.length>0?i:"default",this.baseUrl+="tests/".concat(this.testName,"/"),this.liveData=!0,this.fbKey="test-updates"}}var e,n;return e=t,(n=[{key:"init",value:function(){var t=this;hn.json(this.baseUrl+"summary.json").then((function(e){t.initFunc(e)})),this.liveData&&(this.testName&&"live"!=this.testName?setInterval((function(){return t.updateTestData()}),500):this.updateLiveData())}},{key:"updateTestData",value:function(){var t=this;hn.json(this.baseUrl+"live_".concat(this.testIdx,".json")).then((function(e){t.updateFunc(e)})),this.testIdx++}},{key:"updateLiveData",value:function(){var t=this;Dn.Z.database().ref(this.fbKey).on("value",(function(e){var n=e.val();t.initializing?t.initializing=!1:n&&(!t.ts||n>t.ts)&&setTimeout((function(){hn.json(t.baseUrl+"live_".concat(n,".json")).then((function(e){t.updateFunc(e)}))}),1e3*Math.random()),n&&(t.ts=n)}))}}])&&Rn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();t=n.hmd(t),n(900);var Ln,jn,qn,Un,Bn,Wn,zn,Hn=n(3349),$n=n(5940),Yn=n(1793),Vn=n(9050),Gn=n(1627);window.production=location.hostname.indexOf("projects.fivethirtyeight.com")>=0,window.focused=!0;var Kn={},Qn=document.title;new Fn({init:function(t){Ln=t.forecasts,jn=Ln[0].teams,qn=t.matches,Un=Vn.indexBy(qn,"id"),Bn=Vn.indexBy(t.clinches||[],(function(t){return"".concat(t.team_id,"-").concat(t.typ)}));var e=Vn.sortBy(["default","bracket","matches"],(function(t){return document.querySelector("#".concat(t)).classList.contains("view-is-active")?0:1}));for(var n in e){var r=e[n];if("default"==r)Wn=new kn({teams:jn,forecasts:Ln,clinches:Vn.values(Bn)});else if("bracket"==r)zn=new Mn({teams:jn,matches:qn,clinches:Vn.values(Bn)});else for(document.getElementById("matches").innerHTML=Gn({matches:qn,utils:Yn,archie:$n}),n=0;n{!function(){var t=!1;try{document}catch(e){t=!0}t&&(self.Worker||(self.Worker=function(t){var e=this;this.id=Math.random().toString(36).substr(2,5),this.eventListeners={message:[]},self.addEventListener("message",(function(t){if(t.data._from===e.id){var n=new MessageEvent("message");n.initMessageEvent("message",!1,!1,t.data.message,e,"",null,[]),e.dispatchEvent(n),e.onmessage&&e.onmessage(n)}}));var n=self.location.pathname,r=n.substring(0,n.lastIndexOf("/"))+"/"+t;self.postMessage({_subworker:!0,cmd:"newWorker",id:this.id,path:r})},Worker.prototype={onerror:null,onmessage:null,postMessage:function(t){self.postMessage({_subworker:!0,id:this.id,cmd:"passMessage",message:t})},terminate:function(){self.postMessage({_subworker:!0,cmd:"terminate",id:this.id})},addEventListener:function(t,e,n){this.eventListeners[t]&&this.eventListeners[t].push(e)},removeEventListener:function(t,e,n){-1!==this.eventListeners[t].indexOf(e)&&this.eventListeners[t].splice(idx,1)},dispatchEvent:function(t){for(var e=this.eventListeners[t.type],n=0;n{e.l=function(){"use strict";var t,e,n,r=!!document.addEventListener;return Object.create||(Object.create=function(t){var e=function(){};return e.prototype=t,new e}),e=function(t,e,n){r?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},n=function(t,e,n){r?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},t={getCell:function(t){return this.trs[t].cells[this.column]},sort:function(t){var e=this,n=t.target;"TH"!==n.nodeName&&(n=n.parentNode),e.column=n.cellIndex,e.get=e.getAccessor(n.getAttribute("data-tsorter"));for(var r=0;ro.get(n)&&o.exchange(n,t),o.get(r)>o.get(t)&&o.exchange(t,r),o.get(t)>o.get(n)&&o.exchange(n,t),i=o.get(t);;){for(r--;i>o.get(r);)r--;for(n++;o.get(n)>i;)n++;if(r<=n)break;o.exchange(n,r)}o.exchange(t,r),r-to.get(t)&&o.exchange(e-1,t)},init:function(t,n,r){var i,o=this;for("string"==typeof t&&(t=document.getElementById(t)),o.table=t,o.ths=t.querySelectorAll("TH:not([top])"),o.tbody=t.tBodies[0],o.trs=o.tbody.getElementsByTagName("tr"),o.prevCol=n&&n>0?n:-1,o.accessors=r,o.boundSort=o.sort.bind(o),i=0;i99?">99%":t<1?"<1%":r.fixedRound(t,0).toString()+"%"},livePct:function(t,e){return"FT"==e&&0==t?"0%":"FT"==e&&1==t?"100%":r.nicePct(t)},cleanNum:function(t){return Math.round(t.replace("%","").replace(">","").replace("<","").replace("'",""))},bracketPct:function(t,e){return t=t||0,t*=100,e&&100==t?"โœ“":t>99?">99%":t<1?"<1%":r.fixedRound(t,0).toString()+"%"},simPct:function(t,e,n,i){var o=100*(t[e]||0),s=r.dayjs(n).tz("America/Los_Angeles").format("YYYY-MM-DD"),u=a.find(i,(function(n){return n.team_id==t.name&&n.typ==e&&n.dt<=s})),c=a.find(i,(function(n){return n.team_id==t.name&&n.typ==e+"_elim"&&n.dt<=s}));return 100==o&&u?"โœ“":0===o&&c?"โ€”":r.nicePct(t[e])},simVal:function(t,e,n,i){var o=r.simPct(t,e,n,i),a=t[e]||0;return 1==a&&"โœ“"!=o?a=.99999:0===a&&"โ€”"!=o&&(a=1e-5),a},isEliminated:function(t,e,n){return"โ€”"==r.simPct(t,"win_league",e,n)},bracketTeams:function(t){var e={Qatar:0,Ecuador:1,Senegal:2,Netherlands:3,England:4,Iran:5,USA:6,Wales:7,Argentina:8,"Saudi Arabia":9,Mexico:10,Poland:11,France:12,Denmark:13,Tunisia:14,Australia:15,Spain:16,Germany:17,Japan:18,"Costa Rica":19,Belgium:20,Canada:21,Morocco:22,Croatia:23,Brazil:24,Serbia:25,Switzerland:26,Cameroon:27,Portugal:28,Ghana:29,Uruguay:30,"South Korea":31};return a.groupBy(a.sortBy(t,(function(t){return e[t.name]})),"group")},slotLabel:function(t,e){return{"1-1":"1st place","1-2":"2nd place","2-1":"1st place","2-2":"2nd place","3-1":"1st place","3-2":"2nd place","4-1":"1st place","4-2":"2nd place","5-2":"1st place","5-1":"2nd place","6-2":"1st place","6-1":"2nd place","7-2":"1st place","7-1":"2nd place","8-2":"1st place","8-1":"2nd place"}[t+"-"+e]},getFlag:function(t){return{Argentina:"AR",Australia:"AU",Belgium:"BE",Brazil:"BR",Switzerland:"CH",Colombia:"CO","Costa Rica":"CR",Germany:"DE",Denmark:"DK",Egypt:"EG",Spain:"ES",France:"FR",England:"GB",Croatia:"HR",Iran:"IR",Iceland:"IS",Japan:"JP","South Korea":"KR",Morocco:"MA",Mexico:"MX",Nigeria:"NG",Panama:"PA",Peru:"PE",Poland:"PL",Portugal:"PT",Serbia:"RS",Russia:"RU","Saudi Arabia":"SA",Sweden:"SE",Senegal:"SN",Tunisia:"TN",Uruguay:"UY",Cameroon:"CM",Canada:"CA",Ecuador:"EC",Ghana:"GH",Netherlands:"NL",Qatar:"QA",USA:"US",Wales:"WA"}[t]},formatMatchTimeStamp:function(t){return r.dayjs(t).tz("America/New_York").format("h a ").replace("am","a.m.").replace("pm","p.m.")},formatLiveTime:function(t,e){if("HT"==t)return o.ht;if("ET"==t)return o.et;if("FT"==t)return o.ft;if("5"==t)return o.so;var n=e;return 1==t&&e>45&&(n="45+"+(e-45)),2==t&&e>90&&(n="90+"+(e-90)),3==t&&e>105&&(n="105+"+(e-105)),4==t&&e>120&&(n="120+"+(e-120)),n+"'"},score1:function(t){var e="";return"post"==t.status?e=t.score1:t.live_winprobs&&(e=t.live_winprobs.score1),t.live_winprobs&&null!=t.live_winprobs.pk1&&(e+=' ('.concat(t.live_winprobs.pk1,')')),e},score2:function(t){var e="";return"post"==t.status?e=t.score2:t.live_winprobs&&(e=t.live_winprobs.score2),t.live_winprobs&&null!=t.live_winprobs.pk2&&(e+=' ('.concat(t.live_winprobs.pk2,')')),e},prob1:function(t){return t.live_winprobs&&t.live_winprobs.winprobs.length>0?t.live_winprobs.winprobs[t.live_winprobs.winprobs.length-1].prob1:t.prob1},prob2:function(t){return t.live_winprobs&&t.live_winprobs.winprobs.length>0?t.live_winprobs.winprobs[t.live_winprobs.winprobs.length-1].prob2:t.prob2},probtie:function(t){return t.live_winprobs&&t.live_winprobs.winprobs.length>0?t.live_winprobs.winprobs[t.live_winprobs.winprobs.length-1].probtie:t.probtie},status:function(t){return t.live_winprobs?t.live_winprobs.status:t.status},title:function(t){var e=r.prob1(t)>=r.prob2(t),n=r.nicePct(e?r.prob1(t):r.prob2(t)),i=(e?t.team1_code:t.team2_code)+" ";return u&&(i={Argentina:"๐Ÿ‡ฆ๐Ÿ‡ท",Australia:"๐Ÿ‡ฆ๐Ÿ‡บ",Belgium:"๐Ÿ‡ง๐Ÿ‡ช",Brazil:"๐Ÿ‡ง๐Ÿ‡ท",Switzerland:"๐Ÿ‡จ๐Ÿ‡ญ",Colombia:"๐Ÿ‡จ๐Ÿ‡ด","Costa Rica":"๐Ÿ‡จ๐Ÿ‡ท",Germany:"๐Ÿ‡ฉ๐Ÿ‡ช",Denmark:"๐Ÿ‡ฉ๐Ÿ‡ฐ",Egypt:"๐Ÿ‡ช๐Ÿ‡ฌ",Spain:"๐Ÿ‡ช๐Ÿ‡ธ",France:"๐Ÿ‡ซ๐Ÿ‡ท",England:"๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ",Croatia:"๐Ÿ‡ญ๐Ÿ‡ท",Iran:"๐Ÿ‡ฎ๐Ÿ‡ท",Iceland:"๐Ÿ‡ฎ๐Ÿ‡ธ",Japan:"๐Ÿ‡ฏ๐Ÿ‡ต","South Korea":"๐Ÿ‡ฐ๐Ÿ‡ท",Morocco:"๐Ÿ‡ฒ๐Ÿ‡ฆ",Mexico:"๐Ÿ‡ฒ๐Ÿ‡ฝ",Nigeria:"๐Ÿ‡ณ๐Ÿ‡ฌ",Panama:"๐Ÿ‡ต๐Ÿ‡ฆ",Peru:"๐Ÿ‡ต๐Ÿ‡ช",Poland:"๐Ÿ‡ต๐Ÿ‡ฑ",Portugal:"๐Ÿ‡ต๐Ÿ‡น",Serbia:"๐Ÿ‡ท๐Ÿ‡ธ",Russia:"๐Ÿ‡ท๐Ÿ‡บ","Saudi Arabia":"๐Ÿ‡ธ๐Ÿ‡ฆ",Sweden:"๐Ÿ‡ธ๐Ÿ‡ช",Senegal:"๐Ÿ‡ธ๐Ÿ‡ณ",Tunisia:"๐Ÿ‡น๐Ÿ‡ณ",Uruguay:"๐Ÿ‡บ๐Ÿ‡พ",Cameroon:"๐Ÿ‡จ๐Ÿ‡ฒ",Canada:"๐Ÿ‡จ๐Ÿ‡ฆ",Ecuador:"๐Ÿ‡ช๐Ÿ‡จ",Ghana:"๐Ÿ‡ฌ๐Ÿ‡ญ",Netherlands:"๐Ÿ‡ณ๐Ÿ‡ฑ",Qatar:"๐Ÿ‡ถ๐Ÿ‡ฆ",USA:"๐Ÿ‡บ๐Ÿ‡ธ",Wales:"๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ"}[e?t.team1:t.team2]),"".concat(i).concat(n," | ")},matchesByDate:function(t){return a.groupBy(t,(function(t){return r.dayjs(t.datetime).tz("America/New_York").format("YYYY-MM-DD")}))},upcomingDates:function(t){var e=[],n=r.dayjs().tz("America/New_York").format("YYYY-MM-DD");for(var i in t)i>=n&&e.push(i);return e},longDate:function(t){return r.getAPDate("".concat(t,"T18:00:00"))},dayName:function(t){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][new Date(t).getUTCDay()]},txtColor:function(t,e){var n=r.nicePct(e);return"<1%"===n||"0%"===n||"โ€”"==n?"#ccc":"#222"},cellColor:function(t){return"blank"===t?"transparent":c(t||0)},dropdownLabels:function(t){var e=["tournament","second","third","16","quarter","semi","final"],n=t.length-1;n=Math.min(7,n);for(var r=[],i=0;i{"use strict";var r=n(210),i=n(5559),o=i(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&o(t,".prototype.")>-1?i(n):n}},5559:(t,e,n)=>{"use strict";var r=n(8612),i=n(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(r,a,arguments);if(u&&c){var n=u(e,"length");n.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var h=function(){return s(r,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h},2650:(t,e,n)=>{"use strict";function r(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function i(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function o(){}n.d(e,{ZP:()=>w,B8:()=>x});var a=.7,s=1/a,u="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",l="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h=/^#([0-9a-f]{3,8})$/,f=new RegExp("^rgb\\("+[u,u,u]+"\\)$"),d=new RegExp("^rgb\\("+[l,l,l]+"\\)$"),p=new RegExp("^rgba\\("+[u,u,u,c]+"\\)$"),m=new RegExp("^rgba\\("+[l,l,l,c]+"\\)$"),y=new RegExp("^hsl\\("+[c,l,l]+"\\)$"),g=new RegExp("^hsla\\("+[c,l,l,c]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function _(){return this.rgb().formatHex()}function b(){return this.rgb().formatRgb()}function w(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=h.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?S(e):3===n?new T(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?C(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?C(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=f.exec(t))?new T(e[1],e[2],e[3],1):(e=d.exec(t))?new T(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=p.exec(t))?C(e[1],e[2],e[3],e[4]):(e=m.exec(t))?C(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=y.exec(t))?M(e[1],e[2]/100,e[3]/100,1):(e=g.exec(t))?M(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?S(v[t]):"transparent"===t?new T(NaN,NaN,NaN,0):null}function S(t){return new T(t>>16&255,t>>8&255,255&t,1)}function C(t,e,n,r){return r<=0&&(t=e=n=NaN),new T(t,e,n,r)}function k(t){return t instanceof o||(t=w(t)),t?new T((t=t.rgb()).r,t.g,t.b,t.opacity):new T}function x(t,e,n,r){return 1===arguments.length?k(t):new T(t,e,n,null==r?1:r)}function T(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function E(){return"#"+P(this.r)+P(this.g)+P(this.b)}function A(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function P(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function M(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new I(t,e,n,r)}function N(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=w(t)),!t)return new I;if(t instanceof I)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,u=a-i,c=(a+i)/2;return u?(s=e===a?(n-r)/u+6*(n0&&c<1?0:s,new I(s,u,c,t.opacity)}function I(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function D(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}r(o,w,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_,formatHex:_,formatHsl:function(){return N(this).formatHsl()},formatRgb:b,toString:b}),r(T,x,i(o,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new T(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new T(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:E,formatHex:E,formatRgb:A,toString:A})),r(I,(function(t,e,n,r){return 1===arguments.length?N(t):new I(t,e,n,null==r?1:r)}),i(o,{brighter:function(t){return t=null==t?s:Math.pow(s,t),new I(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?a:Math.pow(a,t),new I(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new T(D(t>=240?t-240:t+120,i,r),D(t,i,r),D(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}))},5302:(t,e,n)=>{"use strict";function r(t){return function(){return t}}n.d(e,{Z:()=>r})},3626:(t,e,n)=>{"use strict";function r(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}n.d(e,{Z:()=>r})},7765:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>s});var r=n(2650);function i(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}var o=n(5302);function a(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):(0,o.Z)(isNaN(t)?e:t)}const s=function t(e){var n=function(t){return 1==(t=+t)?a:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):(0,o.Z)(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=(0,r.B8)(t)).r,(e=(0,r.B8)(e)).r),o=n(t.g,e.g),s=n(t.b,e.b),u=a(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=s(e),t.opacity=u(e),t+""}}return i.gamma=t,i}(1);function u(t){return function(e){var n,i,o=e.length,a=new Array(o),s=new Array(o),u=new Array(o);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),o=t[r],a=t[r+1],s=r>0?t[r-1]:2*o-a,u=r{"use strict";n.d(e,{Z:()=>a});var r=n(3626),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o=new RegExp(i.source,"g");function a(t,e){var n,a,s,u=i.lastIndex=o.lastIndex=0,c=-1,l=[],h=[];for(t+="",e+="";(n=i.exec(t))&&(a=o.exec(e));)(s=a.index)>u&&(s=e.slice(u,s),l[c]?l[c]+=s:l[++c]=s),(n=n[0])===(a=a[0])?l[c]?l[c]+=a:l[++c]=a:(l[++c]=null,h.push({i:c,x:(0,r.Z)(n,a)})),u=o.lastIndex;return u{"use strict";function r(t,e){return te?1:t>=e?0:NaN}function i(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}n.r(e),n.d(e,{scaleBand:()=>N,scaleDiverging:()=>br,scaleDivergingLog:()=>wr,scaleDivergingPow:()=>Cr,scaleDivergingSqrt:()=>kr,scaleDivergingSymlog:()=>Sr,scaleIdentity:()=>vt,scaleImplicit:()=>P,scaleLinear:()=>gt,scaleLog:()=>Et,scaleOrdinal:()=>M,scalePoint:()=>D,scalePow:()=>Ft,scaleQuantile:()=>jt,scaleQuantize:()=>qt,scaleSequential:()=>dr,scaleSequentialLog:()=>pr,scaleSequentialPow:()=>yr,scaleSequentialQuantile:()=>vr,scaleSequentialSqrt:()=>gr,scaleSequentialSymlog:()=>mr,scaleSqrt:()=>Lt,scaleSymlog:()=>Nt,scaleThreshold:()=>Ut,scaleTime:()=>rr,scaleUtc:()=>lr,tickFormat:()=>mt});var o=i(r),a=o.right;o.left;const s=a;var u=Array.prototype,c=(u.slice,u.map,Math.sqrt(50)),l=Math.sqrt(10),h=Math.sqrt(2);function f(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=c?10:o>=l?5:o>=h?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=c?10:o>=l?5:o>=h?2:1)}function p(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=c?i*=10:o>=l?i*=5:o>=h&&(i*=2),e=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function g(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function Q(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?Z:Q,i=o=null,h}function h(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=r(s,a.map(t),j.Z)))(n)))},h.domain=function(t){return arguments.length?(a=E.call(t,$),c===V||(c=K(a)),l()):a.slice()},h.range=function(t){return arguments.length?(s=A.call(t),l()):s.slice()},h.rangeRound=function(t){return s=A.call(t),u=H,l()},h.clamp=function(t){return arguments.length?(c=t?K(a):V,h):c!==V},h.interpolate=function(t){return arguments.length?(u=t,l()):u},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,l()}}function tt(t,e){return X()(t,e)}var et,nt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rt(t){if(!(e=nt.exec(t)))throw new Error("invalid format: "+t);var e;return new it({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function it(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function ot(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function at(t){return(t=ot(Math.abs(t)))?t[1]:NaN}function st(t,e){var n=ot(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}rt.prototype=it.prototype,it.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const ut={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return st(100*t,e)},r:st,s:function(t,e){var n=ot(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(et=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ot(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function ct(t){return t}var lt,ht,ft,dt=Array.prototype.map,pt=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function mt(t,e,n,r){var i,o=p(t,e,n);switch((r=rt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(at(e)/3)))-at(Math.abs(t)))}(o,a))||(r.precision=i),ft(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,at(e)-at(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-at(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return ht(r)}function yt(t){var e=t.domain;return t.ticks=function(t){var n=e();return f(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return mt(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),o=0,a=i.length-1,s=i[o],u=i[a];return u0?r=d(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=d(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,e(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,e(i)),t},t}function gt(){var t=tt(V,V);return t.copy=function(){return J(t,gt())},v.apply(t,arguments),yt(t)}function vt(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=E.call(e,$),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return vt(t).unknown(e)},t=arguments.length?E.call(t,$):[0,1],yt(n)}function _t(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;du)break;y.push(h)}}else for(;d=1;--l)if(!((h=c*l)u)break;y.push(h)}}else y=f(d,p,Math.min(p-d,m)).map(n);return r?y.reverse():y},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=ht(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o0?i[r-1]:e[0],r=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return qt().domain([e,n]).range(o).unknown(t)},v.apply(yt(a),arguments)}function Ut(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[s(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=A.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=A.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Ut().domain(e).range(n).unknown(t)},v.apply(i,arguments)}lt=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?ct:(e=dt.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?ct:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(dt.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=rt(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,m=t.comma,y=t.precision,g=t.trim,v=t.type;"n"===v?(m=!0,v="g"):ut[v]||(void 0===y&&(y=12),g=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var _="$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===f?o:/[%p]/.test(v)?u:"",w=ut[v],S=/[defgprs%]/.test(v);function C(t){var i,o,u,f=_,C=b;if("c"===v)C=w(t)+C,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),y),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==h&&(k=!1),f=(k?"("===h?h:c:"-"===h||"("===h?"":h)+f,C=("s"===v?pt[8+et/3]:"")+C+(k&&"("===h?")":""),S)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){C=(46===u?a+t.slice(i+1):t.slice(i))+C,t=t.slice(0,i);break}}m&&!d&&(t=r(t,1/0));var x=f.length+t.length+C.length,T=x>1)+f+t+C+T.slice(x);break;default:t=T+f+t+C}return s(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),C.toString=function(){return t+""},C}return{format:h,formatPrefix:function(t,e){var n=h(((t=rt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(at(e)/3))),i=Math.pow(10,-r),o=pt[8+r/3];return function(t){return n(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),ht=lt.format,ft=lt.formatPrefix;var Bt=new Date,Wt=new Date;function zt(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Bt.setTime(+e),Wt.setTime(+r),t(Bt),t(Wt),Math.floor(n(Bt,Wt))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Ht=zt((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ht.every=function(t){return isFinite(t=Math.floor(t))&&t>0?zt((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const $t=Ht;Ht.range;var Yt=zt((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));const Vt=Yt;Yt.range;var Gt=1e3,Kt=6e4,Qt=36e5,Zt=864e5,Jt=6048e5;function Xt(t){return zt((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Kt)/Jt}))}var te=Xt(0),ee=Xt(1),ne=Xt(2),re=Xt(3),ie=Xt(4),oe=Xt(5),ae=Xt(6),se=(te.range,ee.range,ne.range,re.range,ie.range,oe.range,ae.range,zt((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Kt)/Zt}),(function(t){return t.getDate()-1})));const ue=se;se.range;var ce=zt((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Gt-t.getMinutes()*Kt)}),(function(t,e){t.setTime(+t+e*Qt)}),(function(t,e){return(e-t)/Qt}),(function(t){return t.getHours()}));const le=ce;ce.range;var he=zt((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Gt)}),(function(t,e){t.setTime(+t+e*Kt)}),(function(t,e){return(e-t)/Kt}),(function(t){return t.getMinutes()}));const fe=he;he.range;var de=zt((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*Gt)}),(function(t,e){return(e-t)/Gt}),(function(t){return t.getUTCSeconds()}));const pe=de;de.range;var me=zt((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));me.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?zt((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):me:null};const ye=me;function ge(t){return zt((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Jt}))}me.range;var ve=ge(0),_e=ge(1),be=ge(2),we=ge(3),Se=ge(4),Ce=ge(5),ke=ge(6),xe=(ve.range,_e.range,be.range,we.range,Se.range,Ce.range,ke.range,zt((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Zt}),(function(t){return t.getUTCDate()-1})));const Te=xe;xe.range;var Ee=zt((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Ee.every=function(t){return isFinite(t=Math.floor(t))&&t>0?zt((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const Ae=Ee;function Pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Me(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ne(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}Ee.range;var Ie,De,Oe,Re={"-":"",_:" ",0:"0"},Fe=/^\s*\d+/,Le=/^%/,je=/[\\^$*+?|[\]().{}]/g;function qe(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function Qe(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ze(t,e,n){var r=Fe.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Je(t,e,n){var r=Fe.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Xe(t,e,n){var r=Fe.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function tn(t,e,n){var r=Fe.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function en(t,e,n){var r=Fe.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function nn(t,e,n){var r=Fe.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function rn(t,e,n){var r=Fe.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function on(t,e,n){var r=Fe.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function an(t,e,n){var r=Fe.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function sn(t,e,n){var r=Le.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function un(t,e,n){var r=Fe.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function cn(t,e,n){var r=Fe.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ln(t,e){return qe(t.getDate(),e,2)}function hn(t,e){return qe(t.getHours(),e,2)}function fn(t,e){return qe(t.getHours()%12||12,e,2)}function dn(t,e){return qe(1+ue.count($t(t),t),e,3)}function pn(t,e){return qe(t.getMilliseconds(),e,3)}function mn(t,e){return pn(t,e)+"000"}function yn(t,e){return qe(t.getMonth()+1,e,2)}function gn(t,e){return qe(t.getMinutes(),e,2)}function vn(t,e){return qe(t.getSeconds(),e,2)}function _n(t){var e=t.getDay();return 0===e?7:e}function bn(t,e){return qe(te.count($t(t)-1,t),e,2)}function wn(t){var e=t.getDay();return e>=4||0===e?ie(t):ie.ceil(t)}function Sn(t,e){return t=wn(t),qe(ie.count($t(t),t)+(4===$t(t).getDay()),e,2)}function Cn(t){return t.getDay()}function kn(t,e){return qe(ee.count($t(t)-1,t),e,2)}function xn(t,e){return qe(t.getFullYear()%100,e,2)}function Tn(t,e){return qe((t=wn(t)).getFullYear()%100,e,2)}function En(t,e){return qe(t.getFullYear()%1e4,e,4)}function An(t,e){var n=t.getDay();return qe((t=n>=4||0===n?ie(t):ie.ceil(t)).getFullYear()%1e4,e,4)}function Pn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qe(e/60|0,"0",2)+qe(e%60,"0",2)}function Mn(t,e){return qe(t.getUTCDate(),e,2)}function Nn(t,e){return qe(t.getUTCHours(),e,2)}function In(t,e){return qe(t.getUTCHours()%12||12,e,2)}function Dn(t,e){return qe(1+Te.count(Ae(t),t),e,3)}function On(t,e){return qe(t.getUTCMilliseconds(),e,3)}function Rn(t,e){return On(t,e)+"000"}function Fn(t,e){return qe(t.getUTCMonth()+1,e,2)}function Ln(t,e){return qe(t.getUTCMinutes(),e,2)}function jn(t,e){return qe(t.getUTCSeconds(),e,2)}function qn(t){var e=t.getUTCDay();return 0===e?7:e}function Un(t,e){return qe(ve.count(Ae(t)-1,t),e,2)}function Bn(t){var e=t.getUTCDay();return e>=4||0===e?Se(t):Se.ceil(t)}function Wn(t,e){return t=Bn(t),qe(Se.count(Ae(t),t)+(4===Ae(t).getUTCDay()),e,2)}function zn(t){return t.getUTCDay()}function Hn(t,e){return qe(_e.count(Ae(t)-1,t),e,2)}function $n(t,e){return qe(t.getUTCFullYear()%100,e,2)}function Yn(t,e){return qe((t=Bn(t)).getUTCFullYear()%100,e,2)}function Vn(t,e){return qe(t.getUTCFullYear()%1e4,e,4)}function Gn(t,e){var n=t.getUTCDay();return qe((t=n>=4||0===n?Se(t):Se.ceil(t)).getUTCFullYear()%1e4,e,4)}function Kn(){return"+0000"}function Qn(){return"%"}function Zn(t){return+t}function Jn(t){return Math.floor(+t/1e3)}Ie=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=Be(i),l=We(i),h=Be(o),f=We(o),d=Be(a),p=We(a),m=Be(s),y=We(s),g=Be(u),v=We(u),_={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:ln,e:ln,f:mn,g:Tn,G:An,H:hn,I:fn,j:dn,L:pn,m:yn,M:gn,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Zn,s:Jn,S:vn,u:_n,U:bn,V:Sn,w:Cn,W:kn,x:null,X:null,y:xn,Y:En,Z:Pn,"%":Qn},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Mn,e:Mn,f:Rn,g:Yn,G:Gn,H:Nn,I:In,j:Dn,L:On,m:Fn,M:Ln,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Zn,s:Jn,S:jn,u:qn,U:Un,V:Wn,w:zn,W:Hn,x:null,X:null,y:$n,Y:Vn,Z:Kn,"%":Qn},w={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return k(t,e,n,r)},d:Xe,e:Xe,f:an,g:Ke,G:Ge,H:en,I:en,j:tn,L:on,m:Je,M:nn,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:Ze,Q:un,s:cn,S:rn,u:He,U:$e,V:Ye,w:ze,W:Ve,x:function(t,e,r){return k(t,n,e,r)},X:function(t,e,n){return k(t,r,e,n)},y:Ke,Y:Ge,Z:Qe,"%":sn};function S(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Me(Ne(o.y,0,1))).getUTCDay(),r=i>4||0===i?_e.ceil(r):_e(r),r=Te.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Pe(Ne(o.y,0,1))).getDay(),r=i>4||0===i?ee.ceil(r):ee(r),r=ue.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Me(Ne(o.y,0,1)).getUTCDay():Pe(Ne(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Me(o)):Pe(o)}}function k(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in Re?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return _.x=S(n,_),_.X=S(r,_),_.c=S(e,_),b.x=S(n,b),b.X=S(r,b),b.c=S(e,b),{format:function(t){var e=S(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=S(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),De=Ie.format,Ie.parse,Oe=Ie.utcFormat,Ie.utcParse;var Xn=31536e6;function tr(t){return new Date(t)}function er(t){return t instanceof Date?+t:+new Date(+t)}function nr(t,e,n,r,o,a,s,u,c){var l=tt(V,V),h=l.invert,f=l.domain,d=c(".%L"),m=c(":%S"),y=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),_=c("%b %d"),b=c("%B"),w=c("%Y"),S=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,Xn]];function C(i){return(s(i)12?t-12:t}(n);if(function(t,e){return function(t){return 0===t}(t)&&null==e.includeMinutes}(r,e))return o+" "+i;var a=function(t){return t<10?"0"+t:t.toString()}(r);return o+":"+a+" "+i},t.getAPDate=function(r){null==r&&(r={});var i=t.getMonth(),o=t.getDate(),a=t.getFullYear(),s=n[i];return function(t,e){return null!=e.useDayNameForLastWeek&&function(t){var e=(t-new Date)/864e5;return-7=e?t:""+Array(e+1-r.length).join(n)+t},g={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var s=e.name;_[s]=e,i=s}return!r&&i&&(v=i),i||!r&&v},S=function(t,e){if(b(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new k(n)},C=g;C.l=w,C.i=b,C.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var k=function(){function m(t){this.$L=w(t.locale,null,!0),this.parse(t)}var y=m.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(C.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(d);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return S(t)=0&&(o[h]=parseInt(l,10))}var f=o[3],d=24===f?0:f,p=o[0]+"-"+o[1]+"-"+o[2]+" "+d+":"+o[4]+":"+o[5]+":000",m=+e;return(i.utc(p).valueOf()-(m-=m%1e3))/6e4},u=r.prototype;u.tz=function(t,e){void 0===t&&(t=o);var n=this.utcOffset(),r=this.toDate(),a=r.toLocaleString("en-US",{timeZone:t}),s=Math.round((r-new Date(a))/1e3/60),u=i(a).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-s,!0);if(e){var c=u.utcOffset();u=u.add(n-c,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return n&&n.value};var c=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return c.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var r=n&&e,a=n||e||o,u=s(+i(),a);if("string"!=typeof t)return i(t).tz(a);var c=function(t,e,n){var r=t-60*e*1e3,i=s(r,n);if(e===i)return[r,e];var o=s(r-=60*(i-e)*1e3,n);return i===o?[r,i]:[t-60*Math.min(i,o)*1e3,Math.max(i,o)]}(i.utc(t,r).valueOf(),u,a),l=c[0],h=c[1],f=i(l).utcOffset(h);return f.$x.$timezone=a,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){o=t}}}()},178:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,o){var a=i.prototype;o.utc=function(t){return new i({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=o(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var c=a.utcOffset;a.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(t){void 0===t&&(t="");var r=t.match(e);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,s=this;if(i)return s.$offset=a,s.$u=0===r,s;if(0!==r){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+u,t)).$offset=a,s.$x.$localOffset=u}else s=this.utc();return s};var l=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var r=this.local(),i=o(t).local();return f.call(r,i,e,n)}}}()},4289:(t,e,n)=>{"use strict";var r=n(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=n(1044)(),c=s&&u,l=function(t,e,n,r){var i;(!(e in t)||"function"==typeof(i=r)&&"[object Function]"===o.call(i)&&r())&&(c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},h=function(t,e){var n=arguments.length>2?arguments[2]:{},o=r(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s{"use strict";function e(){if(null!==e.cache)return e.cache;if("undefined"==typeof window)return!1;var t=window.document.createElement("canvas").getContext("2d");if(!t)return!1;var n=12*(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1);t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("๐Ÿจ",0,0);var r=0!==t.getImageData(n,n,1,1).data[0];return e.cache=r,r}e.cache=null,t.exports=e},7272:(t,e,n)=>{"use strict";var r=n(7642),i="function"==typeof Symbol&&"symbol"==typeof Symbol.unscopables,o=i&&Array.prototype[Symbol.unscopables],a=TypeError;t.exports=function(t){if("string"!=typeof t||!t)throw new a("method must be a non-empty string");if(!r(Array.prototype,t))throw new a("method must be on Array.prototype");i&&(o[t]=!0)}},1503:(t,e,n)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=n(4149),o=n(5320),a=n(8923),s=n(2636),u=function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var n,r,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?e=c(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var o=e.call(t,n);if(i(o))return o;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||s(t))&&(n="string"),u(t,"default"===n?"number":n)}},4149:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},4470:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===n.call(t)},a=function(t){if(!t||"[object Object]"!==n.call(t))return!1;var r,i=e.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&e.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!o)return!1;for(r in t);return void 0===r||e.call(t,r)},s=function(t,e){r&&"__proto__"===e.name?r(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},u=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};t.exports=function t(){var e,n,r,i,c,l,h=arguments[0],f=1,d=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},f=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});f{"use strict";var e="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||r.call(o)!==i)throw new TypeError(e+o);for(var a,s=n.call(arguments,1),u=function(){if(this instanceof a){var e=o.apply(this,s.concat(n.call(arguments)));return Object(e)===e?e:this}return o.apply(t,s.concat(n.call(arguments)))},c=Math.max(0,o.length-s.length),l=[],h=0;h{"use strict";var r=n(7648);t.exports=Function.prototype.bind||r},210:(t,e,n)=>{"use strict";var r,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,h=n(1405)(),f=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?r:f(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?f((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):r,"%Symbol%":h?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},y=function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=f(i.prototype))}return m[e]=n,n},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(8612),_=n(7642),b=v.call(Function.call,Array.prototype.concat),w=v.call(Function.apply,Array.prototype.splice),S=v.call(Function.call,String.prototype.replace),C=v.call(Function.call,String.prototype.slice),k=v.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,E=function(t){var e=C(t,0,1),n=C(t,-1);if("%"===e&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return S(t,x,(function(t,e,n,i){r[r.length]=n?S(i,T,"$1"):e||t})),r},A=function(t,e){var n,r=t;if(_(g,r)&&(r="%"+(n=g[r])[0]+"%"),_(m,r)){var o=m[r];if(o===d&&(o=y(r)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===k(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=E(t),r=n.length>0?n[0]:"",o=A("%"+r+"%",e),s=o.name,c=o.value,l=!1,h=o.alias;h&&(r=h[0],w(n,b([0,1],h)));for(var f=1,d=!0;f=n.length){var v=u(c,p);c=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[p]}else d=_(c,p),c=c[p];d&&!l&&(m[s]=c)}}return c}},1044:(t,e,n)=>{"use strict";var r=n(210)("%Object.defineProperty%",!0),i=function(){if(r)try{return r({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},1405:(t,e,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,i=n(5419);t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,n)=>{"use strict";var r=n(5419);t.exports=function(){return r()&&!!Symbol.toStringTag}},7642:(t,e,n)=>{"use strict";var r=n(8612);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},5320:t=>{"use strict";var e,n,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,e)}catch(t){t!==n&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=r.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(r.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==n)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},8923:(t,e,n)=>{"use strict";var r=Date.prototype.getDay,i=Object.prototype.toString,o=n(6410)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},8420:(t,e,n)=>{"use strict";var r,i,o,a,s=n(1924),u=n(6410)();if(u){r=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var c=function(){throw o};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!r(e,"value"))return!1;try{i(t,a)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},2636:(t,e,n)=>{"use strict";var r=Object.prototype.toString;if(n(1405)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},900:(t,e,n)=>{"use strict";n.r(e)},8987:(t,e,n)=>{"use strict";var r;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=n(1414),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===o.call(t),r=a(t),s=e&&"[object String]"===o.call(t),f=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var p=c&&n;if(s&&t.length>0&&!i.call(t,0))for(var m=0;m0)for(var y=0;y{"use strict";var r=Array.prototype.slice,i=n(1414),o=Object.keys,a=o?function(t){return o(t)}:n(8987),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(r.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var n=e.call(t),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),r}},7055:(t,e,n)=>{"use strict";var r=Object.prototype.hasOwnProperty;function i(t,e){return Array.isArray(t)?function(t,e){for(var n,r="",o="",a=Array.isArray(e),s=0;s]/;function u(t){var e=""+t,n=s.exec(e);if(!n)return t;var r,i,o,a="";for(r=n.index,i=0;r ":" ")+n+"| "+t})).join("\n"),e.path=r,e.message=(r||"Pug")+":"+i+"\n"+a+"\n\n"+e.message,e}},9246:(t,e,n)=>{"use strict";var r=n(1924),i=n(210),o=n(8420),a=r("RegExp.prototype.exec"),s=i("%TypeError%");t.exports=function(t){if(!o(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},655:(t,e,n)=>{"use strict";n.d(e,{CR:()=>c,Jh:()=>s,XA:()=>u,ZT:()=>i,ev:()=>l,mG:()=>a,pi:()=>o});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i{},1787:(t,e,n)=>{"use strict";t.exports=n(5320)},9619:(t,e,n)=>{"use strict";t.exports=n(4559)},751:(t,e,n)=>{"use strict";var r=n(4908),i=n(375),o=n(5631),a=n(9086),s=n(2633),u=n(8111);t.exports=function(t){var e=o(t);if(a(e)||0===e)return 0;if(!s(e))return e;var n=i(r(e));return 0===n?0:u(e)*n}},8305:(t,e,n)=>{"use strict";var r=n(1645),i=n(751);t.exports=function(t){var e=i(t);return e<=0?0:e>r?r:e}},5631:(t,e,n)=>{"use strict";var r=n(210),i=r("%TypeError%"),o=r("%Number%"),a=r("%RegExp%"),s=r("%parseInt%"),u=n(1924),c=n(9246),l=n(4790),h=u("String.prototype.slice"),f=c(/^0b[01]+$/i),d=c(/^0o[0-7]+$/i),p=c(/^[-+]0x[0-9a-f]+$/i),m=c(new a("["+["ย…","โ€‹","๏ฟพ"].join("")+"]","g")),y=["\t\n\v\f\r ย แš€แ Žโ€€โ€โ€‚โ€ƒ","โ€„โ€…โ€†โ€‡โ€ˆโ€‰โ€Šโ€ฏโŸใ€€\u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),v=u("String.prototype.replace"),_=n(4607);t.exports=function t(e){var n=l(e)?e:_(e,o);if("symbol"==typeof n)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(f(n))return t(s(h(n,2),2));if(d(n))return t(s(h(n,2),8));if(m(n)||p(n))return NaN;var r=function(t){return v(t,g,"")}(n);if(r!==n)return t(r)}return o(n)}},821:(t,e,n)=>{"use strict";var r=n(210)("%Object%"),i=n(9619);t.exports=function(t){return i(t),r(t)}},4607:(t,e,n)=>{"use strict";var r=n(1503);t.exports=function(t){return arguments.length>1?r(t,arguments[1]):r(t)}},4908:(t,e,n)=>{"use strict";var r=n(210)("%Math.abs%");t.exports=function(t){return r(t)}},375:t=>{"use strict";var e=Math.floor;t.exports=function(t){return e(t)}},4559:(t,e,n)=>{"use strict";var r=n(210)("%TypeError%");t.exports=function(t,e){if(null==t)throw new r(e||"Cannot call method on "+t);return t}},2633:t=>{"use strict";var e=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!e(t)&&t!==1/0&&t!==-1/0}},9086:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},4790:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},1645:(t,e,n)=>{"use strict";var r=n(210),i=r("%Math%"),o=r("%Number%");t.exports=o.MAX_SAFE_INTEGER||i.pow(2,53)-1},8111:t=>{"use strict";t.exports=function(t){return t>=0?1:-1}},9050:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>i,after:()=>Oe,all:()=>tn,allKeys:()=>yt,any:()=>en,assign:()=>Ot,before:()=>Re,bind:()=>Se,bindAll:()=>xe,chain:()=>ve,chunk:()=>jn,clone:()=>jt,collect:()=>Ge,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>nn,countBy:()=>gn,create:()=>Lt,debounce:()=>Me,default:()=>zn,defaults:()=>Rt,defer:()=>Ae,delay:()=>Ee,detect:()=>$e,difference:()=>Pn,drop:()=>xn,each:()=>Ve,escape:()=>ae,every:()=>tn,extend:()=>Dt,extendOwn:()=>Ot,filter:()=>Je,find:()=>$e,findIndex:()=>qe,findKey:()=>Le,findLastIndex:()=>Ue,findWhere:()=>Ye,first:()=>kn,flatten:()=>An,foldl:()=>Qe,foldr:()=>Ze,forEach:()=>Ve,functions:()=>Nt,get:()=>zt,groupBy:()=>mn,has:()=>Ht,head:()=>kn,identity:()=>$t,include:()=>nn,includes:()=>nn,indexBy:()=>yn,indexOf:()=>ze,initial:()=>Cn,inject:()=>Qe,intersection:()=>Dn,invert:()=>Mt,invoke:()=>rn,isArguments:()=>K,isArray:()=>Y,isArrayBuffer:()=>L,isBoolean:()=>A,isDataView:()=>$,isDate:()=>D,isElement:()=>P,isEmpty:()=>ut,isEqual:()=>mt,isError:()=>R,isFinite:()=>Q,isFunction:()=>U,isMap:()=>kt,isMatch:()=>ct,isNaN:()=>Z,isNull:()=>T,isNumber:()=>I,isObject:()=>x,isRegExp:()=>O,isSet:()=>Tt,isString:()=>N,isSymbol:()=>F,isTypedArray:()=>it,isUndefined:()=>E,isWeakMap:()=>xt,isWeakSet:()=>Et,iteratee:()=>Qt,keys:()=>st,last:()=>Tn,lastIndexOf:()=>He,map:()=>Ge,mapObject:()=>Jt,matcher:()=>Yt,matches:()=>Yt,max:()=>sn,memoize:()=>Te,methods:()=>Nt,min:()=>un,mixin:()=>Un,negate:()=>Ie,noop:()=>Xt,now:()=>re,object:()=>Fn,omit:()=>Sn,once:()=>Fe,pairs:()=>Pt,partial:()=>we,partition:()=>vn,pick:()=>wn,pluck:()=>on,property:()=>Vt,propertyOf:()=>te,random:()=>ne,range:()=>Ln,reduce:()=>Qe,reduceRight:()=>Ze,reject:()=>Xe,rest:()=>xn,restArguments:()=>k,result:()=>me,sample:()=>hn,select:()=>Je,shuffle:()=>fn,size:()=>_n,some:()=>en,sortBy:()=>dn,sortedIndex:()=>Be,tail:()=>xn,take:()=>kn,tap:()=>qt,template:()=>pe,templateSettings:()=>ue,throttle:()=>Pe,times:()=>ee,toArray:()=>ln,toPath:()=>Ut,transpose:()=>On,unescape:()=>se,union:()=>In,uniq:()=>Nn,unique:()=>Nn,uniqueId:()=>ge,unzip:()=>On,values:()=>At,where:()=>an,without:()=>Mn,wrap:()=>Ne,zip:()=>Rn});var r={};n.r(r),n.d(r,{VERSION:()=>i,after:()=>Oe,all:()=>tn,allKeys:()=>yt,any:()=>en,assign:()=>Ot,before:()=>Re,bind:()=>Se,bindAll:()=>xe,chain:()=>ve,chunk:()=>jn,clone:()=>jt,collect:()=>Ge,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>nn,countBy:()=>gn,create:()=>Lt,debounce:()=>Me,default:()=>Bn,defaults:()=>Rt,defer:()=>Ae,delay:()=>Ee,detect:()=>$e,difference:()=>Pn,drop:()=>xn,each:()=>Ve,escape:()=>ae,every:()=>tn,extend:()=>Dt,extendOwn:()=>Ot,filter:()=>Je,find:()=>$e,findIndex:()=>qe,findKey:()=>Le,findLastIndex:()=>Ue,findWhere:()=>Ye,first:()=>kn,flatten:()=>An,foldl:()=>Qe,foldr:()=>Ze,forEach:()=>Ve,functions:()=>Nt,get:()=>zt,groupBy:()=>mn,has:()=>Ht,head:()=>kn,identity:()=>$t,include:()=>nn,includes:()=>nn,indexBy:()=>yn,indexOf:()=>ze,initial:()=>Cn,inject:()=>Qe,intersection:()=>Dn,invert:()=>Mt,invoke:()=>rn,isArguments:()=>K,isArray:()=>Y,isArrayBuffer:()=>L,isBoolean:()=>A,isDataView:()=>$,isDate:()=>D,isElement:()=>P,isEmpty:()=>ut,isEqual:()=>mt,isError:()=>R,isFinite:()=>Q,isFunction:()=>U,isMap:()=>kt,isMatch:()=>ct,isNaN:()=>Z,isNull:()=>T,isNumber:()=>I,isObject:()=>x,isRegExp:()=>O,isSet:()=>Tt,isString:()=>N,isSymbol:()=>F,isTypedArray:()=>it,isUndefined:()=>E,isWeakMap:()=>xt,isWeakSet:()=>Et,iteratee:()=>Qt,keys:()=>st,last:()=>Tn,lastIndexOf:()=>He,map:()=>Ge,mapObject:()=>Jt,matcher:()=>Yt,matches:()=>Yt,max:()=>sn,memoize:()=>Te,methods:()=>Nt,min:()=>un,mixin:()=>Un,negate:()=>Ie,noop:()=>Xt,now:()=>re,object:()=>Fn,omit:()=>Sn,once:()=>Fe,pairs:()=>Pt,partial:()=>we,partition:()=>vn,pick:()=>wn,pluck:()=>on,property:()=>Vt,propertyOf:()=>te,random:()=>ne,range:()=>Ln,reduce:()=>Qe,reduceRight:()=>Ze,reject:()=>Xe,rest:()=>xn,restArguments:()=>k,result:()=>me,sample:()=>hn,select:()=>Je,shuffle:()=>fn,size:()=>_n,some:()=>en,sortBy:()=>dn,sortedIndex:()=>Be,tail:()=>xn,take:()=>kn,tap:()=>qt,template:()=>pe,templateSettings:()=>ue,throttle:()=>Pe,times:()=>ee,toArray:()=>ln,toPath:()=>Ut,transpose:()=>On,unescape:()=>se,union:()=>In,uniq:()=>Nn,unique:()=>Nn,uniqueId:()=>ge,unzip:()=>On,values:()=>At,where:()=>an,without:()=>Mn,wrap:()=>Ne,zip:()=>Rn});var i="1.13.6",o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,s=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,l=a.slice,h=s.toString,f=s.hasOwnProperty,d="undefined"!=typeof ArrayBuffer,p="undefined"!=typeof DataView,m=Array.isArray,y=Object.keys,g=Object.create,v=d&&ArrayBuffer.isView,_=isNaN,b=isFinite,w=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C=Math.pow(2,53)-1;function k(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i=0&&n<=C}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt("byteLength"),nt=X(et);var rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const it=d?function(t){return v?v(t)&&!$(t):nt(t)&&rt.test(h.call(t))}:J(!1),ot=tt("length");function at(t,e){e=function(t){for(var e={},n=t.length,r=0;r":">",'"':""","'":"'","`":"`"},ae=ie(oe),se=ie(Mt(oe)),ue=lt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ce=/(.)^/,le={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},he=/\\|'|\r|\n|\u2028|\u2029/g;function fe(t){return"\\"+le[t]}var de=/^\s*(\w|\$)+\s*$/;function pe(t,e,n){!e&&n&&(e=n),e=Rt({},e,lt.templateSettings);var r=RegExp([(e.escape||ce).source,(e.interpolate||ce).source,(e.evaluate||ce).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(he,fe),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!de.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(t){throw t.source=o,t}var u=function(t){return a.call(this,t,lt)};return u.source="function("+s+"){\n"+o+"}",u}function me(t,e,n){var r=(e=Bt(e)).length;if(!r)return U(n)?n.call(t):n;for(var i=0;i1)ke(s,e-1,n,r),i=r.length;else for(var u=0,c=s.length;ue?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,l)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}function Me(t,e,n){var r,i,o,a,s,u=function(){var c=re()-i;e>c?r=setTimeout(u,e-c):(r=null,n||(a=t.apply(s,o)),r||(o=s=null))},c=k((function(c){return s=this,o=c,i=re(),r||(r=setTimeout(u,e),n&&(a=t.apply(s,o))),a}));return c.cancel=function(){clearTimeout(r),r=o=s=null},c}function Ne(t,e){return we(e,t)}function Ie(t){return function(){return!t.apply(this,arguments)}}function De(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Oe(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Re(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Fe=we(Re,2);function Le(t,e,n){e=Zt(e,n);for(var r,i=st(t),o=0,a=i.length;o0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(l.call(r,a,s),Z))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s=3;return e(t,Gt(n,i,4),r,o)}}const Qe=Ke(1),Ze=Ke(-1);function Je(t,e,n){var r=[];return e=Zt(e,n),Ve(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function Xe(t,e,n){return Je(t,Ie(Zt(e)),n)}function tn(t,e,n){e=Zt(e,n);for(var r=!Ce(t)&&st(t),i=(r||t).length,o=0;o=0}const rn=k((function(t,e,n){var r,i;return U(e)?i=e:(e=Bt(e),r=e.slice(0,-1),e=e[e.length-1]),Ge(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=Wt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function on(t,e){return Ge(t,Vt(e))}function an(t,e){return Je(t,Yt(e))}function sn(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,u=(t=Ce(t)?t:At(t)).length;so&&(o=r);else e=Zt(e,n),Ve(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function un(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,u=(t=Ce(t)?t:At(t)).length;sr||void 0===n)return 1;if(n1&&(r=Gt(r,e[1])),e=yt(t)):(r=bn,e=ke(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(n=e[1])):(e=Ge(ke(e,!1,!1),String),r=function(t,n){return!nn(e,n)}),wn(t,r,n)}));function Cn(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function kn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function xn(t,e,n){return l.call(t,null==e||n?1:e)}function Tn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:xn(t,Math.max(0,t.length-e))}function En(t){return Je(t,Boolean)}function An(t,e){return ke(t,e,!1)}const Pn=k((function(t,e){return e=ke(e,!0,!0),Je(t,(function(t){return!nn(e,t)}))})),Mn=k((function(t,e){return Pn(t,e)}));function Nn(t,e,n,r){A(e)||(r=n,n=e,e=!1),null!=n&&(n=Zt(n,r));for(var i=[],o=[],a=0,s=ot(t);a{"use strict";t.exports=JSON.parse('{"hed":"2022 World Cup Predictions","dek":"Soccer Power Index (SPI) ratings and chances of advancing for every team, updating live.","See_also":{"readin":""},"see_also":{"links":["How this works","ESPN coverage"]},"matches_btn":"Matches","knockout_btn":"Standings","bracket_btn":"Bracket","team_ratings":"Team Rating","groups":"Chance of finishing group stage in ...","prob_rounds":"Knockout stage chances","team":"Team","spi":"SPI","group_hed":"Group","offense":"Off.","defense":"Def.","group_1":"1st
Place","group_2":"2nd
Place","prob_round_16":"Make
Round of 16","prob_round_16_mobile":"Make
Rd. of 16","prob_quarters":"Make Quarter-
finals","prob_quarters_mobile":"Make Qtr.-
finals","prob_semis":"Make
Semi-finals","prob_final":"Make
Final","prob_win":"Win
World cup","points_label":"pts.","dropdown_label":"Forecast from","dropdown_today":"today","dropdown_final":"before final","dropdown_semi":"before semifinals","dropdown_quarter":"before quarterfinals","dropdown_16":"before round of 16","dropdown_third":"before 3rd group matches","dropdown_second":"before 2nd group matches","dropdown_tournament":"before tournament","mobile_note":"Please visit this page on a desktop computer to make your own bracket.","instruction_groups":"Select the first- and second-place finishers in each group to advance to the knockout stage","instruction_groups_hover":"Hover over a team\'s name to see its chances of reaching each possible match","instruction_bracket":"Click on a team to advance it to the next match","instruction_bracket_hover":"Hover over a match to see teams\' chances of reaching it","bracket_header_champ":"Chance of winning the World Cup","bracket_header_final":"Chance of reaching the final","bracket_header_fill":"Chance of reaching this","bracket_header_match":"match","first":"1st place","second":"2nd place","resetbtn":"Reset","round_of_16":"round of 16","quarter_final":"quarterfinal","semi_final":"semifinal","final":"final","third_place":"Third-place match","champ":"World Cup champion","group":"Group","rd_round_of_16":"Round of 16","rd_quarter_final":"Quarterfinal","rd_semi_final":"Semifinal","rd_final":"Final","completed":"Completed matches","ht":"Halftime","et":"Extra time","so":"Penalties","ft":"Full-time","match_card":{"group":"Group","win_prob":"Win Prob.","tie":"Draw","score":"Score"},"notes":{"description":"How this works: Soccer Power Index (SPI) ratings are a combination of each team\'s recent match results and the overall quality of its World Cup roster. This forecast is based on 20,000 simulations of the tournament and updates live. Read more ยป","data_link":"Download this data."},"byline":"Statistical models by Jay Boice and Nate Silver. Design and development by Jay Boice.","promo":{"hed":"","caption":"","btn":""}}')},3349:t=>{"use strict";t.exports=JSON.parse('{"shortname":"world-cup-2022","publishtime":"2022-11-16 11:00","title":"2022 World Cup Predictions","description":"FiveThirtyEight\'s World Cup forecasting model calculates each team\'s chances of winning each match and reaching each round.","author":"Jay Boice","authorurl":"https://fivethirtyeight.com/contributors/jay-boice/","twittertext":"FiveThirtyEight\'s World Cup Predictions","twittercreator":"jayboice","twittercreatorid":"961152319","shareimage":"https://fivethirtyeight.com/wp-content/uploads/2022/11/2022-WORLDCUP-INTERACTIVE-16x9-1.png","wordpressid":"350078","wordpresssection":"sports","primarytag":"2022 World Cup","homepagetags":"Forecasts and Predictions","url":"https://projects.fivethirtyeight.com/2022-world-cup-predictions/"}')}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__=__webpack_require__(6214)})();