/*! For license information please see main.2e2b9692.js.LICENSE.txt */
!function(){var e={757:function(e,t,n){e.exports=n(727)},725:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,a){for(var o,u,s=i(e),c=1;c<arguments.length;c++){for(var l in o=Object(arguments[c]))n.call(o,l)&&(s[l]=o[l]);if(t){u=t(o);for(var f=0;f<u.length;f++)r.call(o,u[f])&&(s[u[f]]=o[u[f]])}}return s}},463:function(e,t,n){"use strict";var r=n(791),i=n(725),a=n(296);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var u=new Set,s={};function c(e,t){l(e,t),l(e+"Capture",t)}function l(e,t){for(s[e]=t,e=0;e<t.length;e++)u.add(t[e])}var f=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d=Object.prototype.hasOwnProperty,p={},v={};function y(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new y(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new y(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new y(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new y(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new y(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new y(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)}));var g=/[\-:]([a-z])/g;function k(e){return e[1].toUpperCase()}function b(e,t,n,r){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(v,e)||!d.call(p,e)&&(h.test(e)?v[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(g,k);m[t]=new y(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(g,k);m[t]=new y(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(g,k);m[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=60103,E=60106,S=60107,T=60108,x=60114,I=60109,C=60110,N=60112,A=60113,R=60120,L=60115,O=60116,P=60121,D=60128,M=60129,U=60130,V=60131;if("function"===typeof Symbol&&Symbol.for){var F=Symbol.for;_=F("react.element"),E=F("react.portal"),S=F("react.fragment"),T=F("react.strict_mode"),x=F("react.profiler"),I=F("react.provider"),C=F("react.context"),N=F("react.forward_ref"),A=F("react.suspense"),R=F("react.suspense_list"),L=F("react.memo"),O=F("react.lazy"),P=F("react.block"),F("react.scope"),D=F("react.opaque.id"),M=F("react.debug_trace_mode"),U=F("react.offscreen"),V=F("react.legacy_hidden")}var j,z="function"===typeof Symbol&&Symbol.iterator;function B(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=z&&e[z]||e["@@iterator"])?e:null}function q(e){if(void 0===j)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return"\n"+j+e}var H=!1;function K(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(s){var r=s}Reflect.construct(e,[],t)}else{try{t.call()}catch(s){r=s}e.call(t.prototype)}else{try{throw Error()}catch(s){r=s}e()}}catch(s){if(s&&r&&"string"===typeof s.stack){for(var i=s.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,u=a.length-1;1<=o&&0<=u&&i[o]!==a[u];)u--;for(;1<=o&&0<=u;o--,u--)if(i[o]!==a[u]){if(1!==o||1!==u)do{if(o--,0>--u||i[o]!==a[u])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=u);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?q(e):""}function W(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return e=K(e.type,!1);case 11:return e=K(e.type.render,!1);case 22:return e=K(e.type._render,!1);case 1:return e=K(e.type,!0);default:return""}}function G(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case E:return"Portal";case x:return"Profiler";case T:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case N:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case L:return G(e.type);case P:return G(e._render);case O:t=e._payload,e=e._init;try{return G(e(t))}catch(n){}}return null}function Q(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function X(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=X(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function J(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=X(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function $(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Q(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Q(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Q(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&$(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ae(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Q(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ue(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function se(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Q(n)}}function ce(e,t){var n=Q(t.value),r=Q(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function le(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe="http://www.w3.org/1999/xhtml",he="http://www.w3.org/2000/svg";function de(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?de(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ve,ye,me=(ye=function(e,t){if(e.namespaceURI!==he||"innerHTML"in e)e.innerHTML=t;else{for((ve=ve||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ve.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ye(e,t)}))}:ye);function ge(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ke={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},be=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||ke.hasOwnProperty(e)&&ke[e]?(""+t).trim():t+"px"}function _e(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(ke).forEach((function(e){be.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ke[t]=ke[e]}))}));var Ee=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Se(e,t){if(t){if(Ee[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function Te(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function xe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ie=null,Ce=null,Ne=null;function Ae(e){if(e=ri(e)){if("function"!==typeof Ie)throw Error(o(280));var t=e.stateNode;t&&(t=ai(t),Ie(e.stateNode,e.type,t))}}function Re(e){Ce?Ne?Ne.push(e):Ne=[e]:Ce=e}function Le(){if(Ce){var e=Ce,t=Ne;if(Ne=Ce=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function Oe(e,t){return e(t)}function Pe(e,t,n,r,i){return e(t,n,r,i)}function De(){}var Me=Oe,Ue=!1,Ve=!1;function Fe(){null===Ce&&null===Ne||(De(),Le())}function je(e,t){var n=e.stateNode;if(null===n)return null;var r=ai(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}var ze=!1;if(f)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){ze=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch(ye){ze=!1}function qe(e,t,n,r,i,a,o,u,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(l){this.onError(l)}}var He=!1,Ke=null,We=!1,Ge=null,Qe={onError:function(e){He=!0,Ke=e}};function Xe(e,t,n,r,i,a,o,u,s){He=!1,Ke=null,qe.apply(Qe,arguments)}function Ye(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function $e(e){if(Ye(e)!==e)throw Error(o(188))}function Ze(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ye(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return $e(i),e;if(a===r)return $e(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var u=!1,s=i.child;s;){if(s===n){u=!0,n=i,r=a;break}if(s===r){u=!0,r=i,n=a;break}s=s.sibling}if(!u){for(s=a.child;s;){if(s===n){u=!0,n=a,r=i;break}if(s===r){u=!0,r=a,n=i;break}s=s.sibling}if(!u)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,it,at=!1,ot=[],ut=null,st=null,ct=null,lt=new Map,ft=new Map,ht=[],dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function vt(e,t){switch(e){case"focusin":case"focusout":ut=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":lt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ft.delete(t.pointerId)}}function yt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e=pt(t,n,r,i,a),null!==t&&(null!==(t=ri(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function mt(e){var t=ni(e.target);if(null!==t){var n=Ye(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Je(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){a.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function gt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ri(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function kt(e,t,n){gt(e)&&n.delete(t)}function bt(){for(at=!1;0<ot.length;){var e=ot[0];if(null!==e.blockedOn){null!==(e=ri(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&ot.shift()}null!==ut&&gt(ut)&&(ut=null),null!==st&&gt(st)&&(st=null),null!==ct&&gt(ct)&&(ct=null),lt.forEach(kt),ft.forEach(kt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,at||(at=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,bt)))}function _t(e){function t(t){return wt(t,e)}if(0<ot.length){wt(ot[0],e);for(var n=1;n<ot.length;n++){var r=ot[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==ut&&wt(ut,e),null!==st&&wt(st,e),null!==ct&&wt(ct,e),lt.forEach(t),ft.forEach(t),n=0;n<ht.length;n++)(r=ht[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ht.length&&null===(n=ht[0]).blockedOn;)mt(n),null===n.blockedOn&&ht.shift()}function Et(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var St={animationend:Et("Animation","AnimationEnd"),animationiteration:Et("Animation","AnimationIteration"),animationstart:Et("Animation","AnimationStart"),transitionend:Et("Transition","TransitionEnd")},Tt={},xt={};function It(e){if(Tt[e])return Tt[e];if(!St[e])return e;var t,n=St[e];for(t in n)if(n.hasOwnProperty(t)&&t in xt)return Tt[e]=n[t];return e}f&&(xt=document.createElement("div").style,"AnimationEvent"in window||(delete St.animationend.animation,delete St.animationiteration.animation,delete St.animationstart.animation),"TransitionEvent"in window||delete St.transitionend.transition);var Ct=It("animationend"),Nt=It("animationiteration"),At=It("animationstart"),Rt=It("transitionend"),Lt=new Map,Ot=new Map,Pt=["abort","abort",Ct,"animationEnd",Nt,"animationIteration",At,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Rt,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Ot.set(r,t),Lt.set(r,i),c(i,[r])}}(0,a.unstable_now)();var Mt=8;function Ut(e){if(0!==(1&e))return Mt=15,1;if(0!==(2&e))return Mt=14,2;if(0!==(4&e))return Mt=13,4;var t=24&e;return 0!==t?(Mt=12,t):0!==(32&e)?(Mt=11,32):0!==(t=192&e)?(Mt=10,t):0!==(256&e)?(Mt=9,256):0!==(t=3584&e)?(Mt=8,t):0!==(4096&e)?(Mt=7,4096):0!==(t=4186112&e)?(Mt=6,t):0!==(t=62914560&e)?(Mt=5,t):67108864&e?(Mt=4,67108864):0!==(134217728&e)?(Mt=3,134217728):0!==(t=805306368&e)?(Mt=2,t):0!==(1073741824&e)?(Mt=1,1073741824):(Mt=8,e)}function Vt(e,t){var n=e.pendingLanes;if(0===n)return Mt=0;var r=0,i=0,a=e.expiredLanes,o=e.suspendedLanes,u=e.pingedLanes;if(0!==a)r=a,i=Mt=15;else if(0!==(a=134217727&n)){var s=a&~o;0!==s?(r=Ut(s),i=Mt):0!==(u&=a)&&(r=Ut(u),i=Mt)}else 0!==(a=n&~o)?(r=Ut(a),i=Mt):0!==u&&(r=Ut(u),i=Mt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&o)){if(Ut(t),i<=Mt)return t;Mt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Ht(t)),r|=e[n],t&=~i;return r}function Ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function jt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=zt(24&~t))?jt(10,t):e;case 10:return 0===(e=zt(192&~t))?jt(8,t):e;case 8:return 0===(e=zt(3584&~t))&&(0===(e=zt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=zt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function zt(e){return e&-e}function Bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Kt(e)/Wt|0)|0},Kt=Math.log,Wt=Math.LN2;var Gt=a.unstable_UserBlockingPriority,Qt=a.unstable_runWithPriority,Xt=!0;function Yt(e,t,n,r){Ue||De();var i=$t,a=Ue;Ue=!0;try{Pe(i,e,t,n,r)}finally{(Ue=a)||Fe()}}function Jt(e,t,n,r){Qt(Gt,$t.bind(null,e,t,n,r))}function $t(e,t,n,r){var i;if(Xt)if((i=0===(4&t))&&0<ot.length&&-1<dt.indexOf(e))e=pt(null,e,t,n,r),ot.push(e);else{var a=Zt(e,t,n,r);if(null===a)i&&vt(e,r);else{if(i){if(-1<dt.indexOf(e))return e=pt(a,e,t,n,r),void ot.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return ut=yt(ut,e,t,n,r,i),!0;case"dragenter":return st=yt(st,e,t,n,r,i),!0;case"mouseover":return ct=yt(ct,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return lt.set(a,yt(lt.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ft.set(a,yt(ft.get(a)||null,e,t,n,r,i)),!0}return!1}(a,e,t,n,r))return;vt(e,r)}Dr(e,t,r,null,n)}}}function Zt(e,t,n,r){var i=xe(r);if(null!==(i=ni(i))){var a=Ye(i);if(null===a)i=null;else{var o=a.tag;if(13===o){if(null!==(i=Je(a)))return i;i=null}else if(3===o){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Dr(e,t,r,i,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,i="value"in en?en.value:en.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return nn=i.slice(e,1<t?1-t:void 0)}function an(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function on(){return!0}function un(){return!1}function sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?on:un,this.isPropagationStopped=un,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var cn,ln,fn,hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=sn(hn),pn=i({},hn,{view:0,detail:0}),vn=sn(pn),yn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fn&&(fn&&"mousemove"===e.type?(cn=e.screenX-fn.screenX,ln=e.screenY-fn.screenY):ln=cn=0,fn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),mn=sn(yn),gn=sn(i({},yn,{dataTransfer:0})),kn=sn(i({},pn,{relatedTarget:0})),bn=sn(i({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=i({},hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_n=sn(wn),En=sn(i({},hn,{data:0})),Sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=xn[e])&&!!t[e]}function Cn(){return In}var Nn=i({},pn,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=an(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Tn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?an(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?an(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),An=sn(Nn),Rn=sn(i({},yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=sn(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),On=sn(i({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=i({},yn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dn=sn(Pn),Mn=[9,13,27,32],Un=f&&"CompositionEvent"in window,Vn=null;f&&"documentMode"in document&&(Vn=document.documentMode);var Fn=f&&"TextEvent"in window&&!Vn,jn=f&&(!Un||Vn&&8<Vn&&11>=Vn),zn=String.fromCharCode(32),Bn=!1;function qn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Kn=!1;var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Wn[e.type]:"textarea"===t}function Qn(e,t,n,r){Re(r),0<(t=Ur(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xn=null,Yn=null;function Jn(e){Nr(e,0)}function $n(e){if(J(ii(e)))return e}function Zn(e,t){if("change"===e)return t}var er=!1;if(f){var tr;if(f){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"===typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Xn&&(Xn.detachEvent("onpropertychange",ar),Yn=Xn=null)}function ar(e){if("value"===e.propertyName&&$n(Yn)){var t=[];if(Qn(t,Yn,e,xe(e)),e=Jn,Ue)e(t);else{Ue=!0;try{Oe(e,t)}finally{Ue=!1,Fe()}}}}function or(e,t,n){"focusin"===e?(ir(),Yn=n,(Xn=t).attachEvent("onpropertychange",ar)):"focusout"===e&&ir()}function ur(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return $n(Yn)}function sr(e,t){if("click"===e)return $n(t)}function cr(e,t){if("input"===e||"change"===e)return $n(t)}var lr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},fr=Object.prototype.hasOwnProperty;function hr(e,t){if(lr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!fr.call(t,n[r])||!lr(e[n[r]],t[n[r]]))return!1;return!0}function dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=dr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dr(r)}}function vr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?vr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function yr(){for(var e=window,t=$();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=$((e=t.contentWindow).document)}return t}function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var gr=f&&"documentMode"in document&&11>=document.documentMode,kr=null,br=null,wr=null,_r=!1;function Er(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;_r||null==kr||kr!==$(r)||("selectionStart"in(r=kr)&&mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&hr(wr,r)||(wr=r,0<(r=Ur(br,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(Pt,2);for(var Sr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Tr=0;Tr<Sr.length;Tr++)Ot.set(Sr[Tr],0);l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(xr));function Cr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,a,u,s,c){if(Xe.apply(this,arguments),He){if(!He)throw Error(o(198));var l=Ke;He=!1,Ke=null,We||(We=!0,Ge=l)}}(r,t,void 0,e),e.currentTarget=null}function Nr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var u=r[o],s=u.instance,c=u.currentTarget;if(u=u.listener,s!==a&&i.isPropagationStopped())break e;Cr(i,u,c),a=s}else for(o=0;o<r.length;o++){if(s=(u=r[o]).instance,c=u.currentTarget,u=u.listener,s!==a&&i.isPropagationStopped())break e;Cr(i,u,c),a=s}}}if(We)throw e=Ge,We=!1,Ge=null,e}function Ar(e,t){var n=oi(t),r=e+"__bubble";n.has(r)||(Pr(t,e,2,!1),n.add(r))}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Lr(e){e[Rr]||(e[Rr]=!0,u.forEach((function(t){Ir.has(t)||Or(t,!1,e,null),Or(t,!0,e,null)})))}function Or(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=n;if("selectionchange"===e&&9!==n.nodeType&&(a=n.ownerDocument),null!==r&&!t&&Ir.has(e)){if("scroll"!==e)return;i|=2,a=r}var o=oi(a),u=e+"__"+(t?"capture":"bubble");o.has(u)||(t&&(i|=4),Pr(a,e,i,t),o.add(u))}function Pr(e,t,n,r){var i=Ot.get(t);switch(void 0===i?2:i){case 0:i=Yt;break;case 1:i=Jt;break;default:i=$t}n=i.bind(null,t,n,e),i=void 0,!ze||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dr(e,t,n,r,i){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var u=r.stateNode.containerInfo;if(u===i||8===u.nodeType&&u.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var s=o.tag;if((3===s||4===s)&&((s=o.stateNode.containerInfo)===i||8===s.nodeType&&s.parentNode===i))return;o=o.return}for(;null!==u;){if(null===(o=ni(u)))return;if(5===(s=o.tag)||6===s){r=a=o;continue e}u=u.parentNode}}r=r.return}!function(e,t,n){if(Ve)return e(t,n);Ve=!0;try{Me(e,t,n)}finally{Ve=!1,Fe()}}((function(){var r=a,i=xe(n),o=[];e:{var u=Lt.get(e);if(void 0!==u){var s=dn,c=e;switch(e){case"keypress":if(0===an(n))break e;case"keydown":case"keyup":s=An;break;case"focusin":c="focus",s=kn;break;case"focusout":c="blur",s=kn;break;case"beforeblur":case"afterblur":s=kn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=mn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Ln;break;case Ct:case Nt:case At:s=bn;break;case Rt:s=On;break;case"scroll":s=vn;break;case"wheel":s=Dn;break;case"copy":case"cut":case"paste":s=_n;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Rn}var l=0!==(4&t),f=!l&&"scroll"===e,h=l?null!==u?u+"Capture":null:u;l=[];for(var d,p=r;null!==p;){var v=(d=p).stateNode;if(5===d.tag&&null!==v&&(d=v,null!==h&&(null!=(v=je(p,h))&&l.push(Mr(p,v,d)))),f)break;p=p.return}0<l.length&&(u=new s(u,c,null,n,i),o.push({event:u,listeners:l}))}}if(0===(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(u="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(c=n.relatedTarget||n.fromElement)||!ni(c)&&!c[ei])&&(s||u)&&(u=i.window===i?i:(u=i.ownerDocument)?u.defaultView||u.parentWindow:window,s?(s=r,null!==(c=(c=n.relatedTarget||n.toElement)?ni(c):null)&&(c!==(f=Ye(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(s=null,c=r),s!==c)){if(l=mn,v="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(l=Rn,v="onPointerLeave",h="onPointerEnter",p="pointer"),f=null==s?u:ii(s),d=null==c?u:ii(c),(u=new l(v,p+"leave",s,n,i)).target=f,u.relatedTarget=d,v=null,ni(i)===r&&((l=new l(h,p+"enter",c,n,i)).target=d,l.relatedTarget=f,v=l),f=v,s&&c)e:{for(h=c,p=0,d=l=s;d;d=Vr(d))p++;for(d=0,v=h;v;v=Vr(v))d++;for(;0<p-d;)l=Vr(l),p--;for(;0<d-p;)h=Vr(h),d--;for(;p--;){if(l===h||null!==h&&l===h.alternate)break e;l=Vr(l),h=Vr(h)}l=null}else l=null;null!==s&&Fr(o,u,s,l,!1),null!==c&&null!==f&&Fr(o,f,c,l,!0)}if("select"===(s=(u=r?ii(r):window).nodeName&&u.nodeName.toLowerCase())||"input"===s&&"file"===u.type)var y=Zn;else if(Gn(u))if(er)y=cr;else{y=ur;var m=or}else(s=u.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===u.type||"radio"===u.type)&&(y=sr);switch(y&&(y=y(e,r))?Qn(o,y,n,i):(m&&m(e,u,r),"focusout"===e&&(m=u._wrapperState)&&m.controlled&&"number"===u.type&&ie(u,"number",u.value)),m=r?ii(r):window,e){case"focusin":(Gn(m)||"true"===m.contentEditable)&&(kr=m,br=r,wr=null);break;case"focusout":wr=br=kr=null;break;case"mousedown":_r=!0;break;case"contextmenu":case"mouseup":case"dragend":_r=!1,Er(o,n,i);break;case"selectionchange":if(gr)break;case"keydown":case"keyup":Er(o,n,i)}var g;if(Un)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Kn?qn(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(jn&&"ko"!==n.locale&&(Kn||"onCompositionStart"!==k?"onCompositionEnd"===k&&Kn&&(g=rn()):(tn="value"in(en=i)?en.value:en.textContent,Kn=!0)),0<(m=Ur(r,k)).length&&(k=new En(k,e,null,n,i),o.push({event:k,listeners:m}),g?k.data=g:null!==(g=Hn(n))&&(k.data=g))),(g=Fn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Bn=!0,zn);case"textInput":return(e=t.data)===zn&&Bn?null:e;default:return null}}(e,n):function(e,t){if(Kn)return"compositionend"===e||!Un&&qn(e,t)?(e=rn(),nn=tn=en=null,Kn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Ur(r,"onBeforeInput")).length&&(i=new En("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=g))}Nr(o,t)}))}function Mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ur(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=je(e,n))&&r.unshift(Mr(e,a,i)),null!=(a=je(e,t))&&r.push(Mr(e,a,i))),e=e.return}return r}function Vr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Fr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var u=n,s=u.alternate,c=u.stateNode;if(null!==s&&s===r)break;5===u.tag&&null!==c&&(u=c,i?null!=(s=je(n,a))&&o.unshift(Mr(n,s,u)):i||null!=(s=je(n,a))&&o.push(Mr(n,s,u))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function jr(){}var zr=null,Br=null;function qr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Kr="function"===typeof setTimeout?setTimeout:void 0,Wr="function"===typeof clearTimeout?clearTimeout:void 0;function Gr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Qr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Xr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Yr=0;var Jr=Math.random().toString(36).slice(2),$r="__reactFiber$"+Jr,Zr="__reactProps$"+Jr,ei="__reactContainer$"+Jr,ti="__reactEvents$"+Jr;function ni(e){var t=e[$r];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ei]||n[$r]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Xr(e);null!==e;){if(n=e[$r])return n;e=Xr(e)}return t}n=(e=n).parentNode}return null}function ri(e){return!(e=e[$r]||e[ei])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ii(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ai(e){return e[Zr]||null}function oi(e){var t=e[ti];return void 0===t&&(t=e[ti]=new Set),t}var ui=[],si=-1;function ci(e){return{current:e}}function li(e){0>si||(e.current=ui[si],ui[si]=null,si--)}function fi(e,t){si++,ui[si]=e.current,e.current=t}var hi={},di=ci(hi),pi=ci(!1),vi=hi;function yi(e,t){var n=e.type.contextTypes;if(!n)return hi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function mi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function gi(){li(pi),li(di)}function ki(e,t,n){if(di.current!==hi)throw Error(o(168));fi(di,t),fi(pi,n)}function bi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw Error(o(108,G(t)||"Unknown",a));return i({},n,r)}function wi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hi,vi=di.current,fi(di,e),fi(pi,pi.current),!0}function _i(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=bi(e,t,vi),r.__reactInternalMemoizedMergedChildContext=e,li(pi),li(di),fi(di,e)):li(pi),fi(pi,n)}var Ei=null,Si=null,Ti=a.unstable_runWithPriority,xi=a.unstable_scheduleCallback,Ii=a.unstable_cancelCallback,Ci=a.unstable_shouldYield,Ni=a.unstable_requestPaint,Ai=a.unstable_now,Ri=a.unstable_getCurrentPriorityLevel,Li=a.unstable_ImmediatePriority,Oi=a.unstable_UserBlockingPriority,Pi=a.unstable_NormalPriority,Di=a.unstable_LowPriority,Mi=a.unstable_IdlePriority,Ui={},Vi=void 0!==Ni?Ni:function(){},Fi=null,ji=null,zi=!1,Bi=Ai(),qi=1e4>Bi?Ai:function(){return Ai()-Bi};function Hi(){switch(Ri()){case Li:return 99;case Oi:return 98;case Pi:return 97;case Di:return 96;case Mi:return 95;default:throw Error(o(332))}}function Ki(e){switch(e){case 99:return Li;case 98:return Oi;case 97:return Pi;case 96:return Di;case 95:return Mi;default:throw Error(o(332))}}function Wi(e,t){return e=Ki(e),Ti(e,t)}function Gi(e,t,n){return e=Ki(e),xi(e,t,n)}function Qi(){if(null!==ji){var e=ji;ji=null,Ii(e)}Xi()}function Xi(){if(!zi&&null!==Fi){zi=!0;var e=0;try{var t=Fi;Wi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Fi=null}catch(n){throw null!==Fi&&(Fi=Fi.slice(e+1)),xi(Li,Qi),n}finally{zi=!1}}}var Yi=w.ReactCurrentBatchConfig;function Ji(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var $i=ci(null),Zi=null,ea=null,ta=null;function na(){ta=ea=Zi=null}function ra(e){var t=$i.current;li($i),e.type._context._currentValue=t}function ia(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function aa(e,t){Zi=e,ta=ea=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Uo=!0),e.firstContext=null)}function oa(e,t){if(ta!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(ta=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ea){if(null===Zi)throw Error(o(308));ea=t,Zi.dependencies={lanes:0,firstContext:t,responders:null}}else ea=ea.next=t;return e._currentValue}var ua=!1;function sa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ca(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function la(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fa(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ha(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function da(e,t,n,r){var a=e.updateQueue;ua=!1;var o=a.firstBaseUpdate,u=a.lastBaseUpdate,s=a.shared.pending;if(null!==s){a.shared.pending=null;var c=s,l=c.next;c.next=null,null===u?o=l:u.next=l,u=c;var f=e.alternate;if(null!==f){var h=(f=f.updateQueue).lastBaseUpdate;h!==u&&(null===h?f.firstBaseUpdate=l:h.next=l,f.lastBaseUpdate=c)}}if(null!==o){for(h=a.baseState,u=0,f=l=c=null;;){s=o.lane;var d=o.eventTime;if((r&s)===s){null!==f&&(f=f.next={eventTime:d,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,v=o;switch(s=t,d=n,v.tag){case 1:if("function"===typeof(p=v.payload)){h=p.call(d,h,s);break e}h=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null===(s="function"===typeof(p=v.payload)?p.call(d,h,s):p)||void 0===s)break e;h=i({},h,s);break e;case 2:ua=!0}}null!==o.callback&&(e.flags|=32,null===(s=a.effects)?a.effects=[o]:s.push(o))}else d={eventTime:d,lane:s,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===f?(l=f=d,c=h):f=f.next=d,u|=s;if(null===(o=o.next)){if(null===(s=a.shared.pending))break;o=s.next,s.next=null,a.lastBaseUpdate=s,a.shared.pending=null}}null===f&&(c=h),a.baseState=c,a.firstBaseUpdate=l,a.lastBaseUpdate=f,zu|=u,e.lanes=u,e.memoizedState=h}}function pa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(o(191,i));i.call(r)}}}var va=(new r.Component).refs;function ya(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ma={isMounted:function(e){return!!(e=e._reactInternals)&&Ye(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hs(),i=ds(e),a=la(r,i);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),fa(e,a),ps(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hs(),i=ds(e),a=la(r,i);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),fa(e,a),ps(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hs(),r=ds(e),i=la(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),fa(e,i),ps(e,r,n)}};function ga(e,t,n,r,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!hr(n,r)||!hr(i,a))}function ka(e,t,n){var r=!1,i=hi,a=t.contextType;return"object"===typeof a&&null!==a?a=oa(a):(i=mi(t)?vi:di.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?yi(e,i):hi),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ma,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ba(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ma.enqueueReplaceState(t,t.state,null)}function wa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=va,sa(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=oa(a):(a=mi(t)?vi:di.current,i.context=yi(e,a)),da(e,n,i,r),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(ya(e,t,a,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ma.enqueueReplaceState(i,i.state,null),da(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4)}var _a=Array.isArray;function Ea(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===va&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Sa(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Ta(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Ws(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function u(t){return e&&null===t.alternate&&(t.flags=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Ys(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Ea(e,t,n),r.return=e,r):((r=Gs(n.type,n.key,n.props,null,e.mode,r)).ref=Ea(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Js(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=Qs(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Ys(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case _:return(n=Gs(t.type,t.key,t.props,null,e.mode,n)).ref=Ea(e,null,t),n.return=e,n;case E:return(t=Js(t,e.mode,n)).return=e,t}if(_a(t)||B(t))return(t=Qs(t,e.mode,n,null)).return=e,t;Sa(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:s(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case _:return n.key===i?n.type===S?f(e,t,n.props.children,r,i):c(e,t,n,r):null;case E:return n.key===i?l(e,t,n,r):null}if(_a(n)||B(n))return null!==i?null:f(e,t,n,r,null);Sa(e,n)}return null}function p(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return s(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case _:return e=e.get(null===r.key?n:r.key)||null,r.type===S?f(t,e,r.props.children,i,r.key):c(t,e,r,i);case E:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(_a(r)||B(r))return f(t,e=e.get(n)||null,r,i,null);Sa(t,r)}return null}function v(i,o,u,s){for(var c=null,l=null,f=o,v=o=0,y=null;null!==f&&v<u.length;v++){f.index>v?(y=f,f=null):y=f.sibling;var m=d(i,f,u[v],s);if(null===m){null===f&&(f=y);break}e&&f&&null===m.alternate&&t(i,f),o=a(m,o,v),null===l?c=m:l.sibling=m,l=m,f=y}if(v===u.length)return n(i,f),c;if(null===f){for(;v<u.length;v++)null!==(f=h(i,u[v],s))&&(o=a(f,o,v),null===l?c=f:l.sibling=f,l=f);return c}for(f=r(i,f);v<u.length;v++)null!==(y=p(f,i,v,u[v],s))&&(e&&null!==y.alternate&&f.delete(null===y.key?v:y.key),o=a(y,o,v),null===l?c=y:l.sibling=y,l=y);return e&&f.forEach((function(e){return t(i,e)})),c}function y(i,u,s,c){var l=B(s);if("function"!==typeof l)throw Error(o(150));if(null==(s=l.call(s)))throw Error(o(151));for(var f=l=null,v=u,y=u=0,m=null,g=s.next();null!==v&&!g.done;y++,g=s.next()){v.index>y?(m=v,v=null):m=v.sibling;var k=d(i,v,g.value,c);if(null===k){null===v&&(v=m);break}e&&v&&null===k.alternate&&t(i,v),u=a(k,u,y),null===f?l=k:f.sibling=k,f=k,v=m}if(g.done)return n(i,v),l;if(null===v){for(;!g.done;y++,g=s.next())null!==(g=h(i,g.value,c))&&(u=a(g,u,y),null===f?l=g:f.sibling=g,f=g);return l}for(v=r(i,v);!g.done;y++,g=s.next())null!==(g=p(v,i,y,g.value,c))&&(e&&null!==g.alternate&&v.delete(null===g.key?y:g.key),u=a(g,u,y),null===f?l=g:f.sibling=g,f=g);return e&&v.forEach((function(e){return t(i,e)})),l}return function(e,r,a,s){var c="object"===typeof a&&null!==a&&a.type===S&&null===a.key;c&&(a=a.props.children);var l="object"===typeof a&&null!==a;if(l)switch(a.$$typeof){case _:e:{for(l=a.key,c=r;null!==c;){if(c.key===l){if(7===c.tag){if(a.type===S){n(e,c.sibling),(r=i(c,a.props.children)).return=e,e=r;break e}}else if(c.elementType===a.type){n(e,c.sibling),(r=i(c,a.props)).ref=Ea(e,c,a),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===S?((r=Qs(a.props.children,e.mode,s,a.key)).return=e,e=r):((s=Gs(a.type,a.key,a.props,null,e.mode,s)).ref=Ea(e,r,a),s.return=e,e=s)}return u(e);case E:e:{for(c=a.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Js(a,e.mode,s)).return=e,e=r}return u(e)}if("string"===typeof a||"number"===typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a)).return=e,e=r):(n(e,r),(r=Ys(a,e.mode,s)).return=e,e=r),u(e);if(_a(a))return v(e,r,a,s);if(B(a))return y(e,r,a,s);if(l&&Sa(e,a),"undefined"===typeof a&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,G(e.type)||"Component"))}return n(e,r)}}var xa=Ta(!0),Ia=Ta(!1),Ca={},Na=ci(Ca),Aa=ci(Ca),Ra=ci(Ca);function La(e){if(e===Ca)throw Error(o(174));return e}function Oa(e,t){switch(fi(Ra,t),fi(Aa,e),fi(Na,Ca),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}li(Na),fi(Na,t)}function Pa(){li(Na),li(Aa),li(Ra)}function Da(e){La(Ra.current);var t=La(Na.current),n=pe(t,e.type);t!==n&&(fi(Aa,e),fi(Na,n))}function Ma(e){Aa.current===e&&(li(Na),li(Aa))}var Ua=ci(0);function Va(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fa=null,ja=null,za=!1;function Ba(e,t){var n=Hs(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function qa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ha(e){if(za){var t=ja;if(t){var n=t;if(!qa(e,t)){if(!(t=Qr(n.nextSibling))||!qa(e,t))return e.flags=-1025&e.flags|2,za=!1,void(Fa=e);Ba(Fa,n)}Fa=e,ja=Qr(t.firstChild)}else e.flags=-1025&e.flags|2,za=!1,Fa=e}}function Ka(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Fa=e}function Wa(e){if(e!==Fa)return!1;if(!za)return Ka(e),za=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=ja;t;)Ba(e,t),t=Qr(t.nextSibling);if(Ka(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ja=Qr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ja=null}}else ja=Fa?Qr(e.stateNode.nextSibling):null;return!0}function Ga(){ja=Fa=null,za=!1}var Qa=[];function Xa(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Ya=w.ReactCurrentDispatcher,Ja=w.ReactCurrentBatchConfig,$a=0,Za=null,eo=null,to=null,no=!1,ro=!1;function io(){throw Error(o(321))}function ao(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function oo(e,t,n,r,i,a){if($a=a,Za=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ya.current=null===e||null===e.memoizedState?Oo:Po,e=n(r,i),ro){a=0;do{if(ro=!1,!(25>a))throw Error(o(301));a+=1,to=eo=null,t.updateQueue=null,Ya.current=Do,e=n(r,i)}while(ro)}if(Ya.current=Lo,t=null!==eo&&null!==eo.next,$a=0,to=eo=Za=null,no=!1,t)throw Error(o(300));return e}function uo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===to?Za.memoizedState=to=e:to=to.next=e,to}function so(){if(null===eo){var e=Za.alternate;e=null!==e?e.memoizedState:null}else e=eo.next;var t=null===to?Za.memoizedState:to.next;if(null!==t)to=t,eo=e;else{if(null===e)throw Error(o(310));e={memoizedState:(eo=e).memoizedState,baseState:eo.baseState,baseQueue:eo.baseQueue,queue:eo.queue,next:null},null===to?Za.memoizedState=to=e:to=to.next=e}return to}function co(e,t){return"function"===typeof t?t(e):t}function lo(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=eo,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var u=i.next;i.next=a.next,a.next=u}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=u=a=null,c=i;do{var l=c.lane;if(($a&l)===l)null!==s&&(s=s.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var f={lane:l,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(u=s=f,a=r):s=s.next=f,Za.lanes|=l,zu|=l}c=c.next}while(null!==c&&c!==i);null===s?a=r:s.next=u,lr(r,t.memoizedState)||(Uo=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function fo(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var u=i=i.next;do{a=e(a,u.action),u=u.next}while(u!==i);lr(a,t.memoizedState)||(Uo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ho(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=($a&e)===e)&&(t._workInProgressVersionPrimary=r,Qa.push(t))),e)return n(t._source);throw Qa.push(t),Error(o(350))}function po(e,t,n,r){var i=Ou;if(null===i)throw Error(o(349));var a=t._getVersion,u=a(t._source),s=Ya.current,c=s.useState((function(){return ho(i,t,n)})),l=c[1],f=c[0];c=to;var h=e.memoizedState,d=h.refs,p=d.getSnapshot,v=h.source;h=h.subscribe;var y=Za;return e.memoizedState={refs:d,source:t,subscribe:r},s.useEffect((function(){d.getSnapshot=n,d.setSnapshot=l;var e=a(t._source);if(!lr(u,e)){e=n(t._source),lr(f,e)||(l(e),e=ds(y),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var s=31-Ht(o),c=1<<s;r[s]|=e,o&=~c}}}),[n,t,r]),s.useEffect((function(){return r(t._source,(function(){var e=d.getSnapshot,n=d.setSnapshot;try{n(e(t._source));var r=ds(y);i.mutableReadLanes|=r&i.pendingLanes}catch(a){n((function(){throw a}))}}))}),[t,r]),lr(p,n)&&lr(v,t)&&lr(h,r)||((e={pending:null,dispatch:null,lastRenderedReducer:co,lastRenderedState:f}).dispatch=l=Ro.bind(null,Za,e),c.queue=e,c.baseQueue=null,f=ho(i,t,n),c.memoizedState=c.baseState=f),f}function vo(e,t,n){return po(so(),e,t,n)}function yo(e){var t=uo();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:co,lastRenderedState:e}).dispatch=Ro.bind(null,Za,e),[t.memoizedState,e]}function mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Za.updateQueue)?(t={lastEffect:null},Za.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function go(e){return e={current:e},uo().memoizedState=e}function ko(){return so().memoizedState}function bo(e,t,n,r){var i=uo();Za.flags|=e,i.memoizedState=mo(1|t,n,void 0,void 0===r?null:r)}function wo(e,t,n,r){var i=so();r=void 0===r?null:r;var a=void 0;if(null!==eo){var o=eo.memoizedState;if(a=o.destroy,null!==r&&ao(r,o.deps))return void mo(t,n,a,r)}Za.flags|=e,i.memoizedState=mo(1|t,n,a,r)}function _o(e,t){return bo(516,4,e,t)}function Eo(e,t){return wo(516,4,e,t)}function So(e,t){return wo(4,2,e,t)}function To(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function xo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,wo(4,2,To.bind(null,t,e),n)}function Io(){}function Co(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function No(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ao(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ao(e,t){var n=Hi();Wi(98>n?98:n,(function(){e(!0)})),Wi(97<n?97:n,(function(){var n=Ja.transition;Ja.transition=1;try{e(!1),t()}finally{Ja.transition=n}}))}function Ro(e,t,n){var r=hs(),i=ds(e),a={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?a.next=a:(a.next=o.next,o.next=a),t.pending=a,o=e.alternate,e===Za||null!==o&&o===Za)ro=no=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var u=t.lastRenderedState,s=o(u,n);if(a.eagerReducer=o,a.eagerState=s,lr(s,u))return}catch(c){}ps(e,i,r)}}var Lo={readContext:oa,useCallback:io,useContext:io,useEffect:io,useImperativeHandle:io,useLayoutEffect:io,useMemo:io,useReducer:io,useRef:io,useState:io,useDebugValue:io,useDeferredValue:io,useTransition:io,useMutableSource:io,useOpaqueIdentifier:io,unstable_isNewReconciler:!1},Oo={readContext:oa,useCallback:function(e,t){return uo().memoizedState=[e,void 0===t?null:t],e},useContext:oa,useEffect:_o,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,bo(4,2,To.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=uo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=uo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ro.bind(null,Za,e),[r.memoizedState,e]},useRef:go,useState:yo,useDebugValue:Io,useDeferredValue:function(e){var t=yo(e),n=t[0],r=t[1];return _o((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=yo(!1),t=e[0];return go(e=Ao.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=uo();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},po(r,e,t,n)},useOpaqueIdentifier:function(){if(za){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Yr++).toString(36))),Error(o(355))})),n=yo(t)[1];return 0===(2&Za.mode)&&(Za.flags|=516,mo(5,(function(){n("r:"+(Yr++).toString(36))}),void 0,null)),t}return yo(t="r:"+(Yr++).toString(36)),t},unstable_isNewReconciler:!1},Po={readContext:oa,useCallback:Co,useContext:oa,useEffect:Eo,useImperativeHandle:xo,useLayoutEffect:So,useMemo:No,useReducer:lo,useRef:ko,useState:function(){return lo(co)},useDebugValue:Io,useDeferredValue:function(e){var t=lo(co),n=t[0],r=t[1];return Eo((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=lo(co)[0];return[ko().current,e]},useMutableSource:vo,useOpaqueIdentifier:function(){return lo(co)[0]},unstable_isNewReconciler:!1},Do={readContext:oa,useCallback:Co,useContext:oa,useEffect:Eo,useImperativeHandle:xo,useLayoutEffect:So,useMemo:No,useReducer:fo,useRef:ko,useState:function(){return fo(co)},useDebugValue:Io,useDeferredValue:function(e){var t=fo(co),n=t[0],r=t[1];return Eo((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=fo(co)[0];return[ko().current,e]},useMutableSource:vo,useOpaqueIdentifier:function(){return fo(co)[0]},unstable_isNewReconciler:!1},Mo=w.ReactCurrentOwner,Uo=!1;function Vo(e,t,n,r){t.child=null===e?Ia(t,null,n,r):xa(t,e.child,n,r)}function Fo(e,t,n,r,i){n=n.render;var a=t.ref;return aa(t,i),r=oo(e,t,n,r,a,i),null===e||Uo?(t.flags|=1,Vo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,au(e,t,i))}function jo(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!==typeof o||Ks(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Gs(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,zo(e,t,o,r,i,a))}return o=e.child,0===(i&a)&&(i=o.memoizedProps,(n=null!==(n=n.compare)?n:hr)(i,r)&&e.ref===t.ref)?au(e,t,a):(t.flags|=1,(e=Ws(o,r)).ref=t.ref,e.return=t,t.child=e)}function zo(e,t,n,r,i,a){if(null!==e&&hr(e.memoizedProps,r)&&e.ref===t.ref){if(Uo=!1,0===(a&i))return t.lanes=e.lanes,au(e,t,a);0!==(16384&e.flags)&&(Uo=!0)}return Ho(e,t,n,r,a)}function Bo(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},_s(t,n);else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},_s(t,e),null;t.memoizedState={baseLanes:0},_s(t,null!==a?a.baseLanes:n)}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,_s(t,r);return Vo(e,t,i,n),t.child}function qo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ho(e,t,n,r,i){var a=mi(n)?vi:di.current;return a=yi(t,a),aa(t,i),n=oo(e,t,n,r,a,i),null===e||Uo?(t.flags|=1,Vo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,au(e,t,i))}function Ko(e,t,n,r,i){if(mi(n)){var a=!0;wi(t)}else a=!1;if(aa(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ka(t,n,r),wa(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,u=t.memoizedProps;o.props=u;var s=o.context,c=n.contextType;"object"===typeof c&&null!==c?c=oa(c):c=yi(t,c=mi(n)?vi:di.current);var l=n.getDerivedStateFromProps,f="function"===typeof l||"function"===typeof o.getSnapshotBeforeUpdate;f||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(u!==r||s!==c)&&ba(t,o,r,c),ua=!1;var h=t.memoizedState;o.state=h,da(t,r,o,i),s=t.memoizedState,u!==r||h!==s||pi.current||ua?("function"===typeof l&&(ya(t,n,l,r),s=t.memoizedState),(u=ua||ga(t,n,u,r,h,s,c))?(f||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4)):("function"===typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=c,r=u):("function"===typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,ca(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:Ji(t.type,u),o.props=c,f=t.pendingProps,h=o.context,"object"===typeof(s=n.contextType)&&null!==s?s=oa(s):s=yi(t,s=mi(n)?vi:di.current);var d=n.getDerivedStateFromProps;(l="function"===typeof d||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(u!==f||h!==s)&&ba(t,o,r,s),ua=!1,h=t.memoizedState,o.state=h,da(t,r,o,i);var p=t.memoizedState;u!==f||h!==p||pi.current||ua?("function"===typeof d&&(ya(t,n,d,r),p=t.memoizedState),(c=ua||ga(t,n,c,r,h,p,s))?(l||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,s),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,s)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof o.componentDidUpdate||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=s,r=c):("function"!==typeof o.componentDidUpdate||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),r=!1)}return Wo(e,t,n,r,a,i)}function Wo(e,t,n,r,i,a){qo(e,t);var o=0!==(64&t.flags);if(!r&&!o)return i&&_i(t,n,!1),au(e,t,a);r=t.stateNode,Mo.current=t;var u=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=xa(t,e.child,null,a),t.child=xa(t,null,u,a)):Vo(e,t,u,a),t.memoizedState=r.state,i&&_i(t,n,!0),t.child}function Go(e){var t=e.stateNode;t.pendingContext?ki(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ki(0,t.context,!1),Oa(e,t.containerInfo)}var Qo,Xo,Yo,Jo={dehydrated:null,retryLane:0};function $o(e,t,n){var r,i=t.pendingProps,a=Ua.current,o=!1;return(r=0!==(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),fi(Ua,1&a),null===e?(void 0!==i.fallback&&Ha(t),e=i.children,a=i.fallback,o?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Jo,e):"number"===typeof i.unstable_expectedLoadTime?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Jo,t.lanes=33554432,e):((n=Xs({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(i=tu(e,t,i.children,i.fallback,n),o=t.child,a=e.child.memoizedState,o.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Jo,i):(n=eu(e,t,i.children,n),t.memoizedState=null,n))}function Zo(e,t,n,r){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},0===(2&i)&&null!==a?(a.childLanes=0,a.pendingProps=t):a=Xs(t,i,0,null),n=Qs(n,i,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function eu(e,t,n,r){var i=e.child;return e=i.sibling,n=Ws(i,{mode:"visible",children:n}),0===(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function tu(e,t,n,r,i){var a=t.mode,o=e.child;e=o.sibling;var u={mode:"hidden",children:n};return 0===(2&a)&&t.child!==o?((n=t.child).childLanes=0,n.pendingProps=u,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Ws(o,u),null!==e?r=Ws(e,r):(r=Qs(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function nu(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ia(e.return,t)}function ru(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=a)}function iu(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vo(e,t,r.children,n),0!==(2&(r=Ua.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&nu(e,n);else if(19===e.tag)nu(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fi(Ua,r),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Va(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ru(t,!1,i,n,a,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Va(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ru(t,!0,n,null,a,t.lastEffect);break;case"together":ru(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function au(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),zu|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Ws(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ws(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function ou(e,t){if(!za)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function uu(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return mi(t.type)&&gi(),null;case 3:return Pa(),li(pi),li(di),Xa(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Wa(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ma(t);var a=La(Ra.current);if(n=t.type,null!==e&&null!=t.stateNode)Xo(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=La(Na.current),Wa(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[$r]=t,r[Zr]=u,n){case"dialog":Ar("cancel",r),Ar("close",r);break;case"iframe":case"object":case"embed":Ar("load",r);break;case"video":case"audio":for(e=0;e<xr.length;e++)Ar(xr[e],r);break;case"source":Ar("error",r);break;case"img":case"image":case"link":Ar("error",r),Ar("load",r);break;case"details":Ar("toggle",r);break;case"input":ee(r,u),Ar("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!u.multiple},Ar("invalid",r);break;case"textarea":se(r,u),Ar("invalid",r)}for(var c in Se(n,u),e=null,u)u.hasOwnProperty(c)&&(a=u[c],"children"===c?"string"===typeof a?r.textContent!==a&&(e=["children",a]):"number"===typeof a&&r.textContent!==""+a&&(e=["children",""+a]):s.hasOwnProperty(c)&&null!=a&&"onScroll"===c&&Ar("scroll",r));switch(n){case"input":Y(r),re(r,u,!0);break;case"textarea":Y(r),le(r);break;case"select":case"option":break;default:"function"===typeof u.onClick&&(r.onclick=jr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===a.nodeType?a:a.ownerDocument,e===fe&&(e=de(n)),e===fe?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[$r]=t,e[Zr]=r,Qo(e,t),t.stateNode=e,c=Te(n,r),n){case"dialog":Ar("cancel",e),Ar("close",e),a=r;break;case"iframe":case"object":case"embed":Ar("load",e),a=r;break;case"video":case"audio":for(a=0;a<xr.length;a++)Ar(xr[a],e);a=r;break;case"source":Ar("error",e),a=r;break;case"img":case"image":case"link":Ar("error",e),Ar("load",e),a=r;break;case"details":Ar("toggle",e),a=r;break;case"input":ee(e,r),a=Z(e,r),Ar("invalid",e);break;case"option":a=ae(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=i({},r,{value:void 0}),Ar("invalid",e);break;case"textarea":se(e,r),a=ue(e,r),Ar("invalid",e);break;default:a=r}Se(n,a);var l=a;for(u in l)if(l.hasOwnProperty(u)){var f=l[u];"style"===u?_e(e,f):"dangerouslySetInnerHTML"===u?null!=(f=f?f.__html:void 0)&&me(e,f):"children"===u?"string"===typeof f?("textarea"!==n||""!==f)&&ge(e,f):"number"===typeof f&&ge(e,""+f):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(s.hasOwnProperty(u)?null!=f&&"onScroll"===u&&Ar("scroll",e):null!=f&&b(e,u,f,c))}switch(n){case"input":Y(e),re(e,r,!1);break;case"textarea":Y(e),le(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Q(r.value));break;case"select":e.multiple=!!r.multiple,null!=(u=r.value)?oe(e,!!r.multiple,u,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof a.onClick&&(e.onclick=jr)}qr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Yo(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));n=La(Ra.current),La(Na.current),Wa(t)?(r=t.stateNode,n=t.memoizedProps,r[$r]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[$r]=t,t.stateNode=r)}return null;case 13:return li(Ua),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Wa(t):n=null!==e.memoizedState,r&&!n&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Ua.current)?0===Vu&&(Vu=3):(0!==Vu&&3!==Vu||(Vu=4),null===Ou||0===(134217727&zu)&&0===(134217727&Bu)||gs(Ou,Du))),(r||n)&&(t.flags|=4),null);case 4:return Pa(),null===e&&Lr(t.stateNode.containerInfo),null;case 10:return ra(t),null;case 19:if(li(Ua),null===(r=t.memoizedState))return null;if(u=0!==(64&t.flags),null===(c=r.rendering))if(u)ou(r,!1);else{if(0!==Vu||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Va(e))){for(t.flags|=64,ou(r,!1),null!==(u=c.updateQueue)&&(t.updateQueue=u,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(u=n).flags&=2,u.nextEffect=null,u.firstEffect=null,u.lastEffect=null,null===(c=u.alternate)?(u.childLanes=0,u.lanes=e,u.child=null,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=c.childLanes,u.lanes=c.lanes,u.child=c.child,u.memoizedProps=c.memoizedProps,u.memoizedState=c.memoizedState,u.updateQueue=c.updateQueue,u.type=c.type,e=c.dependencies,u.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fi(Ua,1&Ua.current|2),t.child}e=e.sibling}null!==r.tail&&qi()>Wu&&(t.flags|=64,u=!0,ou(r,!1),t.lanes=33554432)}else{if(!u)if(null!==(e=Va(c))){if(t.flags|=64,u=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),ou(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!za)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*qi()-r.renderingStartTime>Wu&&1073741824!==n&&(t.flags|=64,u=!0,ou(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=qi(),n.sibling=null,t=Ua.current,fi(Ua,u?1&t|2:1&t),n):null;case 23:case 24:return Es(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function su(e){switch(e.tag){case 1:mi(e.type)&&gi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Pa(),li(pi),li(di),Xa(),0!==(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Ma(e),null;case 13:return li(Ua),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return li(Ua),null;case 4:return Pa(),null;case 10:return ra(e),null;case 23:case 24:return Es(),null;default:return null}}function cu(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i}}function lu(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Qo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,La(Na.current);var o,u=null;switch(n){case"input":a=Z(e,a),r=Z(e,r),u=[];break;case"option":a=ae(e,a),r=ae(e,r),u=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),u=[];break;case"textarea":a=ue(e,a),r=ue(e,r),u=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(e.onclick=jr)}for(f in Se(n,r),n=null,a)if(!r.hasOwnProperty(f)&&a.hasOwnProperty(f)&&null!=a[f])if("style"===f){var c=a[f];for(o in c)c.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(s.hasOwnProperty(f)?u||(u=[]):(u=u||[]).push(f,null));for(f in r){var l=r[f];if(c=null!=a?a[f]:void 0,r.hasOwnProperty(f)&&l!==c&&(null!=l||null!=c))if("style"===f)if(c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(u||(u=[]),u.push(f,n)),n=l;else"dangerouslySetInnerHTML"===f?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(u=u||[]).push(f,l)):"children"===f?"string"!==typeof l&&"number"!==typeof l||(u=u||[]).push(f,""+l):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(s.hasOwnProperty(f)?(null!=l&&"onScroll"===f&&Ar("scroll",e),u||c===l||(u=[])):"object"===typeof l&&null!==l&&l.$$typeof===D?l.toString():(u=u||[]).push(f,l))}n&&(u=u||[]).push("style",n);var f=u;(t.updateQueue=f)&&(t.flags|=4)}},Yo=function(e,t,n,r){n!==r&&(t.flags|=4)};var fu="function"===typeof WeakMap?WeakMap:Map;function hu(e,t,n){(n=la(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yu||(Yu=!0,Ju=r),lu(0,t)},n}function du(e,t,n){(n=la(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return lu(0,t),r(i)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===$u?$u=new Set([this]):$u.add(this),lu(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var pu="function"===typeof WeakSet?WeakSet:Set;function vu(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){js(e,n)}else t.current=null}function yu(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ji(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Gr(t.stateNode.containerInfo))}throw Error(o(163))}function mu(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!==(4&(i=i.tag))&&0!==(1&i)&&(Us(n,e),Ms(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Ji(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&pa(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}pa(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&qr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&_t(n)))))}throw Error(o(163))}function gu(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,r.style.display=we("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function ku(e,t){if(Si&&"function"===typeof Si.onCommitFiberUnmount)try{Si.onCommitFiberUnmount(Ei,t)}catch(a){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!==(4&r))Us(t,n);else{r=t;try{i()}catch(a){js(r,a)}}n=n.next}while(n!==e)}break;case 1:if(vu(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(a){js(t,a)}break;case 5:vu(t);break;case 4:Tu(e,t)}}function bu(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function wu(e){return 5===e.tag||3===e.tag||4===e.tag}function _u(e){e:{for(var t=e.return;null!==t;){if(wu(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ge(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||wu(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Eu(e,n,t):Su(e,n,t)}function Eu(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=jr));else if(4!==r&&null!==(e=e.child))for(Eu(e,t,n),e=e.sibling;null!==e;)Eu(e,t,n),e=e.sibling}function Su(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Su(e,t,n),e=e.sibling;null!==e;)Su(e,t,n),e=e.sibling}function Tu(e,t){for(var n,r,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(o(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag){e:for(var u=e,s=i,c=s;;)if(ku(u,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===s)break e;for(;null===c.sibling;){if(null===c.return||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(u=n,s=i.stateNode,8===u.nodeType?u.parentNode.removeChild(s):u.removeChild(s)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(ku(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function xu(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Zr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Te(e,i),t=Te(e,r),i=0;i<a.length;i+=2){var u=a[i],s=a[i+1];"style"===u?_e(n,s):"dangerouslySetInnerHTML"===u?me(n,s):"children"===u?ge(n,s):b(n,u,s,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?oe(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,_t(n.containerInfo)));case 13:return null!==t.memoizedState&&(Ku=qi(),gu(t.child,!0)),void Iu(t);case 19:return void Iu(t);case 23:case 24:return void gu(t,null!==t.memoizedState)}throw Error(o(163))}function Iu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new pu),t.forEach((function(t){var r=Bs.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Cu(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Nu=Math.ceil,Au=w.ReactCurrentDispatcher,Ru=w.ReactCurrentOwner,Lu=0,Ou=null,Pu=null,Du=0,Mu=0,Uu=ci(0),Vu=0,Fu=null,ju=0,zu=0,Bu=0,qu=0,Hu=null,Ku=0,Wu=1/0;function Gu(){Wu=qi()+500}var Qu,Xu=null,Yu=!1,Ju=null,$u=null,Zu=!1,es=null,ts=90,ns=[],rs=[],is=null,as=0,os=null,us=-1,ss=0,cs=0,ls=null,fs=!1;function hs(){return 0!==(48&Lu)?qi():-1!==us?us:us=qi()}function ds(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===Hi()?1:2;if(0===ss&&(ss=ju),0!==Yi.transition){0!==cs&&(cs=null!==Hu?Hu.pendingLanes:0),e=ss;var t=4186112&~cs;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Hi(),0!==(4&Lu)&&98===e?e=jt(12,ss):e=jt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ss),e}function ps(e,t,n){if(50<as)throw as=0,os=null,Error(o(185));if(null===(e=vs(e,t)))return null;qt(e,t,n),e===Ou&&(Bu|=t,4===Vu&&gs(e,Du));var r=Hi();1===t?0!==(8&Lu)&&0===(48&Lu)?ks(e):(ys(e,n),0===Lu&&(Gu(),Qi())):(0===(4&Lu)||98!==r&&99!==r||(null===is?is=new Set([e]):is.add(e)),ys(e,n)),Hu=e}function vs(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function ys(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes;0<u;){var s=31-Ht(u),c=1<<s,l=a[s];if(-1===l){if(0===(c&r)||0!==(c&i)){l=t,Ut(c);var f=Mt;a[s]=10<=f?l+250:6<=f?l+5e3:-1}}else l<=t&&(e.expiredLanes|=c);u&=~c}if(r=Vt(e,e===Ou?Du:0),t=Mt,0===r)null!==n&&(n!==Ui&&Ii(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ui&&Ii(n)}15===t?(n=ks.bind(null,e),null===Fi?(Fi=[n],ji=xi(Li,Xi)):Fi.push(n),n=Ui):14===t?n=Gi(99,ks.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=Gi(n,ms.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function ms(e){if(us=-1,cs=ss=0,0!==(48&Lu))throw Error(o(327));var t=e.callbackNode;if(Ds()&&e.callbackNode!==t)return null;var n=Vt(e,e===Ou?Du:0);if(0===n)return null;var r=n,i=Lu;Lu|=16;var a=xs();for(Ou===e&&Du===r||(Gu(),Ss(e,r));;)try{Ns();break}catch(s){Ts(e,s)}if(na(),Au.current=a,Lu=i,null!==Pu?r=0:(Ou=null,Du=0,r=Vu),0!==(ju&Bu))Ss(e,0);else if(0!==r){if(2===r&&(Lu|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(n=Ft(e))&&(r=Is(e,n))),1===r)throw t=Fu,Ss(e,0),gs(e,n),ys(e,qi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:Ls(e);break;case 3:if(gs(e,n),(62914560&n)===n&&10<(r=Ku+500-qi())){if(0!==Vt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){hs(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Kr(Ls.bind(null,e),r);break}Ls(e);break;case 4:if(gs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var u=31-Ht(n);a=1<<u,(u=r[u])>i&&(i=u),n&=~a}if(n=i,10<(n=(120>(n=qi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Nu(n/1960))-n)){e.timeoutHandle=Kr(Ls.bind(null,e),n);break}Ls(e);break;default:throw Error(o(329))}}return ys(e,qi()),e.callbackNode===t?ms.bind(null,e):null}function gs(e,t){for(t&=~qu,t&=~Bu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function ks(e){if(0!==(48&Lu))throw Error(o(327));if(Ds(),e===Ou&&0!==(e.expiredLanes&Du)){var t=Du,n=Is(e,t);0!==(ju&Bu)&&(n=Is(e,t=Vt(e,t)))}else n=Is(e,t=Vt(e,0));if(0!==e.tag&&2===n&&(Lu|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(t=Ft(e))&&(n=Is(e,t))),1===n)throw n=Fu,Ss(e,0),gs(e,t),ys(e,qi()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ls(e),ys(e,qi()),null}function bs(e,t){var n=Lu;Lu|=1;try{return e(t)}finally{0===(Lu=n)&&(Gu(),Qi())}}function ws(e,t){var n=Lu;Lu&=-2,Lu|=8;try{return e(t)}finally{0===(Lu=n)&&(Gu(),Qi())}}function _s(e,t){fi(Uu,Mu),Mu|=t,ju|=t}function Es(){Mu=Uu.current,li(Uu)}function Ss(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Wr(n)),null!==Pu)for(n=Pu.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&gi();break;case 3:Pa(),li(pi),li(di),Xa();break;case 5:Ma(r);break;case 4:Pa();break;case 13:case 19:li(Ua);break;case 10:ra(r);break;case 23:case 24:Es()}n=n.return}Ou=e,Pu=Ws(e.current,null),Du=Mu=ju=t,Vu=0,Fu=null,qu=Bu=zu=0}function Ts(e,t){for(;;){var n=Pu;try{if(na(),Ya.current=Lo,no){for(var r=Za.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}no=!1}if($a=0,to=eo=Za=null,ro=!1,Ru.current=null,null===n||null===n.return){Vu=1,Fu=t,Pu=null;break}e:{var a=e,o=n.return,u=n,s=t;if(t=Du,u.flags|=2048,u.firstEffect=u.lastEffect=null,null!==s&&"object"===typeof s&&"function"===typeof s.then){var c=s;if(0===(2&u.mode)){var l=u.alternate;l?(u.updateQueue=l.updateQueue,u.memoizedState=l.memoizedState,u.lanes=l.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=0!==(1&Ua.current),h=o;do{var d;if(d=13===h.tag){var p=h.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var v=h.memoizedProps;d=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(d){var y=h.updateQueue;if(null===y){var m=new Set;m.add(c),h.updateQueue=m}else y.add(c);if(0===(2&h.mode)){if(h.flags|=64,u.flags|=16384,u.flags&=-2981,1===u.tag)if(null===u.alternate)u.tag=17;else{var g=la(-1,1);g.tag=2,fa(u,g)}u.lanes|=1;break e}s=void 0,u=t;var k=a.pingCache;if(null===k?(k=a.pingCache=new fu,s=new Set,k.set(c,s)):void 0===(s=k.get(c))&&(s=new Set,k.set(c,s)),!s.has(u)){s.add(u);var b=zs.bind(null,a,c,u);c.then(b,b)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);s=Error((G(u.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Vu&&(Vu=2),s=cu(s,u),h=o;do{switch(h.tag){case 3:a=s,h.flags|=4096,t&=-t,h.lanes|=t,ha(h,hu(0,a,t));break e;case 1:a=s;var w=h.type,_=h.stateNode;if(0===(64&h.flags)&&("function"===typeof w.getDerivedStateFromError||null!==_&&"function"===typeof _.componentDidCatch&&(null===$u||!$u.has(_)))){h.flags|=4096,t&=-t,h.lanes|=t,ha(h,du(h,a,t));break e}}h=h.return}while(null!==h)}Rs(n)}catch(E){t=E,Pu===n&&null!==n&&(Pu=n=n.return);continue}break}}function xs(){var e=Au.current;return Au.current=Lo,null===e?Lo:e}function Is(e,t){var n=Lu;Lu|=16;var r=xs();for(Ou===e&&Du===t||Ss(e,t);;)try{Cs();break}catch(i){Ts(e,i)}if(na(),Lu=n,Au.current=r,null!==Pu)throw Error(o(261));return Ou=null,Du=0,Vu}function Cs(){for(;null!==Pu;)As(Pu)}function Ns(){for(;null!==Pu&&!Ci();)As(Pu)}function As(e){var t=Qu(e.alternate,e,Mu);e.memoizedProps=e.pendingProps,null===t?Rs(e):Pu=t,Ru.current=null}function Rs(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(n=uu(n,t,Mu)))return void(Pu=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Mu)||0===(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=su(t)))return n.flags&=2047,void(Pu=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Pu=t);Pu=t=e}while(null!==t);0===Vu&&(Vu=5)}function Ls(e){var t=Hi();return Wi(99,Os.bind(null,e,t)),null}function Os(e,t){do{Ds()}while(null!==es);if(0!==(48&Lu))throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var u=e.eventTimes,s=e.expirationTimes;0<a;){var c=31-Ht(a),l=1<<c;i[c]=0,u[c]=-1,s[c]=-1,a&=~l}if(null!==is&&0===(24&r)&&is.has(e)&&is.delete(e),e===Ou&&(Pu=Ou=null,Du=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Lu,Lu|=32,Ru.current=null,zr=Xt,mr(u=yr())){if("selectionStart"in u)s={start:u.selectionStart,end:u.selectionEnd};else e:if(s=(s=u.ownerDocument)&&s.defaultView||window,(l=s.getSelection&&s.getSelection())&&0!==l.rangeCount){s=l.anchorNode,a=l.anchorOffset,c=l.focusNode,l=l.focusOffset;try{s.nodeType,c.nodeType}catch(x){s=null;break e}var f=0,h=-1,d=-1,p=0,v=0,y=u,m=null;t:for(;;){for(var g;y!==s||0!==a&&3!==y.nodeType||(h=f+a),y!==c||0!==l&&3!==y.nodeType||(d=f+l),3===y.nodeType&&(f+=y.nodeValue.length),null!==(g=y.firstChild);)m=y,y=g;for(;;){if(y===u)break t;if(m===s&&++p===a&&(h=f),m===c&&++v===l&&(d=f),null!==(g=y.nextSibling))break;m=(y=m).parentNode}y=g}s=-1===h||-1===d?null:{start:h,end:d}}else s=null;s=s||{start:0,end:0}}else s=null;Br={focusedElem:u,selectionRange:s},Xt=!1,ls=null,fs=!1,Xu=r;do{try{Ps()}catch(x){if(null===Xu)throw Error(o(330));js(Xu,x),Xu=Xu.nextEffect}}while(null!==Xu);ls=null,Xu=r;do{try{for(u=e;null!==Xu;){var k=Xu.flags;if(16&k&&ge(Xu.stateNode,""),128&k){var b=Xu.alternate;if(null!==b){var w=b.ref;null!==w&&("function"===typeof w?w(null):w.current=null)}}switch(1038&k){case 2:_u(Xu),Xu.flags&=-3;break;case 6:_u(Xu),Xu.flags&=-3,xu(Xu.alternate,Xu);break;case 1024:Xu.flags&=-1025;break;case 1028:Xu.flags&=-1025,xu(Xu.alternate,Xu);break;case 4:xu(Xu.alternate,Xu);break;case 8:Tu(u,s=Xu);var _=s.alternate;bu(s),null!==_&&bu(_)}Xu=Xu.nextEffect}}catch(x){if(null===Xu)throw Error(o(330));js(Xu,x),Xu=Xu.nextEffect}}while(null!==Xu);if(w=Br,b=yr(),k=w.focusedElem,u=w.selectionRange,b!==k&&k&&k.ownerDocument&&vr(k.ownerDocument.documentElement,k)){null!==u&&mr(k)&&(b=u.start,void 0===(w=u.end)&&(w=b),"selectionStart"in k?(k.selectionStart=b,k.selectionEnd=Math.min(w,k.value.length)):(w=(b=k.ownerDocument||document)&&b.defaultView||window).getSelection&&(w=w.getSelection(),s=k.textContent.length,_=Math.min(u.start,s),u=void 0===u.end?_:Math.min(u.end,s),!w.extend&&_>u&&(s=u,u=_,_=s),s=pr(k,_),a=pr(k,u),s&&a&&(1!==w.rangeCount||w.anchorNode!==s.node||w.anchorOffset!==s.offset||w.focusNode!==a.node||w.focusOffset!==a.offset)&&((b=b.createRange()).setStart(s.node,s.offset),w.removeAllRanges(),_>u?(w.addRange(b),w.extend(a.node,a.offset)):(b.setEnd(a.node,a.offset),w.addRange(b))))),b=[];for(w=k;w=w.parentNode;)1===w.nodeType&&b.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"===typeof k.focus&&k.focus(),k=0;k<b.length;k++)(w=b[k]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Xt=!!zr,Br=zr=null,e.current=n,Xu=r;do{try{for(k=e;null!==Xu;){var E=Xu.flags;if(36&E&&mu(k,Xu.alternate,Xu),128&E){b=void 0;var S=Xu.ref;if(null!==S){var T=Xu.stateNode;Xu.tag,b=T,"function"===typeof S?S(b):S.current=b}}Xu=Xu.nextEffect}}catch(x){if(null===Xu)throw Error(o(330));js(Xu,x),Xu=Xu.nextEffect}}while(null!==Xu);Xu=null,Vi(),Lu=i}else e.current=n;if(Zu)Zu=!1,es=e,ts=t;else for(Xu=r;null!==Xu;)t=Xu.nextEffect,Xu.nextEffect=null,8&Xu.flags&&((E=Xu).sibling=null,E.stateNode=null),Xu=t;if(0===(r=e.pendingLanes)&&($u=null),1===r?e===os?as++:(as=0,os=e):as=0,n=n.stateNode,Si&&"function"===typeof Si.onCommitFiberRoot)try{Si.onCommitFiberRoot(Ei,n,void 0,64===(64&n.current.flags))}catch(x){}if(ys(e,qi()),Yu)throw Yu=!1,e=Ju,Ju=null,e;return 0!==(8&Lu)||Qi(),null}function Ps(){for(;null!==Xu;){var e=Xu.alternate;fs||null===ls||(0!==(8&Xu.flags)?et(Xu,ls)&&(fs=!0):13===Xu.tag&&Cu(e,Xu)&&et(Xu,ls)&&(fs=!0));var t=Xu.flags;0!==(256&t)&&yu(e,Xu),0===(512&t)||Zu||(Zu=!0,Gi(97,(function(){return Ds(),null}))),Xu=Xu.nextEffect}}function Ds(){if(90!==ts){var e=97<ts?97:ts;return ts=90,Wi(e,Vs)}return!1}function Ms(e,t){ns.push(t,e),Zu||(Zu=!0,Gi(97,(function(){return Ds(),null})))}function Us(e,t){rs.push(t,e),Zu||(Zu=!0,Gi(97,(function(){return Ds(),null})))}function Vs(){if(null===es)return!1;var e=es;if(es=null,0!==(48&Lu))throw Error(o(331));var t=Lu;Lu|=32;var n=rs;rs=[];for(var r=0;r<n.length;r+=2){var i=n[r],a=n[r+1],u=i.destroy;if(i.destroy=void 0,"function"===typeof u)try{u()}catch(c){if(null===a)throw Error(o(330));js(a,c)}}for(n=ns,ns=[],r=0;r<n.length;r+=2){i=n[r],a=n[r+1];try{var s=i.create;i.destroy=s()}catch(c){if(null===a)throw Error(o(330));js(a,c)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return Lu=t,Qi(),!0}function Fs(e,t,n){fa(e,t=hu(0,t=cu(n,t),1)),t=hs(),null!==(e=vs(e,1))&&(qt(e,1,t),ys(e,t))}function js(e,t){if(3===e.tag)Fs(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Fs(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===$u||!$u.has(r))){var i=du(n,e=cu(t,e),1);if(fa(n,i),i=hs(),null!==(n=vs(n,1)))qt(n,1,i),ys(n,i);else if("function"===typeof r.componentDidCatch&&(null===$u||!$u.has(r)))try{r.componentDidCatch(t,e)}catch(a){}break}}n=n.return}}function zs(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=hs(),e.pingedLanes|=e.suspendedLanes&n,Ou===e&&(Du&n)===n&&(4===Vu||3===Vu&&(62914560&Du)===Du&&500>qi()-Ku?Ss(e,0):qu|=n),ys(e,t)}function Bs(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===Hi()?1:2:(0===ss&&(ss=ju),0===(t=zt(62914560&~ss))&&(t=4194304))),n=hs(),null!==(e=vs(e,t))&&(qt(e,t,n),ys(e,n))}function qs(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hs(e,t,n,r){return new qs(e,t,n,r)}function Ks(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ws(e,t){var n=e.alternate;return null===n?((n=Hs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gs(e,t,n,r,i,a){var u=2;if(r=e,"function"===typeof e)Ks(e)&&(u=1);else if("string"===typeof e)u=5;else e:switch(e){case S:return Qs(n.children,i,a,t);case M:u=8,i|=16;break;case T:u=8,i|=1;break;case x:return(e=Hs(12,n,t,8|i)).elementType=x,e.type=x,e.lanes=a,e;case A:return(e=Hs(13,n,t,i)).type=A,e.elementType=A,e.lanes=a,e;case R:return(e=Hs(19,n,t,i)).elementType=R,e.lanes=a,e;case U:return Xs(n,i,a,t);case V:return(e=Hs(24,n,t,i)).elementType=V,e.lanes=a,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case I:u=10;break e;case C:u=9;break e;case N:u=11;break e;case L:u=14;break e;case O:u=16,r=null;break e;case P:u=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Hs(u,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Qs(e,t,n,r){return(e=Hs(7,e,r,t)).lanes=n,e}function Xs(e,t,n,r){return(e=Hs(23,e,r,t)).elementType=U,e.lanes=n,e}function Ys(e,t,n){return(e=Hs(6,e,null,t)).lanes=n,e}function Js(e,t,n){return(t=Hs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $s(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.mutableSourceEagerHydrationData=null}function Zs(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function ec(e,t,n,r){var i=t.current,a=hs(),u=ds(i);e:if(n){t:{if(Ye(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(mi(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(o(171))}if(1===n.tag){var c=n.type;if(mi(c)){n=bi(n,c,s);break e}}n=s}else n=hi;return null===t.context?t.context=n:t.pendingContext=n,(t=la(a,u)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),fa(i,t),ps(i,u,a),u}function tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rc(e,t){nc(e,t),(e=e.alternate)&&nc(e,t)}function ic(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new $s(e,t,null!=n&&!0===n.hydrate),t=Hs(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,sa(t),e[ei]=n.current,Lr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function ac(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function oc(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a._internalRoot;if("function"===typeof i){var u=i;i=function(){var e=tc(o);u.call(e)}}ec(t,o,e,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ic(e,0,t?{hydrate:!0}:void 0)}(n,r),o=a._internalRoot,"function"===typeof i){var s=i;i=function(){var e=tc(o);s.call(e)}}ws((function(){ec(t,o,e,i)}))}return tc(o)}function uc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ac(t))throw Error(o(200));return Zs(e,t,null,n)}Qu=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Uo=!0;else{if(0===(n&r)){switch(Uo=!1,t.tag){case 3:Go(t),Ga();break;case 5:Da(t);break;case 1:mi(t.type)&&wi(t);break;case 4:Oa(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;fi($i,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?$o(e,t,n):(fi(Ua,1&Ua.current),null!==(t=au(e,t,n))?t.sibling:null);fi(Ua,1&Ua.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(64&e.flags)){if(r)return iu(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),fi(Ua,Ua.current),r)break;return null;case 23:case 24:return t.lanes=0,Bo(e,t,n)}return au(e,t,n)}Uo=0!==(16384&e.flags)}else Uo=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=yi(t,di.current),aa(t,n),i=oo(null,t,r,e,i,n),t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,mi(r)){var a=!0;wi(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,sa(t);var u=r.getDerivedStateFromProps;"function"===typeof u&&ya(t,r,u,e),i.updater=ma,t.stateNode=i,i._reactInternals=t,wa(t,r,e,n),t=Wo(null,t,r,!0,a,n)}else t.tag=0,Vo(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"===typeof e)return Ks(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===N)return 11;if(e===L)return 14}return 2}(i),e=Ji(i,e),a){case 0:t=Ho(null,t,i,e,n);break e;case 1:t=Ko(null,t,i,e,n);break e;case 11:t=Fo(null,t,i,e,n);break e;case 14:t=jo(null,t,i,Ji(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ho(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 1:return r=t.type,i=t.pendingProps,Ko(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 3:if(Go(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ca(e,t),da(t,r,null,n),(r=t.memoizedState.element)===i)Ga(),t=au(e,t,n);else{if((a=(i=t.stateNode).hydrate)&&(ja=Qr(t.stateNode.containerInfo.firstChild),Fa=t,a=za=!0),a){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(a=e[i])._workInProgressVersionPrimary=e[i+1],Qa.push(a);for(n=Ia(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Vo(e,t,r,n),Ga();t=t.child}return t;case 5:return Da(t),null===e&&Ha(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,u=i.children,Hr(r,i)?u=null:null!==a&&Hr(r,a)&&(t.flags|=16),qo(e,t),Vo(e,t,u,n),t.child;case 6:return null===e&&Ha(t),null;case 13:return $o(e,t,n);case 4:return Oa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=xa(t,null,r,n):Vo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Fo(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 7:return Vo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Vo(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,u=t.memoizedProps,a=i.value;var s=t.type._context;if(fi($i,s._currentValue),s._currentValue=a,null!==u)if(s=u.value,0===(a=lr(s,a)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823))){if(u.children===i.children&&!pi.current){t=au(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){u=s.child;for(var l=c.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&a)){1===s.tag&&((l=la(-1,n&-n)).tag=2,fa(s,l)),s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),ia(s.return,n),c.lanes|=n;break}l=l.next}}else u=10===s.tag&&s.type===t.type?null:s.child;if(null!==u)u.return=s;else for(u=s;null!==u;){if(u===t){u=null;break}if(null!==(s=u.sibling)){s.return=u.return,u=s;break}u=u.return}s=u}Vo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(a=t.pendingProps).children,aa(t,n),r=r(i=oa(i,a.unstable_observedBits)),t.flags|=1,Vo(e,t,r,n),t.child;case 14:return a=Ji(i=t.type,t.pendingProps),jo(e,t,i,a=Ji(i.type,a),r,n);case 15:return zo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ji(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,mi(r)?(e=!0,wi(t)):e=!1,aa(t,n),ka(t,r,i),wa(t,r,i,n),Wo(null,t,r,!0,e,n);case 19:return iu(e,t,n);case 23:case 24:return Bo(e,t,n)}throw Error(o(156,t.tag))},ic.prototype.render=function(e){ec(e,this._internalRoot,null,null)},ic.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ec(null,e,null,(function(){t[ei]=null}))},tt=function(e){13===e.tag&&(ps(e,4,hs()),rc(e,4))},nt=function(e){13===e.tag&&(ps(e,67108864,hs()),rc(e,67108864))},rt=function(e){if(13===e.tag){var t=hs(),n=ds(e);ps(e,n,t),rc(e,n)}},it=function(e,t){return t()},Ie=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ai(r);if(!i)throw Error(o(90));J(r),ne(r,i)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},Oe=bs,Pe=function(e,t,n,r,i){var a=Lu;Lu|=4;try{return Wi(98,e.bind(null,t,n,r,i))}finally{0===(Lu=a)&&(Gu(),Qi())}},De=function(){0===(49&Lu)&&(function(){if(null!==is){var e=is;is=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,ys(e,qi())}))}Qi()}(),Ds())},Me=function(e,t){var n=Lu;Lu|=2;try{return e(t)}finally{0===(Lu=n)&&(Gu(),Qi())}};var sc={Events:[ri,ii,ai,Re,Le,Ds,{current:!1}]},cc={findFiberByHostInstance:ni,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},lc={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{Ei=fc.inject(lc),Si=fc}catch(ye){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sc,t.createPortal=uc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Lu;if(0!==(48&n))return e(t);Lu|=1;try{if(e)return Wi(99,e.bind(null,t))}finally{Lu=n,Qi()}},t.hydrate=function(e,t,n){if(!ac(t))throw Error(o(200));return oc(null,e,t,!0,n)},t.render=function(e,t,n){if(!ac(t))throw Error(o(200));return oc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ac(e))throw Error(o(40));return!!e._reactRootContainer&&(ws((function(){oc(null,null,e,!1,(function(){e._reactRootContainer=null,e[ei]=null}))})),!0)},t.unstable_batchedUpdates=bs,t.unstable_createPortal=function(e,t){return uc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ac(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return oc(e,t,n,!1,r)},t.version="17.0.2"},164:function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(463)},562:function(e,t,n){var r=n(791);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=r.createElement("svg",{viewBox:"-2 -5 14 20",height:"100%",width:"100%",style:{position:"absolute",top:0}},r.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"})),o=r.createElement("svg",{height:"100%",width:"100%",viewBox:"-2 -5 17 21",style:{position:"absolute",top:0}},r.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}));function u(e){if(7===e.length)return e;for(var t="#",n=1;n<4;n+=1)t+=e[n]+e[n];return t}function s(e,t,n,r,i){return function(e,t,n,r,i){var a=(e-n)/(t-n);if(0===a)return r;if(1===a)return i;for(var o="#",u=1;u<6;u+=2){var s=parseInt(r.substr(u,2),16),c=parseInt(i.substr(u,2),16),l=Math.round((1-a)*s+a*c).toString(16);1===l.length&&(l="0"+l),o+=l}return o}(e,t,n,u(r),u(i))}var c=function(e){function t(t){e.call(this,t);var n=t.height,r=t.width,i=t.checked;this.t=t.handleDiameter||n-2,this.i=Math.max(r-n,r-(n+this.t)/2),this.o=Math.max(0,(n-this.t)/2),this.state={h:i?this.i:this.o},this.l=0,this.u=0,this.p=this.p.bind(this),this.v=this.v.bind(this),this.g=this.g.bind(this),this.k=this.k.bind(this),this.M=this.M.bind(this),this.m=this.m.bind(this),this.T=this.T.bind(this),this.$=this.$.bind(this),this.C=this.C.bind(this),this.D=this.D.bind(this),this.O=this.O.bind(this),this.S=this.S.bind(this)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.componentDidMount=function(){this.W=!0},t.prototype.componentDidUpdate=function(e){e.checked!==this.props.checked&&this.setState({h:this.props.checked?this.i:this.o})},t.prototype.componentWillUnmount=function(){this.W=!1},t.prototype.I=function(e){this.H.focus(),this.setState({R:e,j:!0,B:Date.now()})},t.prototype.L=function(e){var t=this.state,n=t.R,r=t.h,i=(this.props.checked?this.i:this.o)+e-n;t.N||e===n||this.setState({N:!0});var a=Math.min(this.i,Math.max(this.o,i));a!==r&&this.setState({h:a})},t.prototype.U=function(e){var t=this.state,n=t.h,r=t.N,i=t.B,a=this.props.checked,o=(this.i+this.o)/2;this.setState({h:this.props.checked?this.i:this.o});var u=Date.now()-i;(!r||u<250||a&&n<=o||!a&&n>=o)&&this.A(e),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(e){e.preventDefault(),"number"==typeof e.button&&0!==e.button||(this.I(e.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(e){e.preventDefault(),this.L(e.clientX)},t.prototype.g=function(e){this.U(e),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(e){this.X=null,this.I(e.touches[0].clientX)},t.prototype.M=function(e){this.L(e.touches[0].clientX)},t.prototype.m=function(e){e.preventDefault(),this.U(e)},t.prototype.$=function(e){Date.now()-this.l>50&&(this.A(e),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(e){this.H=e},t.prototype.T=function(e){e.preventDefault(),this.H.focus(),this.A(e),this.W&&this.setState({j:!1})},t.prototype.A=function(e){var t=this.props;(0,t.onChange)(!t.checked,e,t.id)},t.prototype.render=function(){var e=this.props,t=e.checked,n=e.disabled,a=e.className,o=e.offColor,u=e.onColor,c=e.offHandleColor,l=e.onHandleColor,f=e.checkedIcon,h=e.uncheckedIcon,d=e.checkedHandleIcon,p=e.uncheckedHandleIcon,v=e.boxShadow,y=e.activeBoxShadow,m=e.height,g=e.width,k=e.borderRadius,b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),w=this.state,_=w.h,E=w.N,S=w.j,T={position:"relative",display:"inline-block",textAlign:"left",opacity:n?.5:1,direction:"ltr",borderRadius:m/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},x={height:m,width:g,margin:Math.max(0,(this.t-m)/2),position:"relative",background:s(_,this.i,this.o,o,u),borderRadius:"number"==typeof k?k:m/2,cursor:n?"default":"pointer",WebkitTransition:E?null:"background 0.25s",MozTransition:E?null:"background 0.25s",transition:E?null:"background 0.25s"},I={height:m,width:Math.min(1.5*m,g-(this.t+m)/2+1),position:"relative",opacity:(_-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:E?null:"opacity 0.25s",MozTransition:E?null:"opacity 0.25s",transition:E?null:"opacity 0.25s"},C={height:m,width:Math.min(1.5*m,g-(this.t+m)/2+1),position:"absolute",opacity:1-(_-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:E?null:"opacity 0.25s",MozTransition:E?null:"opacity 0.25s",transition:E?null:"opacity 0.25s"},N={height:this.t,width:this.t,background:s(_,this.i,this.o,c,l),display:"inline-block",cursor:n?"default":"pointer",borderRadius:"number"==typeof k?k-1:"50%",position:"absolute",transform:"translateX("+_+"px)",top:Math.max(0,(m-this.t)/2),outline:0,boxShadow:S?y:v,border:0,WebkitTransition:E?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:E?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:E?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},A={height:this.t,width:this.t,opacity:Math.max(2*(1-(_-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:E?null:"opacity 0.25s",MozTransition:E?null:"opacity 0.25s",transition:E?null:"opacity 0.25s"},R={height:this.t,width:this.t,opacity:Math.max(2*((_-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:E?null:"opacity 0.25s",MozTransition:E?null:"opacity 0.25s",transition:E?null:"opacity 0.25s"};return r.createElement("div",{className:a,style:T},r.createElement("div",{className:"react-switch-bg",style:x,onClick:n?null:this.T,onMouseDown:function(e){return e.preventDefault()}},f&&r.createElement("div",{style:I},f),h&&r.createElement("div",{style:C},h)),r.createElement("div",{className:"react-switch-handle",style:N,onClick:function(e){return e.preventDefault()},onMouseDown:n?null:this.p,onTouchStart:n?null:this.k,onTouchMove:n?null:this.M,onTouchEnd:n?null:this.m,onTouchCancel:n?null:this.O},p&&r.createElement("div",{style:A},p),d&&r.createElement("div",{style:R},d)),r.createElement("input",i({},{type:"checkbox",role:"switch","aria-checked":t,checked:t,disabled:n,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},b,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(r.Component);c.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:a,checkedIcon:o,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56},t.default=c},862:function(e,t,n){e.exports=n(562)},374:function(e,t,n){"use strict";n(725);var r=n(791),i=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var a=Symbol.for;i=a("react.element"),t.Fragment=a("react.fragment")}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)u.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:l,props:a,_owner:o.current}}t.jsx=c,t.jsxs=c},117:function(e,t,n){"use strict";var r=n(725),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,u=60110,s=60112;t.Suspense=60113;var c=60115,l=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),a=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),o=f("react.provider"),u=f("react.context"),s=f("react.forward_ref"),t.Suspense=f("react.suspense"),c=f("react.memo"),l=f("react.lazy")}var h="function"===typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||p}function m(){}function g(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=y.prototype;var k=g.prototype=new m;k.constructor=g,r(k,y.prototype),k.isPureReactComponent=!0;var b={current:null},w=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var r,a={},o=null,u=null;if(null!=t)for(r in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,r)&&!_.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:i,type:e,key:o,ref:u,props:a,_owner:b.current}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var T=/\/+/g;function x(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function I(e,t,n,r,o){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var s=!1;if(null===e)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case i:case a:s=!0}}if(s)return o=o(s=e),e=""===r?"."+x(s,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(T,"$&/")+"/"),I(o,t,n,"",(function(e){return e}))):null!=o&&(S(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(T,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var l=r+x(u=e[c],c);s+=I(u,t,n,l,o)}else if(l=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"===typeof l)for(e=l.call(e),c=0;!(u=e.next()).done;)s+=I(u=u.value,t,n,l=r+x(u,c++),o);else if("object"===u)throw t=""+e,Error(d(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function C(e,t,n){if(null==e)return e;var r=[],i=0;return I(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function N(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var A={current:null};function R(){var e=A.current;if(null===e)throw Error(d(321));return e}var L={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:b,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error(d(143));return e}},t.Component=y,t.PureComponent=g,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(d(267,e));var a=r({},e.props),o=e.key,u=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(u=t.ref,s=b.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)w.call(t,l)&&!_.hasOwnProperty(l)&&(a[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){c=Array(l);for(var f=0;f<l;f++)c[f]=arguments[f+2];a.children=c}return{$$typeof:i,type:e.type,key:o,ref:u,props:a,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:u,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return R().useCallback(e,t)},t.useContext=function(e,t){return R().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return R().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return R().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},t.useMemo=function(e,t){return R().useMemo(e,t)},t.useReducer=function(e,t,n){return R().useReducer(e,t,n)},t.useRef=function(e){return R().useRef(e)},t.useState=function(e){return R().useState(e)},t.version="17.0.2"},791:function(e,t,n){"use strict";e.exports=n(117)},184:function(e,t,n){"use strict";e.exports=n(374)},727:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(R){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new C(r||[]);return a._invoke=function(e,t,n){var r=f;return function(i,a){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw a;return A()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var u=T(o,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?p:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(e,n,o),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(R){return{type:"throw",arg:R}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function y(){}function m(){}function g(){}var k={};s(k,a,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==n&&r.call(w,a)&&(k=w);var _=g.prototype=y.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(i,a,o,u){var s=l(e[i],e,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"===typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,o,u)}),(function(e){n("throw",e,o,u)})):t.resolve(f).then((function(e){c.value=e,o(c)}),(function(e){return n("throw",e,o,u)}))}u(s.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function T(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function N(e){if(e){var n=e[a];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:A}}function A(){return{value:t,done:!0}}return m.prototype=g,s(_,"constructor",g),s(g,"constructor",m),m.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},E(S.prototype),s(S.prototype,o,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new S(c(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return u.type="throw",u.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],u=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},813:function(e,t){"use strict";var n,r,i,a;if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var u=Date,s=u.now();t.unstable_now=function(){return u.now()-s}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var c=null,l=null,f=function e(){if(null!==c)try{var n=t.unstable_now();c(!0,n),c=null}catch(r){throw setTimeout(e,0),r}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(f,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,d=window.clearTimeout;if("undefined"!==typeof console){var p=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,y=null,m=-1,g=5,k=0;t.unstable_shouldYield=function(){return t.unstable_now()>=k},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):g=0<e?Math.floor(1e3/e):5};var b=new MessageChannel,w=b.port2;b.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();k=e+g;try{y(!0,e)?w.postMessage(null):(v=!1,y=null)}catch(n){throw w.postMessage(null),n}}else v=!1},n=function(e){y=e,v||(v=!0,w.postMessage(null))},r=function(e,n){m=h((function(){e(t.unstable_now())}),n)},i=function(){d(m),m=-1}}function _(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<T(i,t)))break e;e[r]=t,e[n]=i,n=r}}function E(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var a=2*(r+1)-1,o=e[a],u=a+1,s=e[u];if(void 0!==o&&0>T(o,n))void 0!==s&&0>T(s,o)?(e[r]=s,e[u]=n,r=u):(e[r]=o,e[a]=n,r=a);else{if(!(void 0!==s&&0>T(s,n)))break e;e[r]=s,e[u]=n,r=u}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],I=[],C=1,N=null,A=3,R=!1,L=!1,O=!1;function P(e){for(var t=E(I);null!==t;){if(null===t.callback)S(I);else{if(!(t.startTime<=e))break;S(I),t.sortIndex=t.expirationTime,_(x,t)}t=E(I)}}function D(e){if(O=!1,P(e),!L)if(null!==E(x))L=!0,n(M);else{var t=E(I);null!==t&&r(D,t.startTime-e)}}function M(e,n){L=!1,O&&(O=!1,i()),R=!0;var a=A;try{for(P(n),N=E(x);null!==N&&(!(N.expirationTime>n)||e&&!t.unstable_shouldYield());){var o=N.callback;if("function"===typeof o){N.callback=null,A=N.priorityLevel;var u=o(N.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?N.callback=u:N===E(x)&&S(x),P(n)}else S(x);N=E(x)}if(null!==N)var s=!0;else{var c=E(I);null!==c&&r(D,c.startTime-n),s=!1}return s}finally{N=null,A=a,R=!1}}var U=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||R||(L=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return E(x)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,a,o){var u=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?u+o:u:o=u,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:C++,callback:a,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>u?(e.sortIndex=o,_(I,e),null===E(x)&&e===E(I)&&(O?i():O=!0,r(D,o-u))):(e.sortIndex=s,_(x,e),L||R||(L=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},296:function(e,t,n){"use strict";e.exports=n(813)},254:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAARA0lEQVR4nO2caXBc1ZXHf/e916vUUmtp7bZsgS1ZxjgY23Gw45lJphKSylCpgeIDKSpTqUoYbEJIMCFrxdlZDExhYpKpWVLFwJchCTAUkEkVjrHYjFfhRZaRrd3a1a1W7++9Ox9et5Bl7f1aJhP/P7isd+8759x/33fvueeee+EqruJKQlxJ5bt/c9g7bsY2SykaFMFqKWkAqgXkSygC8tJVIwJGJYwDPULQIuGskGZLnup9b/ddG6NXqg1LTuC39jVtUaS8GSE+BXwccGYpMongHUy5H8mre+755Ls2mDlvLAmB33n67RU6xp1IcSfIVR8qF+QXeMgv8OD1uvHmuXB7XKiawKFpqJoCgKGbpHQdQ5fEYnFikSTRSJzxcIzxsRgSOVldK4L/0lCfeejuT7Tnum05JfD+fQdvFIjvAV8EFACXy0Gg3E9RiQ9/sQ8tTdJioacMgqPjjAyHGeoPkkikMkUm8Adhmr949J7tR7NSMgtyQmCauJ8BNwMIRVBe7qe8qoSiknyEyM3vJqVkdDhMf+8IA/1BTHOiZ75qCuX7j9990zG7ddrakvue2O/XnNqPEWInoKqqQmV1CcvrynG5HHaqmhPJpE5P5yDdHQPouglggnjWYWrf/OU9Hx+2S49tBD7w9Ju3YspfSUG5EIKa2gAr6irQHKpdKhaFVEqno62f7s5BpJQAfVKy87Gd235vh/ysCfz6k6+4XKrvEYS4F8BX4KV+7TJ8Bd7srbMR4+EYrae7CQXH00/EM0Zc3PXEt26KZSM3KwJ37T2wEk17Hik3CAHXNtRQvTxwZZ3LWSCB7vYB2lp7sDojRzSh3pbNbL3otj74VNNaQ+GPQLXL7WTt+hUU+vPmfO+jgPBYlFPH24nFEgB9QorPPbpz6/HFyFoUgfc/9eZ2ocgXAb+/OJ91H6u74mPdQqGnDN4/fp7gyDhAUMAtj+7YdnChchZMYJq81wBPoNxP4/W1KEp2vtyVgmmanD7RweBAECAm4LMLJXFBBO7a98b1oBwA/JXVxdSvXW6rTyfC5xGDhxDB04hUEBG3vA3pLkE6/Eh/IzKwGemrs02nlJKWU5309YwABA1D2f7E1296f942z7firr0HVqKqbwKVgXI/a9evsIk8iRh4B+38cxDtnd8r3iqMujswy7ZghycmpeTU8fZMT+yVprjpsXu2dszn3Xlp//qTr7hcjsK3kHKDvyif9RuvseWzFbF+1NP/ggi1AuD25BGoqiFQWYXbm4fba01K8WiEWCTCUF8Pg73dxGNW8EUWNqA3fgM8ZVnbIqXkxJE2RofDIDmcMMa27b3384k52zAf4ffva3pKwE6Px8XGT9TbMmGIUAva+49AMoTL46FuzfVU19Yh5vhhpISB3k5am48Sj0bA4UNftwvpvy5rm/SUwXtvtxCPJUHKJ/fs/OQ35mzHXBUeePrNW6WUzwsBN26pt8VBFsHTaMd+DFInUFXDdZu2omnagmTous7JQ00MXuwBoaHf8COkvzFr28aCEY4eakVKpMT8x8d2bH9htvqzEnjfE/v9DqejRQrKV62poWZ5IGsDRawf9fCDiFSYZdfWU3/9RhY7lEoJZ08cpqvtLDgK0Dc+hPSUZ21jV/sAH5ztAbiY0LWGvfduGZup7qzfi+py/EwKygv9+VTbQB5Ia8xLhQlU1WRFHoAQUL9+I4HKakiNoZ5+Ei6NDS4Ky2rLKCjMA6h0O4yfzFZ3RgKtkBT/LIRgdWONLcszMfAOItSKy+Phuk1bsyJvQqaA6zZvxeX2IEItKIM2BKQFrF67DIFASrnzgV+9+bGZqs5IYDqep9bUBsj3ebI3Cmm5KsA1jesXPObNBk1zUNd4PQBKWke28Pk8VC0vBdBMwU9nqjctgWnGP6uqCrUrsx9TAET4AkR7cXvyqKq1zxHOoLq2DpfHg4j0IML2RPJXXluBqioI5Bfu33fwxunqTEugFPKHgKhaXorDaU9PUQYPARCorslJRFooCmVVy6z/D9mzr+RwaFTWlFoyUR6crs5lBO7ae2Al8EWhCJbVZu+gTiB4GoDS8ir7ZE5BaYUlW0nrsgPLV5ahKAKQt97/1Ju1U8svI1Cq6p2AUlbhtzUML5KjAHjz8m2TORWefJ+lKzFim0yXy0FpmR9AQZFfmlp+GYEC7gCoqCyxzQgAkbAIdHnsmJCmh9udlp3WZRcqqosBEPDlqWWXEPitfU1bgHqXy0FRid09Rab/zV28OnsPcHoUl/hwWl/j6m//umnj5LJLCFSkvBmgrKLI9oFeuqxfMRnPagtiViRilmzpLrZVrhCCQLkfAFPyucllypSanwLwF+dgnHJajYqOh+2XnUYskpbtLLJddlGaEyn5u8nPJwjc/ZvDXmCzQOAvsp9A078GgKG+HttlZzB40ZIti7KPzExFUbEPgUDATd98/K2JgXyCwIgR3QS48gs8OdnfkIHNAAz2diNN0375psngxW4AzJJNtsvXHCp5BR4Al+Y2J8bBCQJNlDUA+QW5mSWlbyV4q4jHovR2nLddfk9HG4lYDJlXjfStsF0+QL7PDYCUoiHzbIJAAfUA3jx3TpSDwKi7A4C20++j67ptkvVUkrZTzQCYdZe5arYhL81Nhiu4dBKxCPS6cmaAWbYFWdhAIh7l5KGmzOZ2VpAS3j/0FslEHFnYgBn4ePZCZ4A3z+LGFNMQKAQ1AG5PtvmOs0FYexiOAgYv9nD2xOGsSLQCqu9ZE5OjAGPtffaZOg3cbotAgVyWeTZBoJQUAGhajjfIPWXo6x4AodHVdpYTbx9A11NzvzcFeirJ8bf+TFdbqxXSX/cA0m1H0HdmZHIZBfgyzyZ/wj4ANdcEAtLfiL7hx0inn8GL3TS99iKd51rmNTtL06T7wge89b8vp3ueD/2GH9qyHzIX1LR3IrE6G8DkWFU+kHXG6HwhCxswbvwF6uknSYVaONt8hPZzpwlU1hCorMGTl487vW6Ox2LEImEGL/YweLH7wxVHYQPG2vty3vMyUNUJbiZ6oH1h4UVAesrRb/wZyuC7KOefIxHpofv8ObrPn5v9vbxqzLov5XTCmC8mEzgOFOu6iWNJE4UEZmALZmALItyOMnQIETwFyVFE3ApLSXcxOIuQ/rWYpZtz5ufNBcOYGGIm1qOTCQwDxYZuLDGBH0L6VmBcIXLmA103ABAwsc052Y0Zm1zpKi6HkbJ6oJzUAye7Md2AldZwFdMinZCJRHRlnk2ecs8CRCNz5tP81SLDjSItrmByD5wgML7khv2lIMNNhiuYRKCCeQasbParmB6RNDdCyJbMs4lZOE/1vjduxBPjYzGXnjJymvM8EozS2TlER+cw/QOhrNbDRX4vtctLWb68hIqyQlvSRaZDKmUQHo8BxPW4cjjz/BJ1u55uOoBk+7ob6igtK7TVgGRSp+3CACdP9TAyGrFVdgaFhV4aVldQv7oSj9vek1GD/UFOHr8A8PqeHds+nXl+6UrElPsRYvvIcNg2AscjCY4e66D1g74JR9TpdFJcUkxpcTGF/sJFZ7uapkkoGGJoZISR4RFCoSjvvneew0fbqV9VwYaP1ZKXZ094bnTY8lwkcv/k55cSKHkVwY+G+oOsaqjOamcuFkty9HgnZ872YhgmQghKS4qpqKigqNiPHbnNiqJQVFxEUXERXFvHyGiQvot9jIyMcrqll9ZzfTTUV7HhhtqseqSUksH+YObPVyeXXdaKXfuaWoD69TdeS3Gpb2rxPJRBS2sv7xw6TzKpI4SgrCzA8trluF25C9ZORiKeoKOrk4F+63ycy6WxZdM11K+uXNQYOTw4RvPRNkCe2bPjk5eEfS4PJgieRfKT/t7hBROYSKTY/0YLHZ3W8YSSkhJWrqzFk8NshOngcrtYvWoVy2pqaL/QztDwCAeaztLROczfbm/A5VpYDKWvN5MqIp6ZWnbZ4KOhPgOY/f1BkvH5BzrHwjH+8NIxOjqHUTWVa1ddQ2Njw5KTNxkej4c1jWtYs6YeTdNo7xzidy8eITQ2/ysWEokUQ9bxB1NVeXZq+WUEpg/evSBNSVfHwLyUBINRXnjpKKGxKIUFPjZu2EBlRcW8jcw1SktL2bDhBgoKCgiHY7z48nGCofn5u10XBqyD25LnH75rW+fU8mmnPyHFTwHZ0zVEKjn77lk0muSVPzYTi6coLSnmunXX4XTlcl9lcXC5nKxbt5bi4iJisSSvvNZMNDr7uj+Z1OnpGgSQQpoPT1dnWgLTJxdfMwyTjvP9MyqQEv58sIXweJzCwkLqG+o/0ufmFEWhsbEBv99PeDzG/jfOzOrEt7f1Za4NeHmmexdmbK0plO8DRnfn4IzLu7Pn+ujqHsHpdLKm8aNNXgZCKDQ0rMbpdNLdM8q5D/qmrTc+FqW3cwhAB/MHM8mbscWP333TMSRPZw7jTc0dM6Xk2HHrOFld3Uoc2tLeiZANHA4HK+uswO3R4x1Ic0rjJLSe6UYiEYK9e3Zsb55J1uznRDT3D4C+cCh62YTS1TnMWDiG1+slELA3GXMpUBYoxev1EhqL0dl9aUZrZ8cAoWAEoDee0nbPJmdWAh++a2NISnYCtLX2EA59OP13pJWWlQW4wjdILRKCQMBKIO+aROBYKML51h4AiSl2zHZKCeYgEOCxndt+j+QpKeHkiQvoKSvk398fAsDv9y+2BVccRUWW7X0DVlv0lMHJ4+1ICUKIJ/fcs/XFuWTMa9RPGGO7gCPxWJITR9owDXPCBXB7lmZ5lgu43VayUDSSwDRMmo+dJxFPguRwXon/2/ORMS8C9977+YQm1NuA3rFQhNPNHcTT/qHDxhNHSw2Hw7I9ltA51dxOaHQcoEfVuHX37WvntTk0b7/DWqGYnwOCgwNBPnSg/hLHvwzStkvJkPUZjyLEzdOtOGbCghy3PTu2Nwu4BZhwDM0cZJsuFabYHpOSW/bcvfXkQmQs2PN9dMe2gwI+qwhFAjQ3nySZ+MvbCk0mkjQ3W1wpQkgp+cxjO7c1LVTOor+/r/zi9VuCscTvdMPUnC4na9c0kO9bePzwSmAsHObMmRaSiSQOVRj+fOdt//7g3896Mn0mZDWA3fXY6+tHwsmDiaThE0JQU11N7YplCPHRXNJJKenu6aGjvQspTVxOdbzE59n+6/v/ZtHX4mU9A3xt9/94x4Vr/3hC3wySfF8+q1etIi/vo3X5WCQSobX1A8bHxwGBz6OdqHSXb93zwPqsdrhsm0K/8tCfvhOK6j9N6aYGgtLSElbWrViyMP5MSCSTdHV00dffj5QShyKMgjzXj/7zu5/+uR3ybfVB/umR/RXJeOqlSELfJKVEVRUqKyuoqqzC5V5aIuPxOL29F7l4sQ/TNBEC8t3aUZdT/MN/PPiZed7wMzdy4sR99ZH9XwjHkv8aTeiVYJ01K0nvyPn9hTm9AjQYDNHX18fw8Ih14aIAr9PR63bw1d9+7zOv2K0zp17wl3/+p9uThnw4mtBXpG+PxKE5KCktpqSkhIICX9Z3J+i6zthYmOHhYYaGR9BT1j6OEOB1au2aU/v2M9/99H9n3ZgZsCTLiK/+8s+bokbyl4mEsS1pmBPfshDWxk9BQQEetwe3x43b7U5fgayiKlZ6iWEaGLpBSteJx+PEY3Fi8RhjY2PEYrFLospOTUk4HcpBr+b4zr9991NHct22JV+HfeXR129PxvW7Eoa5IZky/TLL0zZCgFPTgk6HOOJQ1d/8Noe9bVr9S6lsKr720J8KU3BHMsU2Kc16Q1JjGGahKdFMU6omUgAoCKkowlAEuqoqQVUR3YoqzmpCNvkSBc/t3T17zO4qruL/L/4P/Cmj4fQwAQEAAAAASUVORK5CYII="}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.m=e,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return"static/js/"+e+".e8607b80.chunk.js"},n.miniCssF=function(e){},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="twitter-clone:";n.l=function(r,i,a,o){if(e[r])e[r].push(i);else{var u,s;if(void 0!==a)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var f=c[l];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==t+a){u=f;break}}u||(s=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,n.nc&&u.setAttribute("nonce",n.nc),u.setAttribute("data-webpack",t+a),u.src=r),e[r]=[i];var h=function(t,n){u.onerror=u.onload=null,clearTimeout(d);var i=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),i&&i.forEach((function(e){return e(n)})),t)return t(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=h.bind(null,u.onerror),u.onload=h.bind(null,u.onload),s&&document.head.appendChild(u)}}}(),n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/twitter-clone/",function(){var e={179:0};n.f.j=function(t,r){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var a=new Promise((function(n,r){i=e[t]=[n,r]}));r.push(i[2]=a);var o=n.p+n.u(t),u=new Error;n.l(o,(function(r){if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",u.name="ChunkLoadError",u.type=a,u.request=o,i[1](u)}}),"chunk-"+t,t)}};var t=function(t,r){var i,a,o=r[0],u=r[1],s=r[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(i in u)n.o(u,i)&&(n.m[i]=u[i]);if(s)s(n)}for(t&&t(r);c<o.length;c++)a=o[c],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunktwitter_clone=self.webpackChunktwitter_clone||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),function(){"use strict";var e=n(791),t=n(164);n.p;function r(e,t,n,r,i,a,o){try{var u=e[a](o),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function u(e){r(o,i,a,u,s,"next",e)}function s(e){r(o,i,a,u,s,"throw",e)}u(void 0)}))}}function a(e){if(Array.isArray(e))return e}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){if(e){if("string"===typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){return a(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(s){u=!0,i=s}finally{try{o||null==n.return||n.return()}finally{if(u)throw i}}return a}}(e,t)||u(e,t)||s()}var l,f=n(757),h=n.n(f);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(l||(l={}));var p=function(e){return e};var v="beforeunload",y="popstate";function m(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,r=n.history;function i(){var e=_(n.location.hash.substr(1)),t=e.pathname,i=void 0===t?"/":t,a=e.search,o=void 0===a?"":a,u=e.hash,s=void 0===u?"":u,c=r.state||{};return[c.idx,p({pathname:i,search:o,hash:s,state:c.usr||null,key:c.key||"default"})]}var a=null;function o(){if(a)m.call(a),a=null;else{var e=l.Pop,t=i(),n=t[0],r=t[1];if(m.length){if(null!=n){var o=c-n;o&&(a={action:e,location:r,retry:function(){C(-1*o)}},C(o))}}else I(e)}}n.addEventListener(y,o),n.addEventListener("hashchange",(function(){w(i()[1])!==w(f)&&o()}));var u=l.Pop,s=i(),c=s[0],f=s[1],h=k(),m=k();function E(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var r=n.location.href,i=r.indexOf("#");t=-1===i?r:r.slice(0,i)}return t}()+"#"+("string"===typeof e?e:w(e))}function S(e,t){return void 0===t&&(t=null),p(d({pathname:f.pathname,hash:"",search:""},"string"===typeof e?_(e):e,{state:t,key:b()}))}function T(e,t){return[{usr:e.state,key:e.key,idx:t},E(e)]}function x(e,t,n){return!m.length||(m.call({action:e,location:t,retry:n}),!1)}function I(e){u=e;var t=i();c=t[0],f=t[1],h.call({action:u,location:f})}function C(e){r.go(e)}null==c&&(c=0,r.replaceState(d({},r.state,{idx:c}),""));var N={get action(){return u},get location(){return f},createHref:E,push:function e(t,i){var a=l.Push,o=S(t,i);if(x(a,o,(function(){e(t,i)}))){var u=T(o,c+1),s=u[0],f=u[1];try{r.pushState(s,"",f)}catch(h){n.location.assign(f)}I(a)}},replace:function e(t,n){var i=l.Replace,a=S(t,n);if(x(i,a,(function(){e(t,n)}))){var o=T(a,c),u=o[0],s=o[1];r.replaceState(u,"",s),I(i)}},go:C,back:function(){C(-1)},forward:function(){C(1)},listen:function(e){return h.push(e)},block:function(e){var t=m.push(e);return 1===m.length&&n.addEventListener(v,g),function(){t(),m.length||n.removeEventListener(v,g)}}};return N}function g(e){e.preventDefault(),e.returnValue=""}function k(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function b(){return Math.random().toString(36).substr(2,8)}function w(e){var t=e.pathname,n=void 0===t?"/":t,r=e.search,i=void 0===r?"":r,a=e.hash,o=void 0===a?"":a;return i&&"?"!==i&&(n+="?"===i.charAt(0)?i:"?"+i),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function _(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function E(e,t){if(!e)throw new Error(t)}var S=(0,e.createContext)(null);var T=(0,e.createContext)(null);var x=(0,e.createContext)({outlet:null,matches:[]});function I(e){E(!1)}function C(t){var n=t.basename,r=void 0===n?"/":n,i=t.children,a=void 0===i?null:i,o=t.location,u=t.navigationType,s=void 0===u?l.Pop:u,c=t.navigator,f=t.static,h=void 0!==f&&f;A()&&E(!1);var d=H(r),p=(0,e.useMemo)((function(){return{basename:d,navigator:c,static:h}}),[d,c,h]);"string"===typeof o&&(o=_(o));var v=o,y=v.pathname,m=void 0===y?"/":y,g=v.search,k=void 0===g?"":g,b=v.hash,w=void 0===b?"":b,x=v.state,I=void 0===x?null:x,C=v.key,N=void 0===C?"default":C,R=(0,e.useMemo)((function(){var e=B(m,d);return null==e?null:{pathname:e,search:k,hash:w,state:I,key:N}}),[d,m,k,w,I,N]);return null==R?null:(0,e.createElement)(S.Provider,{value:p},(0,e.createElement)(T.Provider,{children:a,value:{location:R,navigationType:s}}))}function N(t){var n=t.children,r=t.location;return function(t,n){A()||E(!1);var r=(0,e.useContext)(x).matches,i=r[r.length-1],a=i?i.params:{},o=(i&&i.pathname,i?i.pathnameBase:"/");i&&i.route;0;var u,s=R();if(n){var c,l="string"===typeof n?_(n):n;"/"===o||(null==(c=l.pathname)?void 0:c.startsWith(o))||E(!1),u=l}else u=s;var f=u.pathname||"/",h="/"===o?f:f.slice(o.length)||"/",d=function(e,t,n){void 0===n&&(n="/");var r=B(("string"===typeof t?_(t):t).pathname||"/",n);if(null==r)return null;var i=P(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var n=e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(i);for(var a=null,o=0;null==a&&o<i.length;++o)a=V(i[o],r);return a}(t,{pathname:h});0;return F(d&&d.map((function(e){return Object.assign({},e,{params:Object.assign({},a,e.params),pathname:q([o,e.pathname]),pathnameBase:"/"===e.pathnameBase?o:q([o,e.pathnameBase])})})),r)}(O(n),r)}function A(){return null!=(0,e.useContext)(T)}function R(){return A()||E(!1),(0,e.useContext)(T).location}function L(){A()||E(!1);var t=(0,e.useContext)(S),n=t.basename,r=t.navigator,i=(0,e.useContext)(x).matches,a=R().pathname,o=JSON.stringify(i.map((function(e){return e.pathnameBase}))),u=(0,e.useRef)(!1);(0,e.useEffect)((function(){u.current=!0}));var s=(0,e.useCallback)((function(e,t){if(void 0===t&&(t={}),u.current)if("number"!==typeof e){var i=z(e,JSON.parse(o),a);"/"!==n&&(i.pathname=q([n,i.pathname])),(t.replace?r.replace:r.push)(i,t.state)}else r.go(e)}),[n,r,o,a]);return s}function O(t){var n=[];return e.Children.forEach(t,(function(t){if((0,e.isValidElement)(t))if(t.type!==e.Fragment){t.type!==I&&E(!1);var r={caseSensitive:t.props.caseSensitive,element:t.props.element,index:t.props.index,path:t.props.path};t.props.children&&(r.children=O(t.props.children)),n.push(r)}else n.push.apply(n,O(t.props.children))})),n}function P(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach((function(e,i){var a={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(a.relativePath.startsWith(r)||E(!1),a.relativePath=a.relativePath.slice(r.length));var o=q([r,a.relativePath]),u=n.concat(a);e.children&&e.children.length>0&&(!0===e.index&&E(!1),P(e.children,t,u,o)),(null!=e.path||e.index)&&t.push({path:o,score:U(o,e.index),routesMeta:u})})),t}var D=/^:\w+$/,M=function(e){return"*"===e};function U(e,t){var n=e.split("/"),r=n.length;return n.some(M)&&(r+=-2),t&&(r+=2),n.filter((function(e){return!M(e)})).reduce((function(e,t){return e+(D.test(t)?3:""===t?1:10)}),r)}function V(e,t){for(var n=e.routesMeta,r={},i="/",a=[],o=0;o<n.length;++o){var u=n[o],s=o===n.length-1,c="/"===i?t:t.slice(i.length)||"/",l=j({path:u.relativePath,caseSensitive:u.caseSensitive,end:s},c);if(!l)return null;Object.assign(r,l.params);var f=u.route;a.push({params:r,pathname:q([i,l.pathname]),pathnameBase:H(q([i,l.pathnameBase])),route:f}),"/"!==l.pathnameBase&&(i=q([i,l.pathnameBase]))}return a}function F(t,n){return void 0===n&&(n=[]),null==t?null:t.reduceRight((function(r,i,a){return(0,e.createElement)(x.Provider,{children:void 0!==i.route.element?i.route.element:r,value:{outlet:r,matches:n.concat(t.slice(0,a+1))}})}),null)}function j(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});var n=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);var r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(function(e,t){return r.push(t),"([^\\/]+)"}));e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):i+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";return[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),r=c(n,2),i=r[0],a=r[1],o=t.match(i);if(!o)return null;var u=o[0],s=u.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:a.reduce((function(e,t,n){if("*"===t){var r=l[n]||"";s=u.slice(0,u.length-r.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return e}}(l[n]||""),e}),{}),pathname:u,pathnameBase:s,pattern:e}}function z(e,t,n){var r,i="string"===typeof e?_(e):e,a=""===e||""===i.pathname?"/":i.pathname;if(null==a)r=n;else{var o=t.length-1;if(a.startsWith("..")){for(var u=a.split("/");".."===u[0];)u.shift(),o-=1;i.pathname=u.join("/")}r=o>=0?t[o]:"/"}var s=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?_(e):e,r=n.pathname,i=n.search,a=void 0===i?"":i,o=n.hash,u=void 0===o?"":o,s=r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t;return{pathname:s,search:K(a),hash:W(u)}}(i,r);return a&&"/"!==a&&a.endsWith("/")&&!s.pathname.endsWith("/")&&(s.pathname+="/"),s}function B(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;var n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}var q=function(e){return e.join("/").replace(/\/\/+/g,"/")},H=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},K=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},W=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""};function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function Q(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=G(e)););return e}function X(){return X="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Q(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},X.apply(this,arguments)}function Y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e,t){return J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},J(e,t)}function $(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J(e,t)}function Z(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){if(t&&("object"===ee(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Y(e)}function ne(e){var t=Z();return function(){var n,r=G(e);if(t){var i=G(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return te(this,n)}}function re(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oe(e,t,n){return t&&ae(e.prototype,t),n&&ae(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ue(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function se(e){return function(e){if(Array.isArray(e))return o(e)}(e)||ue(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function le(e,t,n){return le=Z()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&J(i,n.prototype),i},le.apply(null,arguments)}function fe(e){var t="function"===typeof Map?new Map:void 0;return fe=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return le(e,arguments,G(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),J(n,e)},fe(e)}var he=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1<e.length&&56320===(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},de={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<e.length;i+=3){var a=e[i],o=i+1<e.length,u=o?e[i+1]:0,s=i+2<e.length,c=s?e[i+2]:0,l=a>>2,f=(3&a)<<4|u>>4,h=(15&u)<<2|c>>6,d=63&c;s||(d=64,o||(h=64)),r.push(n[l],n[f],n[h],n[d])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(he(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){var a=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&a)}else if(i>239&&i<365){var o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{var u=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&u)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<e.length;){var a=n[e.charAt(i++)],o=i<e.length?n[e.charAt(i)]:0,u=++i<e.length?n[e.charAt(i)]:64,s=++i<e.length?n[e.charAt(i)]:64;if(++i,null==a||null==o||null==u||null==s)throw Error();var c=a<<2|o>>4;if(r.push(c),64!==u){var l=o<<4&240|u>>2;if(r.push(l),64!==s){var f=u<<6&192|s;r.push(f)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},pe=function(e){return function(e){var t=he(e);return de.encodeByteArray(t,!0)}(e).replace(/\./g,"")},ve=function(e){try{return de.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};var ye=function(){function e(){var t=this;ie(this,e),this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return oe(e,[{key:"wrapCallback",value:function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"===typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}}}]),e}();function me(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function ge(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(me())}function ke(){var e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function be(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function we(){var e=me();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}var _e=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this,r)).code=e,a.customData=i,a.name="FirebaseError",Object.setPrototypeOf(Y(a),n.prototype),Error.captureStackTrace&&Error.captureStackTrace(Y(a),Ee.prototype.create),a}return oe(n)}(fe(Error)),Ee=function(){function e(t,n,r){ie(this,e),this.service=t,this.serviceName=n,this.errors=r}return oe(e,[{key:"create",value:function(e){var t=(arguments.length<=1?void 0:arguments[1])||{},n="".concat(this.service,"/").concat(e),r=this.errors[e],i=r?Se(r,t):"Error",a="".concat(this.serviceName,": ").concat(i," (").concat(n,")."),o=new _e(n,a,t);return o}}]),e}();function Se(e,t){return e.replace(Te,(function(e,n){var r=t[n];return null!=r?String(r):"<".concat(n,"?>")}))}var Te=/\{\$([^}]+)}/g;function xe(e,t){if(e===t)return!0;for(var n=Object.keys(e),r=Object.keys(t),i=0,a=n;i<a.length;i++){var o=a[i];if(!r.includes(o))return!1;var u=e[o],s=t[o];if(Ie(u)&&Ie(s)){if(!xe(u,s))return!1}else if(u!==s)return!1}for(var c=0,l=r;c<l.length;c++){var f=l[c];if(!n.includes(f))return!1}return!0}function Ie(e){return null!==e&&"object"===typeof e}function Ce(e){for(var t=[],n=function(){var e=c(i[r],2),n=e[0],a=e[1];Array.isArray(a)?a.forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(a))},r=0,i=Object.entries(e);r<i.length;r++)n();return t.length?"&"+t.join("&"):""}function Ne(e){var t={};return e.replace(/^\?/,"").split("&").forEach((function(e){if(e){var n=c(e.split("="),2),r=n[0],i=n[1];t[decodeURIComponent(r)]=decodeURIComponent(i)}})),t}function Ae(e){var t=e.indexOf("?");if(!t)return"";var n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}var Re=function(){function e(t,n){var r=this;ie(this,e),this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then((function(){t(r)})).catch((function(e){r.error(e)}))}return oe(e,[{key:"next",value:function(e){this.forEachObserver((function(t){t.next(e)}))}},{key:"error",value:function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)}},{key:"complete",value:function(){this.forEachObserver((function(e){e.complete()})),this.close()}},{key:"subscribe",value:function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!==typeof e||null===e)return!1;var n,r=re(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i in e&&"function"===typeof e[i])return!0}}catch(a){r.e(a)}finally{r.f()}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=Le),void 0===r.error&&(r.error=Le),void 0===r.complete&&(r.complete=Le);var a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}})),this.observers.push(r),a}},{key:"unsubscribeOne",value:function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}},{key:"forEachObserver",value:function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)}},{key:"sendOne",value:function(e,t){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(r){"undefined"!==typeof console&&console.error&&console.error(r)}}))}},{key:"close",value:function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((function(){t.observers=void 0,t.onNoObservers=void 0})))}}]),e}();function Le(){}function Oe(e){return e&&e._delegate?e._delegate:e}function Pe(e,t){return new Promise((function(n,r){e.onsuccess=function(e){n(e.target.result)},e.onerror=function(e){var n;r("".concat(t,": ").concat(null===(n=e.target.error)||void 0===n?void 0:n.message))}}))}var De=function(){function e(t){ie(this,e),this._db=t,this.objectStoreNames=this._db.objectStoreNames}return oe(e,[{key:"transaction",value:function(e,t){return new Me(this._db.transaction.call(this._db,e,t))}},{key:"createObjectStore",value:function(e,t){return new Ue(this._db.createObjectStore(e,t))}},{key:"close",value:function(){this._db.close()}}]),e}(),Me=function(){function e(t){var n=this;ie(this,e),this._transaction=t,this.complete=new Promise((function(e,t){n._transaction.oncomplete=function(){e()},n._transaction.onerror=function(){t(n._transaction.error)},n._transaction.onabort=function(){t(n._transaction.error)}}))}return oe(e,[{key:"objectStore",value:function(e){return new Ue(this._transaction.objectStore(e))}}]),e}(),Ue=function(){function e(t){ie(this,e),this._store=t}return oe(e,[{key:"index",value:function(e){return new Ve(this._store.index(e))}},{key:"createIndex",value:function(e,t,n){return new Ve(this._store.createIndex(e,t,n))}},{key:"get",value:function(e){return Pe(this._store.get(e),"Error reading from IndexedDB")}},{key:"put",value:function(e,t){return Pe(this._store.put(e,t),"Error writing to IndexedDB")}},{key:"delete",value:function(e){return Pe(this._store.delete(e),"Error deleting from IndexedDB")}},{key:"clear",value:function(){return Pe(this._store.clear(),"Error clearing IndexedDB object store")}}]),e}(),Ve=function(){function e(t){ie(this,e),this._index=t}return oe(e,[{key:"get",value:function(e){return Pe(this._index.get(e),"Error reading from IndexedDB")}}]),e}();var Fe=function(){function e(t,n,r){ie(this,e),this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return oe(e,[{key:"setInstantiationMode",value:function(e){return this.instantiationMode=e,this}},{key:"setMultipleInstances",value:function(e){return this.multipleInstances=e,this}},{key:"setServiceProps",value:function(e){return this.serviceProps=e,this}},{key:"setInstanceCreatedCallback",value:function(e){return this.onInstanceCreated=e,this}}]),e}(),je="[DEFAULT]",ze=function(){function e(t,n){ie(this,e),this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return oe(e,[{key:"get",value:function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new ye;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:t});r&&n.resolve(r)}catch(i){}}return this.instancesDeferred.get(t).promise}},{key:"getImmediate",value:function(e){var t,n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}}},{key:"getComponent",value:function(){return this.component}},{key:"setComponent",value:function(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:je})}catch(s){}var t,n=re(this.instancesDeferred.entries());try{for(n.s();!(t=n.n()).done;){var r=c(t.value,2),i=r[0],a=r[1],o=this.normalizeInstanceIdentifier(i);try{var u=this.getOrInitializeService({instanceIdentifier:o});a.resolve(u)}catch(s){}}}catch(l){n.e(l)}finally{n.f()}}}},{key:"clearInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:je;this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}},{key:"delete",value:function(){var e=i(f.mark((function e(){var t;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Array.from(this.instances.values()),e.next=3,Promise.all([].concat(se(t.filter((function(e){return"INTERNAL"in e})).map((function(e){return e.INTERNAL.delete()}))),se(t.filter((function(e){return"_delete"in e})).map((function(e){return e._delete()})))));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isComponentSet",value:function(){return null!=this.component}},{key:"isInitialized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:je;return this.instances.has(e)}},{key:"getOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:je;return this.instancesOptions.get(e)||{}}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.options,n=void 0===t?{}:t,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error("".concat(this.name,"(").concat(r,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));var i,a=this.getOrInitializeService({instanceIdentifier:r,options:n}),o=re(this.instancesDeferred.entries());try{for(o.s();!(i=o.n()).done;){var u=c(i.value,2),s=u[0],l=u[1],f=this.normalizeInstanceIdentifier(s);r===f&&l.resolve(a)}}catch(h){o.e(h)}finally{o.f()}return a}},{key:"onInit",value:function(e,t){var n,r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);var a=this.instances.get(r);return a&&e(a,r),function(){i.delete(e)}}},{key:"invokeOnInitCallbacks",value:function(e,t){var n=this.onInitCallbacks.get(t);if(n){var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;try{a(e,t)}catch(o){}}}catch(u){i.e(u)}finally{i.f()}}}},{key:"getOrInitializeService",value:function(e){var t,n=e.instanceIdentifier,r=e.options,i=void 0===r?{}:r,a=this.instances.get(n);if(!a&&this.component&&(a=this.component.instanceFactory(this.container,{instanceIdentifier:(t=n,t===je?void 0:t),options:i}),this.instances.set(n,a),this.instancesOptions.set(n,i),this.invokeOnInitCallbacks(a,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,a)}catch(o){}return a||null}},{key:"normalizeInstanceIdentifier",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:je;return this.component?this.component.multipleInstances?e:je:e}},{key:"shouldAutoInitialize",value:function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}]),e}();var Be,qe,He=function(){function e(t){ie(this,e),this.name=t,this.providers=new Map}return oe(e,[{key:"addComponent",value:function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}},{key:"addOrOverwriteComponent",value:function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}},{key:"getProvider",value:function(e){if(this.providers.has(e))return this.providers.get(e);var t=new ze(e,this);return this.providers.set(e,t),t}},{key:"getProviders",value:function(){return Array.from(this.providers.values())}}]),e}(),Ke=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(qe||(qe={}));var We,Ge,Qe={debug:qe.DEBUG,verbose:qe.VERBOSE,info:qe.INFO,warn:qe.WARN,error:qe.ERROR,silent:qe.SILENT},Xe=qe.INFO,Ye=(ce(Be={},qe.DEBUG,"log"),ce(Be,qe.VERBOSE,"log"),ce(Be,qe.INFO,"info"),ce(Be,qe.WARN,"warn"),ce(Be,qe.ERROR,"error"),Be),Je=function(e,t){if(!(t<e.logLevel)){var n=(new Date).toISOString(),r=Ye[t];if(!r)throw new Error("Attempted to log a message with an invalid logType (value: ".concat(t,")"));for(var i,a=arguments.length,o=new Array(a>2?a-2:0),u=2;u<a;u++)o[u-2]=arguments[u];(i=console)[r].apply(i,["[".concat(n,"]  ").concat(e.name,":")].concat(o))}},$e=function(){function e(t){ie(this,e),this.name=t,this._logLevel=Xe,this._logHandler=Je,this._userLogHandler=null,Ke.push(this)}return oe(e,[{key:"logLevel",get:function(){return this._logLevel},set:function(e){if(!(e in qe))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e}},{key:"setLogLevel",value:function(e){this._logLevel="string"===typeof e?Qe[e]:e}},{key:"logHandler",get:function(){return this._logHandler},set:function(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}},{key:"userLogHandler",get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,[this,qe.DEBUG].concat(t)),this._logHandler.apply(this,[this,qe.DEBUG].concat(t))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,[this,qe.VERBOSE].concat(t)),this._logHandler.apply(this,[this,qe.VERBOSE].concat(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,[this,qe.INFO].concat(t)),this._logHandler.apply(this,[this,qe.INFO].concat(t))}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,[this,qe.WARN].concat(t)),this._logHandler.apply(this,[this,qe.WARN].concat(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,[this,qe.ERROR].concat(t)),this._logHandler.apply(this,[this,qe.ERROR].concat(t))}}]),e}();var Ze=function(){function e(t){ie(this,e),this.container=t}return oe(e,[{key:"getPlatformInfoString",value:function(){return this.container.getProviders().map((function(e){if(function(e){var t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){var t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null})).filter((function(e){return e})).join(" ")}}]),e}();var et="@firebase/app",tt="0.7.20",nt=new $e("@firebase/app"),rt="[DEFAULT]",it=(ce(We={},et,"fire-core"),ce(We,"@firebase/app-compat","fire-core-compat"),ce(We,"@firebase/analytics","fire-analytics"),ce(We,"@firebase/analytics-compat","fire-analytics-compat"),ce(We,"@firebase/app-check","fire-app-check"),ce(We,"@firebase/app-check-compat","fire-app-check-compat"),ce(We,"@firebase/auth","fire-auth"),ce(We,"@firebase/auth-compat","fire-auth-compat"),ce(We,"@firebase/database","fire-rtdb"),ce(We,"@firebase/database-compat","fire-rtdb-compat"),ce(We,"@firebase/functions","fire-fn"),ce(We,"@firebase/functions-compat","fire-fn-compat"),ce(We,"@firebase/installations","fire-iid"),ce(We,"@firebase/installations-compat","fire-iid-compat"),ce(We,"@firebase/messaging","fire-fcm"),ce(We,"@firebase/messaging-compat","fire-fcm-compat"),ce(We,"@firebase/performance","fire-perf"),ce(We,"@firebase/performance-compat","fire-perf-compat"),ce(We,"@firebase/remote-config","fire-rc"),ce(We,"@firebase/remote-config-compat","fire-rc-compat"),ce(We,"@firebase/storage","fire-gcs"),ce(We,"@firebase/storage-compat","fire-gcs-compat"),ce(We,"@firebase/firestore","fire-fst"),ce(We,"@firebase/firestore-compat","fire-fst-compat"),ce(We,"fire-js","fire-js"),ce(We,"firebase","fire-js-all"),We),at=new Map,ot=new Map;function ut(e,t){try{e.container.addComponent(t)}catch(n){nt.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),n)}}function st(e){var t=e.name;if(ot.has(t))return nt.debug("There were multiple attempts to register component ".concat(t,".")),!1;ot.set(t,e);var n,r=re(at.values());try{for(r.s();!(n=r.n()).done;){ut(n.value,e)}}catch(i){r.e(i)}finally{r.f()}return!0}function ct(e,t){var n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}var lt=(ce(Ge={},"no-app","No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()"),ce(Ge,"bad-app-name","Illegal App name: '{$appName}"),ce(Ge,"duplicate-app","Firebase App named '{$appName}' already exists with different options or config"),ce(Ge,"app-deleted","Firebase App named '{$appName}' already deleted"),ce(Ge,"invalid-app-argument","firebase.{$appName}() takes either no argument or a Firebase App instance."),ce(Ge,"invalid-log-argument","First argument to `onLog` must be null or a function."),ce(Ge,"storage-open","Error thrown when opening storage. Original error: {$originalErrorMessage}."),ce(Ge,"storage-get","Error thrown when reading from storage. Original error: {$originalErrorMessage}."),ce(Ge,"storage-set","Error thrown when writing to storage. Original error: {$originalErrorMessage}."),ce(Ge,"storage-delete","Error thrown when deleting from storage. Original error: {$originalErrorMessage}."),Ge),ft=new Ee("app","Firebase",lt),ht=function(){function e(t,n,r){var i=this;ie(this,e),this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Fe("app",(function(){return i}),"PUBLIC"))}return oe(e,[{key:"automaticDataCollectionEnabled",get:function(){return this.checkDestroyed(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}},{key:"name",get:function(){return this.checkDestroyed(),this._name}},{key:"options",get:function(){return this.checkDestroyed(),this._options}},{key:"config",get:function(){return this.checkDestroyed(),this._config}},{key:"container",get:function(){return this._container}},{key:"isDeleted",get:function(){return this._isDeleted},set:function(e){this._isDeleted=e}},{key:"checkDestroyed",value:function(){if(this.isDeleted)throw ft.create("app-deleted",{appName:this._name})}}]),e}(),dt="9.6.10";function pt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rt,t=at.get(e);if(!t)throw ft.create("no-app",{appName:e});return t}function vt(e,t,n){var r,i=null!==(r=it[e])&&void 0!==r?r:e;n&&(i+="-".concat(n));var a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){var u=['Unable to register library "'.concat(i,'" with version "').concat(t,'":')];return a&&u.push('library name "'.concat(i,'" contains illegal characters (whitespace or "/")')),a&&o&&u.push("and"),o&&u.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void nt.warn(u.join(" "))}st(new Fe("".concat(i,"-version"),(function(){return{library:i,version:t}}),"VERSION"))}var yt="firebase-heartbeat-store",mt=null;function gt(){var e,t,n;return mt||(mt=(e="firebase-heartbeat-database",t=1,n=function(e,t){0===t&&e.createObjectStore(yt)},new Promise((function(r,i){try{var a=indexedDB.open(e,t);a.onsuccess=function(e){r(new De(e.target.result))},a.onerror=function(e){var t;i("Error opening indexedDB: ".concat(null===(t=e.target.error)||void 0===t?void 0:t.message))},a.onupgradeneeded=function(e){n(new De(a.result),e.oldVersion,e.newVersion,new Me(a.transaction))}}catch(o){i("Error opening indexedDB: ".concat(o.message))}}))).catch((function(e){throw ft.create("storage-open",{originalErrorMessage:e.message})}))),mt}function kt(e){return bt.apply(this,arguments)}function bt(){return bt=i(f.mark((function e(t){var n;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,gt();case 3:return n=e.sent,e.abrupt("return",n.transaction(yt).objectStore(yt).get(Et(t)));case 7:throw e.prev=7,e.t0=e.catch(0),ft.create("storage-get",{originalErrorMessage:e.t0.message});case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),bt.apply(this,arguments)}function wt(e,t){return _t.apply(this,arguments)}function _t(){return _t=i(f.mark((function e(t,n){var r,i,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,gt();case 3:return r=e.sent,i=r.transaction(yt,"readwrite"),a=i.objectStore(yt),e.next=8,a.put(n,Et(t));case 8:return e.abrupt("return",i.complete);case 11:throw e.prev=11,e.t0=e.catch(0),ft.create("storage-set",{originalErrorMessage:e.t0.message});case 14:case"end":return e.stop()}}),e,null,[[0,11]])}))),_t.apply(this,arguments)}function Et(e){return"".concat(e.name,"!").concat(e.options.appId)}var St=function(){function e(t){var n=this;ie(this,e),this.container=t,this._heartbeatsCache=null;var r=this.container.getProvider("app").getImmediate();this._storage=new Ct(r),this._heartbeatsCachePromise=this._storage.read().then((function(e){return n._heartbeatsCache=e,e}))}return oe(e,[{key:"triggerHeartbeat",value:function(){var e=i(f.mark((function e(){var t,n,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.container.getProvider("platform-logger").getImmediate(),n=t.getPlatformInfoString(),r=Tt(),null!==this._heartbeatsCache){e.next=7;break}return e.next=6,this._heartbeatsCachePromise;case 6:this._heartbeatsCache=e.sent;case 7:if(this._heartbeatsCache.lastSentHeartbeatDate!==r&&!this._heartbeatsCache.heartbeats.some((function(e){return e.date===r}))){e.next=11;break}return e.abrupt("return");case 11:this._heartbeatsCache.heartbeats.push({date:r,agent:n});case 12:return this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((function(e){var t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),e.abrupt("return",this._storage.overwrite(this._heartbeatsCache));case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeartbeatsHeader",value:function(){var e=i(f.mark((function e(){var t,n,r,i,a;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==this._heartbeatsCache){e.next=3;break}return e.next=3,this._heartbeatsCachePromise;case 3:if(null!==this._heartbeatsCache&&0!==this._heartbeatsCache.heartbeats.length){e.next=5;break}return e.abrupt("return","");case 5:if(t=Tt(),n=xt(this._heartbeatsCache.heartbeats),r=n.heartbeatsToSend,i=n.unsentEntries,a=pe(JSON.stringify({version:2,heartbeats:r})),this._heartbeatsCache.lastSentHeartbeatDate=t,!(i.length>0)){e.next=15;break}return this._heartbeatsCache.heartbeats=i,e.next=13,this._storage.overwrite(this._heartbeatsCache);case 13:e.next=17;break;case 15:this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache);case 17:return e.abrupt("return",a);case 18:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();function Tt(){return(new Date).toISOString().substring(0,10)}function xt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=[],i=e.slice(),a=re(e);try{var o=function(){var e=t.value,a=r.find((function(t){return t.agent===e.agent}));if(a){if(a.dates.push(e.date),Nt(r)>n)return a.dates.pop(),"break"}else if(r.push({agent:e.agent,dates:[e.date]}),Nt(r)>n)return r.pop(),"break";i=i.slice(1)};for(a.s();!(t=a.n()).done;){var u=o();if("break"===u)break}}catch(s){a.e(s)}finally{a.f()}return{heartbeatsToSend:r,unsentEntries:i}}var It,Ct=function(){function e(t){ie(this,e),this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}return oe(e,[{key:"runIndexedDBEnvironmentCheck",value:function(){var e=i(f.mark((function e(){return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"===typeof indexedDB){e.next=4;break}return e.abrupt("return",!1);case 4:return e.abrupt("return",new Promise((function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(a){t(a)}})).then((function(){return!0})).catch((function(){return!1})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"read",value:function(){var e=i(f.mark((function e(){var t;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._canUseIndexedDBPromise;case 2:if(e.sent){e.next=7;break}return e.abrupt("return",{heartbeats:[]});case 7:return e.next=9,kt(this.app);case 9:return t=e.sent,e.abrupt("return",t||{heartbeats:[]});case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"overwrite",value:function(){var e=i(f.mark((function e(t){var n,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._canUseIndexedDBPromise;case 2:if(e.sent){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,this.read();case 9:return r=e.sent,e.abrupt("return",wt(this.app,{lastSentHeartbeatDate:null!==(n=t.lastSentHeartbeatDate)&&void 0!==n?n:r.lastSentHeartbeatDate,heartbeats:t.heartbeats}));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"add",value:function(){var e=i(f.mark((function e(t){var n,r;return f.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._canUseIndexedDBPromise;case 2:if(e.sent){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,this.read();case 9:return r=e.sent,e.abrupt("return",wt(this.app,{lastSentHeartbeatDate:null!==(n=t.lastSentHeartbeatDate)&&void 0!==n?n:r.lastSentHeartbeatDate,heartbeats:[].concat(se(r.heartbeats),se(t.heartbeats))}));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Nt(e){return pe(JSON.stringify({version:2,heartbeats:e})).length}It="",st(new Fe("platform-logger",(function(e){return new Ze(e)}),"PRIVATE")),st(new Fe("heartbeat",(function(e){return new St(e)}),"PRIVATE")),vt(et,tt,It),vt(et,tt,"esm2017"),vt("fire-js","");function At(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}Object.create;var Rt;Object.create;function Lt(){return ce({},"dependent-sdk-initialized-before-auth","Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.")}var Ot=Lt,Pt=new Ee("auth","Firebase",Lt()),Dt=new $e("@firebase/auth");function Mt(e){if(Dt.logLevel<=qe.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Dt.error.apply(Dt,["Auth (".concat(dt,"): ").concat(e)].concat(n))}}function Ut(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw zt.apply(void 0,[e].concat(n))}function Vt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return zt.apply(void 0,[e].concat(n))}function Ft(e,t,n){var r=Object.assign(Object.assign({},Ot()),ce({},t,n));return new Ee("auth","Firebase",r).create(t,{appName:e.name})}function jt(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&Ut(e,"argument-error"),Ft(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function zt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("string"!==typeof e){var i,a=n[0],o=se(n.slice(1));return o[0]&&(o[0].appName=e.name),(i=e._errorFactory).create.apply(i,[a].concat(se(o)))}return Pt.create.apply(Pt,[e].concat(n))}function Bt(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];throw zt.apply(void 0,[t].concat(r))}}function qt(e){var t="INTERNAL ASSERTION FAILED: "+e;throw Mt(t),new Error(t)}function Ht(e,t){e||qt(t)}var Kt=new Map;function Wt(e){Ht(e instanceof Function,"Expected a class definition");var t=Kt.get(e);return t?(Ht(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Kt.set(e,t),t)}function Gt(e,t){var n=ct(e,"auth");if(n.isInitialized()){var r=n.getImmediate();if(xe(n.getOptions(),null!==t&&void 0!==t?t:{}))return r;Ut(r,"already-initialized")}return n.initialize({options:t})}function Qt(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function Xt(){return"http:"===Yt()||"https:"===Yt()}function Yt(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}var Jt=function(){function e(t,n){ie(this,e),this.shortDelay=t,this.longDelay=n,Ht(n>t,"Short delay should be less than long delay!"),this.isMobile=ge()||be()}return oe(e,[{key:"get",value:function(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(Xt()||ke()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}]),e}();function $t(e,t){Ht(e.emulator,"Emulator should always be set here");var n=e.emulator.url;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}var Zt=function(){function e(){ie(this,e)}return oe(e,null,[{key:"initialize",value:function(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}},{key:"fetch",value:function(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:void qt("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"headers",value:function(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:void qt("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"response",value:function(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:void qt("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}]),e}(),en=(ce(Rt={},"CREDENTIAL_MISMATCH","custom-token-mismatch"),ce(Rt,"MISSING_CUSTOM_TOKEN","internal-error"),ce(Rt,"INVALID_IDENTIFIER","invalid-email"),ce(Rt,"MISSING_CONTINUE_URI","internal-error"),ce(Rt,"INVALID_PASSWORD","wrong-password"),ce(Rt,"MISSING_PASSWORD","internal-error"),ce(Rt,"EMAIL_EXISTS","email-already-in-use"),ce(Rt,"PASSWORD_LOGIN_DISABLED","operation-not-allowed"),ce(Rt,"INVALID_IDP_RESPONSE","invalid-credential"),ce(Rt,"INVALID_PENDING_TOKEN","invalid-credential"),ce(Rt,"FEDERATED_USER_ID_ALREADY_LINKED","credential-already-in-use"),ce(Rt,"MISSING_REQ_TYPE","internal-error"),ce(Rt,"EMAIL_NOT_FOUND","user-not-found"),ce(Rt,"RESET_PASSWORD_EXCEED_LIMIT","too-many-requests"),ce(Rt,"EXPIRED_OOB_CODE","expired-action-code"),ce(Rt,"INVALID_OOB_CODE","invalid-action-code"),ce(Rt,"MISSING_OOB_CODE","internal-error"),ce(Rt,"CREDENTIAL_TOO_OLD_LOGIN_AGAIN","requires-recent-login"),ce(Rt,"INVALID_ID_TOKEN","invalid-user-token"),ce(Rt,"TOKEN_EXPIRED","user-token-expired"),ce(Rt,"USER_NOT_FOUND","user-token-expired"),ce(Rt,"TOO_MANY_ATTEMPTS_TRY_LATER","too-many-requests"),ce(Rt,"INVALID_CODE","invalid-verification-code"),ce(Rt,"INVALID_SESSION_INFO","invalid-verification-id"),ce(Rt,"INVALID_TEMPORARY_PROOF","invalid-credential"),ce(Rt,"MISSING_SESSION_INFO","missing-verification-id"),ce(Rt,"SESSION_EXPIRED","code-expired"),ce(Rt,"MISSING_ANDROID_PACKAGE_NAME","missing-android-pkg-name"),ce(Rt,"UNAUTHORIZED_DOMAIN","unauthorized-continue-uri"),ce(Rt,"INVALID_OAUTH_CLIENT_ID","invalid-oauth-client-id"),ce(Rt,"ADMIN_ONLY_OPERATION","admin-restricted-operation"),ce(Rt,"INVALID_MFA_PENDING_CREDENTIAL","invalid-multi-factor-session"),ce(Rt,"MFA_ENROLLMENT_NOT_FOUND","multi-factor-info-not-found"),ce(Rt,"MISSING_MFA_ENROLLMENT_ID","missing-multi-factor-info"),ce(Rt,"MISSING_MFA_PENDING_CREDENTIAL","missing-multi-factor-session"),ce(Rt,"SECOND_FACTOR_EXISTS","second-factor-already-in-use"),ce(Rt,"SECOND_FACTOR_LIMIT_EXCEEDED","maximum-second-factor-count-exceeded"),ce(Rt,"BLOCKING_FUNCTION_ERROR_RESPONSE","internal-error"),Rt),tn=new Jt(3e4,6e4);function nn(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function rn(e,t,n,r){return an.apply(this,arguments)}function an(){return an=i(h().mark((function e(t,n,r,a){var o,u=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>4&&void 0!==u[4]?u[4]:{},e.abrupt("return",on(t,o,i(h().mark((function e(){var i,o,u,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={},o={},a&&("GET"===n?o=a:i={body:JSON.stringify(a)}),u=Ce(Object.assign({key:t.config.apiKey},o)).slice(1),e.next=6,t._getAdditionalHeaders();case 6:return(s=e.sent)["Content-Type"]="application/json",t.languageCode&&(s["X-Firebase-Locale"]=t.languageCode),e.abrupt("return",Zt.fetch()(ln(t,t.config.apiHost,r,u),Object.assign({method:n,headers:s,referrerPolicy:"no-referrer"},i)));case 10:case"end":return e.stop()}}),e)})))));case 2:case"end":return e.stop()}}),e)}))),an.apply(this,arguments)}function on(e,t,n){return un.apply(this,arguments)}function un(){return un=i(h().mark((function e(t,n,r){var i,a,o,u,s,l,f,d,p,v;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t._canInitEmulator=!1,i=Object.assign(Object.assign({},en),n),e.prev=2,a=new fn(t),e.next=6,Promise.race([r(),a.promise]);case 6:return o=e.sent,a.clearNetworkTimeout(),e.next=10,o.json();case 10:if(!("needConfirmation"in(u=e.sent))){e.next=13;break}throw hn(t,"account-exists-with-different-credential",u);case 13:if(!o.ok||"errorMessage"in u){e.next=17;break}return e.abrupt("return",u);case 17:if(s=o.ok?u.errorMessage:u.error.message,l=s.split(" : "),f=c(l,2),d=f[0],p=f[1],"FEDERATED_USER_ID_ALREADY_LINKED"!==d){e.next=23;break}throw hn(t,"credential-already-in-use",u);case 23:if("EMAIL_EXISTS"!==d){e.next=25;break}throw hn(t,"email-already-in-use",u);case 25:if(v=i[d]||d.toLowerCase().replace(/[_\s]+/g,"-"),!p){e.next=30;break}throw Ft(t,v,p);case 30:Ut(t,v);case 31:e.next=38;break;case 33:if(e.prev=33,e.t0=e.catch(2),!(e.t0 instanceof _e)){e.next=37;break}throw e.t0;case 37:Ut(t,"network-request-failed");case 38:case"end":return e.stop()}}),e,null,[[2,33]])}))),un.apply(this,arguments)}function sn(e,t,n,r){return cn.apply(this,arguments)}function cn(){return cn=i(h().mark((function e(t,n,r,i){var a,o,u=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>4&&void 0!==u[4]?u[4]:{},e.next=3,rn(t,n,r,i,a);case 3:return"mfaPendingCredential"in(o=e.sent)&&Ut(t,"multi-factor-auth-required",{_serverResponse:o}),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),cn.apply(this,arguments)}function ln(e,t,n,r){var i="".concat(t).concat(n,"?").concat(r);return e.config.emulator?$t(e.config,i):"".concat(e.config.apiScheme,"://").concat(i)}var fn=function(){function e(t){var n=this;ie(this,e),this.auth=t,this.timer=null,this.promise=new Promise((function(e,t){n.timer=setTimeout((function(){return t(Vt(n.auth,"network-request-failed"))}),tn.get())}))}return oe(e,[{key:"clearNetworkTimeout",value:function(){clearTimeout(this.timer)}}]),e}();function hn(e,t,n){var r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);var i=Vt(e,t,r);return i.customData._tokenResponse=n,i}function dn(e,t){return pn.apply(this,arguments)}function pn(){return pn=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rn(t,"POST","/v1/accounts:delete",n));case 1:case"end":return e.stop()}}),e)}))),pn.apply(this,arguments)}function vn(e,t){return yn.apply(this,arguments)}function yn(){return yn=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rn(t,"POST","/v1/accounts:lookup",n));case 1:case"end":return e.stop()}}),e)}))),yn.apply(this,arguments)}function mn(e){if(e)try{var t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(n){}}function gn(){return gn=i(h().mark((function e(t){var n,r,i,a,o,u,s=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]&&s[1],r=Oe(t),e.next=4,r.getIdToken(n);case 4:return i=e.sent,Bt((a=bn(i))&&a.exp&&a.auth_time&&a.iat,r.auth,"internal-error"),o="object"===typeof a.firebase?a.firebase:void 0,u=null===o||void 0===o?void 0:o.sign_in_provider,e.abrupt("return",{claims:a,token:i,authTime:mn(kn(a.auth_time)),issuedAtTime:mn(kn(a.iat)),expirationTime:mn(kn(a.exp)),signInProvider:u||null,signInSecondFactor:(null===o||void 0===o?void 0:o.sign_in_second_factor)||null});case 10:case"end":return e.stop()}}),e)}))),gn.apply(this,arguments)}function kn(e){return 1e3*Number(e)}function bn(e){var t=c(e.split("."),3),n=t[0],r=t[1],i=t[2];if(void 0===n||void 0===r||void 0===i)return Mt("JWT malformed, contained fewer than 3 sections"),null;try{var a=ve(r);return a?JSON.parse(a):(Mt("Failed to decode base64 JWT payload"),null)}catch(o){return Mt("Caught error parsing JWT payload as JSON",o),null}}function wn(e,t){return _n.apply(this,arguments)}function _n(){return _n=i(h().mark((function e(t,n){var r=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r.length>2&&void 0!==r[2]&&r[2])){e.next=3;break}return e.abrupt("return",n);case 3:return e.prev=3,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof _e&&En(e.t0))){e.next=15;break}if(t.auth.currentUser!==t){e.next=15;break}return e.next=15,t.auth.signOut();case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[3,9]])}))),_n.apply(this,arguments)}function En(e){var t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}var Sn=function(){function e(t){ie(this,e),this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}return oe(e,[{key:"_start",value:function(){this.isRunning||(this.isRunning=!0,this.schedule())}},{key:"_stop",value:function(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}},{key:"getInterval",value:function(e){var t;if(e){var n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}this.errorBackoff=3e4;var r=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,r)}},{key:"schedule",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isRunning){var n=this.getInterval(t);this.timerId=setTimeout(i(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.iteration();case 2:case"end":return t.stop()}}),t)}))),n)}}},{key:"iteration",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.user.getIdToken(!0);case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),e.t0.code==="auth/".concat("network-request-failed")&&this.schedule(!0),e.abrupt("return");case 9:this.schedule();case 10:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(){return e.apply(this,arguments)}}()}]),e}(),Tn=function(){function e(t,n){ie(this,e),this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}return oe(e,[{key:"_initializeTime",value:function(){this.lastSignInTime=mn(this.lastLoginAt),this.creationTime=mn(this.createdAt)}},{key:"_copy",value:function(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}},{key:"toJSON",value:function(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}]),e}();function xn(e){return In.apply(this,arguments)}function In(){return In=i(h().mark((function e(t){var n,r,i,a,o,u,s,c,l,f,d;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.auth,e.next=3,t.getIdToken();case 3:return i=e.sent,e.next=6,wn(t,vn(r,{idToken:i}));case 6:Bt(null===(a=e.sent)||void 0===a?void 0:a.users.length,r,"internal-error"),o=a.users[0],t._notifyReloadListener(o),u=(null===(n=o.providerUserInfo)||void 0===n?void 0:n.length)?An(o.providerUserInfo):[],s=Nn(t.providerData,u),c=t.isAnonymous,l=!(t.email&&o.passwordHash)&&!(null===s||void 0===s?void 0:s.length),f=!!c&&l,d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new Tn(o.createdAt,o.lastLoginAt),isAnonymous:f},Object.assign(t,d);case 17:case"end":return e.stop()}}),e)}))),In.apply(this,arguments)}function Cn(){return(Cn=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Oe(t),e.next=3,xn(n);case 3:return e.next=5,n.auth._persistUserIfCurrent(n);case 5:n.auth._notifyListenersIfCurrent(n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nn(e,t){var n=e.filter((function(e){return!t.some((function(t){return t.providerId===e.providerId}))}));return[].concat(se(n),se(t))}function An(e){return e.map((function(e){var t=e.providerId,n=At(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}}))}function Rn(e,t){return Ln.apply(this,arguments)}function Ln(){return Ln=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,on(t,{},i(h().mark((function e(){var r,i,a,o,u,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ce({grant_type:"refresh_token",refresh_token:n}).slice(1),i=t.config,a=i.tokenApiHost,o=i.apiKey,u=ln(t,a,"/v1/token","key=".concat(o)),e.next=5,t._getAdditionalHeaders();case 5:return(s=e.sent)["Content-Type"]="application/x-www-form-urlencoded",e.abrupt("return",Zt.fetch()(u,{method:"POST",headers:s,body:r}));case 8:case"end":return e.stop()}}),e)}))));case 2:return r=e.sent,e.abrupt("return",{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token});case 4:case"end":return e.stop()}}),e)}))),Ln.apply(this,arguments)}var On=function(){function e(){ie(this,e),this.refreshToken=null,this.accessToken=null,this.expirationTime=null}return oe(e,[{key:"isExpired",get:function(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}},{key:"updateFromServerResponse",value:function(e){Bt(e.idToken,"internal-error"),Bt("undefined"!==typeof e.idToken,"internal-error"),Bt("undefined"!==typeof e.refreshToken,"internal-error");var t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):function(e){var t=bn(e);return Bt(t,"internal-error"),Bt("undefined"!==typeof t.exp,"internal-error"),Bt("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}},{key:"getToken",value:function(){var e=i(h().mark((function e(t){var n,r=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]&&r[1],Bt(!this.accessToken||this.refreshToken,t,"user-token-expired"),n||!this.accessToken||this.isExpired){e.next=4;break}return e.abrupt("return",this.accessToken);case 4:if(!this.refreshToken){e.next=8;break}return e.next=7,this.refresh(t,this.refreshToken);case 7:return e.abrupt("return",this.accessToken);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"clearRefreshToken",value:function(){this.refreshToken=null}},{key:"refresh",value:function(){var e=i(h().mark((function e(t,n){var r,i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rn(t,n);case 2:r=e.sent,i=r.accessToken,a=r.refreshToken,o=r.expiresIn,this.updateTokensAndExpiration(i,a,Number(o));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"updateTokensAndExpiration",value:function(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}},{key:"toJSON",value:function(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}},{key:"_assign",value:function(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}},{key:"_clone",value:function(){return Object.assign(new e,this.toJSON())}},{key:"_performRefresh",value:function(){return qt("not implemented")}}],[{key:"fromJSON",value:function(t,n){var r=n.refreshToken,i=n.accessToken,a=n.expirationTime,o=new e;return r&&(Bt("string"===typeof r,"internal-error",{appName:t}),o.refreshToken=r),i&&(Bt("string"===typeof i,"internal-error",{appName:t}),o.accessToken=i),a&&(Bt("number"===typeof a,"internal-error",{appName:t}),o.expirationTime=a),o}}]),e}();function Pn(e,t){Bt("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}var Dn=function(){function e(t){ie(this,e);var n=t.uid,r=t.auth,i=t.stsTokenManager,a=At(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Sn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=a.displayName||null,this.email=a.email||null,this.emailVerified=a.emailVerified||!1,this.phoneNumber=a.phoneNumber||null,this.photoURL=a.photoURL||null,this.isAnonymous=a.isAnonymous||!1,this.tenantId=a.tenantId||null,this.providerData=a.providerData?se(a.providerData):[],this.metadata=new Tn(a.createdAt||void 0,a.lastLoginAt||void 0)}return oe(e,[{key:"getIdToken",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wn(this,this.stsTokenManager.getToken(this.auth,t));case 2:if(Bt(n=e.sent,this.auth,"internal-error"),this.accessToken===n){e.next=9;break}return this.accessToken=n,e.next=8,this.auth._persistUserIfCurrent(this);case 8:this.auth._notifyListenersIfCurrent(this);case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getIdTokenResult",value:function(e){return function(e){return gn.apply(this,arguments)}(this,e)}},{key:"reload",value:function(){return function(e){return Cn.apply(this,arguments)}(this)}},{key:"_assign",value:function(e){this!==e&&(Bt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((function(e){return Object.assign({},e)})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}},{key:"_clone",value:function(t){return new e(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}))}},{key:"_onReload",value:function(e){Bt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}},{key:"_notifyReloadListener",value:function(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}},{key:"_startProactiveRefresh",value:function(){this.proactiveRefresh._start()}},{key:"_stopProactiveRefresh",value:function(){this.proactiveRefresh._stop()}},{key:"_updateTokensIfNecessary",value:function(){var e=i(h().mark((function e(t){var n,r,i=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],r=!1,t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),!n){e.next=6;break}return e.next=6,xn(this);case 6:return e.next=8,this.auth._persistUserIfCurrent(this);case 8:r&&this.auth._notifyListenersIfCurrent(this);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"delete",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getIdToken();case 2:return t=e.sent,e.next=5,wn(this,dn(this.auth,{idToken:t}));case 5:return this.stsTokenManager.clearRefreshToken(),e.abrupt("return",this.auth.signOut());case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toJSON",value:function(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((function(e){return Object.assign({},e)})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}},{key:"refreshToken",get:function(){return this.stsTokenManager.refreshToken||""}}],[{key:"_fromJSON",value:function(t,n){var r,i,a,o,u,s,c,l,f=null!==(r=n.displayName)&&void 0!==r?r:void 0,h=null!==(i=n.email)&&void 0!==i?i:void 0,d=null!==(a=n.phoneNumber)&&void 0!==a?a:void 0,p=null!==(o=n.photoURL)&&void 0!==o?o:void 0,v=null!==(u=n.tenantId)&&void 0!==u?u:void 0,y=null!==(s=n._redirectEventId)&&void 0!==s?s:void 0,m=null!==(c=n.createdAt)&&void 0!==c?c:void 0,g=null!==(l=n.lastLoginAt)&&void 0!==l?l:void 0,k=n.uid,b=n.emailVerified,w=n.isAnonymous,_=n.providerData,E=n.stsTokenManager;Bt(k&&E,t,"internal-error");var S=On.fromJSON(this.name,E);Bt("string"===typeof k,t,"internal-error"),Pn(f,t.name),Pn(h,t.name),Bt("boolean"===typeof b,t,"internal-error"),Bt("boolean"===typeof w,t,"internal-error"),Pn(d,t.name),Pn(p,t.name),Pn(v,t.name),Pn(y,t.name),Pn(m,t.name),Pn(g,t.name);var T=new e({uid:k,auth:t,email:h,emailVerified:b,displayName:f,isAnonymous:w,photoURL:p,phoneNumber:d,tenantId:v,stsTokenManager:S,createdAt:m,lastLoginAt:g});return _&&Array.isArray(_)&&(T.providerData=_.map((function(e){return Object.assign({},e)}))),y&&(T._redirectEventId=y),T}},{key:"_fromIdTokenResponse",value:function(){var t=i(h().mark((function t(n,r){var i,a,o,u=arguments;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=u.length>2&&void 0!==u[2]&&u[2],(a=new On).updateFromServerResponse(r),o=new e({uid:r.localId,auth:n,stsTokenManager:a,isAnonymous:i}),t.next=6,xn(o);case 6:return t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}]),e}(),Mn=function(){function e(){ie(this,e),this.type="NONE",this.storage={}}return oe(e,[{key:"_isAvailable",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"_set",value:function(){var e=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.storage[t]=n;case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_get",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.storage[t],e.abrupt("return",void 0===n?null:n);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_remove",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:delete this.storage[t];case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_addListener",value:function(e,t){}},{key:"_removeListener",value:function(e,t){}}]),e}();Mn.type="NONE";var Un=Mn;function Vn(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}var Fn=function(){function e(t,n,r){ie(this,e),this.persistence=t,this.auth=n,this.userKey=r;var i=this.auth,a=i.config,o=i.name;this.fullUserKey=Vn(this.userKey,a.apiKey,o),this.fullPersistenceKey=Vn("persistence",a.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}return oe(e,[{key:"setCurrentUser",value:function(e){return this.persistence._set(this.fullUserKey,e.toJSON())}},{key:"getCurrentUser",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.persistence._get(this.fullUserKey);case 2:return t=e.sent,e.abrupt("return",t?Dn._fromJSON(this.auth,t):null);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeCurrentUser",value:function(){return this.persistence._remove(this.fullUserKey)}},{key:"savePersistenceForRedirect",value:function(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}},{key:"setPersistence",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.persistence!==t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.getCurrentUser();case 4:return n=e.sent,e.next=7,this.removeCurrentUser();case 7:if(this.persistence=t,!n){e.next=10;break}return e.abrupt("return",this.setCurrentUser(n));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"delete",value:function(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}}],[{key:"create",value:function(){var t=i(h().mark((function t(n,r){var a,o,u,s,c,l,f,d,p,v,y,m=arguments;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=m.length>2&&void 0!==m[2]?m[2]:"authUser",r.length){t.next=3;break}return t.abrupt("return",new e(Wt(Un),n,a));case 3:return t.next=5,Promise.all(r.map(function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._isAvailable();case 2:if(!e.sent){e.next=4;break}return e.abrupt("return",t);case 4:return e.abrupt("return",void 0);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:o=t.sent.filter((function(e){return e})),u=o[0]||Wt(Un),s=Vn(a,n.config.apiKey,n.name),c=null,l=re(r),t.prev=10,l.s();case 12:if((f=l.n()).done){t.next=29;break}return d=f.value,t.prev=14,t.next=17,d._get(s);case 17:if(!(p=t.sent)){t.next=23;break}return v=Dn._fromJSON(n,p),d!==u&&(c=v),u=d,t.abrupt("break",29);case 23:t.next=27;break;case 25:t.prev=25,t.t0=t.catch(14);case 27:t.next=12;break;case 29:t.next=34;break;case 31:t.prev=31,t.t1=t.catch(10),l.e(t.t1);case 34:return t.prev=34,l.f(),t.finish(34);case 37:if(y=o.filter((function(e){return e._shouldAllowMigration})),u._shouldAllowMigration&&y.length){t.next=40;break}return t.abrupt("return",new e(u,n,a));case 40:if(u=y[0],!c){t.next=44;break}return t.next=44,u._set(s,c.toJSON());case 44:return t.next=46,Promise.all(r.map(function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===u){e.next=8;break}return e.prev=1,e.next=4,t._remove(s);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()));case 46:return t.abrupt("return",new e(u,n,a));case 47:case"end":return t.stop()}}),t,null,[[10,31,34,37],[14,25]])})));return function(e,n){return t.apply(this,arguments)}}()}]),e}();function jn(e){var t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Hn(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(zn(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Wn(t))return"Blackberry";if(Gn(t))return"Webos";if(Bn(t))return"Safari";if((t.includes("chrome/")||qn(t))&&!t.includes("edge/"))return"Chrome";if(Kn(t))return"Android";var n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);return 2===(null===n||void 0===n?void 0:n.length)?n[1]:"Other"}function zn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/firefox\//i.test(e)}function Bn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me(),t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function qn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/crios\//i.test(e)}function Hn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/iemobile/i.test(e)}function Kn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/android/i.test(e)}function Wn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/blackberry/i.test(e)}function Gn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/webos/i.test(e)}function Qn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return/iphone|ipad|ipod/i.test(e)}function Xn(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return Qn(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}function Yn(){return we()&&10===document.documentMode}function Jn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me();return Qn(e)||Kn(e)||Gn(e)||Wn(e)||/windows phone/i.test(e)||Hn(e)}function $n(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=jn(me());break;case"Worker":t="".concat(jn(me()),"-").concat(e);break;default:t=e}var r=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(dt,"/").concat(r)}var Zn=function(){function e(t,n,r){ie(this,e),this.app=t,this.heartbeatServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new tr(this),this.idTokenSubscription=new tr(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Pt,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=r.sdkClientVersion}return oe(e,[{key:"_initializeWithPersistence",value:function(e,t){var n=this;return t&&(this._popupRedirectResolver=Wt(t)),this._initializationPromise=this.queue(i(h().mark((function r(){var i,a;return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!n._deleted){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,Fn.create(n,e);case 4:if(n.persistenceManager=r.sent,!n._deleted){r.next=7;break}return r.abrupt("return");case 7:if(!(null===(i=n._popupRedirectResolver)||void 0===i?void 0:i._shouldInitProactively)){r.next=15;break}return r.prev=8,r.next=11,n._popupRedirectResolver._initialize(n);case 11:r.next=15;break;case 13:r.prev=13,r.t0=r.catch(8);case 15:return r.next=17,n.initializeCurrentUser(t);case 17:if(n.lastNotifiedUid=(null===(a=n.currentUser)||void 0===a?void 0:a.uid)||null,!n._deleted){r.next=20;break}return r.abrupt("return");case 20:n._isInitialized=!0;case 21:case"end":return r.stop()}}),r,null,[[8,13]])})))),this._initializationPromise}},{key:"_onStorageEvent",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._deleted){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.assertedPersistence.getCurrentUser();case 4:if(t=e.sent,this.currentUser||t){e.next=7;break}return e.abrupt("return");case 7:if(!this.currentUser||!t||this.currentUser.uid!==t.uid){e.next=12;break}return this._currentUser._assign(t),e.next=11,this.currentUser.getIdToken();case 11:return e.abrupt("return");case 12:return e.next=14,this._updateCurrentUser(t);case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeCurrentUser",value:function(){var e=i(h().mark((function e(t){var n,r,i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.assertedPersistence.getCurrentUser();case 2:if(r=e.sent,!t||!this.config.authDomain){e.next=12;break}return e.next=6,this.getOrInitRedirectPersistenceManager();case 6:return i=null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId,a=null===r||void 0===r?void 0:r._redirectEventId,e.next=10,this.tryRedirectSignIn(t);case 10:o=e.sent,i&&i!==a||!(null===o||void 0===o?void 0:o.user)||(r=o.user);case 12:if(r){e.next=14;break}return e.abrupt("return",this.directlySetCurrentUser(null));case 14:if(r._redirectEventId){e.next=16;break}return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(r));case 16:return Bt(this._popupRedirectResolver,this,"argument-error"),e.next=19,this.getOrInitRedirectPersistenceManager();case 19:if(!this.redirectUser||this.redirectUser._redirectEventId!==r._redirectEventId){e.next=21;break}return e.abrupt("return",this.directlySetCurrentUser(r));case 21:return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(r));case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"tryRedirectSignIn",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,this._popupRedirectResolver._completeRedirectFn(this,t,!0);case 4:n=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),e.next=11,this._setRedirectUser(null);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"reloadAndSetCurrentUserOrClear",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,xn(t);case 3:e.next=9;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t0.code==="auth/".concat("network-request-failed")){e.next=9;break}return e.abrupt("return",this.directlySetCurrentUser(null));case 9:return e.abrupt("return",this.directlySetCurrentUser(t));case 10:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()},{key:"useDeviceLanguage",value:function(){this.languageCode=function(){if("undefined"===typeof navigator)return null;var e=navigator;return e.languages&&e.languages[0]||e.language||null}()}},{key:"_delete",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._deleted=!0;case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateCurrentUser",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t?Oe(t):null)&&Bt(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),e.abrupt("return",this._updateCurrentUser(n&&n._clone(this)));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_updateCurrentUser",value:function(){var e=i(h().mark((function e(t){var n=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._deleted){e.next=2;break}return e.abrupt("return");case 2:return t&&Bt(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e.abrupt("return",this.queue(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.directlySetCurrentUser(t);case 2:n.notifyAuthListeners();case 3:case"end":return e.stop()}}),e)})))));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signOut",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.redirectPersistenceManager&&!this._popupRedirectResolver){e.next=3;break}return e.next=3,this._setRedirectUser(null);case 3:return e.abrupt("return",this._updateCurrentUser(null));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setPersistence",value:function(e){var t=this;return this.queue(i(h().mark((function n(){return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.assertedPersistence.setPersistence(Wt(e));case 2:case"end":return n.stop()}}),n)}))))}},{key:"_getPersistence",value:function(){return this.assertedPersistence.persistence.type}},{key:"_updateErrorMap",value:function(e){this._errorFactory=new Ee("auth","Firebase",e())}},{key:"onAuthStateChanged",value:function(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}},{key:"onIdTokenChanged",value:function(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}},{key:"toJSON",value:function(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}},{key:"_setRedirectUser",value:function(){var e=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getOrInitRedirectPersistenceManager(n);case 2:return r=e.sent,e.abrupt("return",null===t?r.removeCurrentUser():r.setCurrentUser(t));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getOrInitRedirectPersistenceManager",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.redirectPersistenceManager){e.next=9;break}return Bt(n=t&&Wt(t)||this._popupRedirectResolver,this,"argument-error"),e.next=5,Fn.create(this,[Wt(n._redirectPersistence)],"redirectUser");case 5:return this.redirectPersistenceManager=e.sent,e.next=8,this.redirectPersistenceManager.getCurrentUser();case 8:this.redirectUser=e.sent;case 9:return e.abrupt("return",this.redirectPersistenceManager);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_redirectUserForId",value:function(){var e=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isInitialized){e.next=3;break}return e.next=3,this.queue(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 3:if((null===(n=this._currentUser)||void 0===n?void 0:n._redirectEventId)!==t){e.next=5;break}return e.abrupt("return",this._currentUser);case 5:if((null===(r=this.redirectUser)||void 0===r?void 0:r._redirectEventId)!==t){e.next=7;break}return e.abrupt("return",this.redirectUser);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_persistUserIfCurrent",value:function(){var e=i(h().mark((function e(t){var n=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==this.currentUser){e.next=2;break}return e.abrupt("return",this.queue(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.directlySetCurrentUser(t));case 1:case"end":return e.stop()}}),e)})))));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_notifyListenersIfCurrent",value:function(e){e===this.currentUser&&this.notifyAuthListeners()}},{key:"_key",value:function(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}},{key:"_startProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}},{key:"_stopProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}},{key:"_currentUser",get:function(){return this.currentUser}},{key:"notifyAuthListeners",value:function(){var e,t;if(this._isInitialized){this.idTokenSubscription.next(this.currentUser);var n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}}},{key:"registerStateListener",value:function(e,t,n,r){var i=this;if(this._deleted)return function(){};var a="function"===typeof t?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return Bt(o,this,"internal-error"),o.then((function(){return a(i.currentUser)})),"function"===typeof t?e.addObserver(t,n,r):e.addObserver(t)}},{key:"directlySetCurrentUser",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentUser&&this.currentUser!==t&&(this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh()),this.currentUser=t,!t){e.next=7;break}return e.next=5,this.assertedPersistence.setCurrentUser(t);case 5:e.next=9;break;case 7:return e.next=9,this.assertedPersistence.removeCurrentUser();case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"queue",value:function(e){return this.operations=this.operations.then(e,e),this.operations}},{key:"assertedPersistence",get:function(){return Bt(this.persistenceManager,this,"internal-error"),this.persistenceManager}},{key:"_logFramework",value:function(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=$n(this.config.clientPlatform,this._getFrameworks()))}},{key:"_getFrameworks",value:function(){return this.frameworks}},{key:"_getAdditionalHeaders",value:function(){var e=i(h().mark((function e(){var t,n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ce({},"X-Client-Version",this.clientVersion),this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId),e.next=4,null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader();case 4:return(r=e.sent)&&(n["X-Firebase-Client"]=r),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();function er(e){return Oe(e)}var tr=function(){function e(t){var n=this;ie(this,e),this.auth=t,this.observer=null,this.addObserver=function(e,t){var n=new Re(e,t);return n.subscribe.bind(n)}((function(e){return n.observer=e}))}return oe(e,[{key:"next",get:function(){return Bt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}]),e}();var nr=function(){function e(t,n){ie(this,e),this.providerId=t,this.signInMethod=n}return oe(e,[{key:"toJSON",value:function(){return qt("not implemented")}},{key:"_getIdTokenResponse",value:function(e){return qt("not implemented")}},{key:"_linkToIdToken",value:function(e,t){return qt("not implemented")}},{key:"_getReauthenticationResolver",value:function(e){return qt("not implemented")}}]),e}();function rr(e,t){return ir.apply(this,arguments)}function ir(){return ir=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rn(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}}),e)}))),ir.apply(this,arguments)}function ar(e,t){return or.apply(this,arguments)}function or(){return or=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithPassword",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),or.apply(this,arguments)}function ur(e,t){return sr.apply(this,arguments)}function sr(){return sr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithEmailLink",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),sr.apply(this,arguments)}function cr(e,t){return lr.apply(this,arguments)}function lr(){return lr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithEmailLink",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),lr.apply(this,arguments)}var fr=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ie(this,n),(a=t.call(this,"password",i))._email=e,a._password=r,a._tenantId=o,a}return oe(n,[{key:"toJSON",value:function(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}},{key:"_getIdTokenResponse",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?4:5;break;case 3:return e.abrupt("return",ar(t,{returnSecureToken:!0,email:this._email,password:this._password}));case 4:return e.abrupt("return",ur(t,{email:this._email,oobCode:this._password}));case 5:Ut(t,"internal-error");case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_linkToIdToken",value:function(){var e=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?4:5;break;case 3:return e.abrupt("return",rr(t,{idToken:n,returnSecureToken:!0,email:this._email,password:this._password}));case 4:return e.abrupt("return",cr(t,{idToken:n,email:this._email,oobCode:this._password}));case 5:Ut(t,"internal-error");case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_getReauthenticationResolver",value:function(e){return this._getIdTokenResponse(e)}}],[{key:"_fromEmailAndPassword",value:function(e,t){return new n(e,t,"password")}},{key:"_fromEmailAndCode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new n(e,t,"emailLink",r)}},{key:"fromJSON",value:function(e){var t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}}]),n}(nr);function hr(e,t){return dr.apply(this,arguments)}function dr(){return dr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithIdp",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),dr.apply(this,arguments)}var pr=function(e){$(n,e);var t=ne(n);function n(){var e;return ie(this,n),(e=t.apply(this,arguments)).pendingToken=null,e}return oe(n,[{key:"toJSON",value:function(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}},{key:"_getIdTokenResponse",value:function(e){return hr(e,this.buildRequest())}},{key:"_linkToIdToken",value:function(e,t){var n=this.buildRequest();return n.idToken=t,hr(e,n)}},{key:"_getReauthenticationResolver",value:function(e){var t=this.buildRequest();return t.autoCreate=!1,hr(e,t)}},{key:"buildRequest",value:function(){var e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{var t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Ce(t)}return e}}],[{key:"_fromParams",value:function(e){var t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):Ut("argument-error"),t}},{key:"fromJSON",value:function(e){var t="string"===typeof e?JSON.parse(e):e,r=t.providerId,i=t.signInMethod,a=At(t,["providerId","signInMethod"]);if(!r||!i)return null;var o=new n(r,i);return o.idToken=a.idToken||void 0,o.accessToken=a.accessToken||void 0,o.secret=a.secret,o.nonce=a.nonce,o.pendingToken=a.pendingToken||null,o}}]),n}(nr);function vr(e,t){return yr.apply(this,arguments)}function yr(){return yr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rn(t,"POST","/v1/accounts:sendVerificationCode",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),yr.apply(this,arguments)}function mr(){return mr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithPhoneNumber",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),mr.apply(this,arguments)}function gr(){return gr=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sn(t,"POST","/v1/accounts:signInWithPhoneNumber",nn(t,n));case 2:if(!(r=e.sent).temporaryProof){e.next=5;break}throw hn(t,"account-exists-with-different-credential",r);case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),gr.apply(this,arguments)}var kr=ce({},"USER_NOT_FOUND","user-not-found");function br(){return br=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign(Object.assign({},n),{operation:"REAUTH"}),e.abrupt("return",sn(t,"POST","/v1/accounts:signInWithPhoneNumber",nn(t,r),kr));case 2:case"end":return e.stop()}}),e)}))),br.apply(this,arguments)}var wr=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this,"phone","phone")).params=e,r}return oe(n,[{key:"_getIdTokenResponse",value:function(e){return function(e,t){return mr.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_linkToIdToken",value:function(e,t){return function(e,t){return gr.apply(this,arguments)}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}},{key:"_getReauthenticationResolver",value:function(e){return function(e,t){return br.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_makeVerificationRequest",value:function(){var e=this.params,t=e.temporaryProof,n=e.phoneNumber,r=e.verificationId,i=e.verificationCode;return t&&n?{temporaryProof:t,phoneNumber:n}:{sessionInfo:r,code:i}}},{key:"toJSON",value:function(){var e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}}],[{key:"_fromVerification",value:function(e,t){return new n({verificationId:e,verificationCode:t})}},{key:"_fromTokenResponse",value:function(e,t){return new n({phoneNumber:e,temporaryProof:t})}},{key:"fromJSON",value:function(e){"string"===typeof e&&(e=JSON.parse(e));var t=e,r=t.verificationId,i=t.verificationCode,a=t.phoneNumber,o=t.temporaryProof;return i||r||a||o?new n({verificationId:r,verificationCode:i,phoneNumber:a,temporaryProof:o}):null}}]),n}(nr);var _r=function(){function e(t){var n,r,i,a,o,u;ie(this,e);var s=Ne(Ae(t)),c=null!==(n=s.apiKey)&&void 0!==n?n:null,l=null!==(r=s.oobCode)&&void 0!==r?r:null,f=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=s.mode)&&void 0!==i?i:null);Bt(c&&l&&f,"argument-error"),this.apiKey=c,this.operation=f,this.code=l,this.continueUrl=null!==(a=s.continueUrl)&&void 0!==a?a:null,this.languageCode=null!==(o=s.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(u=s.tenantId)&&void 0!==u?u:null}return oe(e,null,[{key:"parseLink",value:function(t){var n=function(e){var t=Ne(Ae(e)).link,n=t?Ne(Ae(t)).deep_link_id:null,r=Ne(Ae(e)).deep_link_id;return(r?Ne(Ae(r)).link:null)||r||n||t||e}(t);try{return new e(n)}catch(r){return null}}}]),e}();var Er=function(){function e(){ie(this,e),this.providerId=e.PROVIDER_ID}return oe(e,null,[{key:"credential",value:function(e,t){return fr._fromEmailAndPassword(e,t)}},{key:"credentialWithLink",value:function(e,t){var n=_r.parseLink(t);return Bt(n,"argument-error"),fr._fromEmailAndCode(e,n.code,n.tenantId)}}]),e}();Er.PROVIDER_ID="password",Er.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Er.EMAIL_LINK_SIGN_IN_METHOD="emailLink";var Sr=function(){function e(t){ie(this,e),this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}return oe(e,[{key:"setDefaultLanguage",value:function(e){this.defaultLanguageCode=e}},{key:"setCustomParameters",value:function(e){return this.customParameters=e,this}},{key:"getCustomParameters",value:function(){return this.customParameters}}]),e}(),Tr=function(e){$(n,e);var t=ne(n);function n(){var e;return ie(this,n),(e=t.apply(this,arguments)).scopes=[],e}return oe(n,[{key:"addScope",value:function(e){return this.scopes.includes(e)||this.scopes.push(e),this}},{key:"getScopes",value:function(){return se(this.scopes)}}]),n}(Sr),xr=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.call(this,"facebook.com")}return oe(n,null,[{key:"credential",value:function(e){return pr._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(Tr);xr.FACEBOOK_SIGN_IN_METHOD="facebook.com",xr.PROVIDER_ID="facebook.com";var Ir=function(e){$(n,e);var t=ne(n);function n(){var e;return ie(this,n),(e=t.call(this,"google.com")).addScope("profile"),e}return oe(n,null,[{key:"credential",value:function(e,t){return pr._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthIdToken,i=t.oauthAccessToken;if(!r&&!i)return null;try{return n.credential(r,i)}catch(a){return null}}}]),n}(Tr);Ir.GOOGLE_SIGN_IN_METHOD="google.com",Ir.PROVIDER_ID="google.com";var Cr=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.call(this,"github.com")}return oe(n,null,[{key:"credential",value:function(e){return pr._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(Tr);Cr.GITHUB_SIGN_IN_METHOD="github.com",Cr.PROVIDER_ID="github.com";var Nr=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.call(this,"twitter.com")}return oe(n,null,[{key:"credential",value:function(e,t){return pr._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthAccessToken,i=t.oauthTokenSecret;if(!r||!i)return null;try{return n.credential(r,i)}catch(a){return null}}}]),n}(Tr);function Ar(e,t){return Rr.apply(this,arguments)}function Rr(){return Rr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",sn(t,"POST","/v1/accounts:signUp",nn(t,n)));case 1:case"end":return e.stop()}}),e)}))),Rr.apply(this,arguments)}Nr.TWITTER_SIGN_IN_METHOD="twitter.com",Nr.PROVIDER_ID="twitter.com";var Lr=function(){function e(t){ie(this,e),this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}return oe(e,null,[{key:"_fromIdTokenResponse",value:function(){var t=i(h().mark((function t(n,r,i){var a,o,u,s,c=arguments;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=c.length>3&&void 0!==c[3]&&c[3],t.next=3,Dn._fromIdTokenResponse(n,i,a);case 3:return o=t.sent,u=Or(i),s=new e({user:o,providerId:u,_tokenResponse:i,operationType:r}),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()},{key:"_forOperation",value:function(){var t=i(h().mark((function t(n,r,i){var a;return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n._updateTokensIfNecessary(i,!0);case 2:return a=Or(i),t.abrupt("return",new e({user:n,providerId:a,_tokenResponse:i,operationType:r}));case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()}]),e}();function Or(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}var Pr=function(e){$(n,e);var t=ne(n);function n(e,r,i,a){var o,u;return ie(this,n),(o=t.call(this,r.code,r.message)).operationType=i,o.user=a,Object.setPrototypeOf(Y(o),n.prototype),o.customData={appName:e.name,tenantId:null!==(u=e.tenantId)&&void 0!==u?u:void 0,_serverResponse:r.customData._serverResponse,operationType:i},o}return oe(n,null,[{key:"_fromErrorAndOperation",value:function(e,t,r,i){return new n(e,t,r,i)}}]),n}(_e);function Dr(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((function(n){if(n.code==="auth/".concat("multi-factor-auth-required"))throw Pr._fromErrorAndOperation(e,n,t,r);throw n}))}function Mr(e,t){return Ur.apply(this,arguments)}function Ur(){return Ur=i(h().mark((function e(t,n){var r,i,a=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]&&a[2],e.t0=wn,e.t1=t,e.t2=n,e.t3=t.auth,e.next=7,t.getIdToken();case 7:return e.t4=e.sent,e.t5=e.t2._linkToIdToken.call(e.t2,e.t3,e.t4),e.t6=r,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return i=e.sent,e.abrupt("return",Lr._forOperation(t,"link",i));case 14:case"end":return e.stop()}}),e)}))),Ur.apply(this,arguments)}function Vr(e,t){return Fr.apply(this,arguments)}function Fr(){return Fr=i(h().mark((function e(t,n){var r,i,a,o,u,s,c=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>2&&void 0!==c[2]&&c[2],i=t.auth,a="reauthenticate",e.prev=3,e.next=6,wn(t,Dr(i,a,n,t),r);case 6:return Bt((o=e.sent).idToken,i,"internal-error"),Bt(u=bn(o.idToken),i,"internal-error"),s=u.sub,Bt(t.uid===s,i,"user-mismatch"),e.abrupt("return",Lr._forOperation(t,a,o));case 15:throw e.prev=15,e.t0=e.catch(3),(null===e.t0||void 0===e.t0?void 0:e.t0.code)==="auth/".concat("user-not-found")&&Ut(i,"user-mismatch"),e.t0;case 19:case"end":return e.stop()}}),e,null,[[3,15]])}))),Fr.apply(this,arguments)}function jr(e,t){return zr.apply(this,arguments)}function zr(){return zr=i(h().mark((function e(t,n){var r,i,a,o,u=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>2&&void 0!==u[2]&&u[2],i="signIn",e.next=4,Dr(t,i,n);case 4:return a=e.sent,e.next=7,Lr._fromIdTokenResponse(t,i,a);case 7:if(o=e.sent,r){e.next=11;break}return e.next=11,t._updateCurrentUser(o.user);case 11:return e.abrupt("return",o);case 12:case"end":return e.stop()}}),e)}))),zr.apply(this,arguments)}function Br(e,t){return qr.apply(this,arguments)}function qr(){return qr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",jr(er(t),n));case 1:case"end":return e.stop()}}),e)}))),qr.apply(this,arguments)}function Hr(){return Hr=i(h().mark((function e(t,n,r){var i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=er(t),e.next=3,Ar(i,{returnSecureToken:!0,email:n,password:r});case 3:return a=e.sent,e.next=6,Lr._fromIdTokenResponse(i,"signIn",a);case 6:return o=e.sent,e.next=9,i._updateCurrentUser(o.user);case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)}))),Hr.apply(this,arguments)}function Kr(e,t){return Wr.apply(this,arguments)}function Wr(){return Wr=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rn(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}}),e)}))),Wr.apply(this,arguments)}function Gr(e,t){return Qr.apply(this,arguments)}function Qr(){return(Qr=i(h().mark((function e(t,n){var r,i,a,o,u,s,c;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.displayName,i=n.photoURL,void 0!==r||void 0!==i){e.next=3;break}return e.abrupt("return");case 3:return a=Oe(t),e.next=6,a.getIdToken();case 6:return o=e.sent,u={idToken:o,displayName:r,photoUrl:i,returnSecureToken:!0},e.next=10,wn(a,Kr(a.auth,u));case 10:return s=e.sent,a.displayName=s.displayName||null,a.photoURL=s.photoUrl||null,(c=a.providerData.find((function(e){return"password"===e.providerId})))&&(c.displayName=a.displayName,c.photoURL=a.photoURL),e.next=17,a._updateTokensIfNecessary(s);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xr(e,t){return rn(e,"POST","/v2/accounts/mfaEnrollment:start",nn(e,t))}new WeakMap;var Yr="__sak",Jr=function(){function e(t,n){ie(this,e),this.storageRetriever=t,this.type=n}return oe(e,[{key:"_isAvailable",value:function(){try{return this.storage?(this.storage.setItem(Yr,"1"),this.storage.removeItem(Yr),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}},{key:"_set",value:function(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}},{key:"_get",value:function(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}},{key:"_remove",value:function(e){return this.storage.removeItem(e),Promise.resolve()}},{key:"storage",get:function(){return this.storageRetriever()}}]),e}();var $r=function(e){$(n,e);var t=ne(n);function n(){var e;return ie(this,n),(e=t.call(this,(function(){return window.localStorage}),"LOCAL")).boundEventHandler=function(t,n){return e.onStorageEvent(t,n)},e.listeners={},e.localCache={},e.pollTimer=null,e.safariLocalStorageNotSynced=function(){var e=me();return Bn(e)||Qn(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),e.fallbackToPolling=Jn(),e._shouldAllowMigration=!0,e}return oe(n,[{key:"forAllChangedKeys",value:function(e){for(var t=0,n=Object.keys(this.listeners);t<n.length;t++){var r=n[t],i=this.storage.getItem(r),a=this.localCache[r];i!==a&&e(r,a,i)}}},{key:"onStorageEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.key){var r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){var i=this.storage.getItem(r);if(e.newValue!==i)null!==e.newValue?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}var a=function(){var e=t.storage.getItem(r);(n||t.localCache[r]!==e)&&t.notifyListeners(r,e)},o=this.storage.getItem(r);Yn()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(a,10):a()}else this.forAllChangedKeys((function(e,n,r){t.notifyListeners(e,r)}))}},{key:"notifyListeners",value:function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t?JSON.parse(t):t)}}},{key:"startPolling",value:function(){var e=this;this.stopPolling(),this.pollTimer=setInterval((function(){e.forAllChangedKeys((function(t,n,r){e.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)}))}),1e3)}},{key:"stopPolling",value:function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}},{key:"attachListener",value:function(){window.addEventListener("storage",this.boundEventHandler)}},{key:"detachListener",value:function(){window.removeEventListener("storage",this.boundEventHandler)}},{key:"_addListener",value:function(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}},{key:"_removeListener",value:function(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}},{key:"_set",value:function(){var e=i(h().mark((function e(t,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(G(n.prototype),"_set",this).call(this,t,r);case 2:this.localCache[t]=JSON.stringify(r);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_get",value:function(){var e=i(h().mark((function e(t){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(G(n.prototype),"_get",this).call(this,t);case 2:return r=e.sent,this.localCache[t]=JSON.stringify(r),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_remove",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(G(n.prototype),"_remove",this).call(this,t);case 2:delete this.localCache[t];case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Jr);$r.type="LOCAL";var Zr=$r,ei=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.call(this,(function(){return window.sessionStorage}),"SESSION")}return oe(n,[{key:"_addListener",value:function(e,t){}},{key:"_removeListener",value:function(e,t){}}]),n}(Jr);ei.type="SESSION";var ti=ei;function ni(e){return Promise.all(e.map(function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{fulfilled:!0,value:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{fulfilled:!1,reason:e.t0});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()))}var ri=function(){function e(t){ie(this,e),this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}return oe(e,[{key:"isListeningto",value:function(e){return this.eventTarget===e}},{key:"handleEvent",value:function(){var e=i(h().mark((function e(t){var n,r,a,o,u,s,c,l;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(n=t).data,a=r.eventId,o=r.eventType,u=r.data,null===(s=this.handlersMap[o])||void 0===s?void 0:s.size){e.next=5;break}return e.abrupt("return");case 5:return n.ports[0].postMessage({status:"ack",eventId:a,eventType:o}),c=Array.from(s).map(function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(n.origin,u));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=9,ni(c);case 9:l=e.sent,n.ports[0].postMessage({status:"done",eventId:a,eventType:o,response:l});case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_subscribe",value:function(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}},{key:"_unsubscribe",value:function(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}],[{key:"_getInstance",value:function(t){var n=this.receivers.find((function(e){return e.isListeningto(t)}));if(n)return n;var r=new e(t);return this.receivers.push(r),r}}]),e}();function ii(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="",r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}ri.receivers=[];var ai=function(){function e(t){ie(this,e),this.target=t,this.handlers=new Set}return oe(e,[{key:"removeMessageHandler",value:function(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}},{key:"_send",value:function(){var e=i(h().mark((function e(t,n){var r,i,a,o,u=this,s=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>2&&void 0!==s[2]?s[2]:50,i="undefined"!==typeof MessageChannel?new MessageChannel:null){e.next=4;break}throw new Error("connection_unavailable");case 4:return e.abrupt("return",new Promise((function(e,s){var c=ii("",20);i.port1.start();var l=setTimeout((function(){s(new Error("unsupported_event"))}),r);o={messageChannel:i,onMessage:function(t){var n=t;if(n.data.eventId===c)switch(n.data.status){case"ack":clearTimeout(l),a=setTimeout((function(){s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(a),e(n.data.response);break;default:clearTimeout(l),clearTimeout(a),s(new Error("invalid_response"))}}},u.handlers.add(o),i.port1.addEventListener("message",o.onMessage),u.target.postMessage({eventType:t,eventId:c,data:n},[i.port2])})).finally((function(){o&&u.removeMessageHandler(o)})));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();function oi(){return window}function ui(){return"undefined"!==typeof oi().WorkerGlobalScope&&"function"===typeof oi().importScripts}function si(){return ci.apply(this,arguments)}function ci(){return(ci=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===navigator||void 0===navigator?void 0:navigator.serviceWorker){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,navigator.serviceWorker.ready;case 5:return t=e.sent,e.abrupt("return",t.active);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function li(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}var fi="firebaseLocalStorageDb",hi="firebaseLocalStorage",di="fbase_key",pi=function(){function e(t){ie(this,e),this.request=t}return oe(e,[{key:"toPromise",value:function(){var e=this;return new Promise((function(t,n){e.request.addEventListener("success",(function(){t(e.request.result)})),e.request.addEventListener("error",(function(){n(e.request.error)}))}))}}]),e}();function vi(e,t){return e.transaction([hi],t?"readwrite":"readonly").objectStore(hi)}function yi(){var e=indexedDB.deleteDatabase(fi);return new pi(e).toPromise()}function mi(){var e=indexedDB.open(fi,1);return new Promise((function(t,n){e.addEventListener("error",(function(){n(e.error)})),e.addEventListener("upgradeneeded",(function(){var t=e.result;try{t.createObjectStore(hi,{keyPath:di})}catch(r){n(r)}})),e.addEventListener("success",i(h().mark((function n(){var r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((r=e.result).objectStoreNames.contains(hi)){n.next=12;break}return r.close(),n.next=5,yi();case 5:return n.t0=t,n.next=8,mi();case 8:n.t1=n.sent,(0,n.t0)(n.t1),n.next=13;break;case 12:t(r);case 13:case"end":return n.stop()}}),n)}))))}))}function gi(e,t,n){return ki.apply(this,arguments)}function ki(){return ki=i(h().mark((function e(t,n,r){var i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=vi(t,!0).put((ce(i={},di,n),ce(i,"value",r),i)),e.abrupt("return",new pi(a).toPromise());case 2:case"end":return e.stop()}}),e)}))),ki.apply(this,arguments)}function bi(e,t){return wi.apply(this,arguments)}function wi(){return wi=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=vi(t,!1).get(n),e.next=3,new pi(r).toPromise();case 3:return i=e.sent,e.abrupt("return",void 0===i?null:i.value);case 5:case"end":return e.stop()}}),e)}))),wi.apply(this,arguments)}function _i(e,t){var n=vi(e,!0).delete(t);return new pi(n).toPromise()}var Ei=function(){function e(){ie(this,e),this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((function(){}),(function(){}))}return oe(e,[{key:"_openDb",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return",this.db);case 2:return e.next=4,mi();case 4:return this.db=e.sent,e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_withRetries",value:function(){var e=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:return e.prev=2,e.next=5,this._openDb();case 5:return r=e.sent,e.next=8,t(r);case 8:return e.abrupt("return",e.sent);case 11:if(e.prev=11,e.t0=e.catch(2),!(n++>3)){e.next=15;break}throw e.t0;case 15:this.db&&(this.db.close(),this.db=void 0);case 16:e.next=1;break;case 18:case"end":return e.stop()}}),e,this,[[2,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"initializeServiceWorkerMessaging",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ui()?this.initializeReceiver():this.initializeSender());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeReceiver",value:function(){var e=i(h().mark((function e(){var t=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.receiver=ri._getInstance(ui()?self:null),this.receiver._subscribe("keyChanged",function(){var e=i(h().mark((function e(n,r){var i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._poll();case 2:return i=e.sent,e.abrupt("return",{keyProcessed:i.includes(r.key)});case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),this.receiver._subscribe("ping",function(){var e=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",["keyChanged"]);case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeSender",value:function(){var e=i(h().mark((function e(){var t,n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,si();case 2:if(this.activeServiceWorker=e.sent,this.activeServiceWorker){e.next=5;break}return e.abrupt("return");case 5:return this.sender=new ai(this.activeServiceWorker),e.next=8,this.sender._send("ping",{},800);case 8:if(r=e.sent){e.next=11;break}return e.abrupt("return");case 11:(null===(t=r[0])||void 0===t?void 0:t.fulfilled)&&(null===(n=r[0])||void 0===n?void 0:n.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"notifyServiceWorker",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sender&&this.activeServiceWorker&&li()===this.activeServiceWorker){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50);case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:case"end":return e.stop()}}),e,this,[[2,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_isAvailable",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,indexedDB){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,mi();case 5:return t=e.sent,e.next=8,gi(t,Yr,"1");case 8:return e.next=10,_i(t,Yr);case 10:return e.abrupt("return",!0);case 13:e.prev=13,e.t0=e.catch(0);case 15:return e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}()},{key:"_withPendingWrite",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingWrites++,e.prev=1,e.next=4,t();case 4:return e.prev=4,this.pendingWrites--,e.finish(4);case 7:case"end":return e.stop()}}),e,this,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_set",value:function(){var e=i(h().mark((function e(t,n){var r=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r._withRetries((function(e){return gi(e,t,n)}));case 2:return r.localCache[t]=n,e.abrupt("return",r.notifyServiceWorker(t));case 4:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_get",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries((function(e){return bi(e,t)}));case 2:return n=e.sent,this.localCache[t]=n,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_remove",value:function(){var e=i(h().mark((function e(t){var n=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._withRetries((function(e){return _i(e,t)}));case 2:return delete n.localCache[t],e.abrupt("return",n.notifyServiceWorker(t));case 4:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_poll",value:function(){var e=i(h().mark((function e(){var t,n,r,i,a,o,u,s,c,l,f;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries((function(e){var t=vi(e,!1).getAll();return new pi(t).toPromise()}));case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",[]);case 5:if(0===this.pendingWrites){e.next=7;break}return e.abrupt("return",[]);case 7:n=[],r=new Set,i=re(t);try{for(i.s();!(a=i.n()).done;)o=a.value,u=o.fbase_key,s=o.value,r.add(u),JSON.stringify(this.localCache[u])!==JSON.stringify(s)&&(this.notifyListeners(u,s),n.push(u))}catch(h){i.e(h)}finally{i.f()}for(c=0,l=Object.keys(this.localCache);c<l.length;c++)f=l[c],this.localCache[f]&&!r.has(f)&&(this.notifyListeners(f,null),n.push(f));return e.abrupt("return",n);case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"notifyListeners",value:function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t)}}},{key:"startPolling",value:function(){var e=this;this.stopPolling(),this.pollTimer=setInterval(i(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._poll());case 1:case"end":return t.stop()}}),t)}))),800)}},{key:"stopPolling",value:function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}},{key:"_addListener",value:function(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}},{key:"_removeListener",value:function(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}]),e}();Ei.type="LOCAL";var Si=Ei;function Ti(e,t){return rn(e,"POST","/v2/accounts/mfaSignIn:start",nn(e,t))}function xi(e){return new Promise((function(t,n){var r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=function(e){var t=Vt("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}))}function Ii(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}Ii("rcb"),new Jt(3e4,6e4);var Ci="recaptcha";function Ni(e,t,n){return Ai.apply(this,arguments)}function Ai(){return Ai=i(h().mark((function e(t,n,r){var i,a,o,u,s,c,l,f,d;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.verify();case 2:if(a=e.sent,e.prev=3,Bt("string"===typeof a,t,"argument-error"),Bt(r.type===Ci,t,"argument-error"),!("session"in(o="string"===typeof n?{phoneNumber:n}:n))){e.next=26;break}if(u=o.session,!("phoneNumber"in o)){e.next=17;break}return Bt("enroll"===u.type,t,"internal-error"),e.next=13,Xr(t,{idToken:u.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:a}});case 13:return s=e.sent,e.abrupt("return",s.phoneSessionInfo.sessionInfo);case 17:return Bt("signin"===u.type,t,"internal-error"),Bt(c=(null===(i=o.multiFactorHint)||void 0===i?void 0:i.uid)||o.multiFactorUid,t,"missing-multi-factor-info"),e.next=22,Ti(t,{mfaPendingCredential:u.credential,mfaEnrollmentId:c,phoneSignInInfo:{recaptchaToken:a}});case 22:return l=e.sent,e.abrupt("return",l.phoneResponseInfo.sessionInfo);case 24:e.next=31;break;case 26:return e.next=28,vr(t,{phoneNumber:o.phoneNumber,recaptchaToken:a});case 28:return f=e.sent,d=f.sessionInfo,e.abrupt("return",d);case 31:return e.prev=31,r._reset(),e.finish(31);case 34:case"end":return e.stop()}}),e,null,[[3,,31,34]])}))),Ai.apply(this,arguments)}var Ri=function(){function e(t){ie(this,e),this.providerId=e.PROVIDER_ID,this.auth=er(t)}return oe(e,[{key:"verifyPhoneNumber",value:function(e,t){return Ni(this.auth,e,Oe(t))}}],[{key:"credential",value:function(e,t){return wr._fromVerification(e,t)}},{key:"credentialFromResult",value:function(t){var n=t;return e.credentialFromTaggedObject(n)}},{key:"credentialFromError",value:function(t){return e.credentialFromTaggedObject(t.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var n=t.phoneNumber,r=t.temporaryProof;return n&&r?wr._fromTokenResponse(n,r):null}}]),e}();function Li(e,t){return t?Wt(t):(Bt(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Ri.PROVIDER_ID="phone",Ri.PHONE_SIGN_IN_METHOD="phone";var Oi=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this,"custom","custom")).params=e,r}return oe(n,[{key:"_getIdTokenResponse",value:function(e){return hr(e,this._buildIdpRequest())}},{key:"_linkToIdToken",value:function(e,t){return hr(e,this._buildIdpRequest(t))}},{key:"_getReauthenticationResolver",value:function(e){return hr(e,this._buildIdpRequest())}},{key:"_buildIdpRequest",value:function(e){var t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}]),n}(nr);function Pi(e){return jr(e.auth,new Oi(e),e.bypassAuthState)}function Di(e){var t=e.auth,n=e.user;return Bt(n,t,"internal-error"),Vr(n,new Oi(e),e.bypassAuthState)}function Mi(e){return Ui.apply(this,arguments)}function Ui(){return Ui=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.auth,Bt(r=t.user,n,"internal-error"),e.abrupt("return",Mr(r,new Oi(t),t.bypassAuthState));case 3:case"end":return e.stop()}}),e)}))),Ui.apply(this,arguments)}var Vi=function(){function e(t,n,r,i){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];ie(this,e),this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}return oe(e,[{key:"execute",value:function(){var e=this;return new Promise(function(){var t=i(h().mark((function t(n,r){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.pendingPromise={resolve:n,reject:r},t.prev=1,t.next=4,e.resolver._initialize(e.auth);case 4:return e.eventManager=t.sent,t.next=7,e.onExecution();case 7:e.eventManager.registerConsumer(e),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),e.reject(t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"onAuthEvent",value:function(){var e=i(h().mark((function e(t){var n,r,i,a,o,u,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.urlResponse,r=t.sessionId,i=t.postBody,a=t.tenantId,o=t.error,u=t.type,!o){e.next=4;break}return this.reject(o),e.abrupt("return");case 4:return s={auth:this.auth,requestUri:n,sessionId:r,tenantId:a||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState},e.prev=5,e.t0=this,e.next=9,this.getIdpTask(u)(s);case 9:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=16;break;case 13:e.prev=13,e.t2=e.catch(5),this.reject(e.t2);case 16:case"end":return e.stop()}}),e,this,[[5,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"onError",value:function(e){this.reject(e)}},{key:"getIdpTask",value:function(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Pi;case"linkViaPopup":case"linkViaRedirect":return Mi;case"reauthViaPopup":case"reauthViaRedirect":return Di;default:Ut(this.auth,"internal-error")}}},{key:"resolve",value:function(e){Ht(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}},{key:"reject",value:function(e){Ht(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}},{key:"unregisterAndCleanUp",value:function(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}]),e}(),Fi=new Jt(2e3,1e4);var ji=function(e){$(n,e);var t=ne(n);function n(e,r,i,a,o){var u;return ie(this,n),(u=t.call(this,e,r,a,o)).provider=i,u.authWindow=null,u.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=Y(u),u}return oe(n,[{key:"executeNotNull",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.execute();case 2:return Bt(t=e.sent,this.auth,"internal-error"),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onExecution",value:function(){var e=i(h().mark((function e(){var t,n=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ht(1===this.filter.length,"Popup operations only handle one event"),t=ii(),e.next=4,this.resolver._openPopup(this.auth,this.provider,this.filter[0],t);case 4:this.authWindow=e.sent,this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((function(e){n.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(function(e){e||n.reject(Vt(n.auth,"web-storage-unsupported"))})),this.pollUserCancellation();case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"eventId",get:function(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}},{key:"cancel",value:function(){this.reject(Vt(this.auth,"cancelled-popup-request"))}},{key:"cleanUp",value:function(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}},{key:"pollUserCancellation",value:function(){var e=this;!function t(){var n,r;(null===(r=null===(n=e.authWindow)||void 0===n?void 0:n.window)||void 0===r?void 0:r.closed)?e.pollId=window.setTimeout((function(){e.pollId=null,e.reject(Vt(e.auth,"popup-closed-by-user"))}),2e3):e.pollId=window.setTimeout(t,Fi.get())}()}}]),n}(Vi);ji.currentPopupAction=null;var zi=new Map,Bi=function(e){$(n,e);var t=ne(n);function n(e,r){var i,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ie(this,n),(i=t.call(this,e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,a)).eventId=null,i}return oe(n,[{key:"execute",value:function(){var e=i(h().mark((function e(){var t,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=zi.get(this.auth._key())){e.next=21;break}return e.prev=2,e.next=5,qi(this.resolver,this.auth);case 5:if(!e.sent){e.next=12;break}return e.next=9,X(G(n.prototype),"execute",this).call(this);case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=null;case 13:r=e.t0,t=function(){return Promise.resolve(r)},e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),t=function(){return Promise.reject(e.t1)};case 20:zi.set(this.auth._key(),t);case 21:return this.bypassAuthState||zi.set(this.auth._key(),(function(){return Promise.resolve(null)})),e.abrupt("return",t());case 23:case"end":return e.stop()}}),e,this,[[2,17]])})));return function(){return e.apply(this,arguments)}}()},{key:"onAuthEvent",value:function(){var e=i(h().mark((function e(t){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("signInViaRedirect"!==t.type){e.next=4;break}return e.abrupt("return",X(G(n.prototype),"onAuthEvent",this).call(this,t));case 4:if("unknown"!==t.type){e.next=7;break}return this.resolve(null),e.abrupt("return");case 7:if(!t.eventId){e.next=17;break}return e.next=10,this.auth._redirectUserForId(t.eventId);case 10:if(!(r=e.sent)){e.next=16;break}return this.user=r,e.abrupt("return",X(G(n.prototype),"onAuthEvent",this).call(this,t));case 16:this.resolve(null);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onExecution",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"cleanUp",value:function(){}}]),n}(Vi);function qi(e,t){return Hi.apply(this,arguments)}function Hi(){return Hi=i(h().mark((function e(t,n){var r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Qi(n),i=Gi(t),e.next=4,i._isAvailable();case 4:if(e.sent){e.next=6;break}return e.abrupt("return",!1);case 6:return e.next=8,i._get(r);case 8:return e.t0=e.sent,a="true"===e.t0,e.next=12,i._remove(r);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e)}))),Hi.apply(this,arguments)}function Ki(e,t){return Wi.apply(this,arguments)}function Wi(){return Wi=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Gi(t)._set(Qi(n),"true"));case 1:case"end":return e.stop()}}),e)}))),Wi.apply(this,arguments)}function Gi(e){return Wt(e._redirectPersistence)}function Qi(e){return Vn("pendingRedirect",e.config.apiKey,e.name)}function Xi(e,t,n){return function(e,t,n){return Yi.apply(this,arguments)}(e,t,n)}function Yi(){return Yi=i(h().mark((function e(t,n,r){var i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=er(t),jt(t,n,Sr),a=Li(i,r),e.next=5,Ki(a,i);case 5:return e.abrupt("return",a._openRedirect(i,n,"signInViaRedirect"));case 6:case"end":return e.stop()}}),e)}))),Yi.apply(this,arguments)}function Ji(e,t){return $i.apply(this,arguments)}function $i(){return $i=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,er(t)._initializationPromise;case 2:return e.abrupt("return",Zi(t,n,!1));case 3:case"end":return e.stop()}}),e)}))),$i.apply(this,arguments)}function Zi(e,t){return ea.apply(this,arguments)}function ea(){return ea=i(h().mark((function e(t,n){var r,i,a,o,u,s=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>2&&void 0!==s[2]&&s[2],i=er(t),a=Li(i,n),o=new Bi(i,a,r),e.next=6,o.execute();case 6:if(!(u=e.sent)||r){e.next=13;break}return delete u.user._redirectEventId,e.next=11,i._persistUserIfCurrent(u.user);case 11:return e.next=13,i._setRedirectUser(null,n);case 13:return e.abrupt("return",u);case 14:case"end":return e.stop()}}),e)}))),ea.apply(this,arguments)}var ta=function(){function e(t){ie(this,e),this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}return oe(e,[{key:"registerConsumer",value:function(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}},{key:"unregisterConsumer",value:function(e){this.consumers.delete(e)}},{key:"onEvent",value:function(e){var t=this;if(this.hasEventBeenHandled(e))return!1;var n=!1;return this.consumers.forEach((function(r){t.isEventForConsumer(e,r)&&(n=!0,t.sendToConsumer(e,r),t.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ra(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}},{key:"sendToConsumer",value:function(e,t){var n;if(e.error&&!ra(e)){var r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(Vt(this.auth,r))}else t.onAuthEvent(e)}},{key:"isEventForConsumer",value:function(e,t){var n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}},{key:"hasEventBeenHandled",value:function(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(na(e))}},{key:"saveEventToCache",value:function(e){this.cachedEventUids.add(na(e)),this.lastProcessedEventTime=Date.now()}}]),e}();function na(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((function(e){return e})).join("-")}function ra(e){var t=e.type,n=e.error;return"unknown"===t&&(null===n||void 0===n?void 0:n.code)==="auth/".concat("no-auth-event")}function ia(e){return aa.apply(this,arguments)}function aa(){return aa=i(h().mark((function e(t){var n,r=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",rn(t,"GET","/v1/projects",n));case 2:case"end":return e.stop()}}),e)}))),aa.apply(this,arguments)}var oa=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ua=/^https?/;function sa(){return sa=i(h().mark((function e(t){var n,r,i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.emulator){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ia(t);case 4:n=e.sent,r=n.authorizedDomains,i=re(r),e.prev=7,i.s();case 9:if((a=i.n()).done){e.next=20;break}if(o=a.value,e.prev=11,!ca(o)){e.next=14;break}return e.abrupt("return");case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(11);case 18:e.next=9;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(7),i.e(e.t1);case 25:return e.prev=25,i.f(),e.finish(25);case 28:Ut(t,"unauthorized-domain");case 29:case"end":return e.stop()}}),e,null,[[7,22,25,28],[11,16]])}))),sa.apply(this,arguments)}function ca(e){var t=Qt(),n=new URL(t),r=n.protocol,i=n.hostname;if(e.startsWith("chrome-extension://")){var a=new URL(e);return""===a.hostname&&""===i?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&a.hostname===i}if(!ua.test(r))return!1;if(oa.test(e))return i===e;var o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(i)}var la=new Jt(3e4,6e4);function fa(){var e=oi().___jsl;if(null===e||void 0===e?void 0:e.H)for(var t=0,n=Object.keys(e.H);t<n.length;t++){var r=n[t];if(e.H[r].r=e.H[r].r||[],e.H[r].L=e.H[r].L||[],e.H[r].r=se(e.H[r].L),e.CP)for(var i=0;i<e.CP.length;i++)e.CP[i]=null}}var ha=null;function da(e){return ha=ha||function(e){return new Promise((function(t,n){var r,i,a;function o(){fa(),gapi.load("gapi.iframes",{callback:function(){t(gapi.iframes.getContext())},ontimeout:function(){fa(),n(Vt(e,"network-request-failed"))},timeout:la.get()})}if(null===(i=null===(r=oi().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(a=oi().gapi)||void 0===a?void 0:a.load)){var u=Ii("iframefcb");return oi()[u]=function(){gapi.load?o():n(Vt(e,"network-request-failed"))},xi("https://apis.google.com/js/api.js?onload=".concat(u)).catch((function(e){return n(e)}))}o()}})).catch((function(e){throw ha=null,e}))}(e),ha}var pa=new Jt(5e3,15e3),va={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ya=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ma(e){var t=e.config;Bt(t.authDomain,e,"auth-domain-config-required");var n=t.emulator?$t(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),r={apiKey:t.apiKey,appName:e.name,v:dt},i=ya.get(e.config.apiHost);i&&(r.eid=i);var a=e._getFrameworks();return a.length&&(r.fw=a.join(",")),"".concat(n,"?").concat(Ce(r).slice(1))}function ga(e){return ka.apply(this,arguments)}function ka(){return ka=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,da(t);case 2:return n=e.sent,Bt(r=oi().gapi,t,"internal-error"),e.abrupt("return",n.open({where:document.body,url:ma(t),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:va,dontclear:!0},(function(e){return new Promise(function(){var n=i(h().mark((function n(r,i){var a,o,u;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=function(){oi().clearTimeout(o),r(e)},n.next=3,e.restyle({setHideOnLeave:!1});case 3:a=Vt(t,"network-request-failed"),o=oi().setTimeout((function(){i(a)}),pa.get()),e.ping(u).then(u,(function(){i(a)}));case 6:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())})));case 6:case"end":return e.stop()}}),e)}))),ka.apply(this,arguments)}var ba={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},wa="_blank",_a="http://localhost",Ea=function(){function e(t){ie(this,e),this.window=t,this.associatedEvent=null}return oe(e,[{key:"close",value:function(){if(this.window)try{this.window.close()}catch(e){}}}]),e}();function Sa(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600,a=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),u="",s=Object.assign(Object.assign({},ba),{width:r.toString(),height:i.toString(),top:a,left:o}),l=me().toLowerCase();n&&(u=qn(l)?wa:n),zn(l)&&(t=t||_a,s.scrollbars="yes");var f=Object.entries(s).reduce((function(e,t){var n=c(t,2),r=n[0],i=n[1];return"".concat(e).concat(r,"=").concat(i,",")}),"");if(Xn(l)&&"_self"!==u)return Ta(t||"",u),new Ea(null);var h=window.open(t||"",u,f);Bt(h,e,"popup-blocked");try{h.focus()}catch(d){}return new Ea(h)}function Ta(e,t){var n=document.createElement("a");n.href=e,n.target=t;var r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}var xa="__/auth/handler",Ia="emulator/auth/handler";function Ca(e,t,n,r,i,a){Bt(e.config.authDomain,e,"auth-domain-config-required"),Bt(e.config.apiKey,e,"invalid-api-key");var o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:dt,eventId:i};if(t instanceof Sr){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(var u=0,s=Object.entries(a||{});u<s.length;u++){var l=c(s[u],2),f=l[0],h=l[1];o[f]=h}}if(t instanceof Tr){var d=t.getScopes().filter((function(e){return""!==e}));d.length>0&&(o.scopes=d.join(","))}e.tenantId&&(o.tid=e.tenantId);for(var p=o,v=0,y=Object.keys(p);v<y.length;v++){var m=y[v];void 0===p[m]&&delete p[m]}return"".concat(function(e){var t=e.config;if(!t.emulator)return"https://".concat(t.authDomain,"/").concat(xa);return $t(t,Ia)}(e),"?").concat(Ce(p).slice(1))}var Na="webStorageSupport",Aa=function(){function e(){ie(this,e),this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ti,this._completeRedirectFn=Zi}return oe(e,[{key:"_openPopup",value:function(){var e=i(h().mark((function e(t,n,r,i){var a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ht(null===(a=this.eventManagers[t._key()])||void 0===a?void 0:a.manager,"_initialize() not called before _openPopup()"),o=Ca(t,n,r,Qt(),i),e.abrupt("return",Sa(t,o,ii()));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"_openRedirect",value:function(){var e=i(h().mark((function e(t,n,r,i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._originValidation(t);case 2:return a=Ca(t,n,r,Qt(),i),oi().location.href=a,e.abrupt("return",new Promise((function(){})));case 4:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"_initialize",value:function(e){var t=this,n=e._key();if(this.eventManagers[n]){var r=this.eventManagers[n],i=r.manager,a=r.promise;return i?Promise.resolve(i):(Ht(a,"If manager is not set, promise should be"),a)}var o=this.initAndGetManager(e);return this.eventManagers[n]={promise:o},o.catch((function(){delete t.eventManagers[n]})),o}},{key:"initAndGetManager",value:function(){var e=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ga(t);case 2:return n=e.sent,r=new ta(t),n.register("authEvent",(function(e){return Bt(null===e||void 0===e?void 0:e.authEvent,t,"invalid-auth-event"),{status:r.onEvent(e.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_isIframeWebStorageSupported",value:function(e,t){this.iframes[e._key()].send(Na,{type:Na},(function(n){var r,i=null===(r=null===n||void 0===n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==i&&t(!!i),Ut(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}},{key:"_originValidation",value:function(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function(e){return sa.apply(this,arguments)}(e)),this.originValidationPromises[t]}},{key:"_shouldInitProactively",get:function(){return Jn()||Bn()||Qn()}}]),e}(),Ra=Aa,La=function(){function e(t){ie(this,e),this.factorId=t}return oe(e,[{key:"_process",value:function(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return qt("unexpected MultiFactorSessionType")}}}]),e}(),Oa=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this,"phone")).credential=e,r}return oe(n,[{key:"_finalizeEnroll",value:function(e,t,n){return function(e,t){return rn(e,"POST","/v2/accounts/mfaEnrollment:finalize",nn(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},{key:"_finalizeSignIn",value:function(e,t){return function(e,t){return rn(e,"POST","/v2/accounts/mfaSignIn:finalize",nn(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}],[{key:"_fromCredential",value:function(e){return new n(e)}}]),n}(La);(function(){function e(){ie(this,e)}return oe(e,null,[{key:"assertion",value:function(e){return Oa._fromCredential(e)}}]),e}()).FACTOR_ID="phone";var Pa,Da="@firebase/auth",Ma="0.19.11",Ua=function(){function e(t){ie(this,e),this.auth=t,this.internalListeners=new Map}return oe(e,[{key:"getUid",value:function(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}},{key:"getToken",value:function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.assertAuthConfigured(),e.next=3,this.auth._initializationPromise;case 3:if(this.auth.currentUser){e.next=5;break}return e.abrupt("return",null);case 5:return e.next=7,this.auth.currentUser.getIdToken(t);case 7:return n=e.sent,e.abrupt("return",{accessToken:n});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"addAuthTokenListener",value:function(e){if(this.assertAuthConfigured(),!this.internalListeners.has(e)){var t=this.auth.onIdTokenChanged((function(t){var n;e((null===(n=t)||void 0===n?void 0:n.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}}},{key:"removeAuthTokenListener",value:function(e){this.assertAuthConfigured();var t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}},{key:"assertAuthConfigured",value:function(){Bt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}},{key:"updateProactiveRefresh",value:function(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}]),e}();function Va(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt(),t=ct(e,"auth");return t.isInitialized()?t.getImmediate():Gt(e,{popupRedirectResolver:Ra,persistence:[Si,Zr,ti]})}Pa="Browser",st(new Fe("auth",(function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),a=r.options,o=a.apiKey,u=a.authDomain;return function(e,t){Bt(o&&!o.includes(":"),"invalid-api-key",{appName:e.name}),Bt(!(null===u||void 0===u?void 0:u.includes(":")),"argument-error",{appName:e.name});var r={apiKey:o,authDomain:u,clientPlatform:Pa,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:$n(Pa)},i=new Zn(e,t,r);return function(e,t){var n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Wt);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(i,n),i}(r,i)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((function(e,t,n){e.getProvider("auth-internal").initialize()}))),st(new Fe("auth-internal",(function(e){return function(e){return new Ua(e)}(er(e.getProvider("auth").getImmediate()))}),"PRIVATE").setInstantiationMode("EXPLICIT")),vt(Da,Ma,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Pa)),vt(Da,Ma,"esm2017");vt("firebase","9.6.10","app");var Fa,ja="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{},za={},Ba=Ba||{},qa=ja||self;function Ha(){}function Ka(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function Wa(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var Ga="closure_uid_"+(1e9*Math.random()>>>0),Qa=0;function Xa(e,t,n){return e.call.apply(e.bind,arguments)}function Ya(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function Ja(e,t,n){return(Ja=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?Xa:Ya).apply(null,arguments)}function $a(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function Za(e,t){function n(){}n.prototype=t.prototype,e.Z=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Vb=function(e,n,r){for(var i=Array(arguments.length-2),a=2;a<arguments.length;a++)i[a-2]=arguments[a];return t.prototype[n].apply(e,i)}}function eo(){this.s=this.s,this.o=this.o}var to={};eo.prototype.s=!1,eo.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0)){var e=function(e){return Object.prototype.hasOwnProperty.call(e,Ga)&&e[Ga]||(e[Ga]=++Qa)}(this);delete to[e]}},eo.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var no=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"===typeof e)return"string"!==typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},ro=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"===typeof e?e.split(""):e,a=0;a<r;a++)a in i&&t.call(n,i[a],a,e)};function io(e){return Array.prototype.concat.apply([],arguments)}function ao(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function oo(e){return/^[\s\xa0]*$/.test(e)}var uo,so=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function co(e,t){return-1!=e.indexOf(t)}function lo(e,t){return e<t?-1:e>t?1:0}e:{var fo=qa.navigator;if(fo){var ho=fo.userAgent;if(ho){uo=ho;break e}}uo=""}function po(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function vo(e){var t={};for(var n in e)t[n]=e[n];return t}var yo="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function mo(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var a=0;a<yo.length;a++)n=yo[a],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function go(e){return go[" "](e),e}go[" "]=Ha;var ko,bo=co(uo,"Opera"),wo=co(uo,"Trident")||co(uo,"MSIE"),_o=co(uo,"Edge"),Eo=_o||wo,So=co(uo,"Gecko")&&!(co(uo.toLowerCase(),"webkit")&&!co(uo,"Edge"))&&!(co(uo,"Trident")||co(uo,"MSIE"))&&!co(uo,"Edge"),To=co(uo.toLowerCase(),"webkit")&&!co(uo,"Edge");function xo(){var e=qa.document;return e?e.documentMode:void 0}e:{var Io="",Co=function(){var e=uo;return So?/rv:([^\);]+)(\)|;)/.exec(e):_o?/Edge\/([\d\.]+)/.exec(e):wo?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):To?/WebKit\/(\S+)/.exec(e):bo?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(Co&&(Io=Co?Co[1]:""),wo){var No=xo();if(null!=No&&No>parseFloat(Io)){ko=String(No);break e}}ko=Io}var Ao,Ro={};function Lo(){return function(e){var t=Ro;return Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=e(9)}((function(){for(var e=0,t=so(String(ko)).split("."),n=so("9").split("."),r=Math.max(t.length,n.length),i=0;0==e&&i<r;i++){var a=t[i]||"",o=n[i]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],0==a[0].length&&0==o[0].length)break;e=lo(0==a[1].length?0:parseInt(a[1],10),0==o[1].length?0:parseInt(o[1],10))||lo(0==a[2].length,0==o[2].length)||lo(a[2],o[2]),a=a[3],o=o[3]}while(0==e)}return 0<=e}))}if(qa.document&&wo){var Oo=xo();Ao=Oo||(parseInt(ko,10)||void 0)}else Ao=void 0;var Po=Ao,Do=function(){if(!qa.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{qa.addEventListener("test",Ha,t),qa.removeEventListener("test",Ha,t)}catch(n){}return e}();function Mo(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}function Uo(e,t){if(Mo.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(So){e:{try{go(t.nodeName);var i=!0;break e}catch(a){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"===typeof e.pointerType?e.pointerType:Vo[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Uo.Z.h.call(this)}}Mo.prototype.h=function(){this.defaultPrevented=!0},Za(Uo,Mo);var Vo={2:"touch",3:"pen",4:"mouse"};Uo.prototype.h=function(){Uo.Z.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var Fo="closure_listenable_"+(1e6*Math.random()|0),jo=0;function zo(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ia=i,this.key=++jo,this.ca=this.fa=!1}function Bo(e){e.ca=!0,e.listener=null,e.proxy=null,e.src=null,e.ia=null}function qo(e){this.src=e,this.g={},this.h=0}function Ho(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],a=no(i,t);(r=0<=a)&&Array.prototype.splice.call(i,a,1),r&&(Bo(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function Ko(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i];if(!a.ca&&a.listener==t&&a.capture==!!n&&a.ia==r)return i}return-1}qo.prototype.add=function(e,t,n,r,i){var a=e.toString();(e=this.g[a])||(e=this.g[a]=[],this.h++);var o=Ko(e,t,r,i);return-1<o?(t=e[o],n||(t.fa=!1)):((t=new zo(t,this.src,a,!!r,i)).fa=n,e.push(t)),t};var Wo="closure_lm_"+(1e6*Math.random()|0),Go={};function Qo(e,t,n,r,i){if(r&&r.once)return Yo(e,t,n,r,i);if(Array.isArray(t)){for(var a=0;a<t.length;a++)Qo(e,t[a],n,r,i);return null}return n=ru(n),e&&e[Fo]?e.N(t,n,Wa(r)?!!r.capture:!!r,i):Xo(e,t,n,!1,r,i)}function Xo(e,t,n,r,i,a){if(!t)throw Error("Invalid event type");var o=Wa(i)?!!i.capture:!!i,u=tu(e);if(u||(e[Wo]=u=new qo(e)),(n=u.add(t,n,r,o,a)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}var t=eu;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)Do||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(Zo(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function Yo(e,t,n,r,i){if(Array.isArray(t)){for(var a=0;a<t.length;a++)Yo(e,t[a],n,r,i);return null}return n=ru(n),e&&e[Fo]?e.O(t,n,Wa(r)?!!r.capture:!!r,i):Xo(e,t,n,!0,r,i)}function Jo(e,t,n,r,i){if(Array.isArray(t))for(var a=0;a<t.length;a++)Jo(e,t[a],n,r,i);else r=Wa(r)?!!r.capture:!!r,n=ru(n),e&&e[Fo]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=Ko(a=e.g[t],n,r,i))&&(Bo(a[n]),Array.prototype.splice.call(a,n,1),0==a.length&&(delete e.g[t],e.h--)))):e&&(e=tu(e))&&(t=e.g[t.toString()],e=-1,t&&(e=Ko(t,n,r,i)),(n=-1<e?t[e]:null)&&$o(n))}function $o(e){if("number"!==typeof e&&e&&!e.ca){var t=e.src;if(t&&t[Fo])Ho(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(Zo(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=tu(t))?(Ho(n,e),0==n.h&&(n.src=null,t[Wo]=null)):Bo(e)}}}function Zo(e){return e in Go?Go[e]:Go[e]="on"+e}function eu(e,t){if(e.ca)e=!0;else{t=new Uo(t,this);var n=e.listener,r=e.ia||e.src;e.fa&&$o(e),e=n.call(r,t)}return e}function tu(e){return(e=e[Wo])instanceof qo?e:null}var nu="__closure_events_fn_"+(1e9*Math.random()>>>0);function ru(e){return"function"===typeof e?e:(e[nu]||(e[nu]=function(t){return e.handleEvent(t)}),e[nu])}function iu(){eo.call(this),this.i=new qo(this),this.P=this,this.I=null}function au(e,t){var n,r=e.I;if(r)for(n=[];r;r=r.I)n.push(r);if(e=e.P,r=t.type||t,"string"===typeof t)t=new Mo(t,e);else if(t instanceof Mo)t.target=t.target||e;else{var i=t;mo(t=new Mo(r,e),i)}if(i=!0,n)for(var a=n.length-1;0<=a;a--){var o=t.g=n[a];i=ou(o,r,!0,t)&&i}if(i=ou(o=t.g=e,r,!0,t)&&i,i=ou(o,r,!1,t)&&i,n)for(a=0;a<n.length;a++)i=ou(o=t.g=n[a],r,!1,t)&&i}function ou(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,a=0;a<t.length;++a){var o=t[a];if(o&&!o.ca&&o.capture==n){var u=o.listener,s=o.ia||o.src;o.fa&&Ho(e.i,o),i=!1!==u.call(s,r)&&i}}return i&&!r.defaultPrevented}Za(iu,eo),iu.prototype[Fo]=!0,iu.prototype.removeEventListener=function(e,t,n,r){Jo(this,e,t,n,r)},iu.prototype.M=function(){if(iu.Z.M.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)Bo(n[r]);delete t.g[e],t.h--}}this.I=null},iu.prototype.N=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},iu.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var uu=qa.JSON.stringify;function su(){var e=yu,t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var cu,lu=function(){function e(){ie(this,e),this.h=this.g=null}return oe(e,[{key:"add",value:function(e,t){var n=fu.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}}]),e}(),fu=new(function(){function e(t,n){ie(this,e),this.i=t,this.j=n,this.h=0,this.g=null}return oe(e,[{key:"get",value:function(){var e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}]),e}())((function(){return new hu}),(function(e){return e.reset()})),hu=function(){function e(){ie(this,e),this.next=this.g=this.h=null}return oe(e,[{key:"set",value:function(e,t){this.h=e,this.g=t,this.next=null}},{key:"reset",value:function(){this.next=this.g=this.h=null}}]),e}();function du(e){qa.setTimeout((function(){throw e}),0)}function pu(e,t){cu||function(){var e=qa.Promise.resolve(void 0);cu=function(){e.then(mu)}}(),vu||(cu(),vu=!0),yu.add(e,t)}var vu=!1,yu=new lu;function mu(){for(var e;e=su();){try{e.h.call(e.g)}catch(n){du(n)}var t=fu;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}vu=!1}function gu(e,t){iu.call(this),this.h=e||1,this.g=t||qa,this.j=Ja(this.kb,this),this.l=Date.now()}function ku(e){e.da=!1,e.S&&(e.g.clearTimeout(e.S),e.S=null)}function bu(e,t,n){if("function"===typeof e)n&&(e=Ja(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=Ja(e.handleEvent,e)}return 2147483647<Number(t)?-1:qa.setTimeout(e,t||0)}function wu(e){e.g=bu((function(){e.g=null,e.i&&(e.i=!1,wu(e))}),e.j);var t=e.h;e.h=null,e.m.apply(null,t)}Za(gu,iu),(Fa=gu.prototype).da=!1,Fa.S=null,Fa.kb=function(){if(this.da){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-e):(this.S&&(this.g.clearTimeout(this.S),this.S=null),au(this,"tick"),this.da&&(ku(this),this.start()))}},Fa.start=function(){this.da=!0,this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now())},Fa.M=function(){gu.Z.M.call(this),ku(this),delete this.g};var _u=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this)).m=e,i.j=r,i.h=null,i.i=!1,i.g=null,i}return oe(n,[{key:"l",value:function(e){this.h=arguments,this.g?this.i=!0:wu(this)}},{key:"M",value:function(){X(G(n.prototype),"M",this).call(this),this.g&&(qa.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}]),n}(eo);function Eu(e){eo.call(this),this.h=e,this.g={}}Za(Eu,eo);var Su=[];function Tu(e,t,n,r){Array.isArray(n)||(n&&(Su[0]=n.toString()),n=Su);for(var i=0;i<n.length;i++){var a=Qo(t,n[i],r||e.handleEvent,!1,e.h||e);if(!a)break;e.g[a.key]=a}}function xu(e){po(e.g,(function(e,t){this.g.hasOwnProperty(t)&&$o(e)}),e),e.g={}}function Iu(){this.g=!0}function Cu(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var o=1;o<i.length;o++)i[o]=""}}}return uu(n)}catch(u){return t}}(e,n)+(r?" "+r:"")}))}Eu.prototype.M=function(){Eu.Z.M.call(this),xu(this)},Eu.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Iu.prototype.Aa=function(){this.g=!1},Iu.prototype.info=function(){};var Nu={},Au=null;function Ru(){return Au=Au||new iu}function Lu(e){Mo.call(this,Nu.Ma,e)}function Ou(e){var t=Ru();au(t,new Lu(t,e))}function Pu(e,t){Mo.call(this,Nu.STAT_EVENT,e),this.stat=t}function Du(e){var t=Ru();au(t,new Pu(t,e))}function Mu(e,t){Mo.call(this,Nu.Na,e),this.size=t}function Uu(e,t){if("function"!==typeof e)throw Error("Fn must not be null and must be a function");return qa.setTimeout((function(){e()}),t)}Nu.Ma="serverreachability",Za(Lu,Mo),Nu.STAT_EVENT="statevent",Za(Pu,Mo),Nu.Na="timingevent",Za(Mu,Mo);var Vu={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9},Fu={qb:"complete",Mb:"success",Ka:"error",Ja:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",tb:"downloadprogress",Ub:"uploadprogress"};function ju(){}function zu(e){return e.h||(e.h=e.i())}function Bu(){}ju.prototype.h=null;var qu,Hu={OPEN:"a",pb:"b",Ka:"c",Bb:"d"};function Ku(){Mo.call(this,"d")}function Wu(){Mo.call(this,"c")}function Gu(){}function Qu(e,t,n,r){this.l=e,this.j=t,this.m=n,this.X=r||1,this.V=new Eu(this),this.P=Yu,e=Eo?125:void 0,this.W=new gu(e),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.N=-1,this.I=!1,this.O=0,this.L=null,this.aa=this.J=this.$=this.U=!1,this.h=new Xu}function Xu(){this.i=null,this.g="",this.h=!1}Za(Ku,Mo),Za(Wu,Mo),Za(Gu,ju),Gu.prototype.g=function(){return new XMLHttpRequest},Gu.prototype.i=function(){return{}},qu=new Gu;var Yu=45e3,Ju={},$u={};function Zu(e,t,n){e.K=1,e.v=_s(ys(t)),e.s=n,e.U=!0,es(e,null)}function es(e,t){e.F=Date.now(),is(e),e.A=ys(e.v);var n=e.A,r=e.X;Array.isArray(r)||(r=[String(r)]),Ds(n.h,"t",r),e.C=0,n=e.l.H,e.h=new Xu,e.g=Uc(e.l,n?t:null,!e.s),0<e.O&&(e.L=new _u(Ja(e.Ia,e,e.g),e.O)),Tu(e.V,e.g,"readystatechange",e.gb),t=e.H?vo(e.H):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.s,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),Ou(1),function(e,t,n,r,i,a){e.info((function(){if(e.g)if(a)for(var o="",u=a.split("&"),s=0;s<u.length;s++){var c=u[s].split("=");if(1<c.length){var l=c[0];c=c[1];var f=l.split("_");o=2<=f.length&&"type"==f[1]?o+(l+"=")+c+"&":o+(l+"=redacted&")}}else o=null;else o=a;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.j,e.u,e.A,e.m,e.X,e.s)}function ts(e){return!!e.g&&("GET"==e.u&&2!=e.K&&e.l.Ba)}function ns(e,t,n){for(var r,i=!0;!e.I&&e.C<n.length;){if((r=rs(e,n))==$u){4==t&&(e.o=4,Du(14),i=!1),Cu(e.j,e.m,null,"[Incomplete Response]");break}if(r==Ju){e.o=4,Du(15),Cu(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}Cu(e.j,e.m,r,null),cs(e,r)}ts(e)&&r!=$u&&r!=Ju&&(e.h.g="",e.C=0),4!=t||0!=n.length||e.h.h||(e.o=1,Du(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.aa&&(e.aa=!0,(t=e.l).g==e&&t.$&&!t.L&&(t.h.info("Great, no buffering proxy detected. Bytes received: "+n.length),Nc(t),t.L=!0,Du(11))):(Cu(e.j,e.m,n,"[Invalid Chunked Response]"),ss(e),us(e))}function rs(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?$u:(n=Number(t.substring(n,r)),isNaN(n)?Ju:(r+=1)+n>t.length?$u:(t=t.substr(r,n),e.C=r+n,t))}function is(e){e.Y=Date.now()+e.P,as(e,e.P)}function as(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Uu(Ja(e.eb,e),t)}function os(e){e.B&&(qa.clearTimeout(e.B),e.B=null)}function us(e){0==e.l.G||e.I||Lc(e.l,e)}function ss(e){os(e);var t=e.L;t&&"function"==typeof t.na&&t.na(),e.L=null,ku(e.W),xu(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.na())}function cs(e,t){try{var n=e.l;if(0!=n.G&&(n.g==e||qs(n.i,e)))if(n.I=e.N,!e.J&&qs(n.i,e)&&3==n.G){try{var r=n.Ca.g.parse(t)}catch(a){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;Rc(n),bc(n)}Cc(n),Du(18)}}else n.ta=i[1],0<n.ta-n.U&&37500>i[2]&&n.N&&0==n.A&&!n.v&&(n.v=Uu(Ja(n.ab,n),6e3));if(1>=Bs(n.i)&&n.ka){try{n.ka()}catch(a){}n.ka=void 0}}else Pc(n,11)}else if((e.J||n.g==e)&&Rc(n),!oo(t))for(i=n.Ca.g.parse(t),t=0;t<i.length;t++){var a=i[t];if(n.U=a[0],a=a[1],2==n.G)if("c"==a[0]){n.J=a[1],n.la=a[2];var o=a[3];null!=o&&(n.ma=o,n.h.info("VER="+n.ma));var u=a[4];null!=u&&(n.za=u,n.h.info("SVER="+n.za));var s=a[5];null!=s&&"number"===typeof s&&0<s&&(r=1.5*s,n.K=r,n.h.info("backChannelRequestTimeoutMs_="+r)),r=n;var c=e.g;if(c){var l=c.g?c.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(l){var f=r.i;!f.g&&(co(l,"spdy")||co(l,"quic")||co(l,"h2"))&&(f.j=f.l,f.g=new Set,f.h&&(Hs(f,f.h),f.h=null))}if(r.D){var h=c.g?c.g.getResponseHeader("X-HTTP-Session-Id"):null;h&&(r.sa=h,ws(r.F,r.D,h))}}n.G=3,n.j&&n.j.xa(),n.$&&(n.O=Date.now()-e.F,n.h.info("Handshake RTT: "+n.O+"ms"));var d=e;if((r=n).oa=Mc(r,r.H?r.la:null,r.W),d.J){Ks(r.i,d);var p=d,v=r.K;v&&p.setTimeout(v),p.B&&(os(p),is(p)),r.g=d}else Ic(r);0<n.l.length&&Ec(n)}else"stop"!=a[0]&&"close"!=a[0]||Pc(n,7);else 3==n.G&&("stop"==a[0]||"close"==a[0]?"stop"==a[0]?Pc(n,7):kc(n):"noop"!=a[0]&&n.j&&n.j.wa(a),n.A=0)}Ou(4)}catch(a){}}function ls(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(Ka(e)||"string"===typeof e)ro(e,t,void 0);else{if(e.T&&"function"==typeof e.T)var n=e.T();else if(e.R&&"function"==typeof e.R)n=void 0;else if(Ka(e)||"string"===typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;r=function(e){if(e.R&&"function"==typeof e.R)return e.R();if("string"===typeof e)return e.split("");if(Ka(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length;for(var a=0;a<i;a++)t.call(void 0,r[a],n&&n[a],e)}}function fs(e,t){this.h={},this.g=[],this.i=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof fs)for(n=e.T(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function hs(e){if(e.i!=e.g.length){for(var t=0,n=0;t<e.g.length;){var r=e.g[t];ds(e.h,r)&&(e.g[n++]=r),t++}e.g.length=n}if(e.i!=e.g.length){var i={};for(n=t=0;t<e.g.length;)ds(i,r=e.g[t])||(e.g[n++]=r,i[r]=1),t++;e.g.length=n}}function ds(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(Fa=Qu.prototype).setTimeout=function(e){this.P=e},Fa.gb=function(e){e=e.target;var t=this.L;t&&3==pc(e)?t.l():this.Ia(e)},Fa.Ia=function(e){try{if(e==this.g)e:{var t=pc(this.g),n=this.g.Da(),r=this.g.ba();if(!(3>t)&&(3!=t||Eo||this.g&&(this.h.h||this.g.ga()||vc(this.g)))){this.I||4!=t||7==n||Ou(8==n||0>=r?3:2),os(this);var i=this.g.ba();this.N=i;t:if(ts(this)){var a=vc(this.g);e="";var o=a.length,u=4==pc(this.g);if(!this.h.i){if("undefined"===typeof TextDecoder){ss(this),us(this);var s="";break t}this.h.i=new qa.TextDecoder}for(n=0;n<o;n++)this.h.h=!0,e+=this.h.i.decode(a[n],{stream:u&&n==o-1});a.splice(0,o),this.h.g+=e,this.C=0,s=this.h.g}else s=this.g.ga();if(this.i=200==i,function(e,t,n,r,i,a,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+a+" "+o}))}(this.j,this.u,this.A,this.m,this.X,t,i),this.i){if(this.$&&!this.J){t:{if(this.g){var c,l=this.g;if((c=l.g?l.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!oo(c)){var f=c;break t}}f=null}if(!(i=f)){this.i=!1,this.o=3,Du(12),ss(this),us(this);break e}Cu(this.j,this.m,i,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,cs(this,i)}this.U?(ns(this,t,s),Eo&&this.i&&3==t&&(Tu(this.V,this.W,"tick",this.fb),this.W.start())):(Cu(this.j,this.m,s,null),cs(this,s)),4==t&&ss(this),this.i&&!this.I&&(4==t?Lc(this.l,this):(this.i=!1,is(this)))}else 400==i&&0<s.indexOf("Unknown SID")?(this.o=3,Du(12)):(this.o=0,Du(13)),ss(this),us(this)}}}catch(t){}},Fa.fb=function(){if(this.g){var e=pc(this.g),t=this.g.ga();this.C<t.length&&(os(this),ns(this,e,t),this.i&&4!=e&&is(this))}},Fa.cancel=function(){this.I=!0,ss(this)},Fa.eb=function(){this.B=null;var e=Date.now();0<=e-this.Y?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.j,this.A),2!=this.K&&(Ou(3),Du(17)),ss(this),this.o=2,us(this)):as(this,this.Y-e)},(Fa=fs.prototype).R=function(){hs(this);for(var e=[],t=0;t<this.g.length;t++)e.push(this.h[this.g[t]]);return e},Fa.T=function(){return hs(this),this.g.concat()},Fa.get=function(e,t){return ds(this.h,e)?this.h[e]:t},Fa.set=function(e,t){ds(this.h,e)||(this.i++,this.g.push(e)),this.h[e]=t},Fa.forEach=function(e,t){for(var n=this.T(),r=0;r<n.length;r++){var i=n[r],a=this.get(i);e.call(t,a,i,this)}};var ps=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function vs(e,t){if(this.i=this.s=this.j="",this.m=null,this.o=this.l="",this.g=!1,e instanceof vs){this.g=void 0!==t?t:e.g,ms(this,e.j),this.s=e.s,gs(this,e.i),ks(this,e.m),this.l=e.l,t=e.h;var n=new Rs;n.i=t.i,t.g&&(n.g=new fs(t.g),n.h=t.h),bs(this,n),this.o=e.o}else e&&(n=String(e).match(ps))?(this.g=!!t,ms(this,n[1]||"",!0),this.s=Es(n[2]||""),gs(this,n[3]||"",!0),ks(this,n[4]),this.l=Es(n[5]||"",!0),bs(this,n[6]||"",!0),this.o=Es(n[7]||"")):(this.g=!!t,this.h=new Rs(null,this.g))}function ys(e){return new vs(e)}function ms(e,t,n){e.j=n?Es(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function gs(e,t,n){e.i=n?Es(t,!0):t}function ks(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function bs(e,t,n){t instanceof Rs?(e.h=t,function(e,t){t&&!e.j&&(Ls(e),e.i=null,e.g.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Os(this,t),Ds(this,n,e))}),e)),e.j=t}(e.h,e.g)):(n||(t=Ss(t,Ns)),e.h=new Rs(t,e.g))}function ws(e,t,n){e.h.set(t,n)}function _s(e){return ws(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function Es(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Ss(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,Ts),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Ts(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}vs.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Ss(t,xs,!0),":");var n=this.i;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Ss(t,xs,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&e.push("/"),e.push(Ss(n,"/"==n.charAt(0)?Cs:Is,!0))),(n=this.h.toString())&&e.push("?",n),(n=this.o)&&e.push("#",Ss(n,As)),e.join("")};var xs=/[#\/\?@]/g,Is=/[#\?:]/g,Cs=/[#\?]/g,Ns=/[#\?@]/g,As=/#/g;function Rs(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Ls(e){e.g||(e.g=new fs,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var a=e[n].substring(0,r);i=e[n].substring(r+1)}else a=e[n];t(a,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Os(e,t){Ls(e),t=Ms(e,t),ds(e.g.h,t)&&(e.i=null,e.h-=e.g.get(t).length,ds((e=e.g).h,t)&&(delete e.h[t],e.i--,e.g.length>2*e.i&&hs(e)))}function Ps(e,t){return Ls(e),t=Ms(e,t),ds(e.g.h,t)}function Ds(e,t,n){Os(e,t),0<n.length&&(e.i=null,e.g.set(Ms(e,t),ao(n)),e.h+=n.length)}function Ms(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(Fa=Rs.prototype).add=function(e,t){Ls(this),this.i=null,e=Ms(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},Fa.forEach=function(e,t){Ls(this),this.g.forEach((function(n,r){ro(n,(function(n){e.call(t,n,r,this)}),this)}),this)},Fa.T=function(){Ls(this);for(var e=this.g.R(),t=this.g.T(),n=[],r=0;r<t.length;r++)for(var i=e[r],a=0;a<i.length;a++)n.push(t[r]);return n},Fa.R=function(e){Ls(this);var t=[];if("string"===typeof e)Ps(this,e)&&(t=io(t,this.g.get(Ms(this,e))));else{e=this.g.R();for(var n=0;n<e.length;n++)t=io(t,e[n])}return t},Fa.set=function(e,t){return Ls(this),this.i=null,Ps(this,e=Ms(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},Fa.get=function(e,t){return e&&0<(e=this.R(e)).length?String(e[0]):t},Fa.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var e=[],t=this.g.T(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.R(r);for(var a=0;a<r.length;a++){var o=i;""!==r[a]&&(o+="="+encodeURIComponent(String(r[a]))),e.push(o)}}return this.i=e.join("&")};var Us=oe((function e(t,n){ie(this,e),this.h=t,this.g=n}));function Vs(e){this.l=e||js,qa.PerformanceNavigationTiming?e=0<(e=qa.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(qa.g&&qa.g.Ea&&qa.g.Ea()&&qa.g.Ea().Zb),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Fs,js=10;function zs(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Bs(e){return e.h?1:e.g?e.g.size:0}function qs(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Hs(e,t){e.g?e.g.add(t):e.h=t}function Ks(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Ws(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){var t,n=e.i,r=re(e.g.values());try{for(r.s();!(t=r.n()).done;){var i=t.value;n=n.concat(i.D)}}catch(a){r.e(a)}finally{r.f()}return n}return ao(e.i)}function Gs(){}function Qs(){this.g=new Gs}function Xs(e,t,n){var r=n||"";try{ls(e,(function(e,n){var i=e;Wa(e)&&(i=uu(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function Ys(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(a){}}function Js(e){this.l=e.$b||null,this.j=e.ib||!1}function $s(e,t){iu.call(this),this.D=e,this.u=t,this.m=void 0,this.readyState=Zs,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}Vs.prototype.cancel=function(){if(this.i=Ws(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){var e,t=re(this.g.values());try{for(t.s();!(e=t.n()).done;){e.value.cancel()}}catch(n){t.e(n)}finally{t.f()}this.g.clear()}},Gs.prototype.stringify=function(e){return qa.JSON.stringify(e,void 0)},Gs.prototype.parse=function(e){return qa.JSON.parse(e,void 0)},Za(Js,ju),Js.prototype.g=function(){return new $s(this.l,this.j)},Js.prototype.i=(Fs={},function(){return Fs}),Za($s,iu);var Zs=0;function ec(e){e.j.read().then(e.Sa.bind(e)).catch(e.ha.bind(e))}function tc(e){e.readyState=4,e.l=null,e.j=null,e.A=null,nc(e)}function nc(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(Fa=$s.prototype).open=function(e,t){if(this.readyState!=Zs)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,nc(this)},Fa.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||qa).fetch(new Request(this.B,t)).then(this.Va.bind(this),this.ha.bind(this))},Fa.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,tc(this)),this.readyState=Zs},Fa.Va=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,nc(this)),this.g&&(this.readyState=3,nc(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if("undefined"!==typeof qa.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;ec(this)}else e.text().then(this.Ua.bind(this),this.ha.bind(this))},Fa.Sa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?tc(this):nc(this),3==this.readyState&&ec(this)}},Fa.Ua=function(e){this.g&&(this.response=this.responseText=e,tc(this))},Fa.Ta=function(e){this.g&&(this.response=e,tc(this))},Fa.ha=function(){this.g&&tc(this)},Fa.setRequestHeader=function(e,t){this.v.append(e,t)},Fa.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},Fa.getAllResponseHeaders=function(){if(!this.h)return"";for(var e=[],t=this.h.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty($s.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var rc=qa.JSON.parse;function ic(e){iu.call(this),this.headers=new fs,this.u=e||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=ac,this.K=this.L=!1}Za(ic,iu);var ac="",oc=/^https?$/i,uc=["POST","PUT"];function sc(e){return"content-type"==e.toLowerCase()}function cc(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,lc(e),hc(e)}function lc(e){e.D||(e.D=!0,au(e,"complete"),au(e,"error"))}function fc(e){if(e.h&&"undefined"!=typeof Ba&&(!e.C[1]||4!=pc(e)||2!=e.ba()))if(e.v&&4==pc(e))bu(e.Fa,0,e);else if(au(e,"readystatechange"),4==pc(e)){e.h=!1;try{var t,n=e.ba();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var a=String(e.H).match(ps)[1]||null;if(!a&&qa.self&&qa.self.location){var o=qa.self.location.protocol;a=o.substr(0,o.length-1)}i=!oc.test(a?a.toLowerCase():"")}t=i}if(t)au(e,"complete"),au(e,"success");else{e.m=6;try{var u=2<pc(e)?e.g.statusText:""}catch(s){u=""}e.j=u+" ["+e.ba()+"]",lc(e)}}finally{hc(e)}}}function hc(e,t){if(e.g){dc(e);var n=e.g,r=e.C[0]?Ha:null;e.g=null,e.C=null,t||au(e,"ready");try{n.onreadystatechange=r}catch(i){}}}function dc(e){e.g&&e.K&&(e.g.ontimeout=null),e.A&&(qa.clearTimeout(e.A),e.A=null)}function pc(e){return e.g?e.g.readyState:0}function vc(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.J){case ac:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}function yc(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return po(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"===typeof e?null!=n&&encodeURIComponent(String(n)):ws(e,t,n))}function mc(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function gc(e){this.za=0,this.l=[],this.h=new Iu,this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null,this.Za=this.V=0,this.Xa=mc("failFast",!1,e),this.N=this.v=this.u=this.m=this.j=null,this.X=!0,this.I=this.ta=this.U=-1,this.Y=this.A=this.C=0,this.Pa=mc("baseRetryDelayMs",5e3,e),this.$a=mc("retryDelaySeedMs",1e4,e),this.Ya=mc("forwardChannelMaxRetries",2,e),this.ra=mc("forwardChannelRequestTimeoutMs",2e4,e),this.qa=e&&e.xmlHttpFactory||void 0,this.Ba=e&&e.Yb||!1,this.K=void 0,this.H=e&&e.supportsCrossDomainXhr||!1,this.J="",this.i=new Vs(e&&e.concurrentRequestLimit),this.Ca=new Qs,this.ja=e&&e.fastHandshake||!1,this.Ra=e&&e.Wb||!1,e&&e.Aa&&this.h.Aa(),e&&e.forceLongPolling&&(this.X=!1),this.$=!this.ja&&this.X&&e&&e.detectBufferingProxy||!1,this.ka=void 0,this.O=0,this.L=!1,this.B=null,this.Wa=!e||!1!==e.Xb}function kc(e){if(wc(e),3==e.G){var t=e.V++,n=ys(e.F);ws(n,"SID",e.J),ws(n,"RID",t),ws(n,"TYPE","terminate"),Tc(e,n),(t=new Qu(e,e.h,t,void 0)).K=2,t.v=_s(ys(n)),n=!1,qa.navigator&&qa.navigator.sendBeacon&&(n=qa.navigator.sendBeacon(t.v.toString(),"")),!n&&qa.Image&&((new Image).src=t.v,n=!0),n||(t.g=Uc(t.l,null),t.g.ea(t.v)),t.F=Date.now(),is(t)}Dc(e)}function bc(e){e.g&&(Nc(e),e.g.cancel(),e.g=null)}function wc(e){bc(e),e.u&&(qa.clearTimeout(e.u),e.u=null),Rc(e),e.i.cancel(),e.m&&("number"===typeof e.m&&qa.clearTimeout(e.m),e.m=null)}function _c(e,t){e.l.push(new Us(e.Za++,t)),3==e.G&&Ec(e)}function Ec(e){zs(e.i)||e.m||(e.m=!0,pu(e.Ha,e),e.C=0)}function Sc(e,t){var n;n=t?t.m:e.V++;var r=ys(e.F);ws(r,"SID",e.J),ws(r,"RID",n),ws(r,"AID",e.U),Tc(e,r),e.o&&e.s&&yc(r,e.o,e.s),n=new Qu(e,e.h,n,e.C+1),null===e.o&&(n.H=e.s),t&&(e.l=t.D.concat(e.l)),t=xc(e,n,1e3),n.setTimeout(Math.round(.5*e.ra)+Math.round(.5*e.ra*Math.random())),Hs(e.i,n),Zu(n,r,t)}function Tc(e,t){e.j&&ls({},(function(e,n){ws(t,n,e)}))}function xc(e,t,n){n=Math.min(e.l.length,n);var r=e.j?Ja(e.j.Oa,e.j,e):null;e:for(var i=e.l,a=-1;;){var o=["count="+n];-1==a?0<n?(a=i[0].h,o.push("ofs="+a)):a=0:o.push("ofs="+a);for(var u=!0,s=0;s<n;s++){var c=i[s].h,l=i[s].g;if(0>(c-=a))a=Math.max(0,i[s].h-100),u=!1;else try{Xs(l,o,"req"+c+"_")}catch(ll){r&&r(l)}}if(u){r=o.join("&");break e}}return e=e.l.splice(0,n),t.D=e,r}function Ic(e){e.g||e.u||(e.Y=1,pu(e.Ga,e),e.A=0)}function Cc(e){return!(e.g||e.u||3<=e.A)&&(e.Y++,e.u=Uu(Ja(e.Ga,e),Oc(e,e.A)),e.A++,!0)}function Nc(e){null!=e.B&&(qa.clearTimeout(e.B),e.B=null)}function Ac(e){e.g=new Qu(e,e.h,"rpc",e.Y),null===e.o&&(e.g.H=e.s),e.g.O=0;var t=ys(e.oa);ws(t,"RID","rpc"),ws(t,"SID",e.J),ws(t,"CI",e.N?"0":"1"),ws(t,"AID",e.U),Tc(e,t),ws(t,"TYPE","xmlhttp"),e.o&&e.s&&yc(t,e.o,e.s),e.K&&e.g.setTimeout(e.K);var n=e.g;e=e.la,n.K=1,n.v=_s(ys(t)),n.s=null,n.U=!0,es(n,e)}function Rc(e){null!=e.v&&(qa.clearTimeout(e.v),e.v=null)}function Lc(e,t){var n=null;if(e.g==t){Rc(e),Nc(e),e.g=null;var r=2}else{if(!qs(e.i,t))return;n=t.D,Ks(e.i,t),r=1}if(e.I=t.N,0!=e.G)if(t.i)if(1==r){n=t.s?t.s.length:0,t=Date.now()-t.F;var i=e.C;au(r=Ru(),new Mu(r,n,t,i)),Ec(e)}else Ic(e);else if(3==(i=t.o)||0==i&&0<e.I||!(1==r&&function(e,t){return!(Bs(e.i)>=e.i.j-(e.m?1:0))&&(e.m?(e.l=t.D.concat(e.l),!0):!(1==e.G||2==e.G||e.C>=(e.Xa?0:e.Ya))&&(e.m=Uu(Ja(e.Ha,e,t),Oc(e,e.C)),e.C++,!0))}(e,t)||2==r&&Cc(e)))switch(n&&0<n.length&&(t=e.i,t.i=t.i.concat(n)),i){case 1:Pc(e,5);break;case 4:Pc(e,10);break;case 3:Pc(e,6);break;default:Pc(e,2)}}function Oc(e,t){var n=e.Pa+Math.floor(Math.random()*e.$a);return e.j||(n*=2),n*t}function Pc(e,t){if(e.h.info("Error code "+t),2==t){var n=null;e.j&&(n=null);var r=Ja(e.jb,e);n||(n=new vs("//www.google.com/images/cleardot.gif"),qa.location&&"http"==qa.location.protocol||ms(n,"https"),_s(n)),function(e,t){var n=new Iu;if(qa.Image){var r=new Image;r.onload=$a(Ys,n,r,"TestLoadImage: loaded",!0,t),r.onerror=$a(Ys,n,r,"TestLoadImage: error",!1,t),r.onabort=$a(Ys,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=$a(Ys,n,r,"TestLoadImage: timeout",!1,t),qa.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else Du(2);e.G=0,e.j&&e.j.va(t),Dc(e),wc(e)}function Dc(e){e.G=0,e.I=-1,e.j&&(0==Ws(e.i).length&&0==e.l.length||(e.i.i.length=0,ao(e.l),e.l.length=0),e.j.ua())}function Mc(e,t,n){var r=function(e){return e instanceof vs?ys(e):new vs(e,void 0)}(n);if(""!=r.i)t&&gs(r,t+"."+r.i),ks(r,r.m);else{var i=qa.location;r=function(e,t,n,r){var i=new vs(null,void 0);return e&&ms(i,e),t&&gs(i,t),n&&ks(i,n),r&&(i.l=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.aa&&po(e.aa,(function(e,t){ws(r,t,e)})),t=e.D,n=e.sa,t&&n&&ws(r,t,n),ws(r,"VER",e.ma),Tc(e,r),r}function Uc(e,t,n){if(t&&!e.H)throw Error("Can't create secondary domain capable XhrIo object.");return(t=n&&e.Ba&&!e.qa?new ic(new Js({ib:!0})):new ic(e.qa)).L=e.H,t}function Vc(){}function Fc(){if(wo&&!(10<=Number(Po)))throw Error("Environmental error: no available transport.")}function jc(e,t){iu.call(this),this.g=new gc(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.ya&&(e?e["X-WebChannel-Client-Profile"]=t.ya:e={"X-WebChannel-Client-Profile":t.ya}),this.g.P=e,(e=t&&t.httpHeadersOverwriteParam)&&!oo(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!oo(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new qc(this)}function zc(e){Ku.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Bc(){Wu.call(this),this.status=1}function qc(e){this.g=e}(Fa=ic.prototype).ea=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+e);t=t?t.toUpperCase():"GET",this.H=e,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():qu.g(),this.C=this.u?zu(this.u):zu(qu),this.g.onreadystatechange=Ja(this.Fa,this);try{this.F=!0,this.g.open(t,String(e),!0),this.F=!1}catch(a){return void cc(this,a)}e=n||"";var i=new fs(this.headers);r&&ls(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=sc,n=e.length,r="string"===typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"===typeof e?e.charAt(t):e[t]}(i.T()),n=qa.FormData&&e instanceof qa.FormData,!(0<=no(uc,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.g.setRequestHeader(t,e)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{dc(this),0<this.B&&((this.K=function(e){return wo&&Lo()&&"number"===typeof e.timeout&&void 0!==e.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=Ja(this.pa,this)):this.A=bu(this.pa,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(a){cc(this,a)}},Fa.pa=function(){"undefined"!=typeof Ba&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,au(this,"timeout"),this.abort(8))},Fa.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,au(this,"complete"),au(this,"abort"),hc(this))},Fa.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),hc(this,!0)),ic.Z.M.call(this)},Fa.Fa=function(){this.s||(this.F||this.v||this.l?fc(this):this.cb())},Fa.cb=function(){fc(this)},Fa.ba=function(){try{return 2<pc(this)?this.g.status:-1}catch(Fs){return-1}},Fa.ga=function(){try{return this.g?this.g.responseText:""}catch(Fs){return""}},Fa.Qa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),rc(t)}},Fa.Da=function(){return this.m},Fa.La=function(){return"string"===typeof this.j?this.j:String(this.j)},(Fa=gc.prototype).ma=8,Fa.G=1,Fa.hb=function(e){try{this.h.info("Origin Trials invoked: "+e)}catch(t){}},Fa.Ha=function(e){if(this.m)if(this.m=null,1==this.G){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;var t=new Qu(this,this.h,e,void 0),n=this.s;if(this.P&&(n?mo(n=vo(n),this.P):n=this.P),null===this.o&&(t.H=n),this.ja)e:{for(var r=0,i=0;i<this.l.length;i++){var a=this.l[i];if(void 0===(a="__data__"in a.g&&"string"===typeof(a=a.g.__data__)?a.length:void 0))break;if(4096<(r+=a)){r=i;break e}if(4096===r||i===this.l.length-1){r=i+1;break e}}r=1e3}else r=1e3;r=xc(this,t,r),ws(i=ys(this.F),"RID",e),ws(i,"CVER",22),this.D&&ws(i,"X-HTTP-Session-Id",this.D),Tc(this,i),this.o&&n&&yc(i,this.o,n),Hs(this.i,t),this.Ra&&ws(i,"TYPE","init"),this.ja?(ws(i,"$req",r),ws(i,"SID","null"),t.$=!0,Zu(t,i,null)):Zu(t,i,r),this.G=2}}else 3==this.G&&(e?Sc(this,e):0==this.l.length||zs(this.i)||Sc(this))},Fa.Ga=function(){if(this.u=null,Ac(this),this.$&&!(this.L||null==this.g||0>=this.O)){var e=2*this.O;this.h.info("BP detection timer enabled: "+e),this.B=Uu(Ja(this.bb,this),e)}},Fa.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,Du(10),bc(this),Ac(this))},Fa.ab=function(){null!=this.v&&(this.v=null,bc(this),Cc(this),Du(19))},Fa.jb=function(e){e?(this.h.info("Successfully pinged google.com"),Du(2)):(this.h.info("Failed to ping google.com"),Du(1))},(Fa=Vc.prototype).xa=function(){},Fa.wa=function(){},Fa.va=function(){},Fa.ua=function(){},Fa.Oa=function(){},Fc.prototype.g=function(e,t){return new jc(e,t)},Za(jc,iu),jc.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var e=this.g,t=this.l,n=this.h||void 0;e.Wa&&(e.h.info("Origin Trials enabled."),pu(Ja(e.hb,e,t))),Du(0),e.W=t,e.aa=n||{},e.N=e.X,e.F=Mc(e,null,e.W),Ec(e)},jc.prototype.close=function(){kc(this.g)},jc.prototype.u=function(e){if("string"===typeof e){var t={};t.__data__=e,_c(this.g,t)}else this.v?((t={}).__data__=uu(e),_c(this.g,t)):_c(this.g,e)},jc.prototype.M=function(){this.g.j=null,delete this.j,kc(this.g),delete this.g,jc.Z.M.call(this)},Za(zc,Ku),Za(Bc,Wu),Za(qc,Vc),qc.prototype.xa=function(){au(this.g,"a")},qc.prototype.wa=function(e){au(this.g,new zc(e))},qc.prototype.va=function(e){au(this.g,new Bc(e))},qc.prototype.ua=function(){au(this.g,"b")},Fc.prototype.createWebChannel=Fc.prototype.g,jc.prototype.send=jc.prototype.u,jc.prototype.open=jc.prototype.m,jc.prototype.close=jc.prototype.close,Vu.NO_ERROR=0,Vu.TIMEOUT=8,Vu.HTTP_ERROR=6,Fu.COMPLETE="complete",Bu.EventType=Hu,Hu.OPEN="a",Hu.CLOSE="b",Hu.ERROR="c",Hu.MESSAGE="d",iu.prototype.listen=iu.prototype.N,ic.prototype.listenOnce=ic.prototype.O,ic.prototype.getLastError=ic.prototype.La,ic.prototype.getLastErrorCode=ic.prototype.Da,ic.prototype.getStatus=ic.prototype.ba,ic.prototype.getResponseJson=ic.prototype.Qa,ic.prototype.getResponseText=ic.prototype.ga,ic.prototype.send=ic.prototype.ea;var Hc=za.createWebChannelTransport=function(){return new Fc},Kc=za.getStatEventTarget=function(){return Ru()},Wc=za.ErrorCode=Vu,Gc=za.EventType=Fu,Qc=za.Event=Nu,Xc=za.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20},Yc=za.FetchXmlHttpFactory=Js,Jc=za.WebChannel=Bu,$c=za.XhrIo=ic,Zc="@firebase/firestore",el=function(){function e(t){ie(this,e),this.uid=t}return oe(e,[{key:"isAuthenticated",value:function(){return null!=this.uid}},{key:"toKey",value:function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}},{key:"isEqual",value:function(e){return e.uid===this.uid}}]),e}();el.UNAUTHENTICATED=new el(null),el.GOOGLE_CREDENTIALS=new el("google-credentials-uid"),el.FIRST_PARTY=new el("first-party-uid"),el.MOCK_USER=new el("mock-user");var tl="9.6.10",nl=new $e("@firebase/firestore");function rl(){return nl.logLevel}function il(e){if(nl.logLevel<=qe.DEBUG){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n.map(ul);nl.debug.apply(nl,["Firestore (".concat(tl,"): ").concat(e)].concat(se(i)))}}function al(e){if(nl.logLevel<=qe.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n.map(ul);nl.error.apply(nl,["Firestore (".concat(tl,"): ").concat(e)].concat(se(i)))}}function ol(e){if(nl.logLevel<=qe.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n.map(ul);nl.warn.apply(nl,["Firestore (".concat(tl,"): ").concat(e)].concat(se(i)))}}function ul(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}var t}function sl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unexpected state",t="FIRESTORE (".concat(tl,") INTERNAL ASSERTION FAILED: ")+e;throw al(t),new Error(t)}function cl(e,t){e||sl()}function ll(e,t){return e}var fl={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},hl=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this,e,r)).code=e,i.message=r,i.toString=function(){return"".concat(i.name,": [code=").concat(i.code,"]: ").concat(i.message)},i}return oe(n)}(_e),dl=oe((function e(){var t=this;ie(this,e),this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))})),pl=oe((function e(t,n){ie(this,e),this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer ".concat(t))})),vl=function(){function e(){ie(this,e)}return oe(e,[{key:"getToken",value:function(){return Promise.resolve(null)}},{key:"invalidateToken",value:function(){}},{key:"start",value:function(e,t){e.enqueueRetryable((function(){return t(el.UNAUTHENTICATED)}))}},{key:"shutdown",value:function(){}}]),e}(),yl=function(){function e(t){ie(this,e),this.t=t,this.currentUser=el.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}return oe(e,[{key:"start",value:function(e,t){var n=this,r=this.i,a=function(e){return n.i!==r?(r=n.i,t(e)):Promise.resolve()},o=new dl;this.o=function(){n.i++,n.currentUser=n.u(),o.resolve(),o=new dl,e.enqueueRetryable((function(){return a(n.currentUser)}))};var u=function(){var t=o;e.enqueueRetryable(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.promise;case 2:return e.next=4,a(n.currentUser);case 4:case"end":return e.stop()}}),e)}))))},s=function(e){il("FirebaseAuthCredentialsProvider","Auth detected"),n.auth=e,n.auth.addAuthTokenListener(n.o),u()};this.t.onInit((function(e){return s(e)})),setTimeout((function(){if(!n.auth){var e=n.t.getImmediate({optional:!0});e?s(e):(il("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new dl)}}),0),u()}},{key:"getToken",value:function(){var e=this,t=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.i!==t?(il("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(cl("string"==typeof n.accessToken),new pl(n.accessToken,e.currentUser)):null})):Promise.resolve(null)}},{key:"invalidateToken",value:function(){this.forceRefresh=!0}},{key:"shutdown",value:function(){this.auth&&this.auth.removeAuthTokenListener(this.o)}},{key:"u",value:function(){var e=this.auth&&this.auth.getUid();return cl(null===e||"string"==typeof e),new el(e)}}]),e}(),ml=oe((function e(t,n,r){ie(this,e),this.type="FirstParty",this.user=el.FIRST_PARTY,this.headers=new Map,this.headers.set("X-Goog-AuthUser",n);var i=t.auth.getAuthHeaderValueForFirstParty([]);i&&this.headers.set("Authorization",i),r&&this.headers.set("X-Goog-Iam-Authorization-Token",r)})),gl=function(){function e(t,n,r){ie(this,e),this.h=t,this.l=n,this.m=r}return oe(e,[{key:"getToken",value:function(){return Promise.resolve(new ml(this.h,this.l,this.m))}},{key:"start",value:function(e,t){e.enqueueRetryable((function(){return t(el.FIRST_PARTY)}))}},{key:"shutdown",value:function(){}},{key:"invalidateToken",value:function(){}}]),e}(),kl=oe((function e(t){ie(this,e),this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)})),bl=function(){function e(t){ie(this,e),this.g=t,this.forceRefresh=!1,this.appCheck=null,this.p=null}return oe(e,[{key:"start",value:function(e,t){var n=this,r=function(e){null!=e.error&&il("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: ".concat(e.error.message));var r=e.token!==n.p;return n.p=e.token,il("FirebaseAppCheckTokenProvider","Received ".concat(r?"new":"existing"," token.")),r?t(e.token):Promise.resolve()};this.o=function(t){e.enqueueRetryable((function(){return r(t)}))};var i=function(e){il("FirebaseAppCheckTokenProvider","AppCheck detected"),n.appCheck=e,n.appCheck.addTokenListener(n.o)};this.g.onInit((function(e){return i(e)})),setTimeout((function(){if(!n.appCheck){var e=n.g.getImmediate({optional:!0});e?i(e):il("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}},{key:"getToken",value:function(){var e=this,t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then((function(t){return t?(cl("string"==typeof t.token),e.p=t.token,new kl(t.token)):null})):Promise.resolve(null)}},{key:"invalidateToken",value:function(){this.forceRefresh=!0}},{key:"shutdown",value:function(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}]),e}(),wl=function(){function e(t,n){var r=this;ie(this,e),this.previousValue=t,n&&(n.sequenceNumberHandler=function(e){return r.I(e)},this.T=function(e){return n.writeSequenceNumber(e)})}return oe(e,[{key:"I",value:function(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}},{key:"next",value:function(){var e=++this.previousValue;return this.T&&this.T(e),e}}]),e}();function _l(e){var t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(var r=0;r<e;r++)n[r]=Math.floor(256*Math.random());return n}wl.A=-1;var El=function(){function e(){ie(this,e)}return oe(e,null,[{key:"R",value:function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,n="";n.length<20;)for(var r=_l(40),i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%e.length));return n}}]),e}();function Sl(e,t){return e<t?-1:e>t?1:0}function Tl(e,t,n){return e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}var xl=function(){function e(t,n){if(ie(this,e),this.seconds=t,this.nanoseconds=n,n<0)throw new hl(fl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new hl(fl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(t<-62135596800)throw new hl(fl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new hl(fl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return oe(e,[{key:"toDate",value:function(){return new Date(this.toMillis())}},{key:"toMillis",value:function(){return 1e3*this.seconds+this.nanoseconds/1e6}},{key:"_compareTo",value:function(e){return this.seconds===e.seconds?Sl(this.nanoseconds,e.nanoseconds):Sl(this.seconds,e.seconds)}},{key:"isEqual",value:function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}},{key:"toString",value:function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}},{key:"toJSON",value:function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}},{key:"valueOf",value:function(){var e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}],[{key:"now",value:function(){return e.fromMillis(Date.now())}},{key:"fromDate",value:function(t){return e.fromMillis(t.getTime())}},{key:"fromMillis",value:function(t){var n=Math.floor(t/1e3);return new e(n,Math.floor(1e6*(t-1e3*n)))}}]),e}(),Il=function(){function e(t){ie(this,e),this.timestamp=t}return oe(e,[{key:"compareTo",value:function(e){return this.timestamp._compareTo(e.timestamp)}},{key:"isEqual",value:function(e){return this.timestamp.isEqual(e.timestamp)}},{key:"toMicroseconds",value:function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}},{key:"toString",value:function(){return"SnapshotVersion("+this.timestamp.toString()+")"}},{key:"toTimestamp",value:function(){return this.timestamp}}],[{key:"fromTimestamp",value:function(t){return new e(t)}},{key:"min",value:function(){return new e(new xl(0,0))}},{key:"max",value:function(){return new e(new xl(253402300799,999999999))}}]),e}();function Cl(e){var t=0;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Nl(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Al(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var Rl=function(){function e(t,n,r){ie(this,e),void 0===n?n=0:n>t.length&&sl(),void 0===r?r=t.length-n:r>t.length-n&&sl(),this.segments=t,this.offset=n,this.len=r}return oe(e,[{key:"length",get:function(){return this.len}},{key:"isEqual",value:function(t){return 0===e.comparator(this,t)}},{key:"child",value:function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(e){n.push(e)})):n.push(t),this.construct(n)}},{key:"limit",value:function(){return this.offset+this.length}},{key:"popFirst",value:function(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}},{key:"popLast",value:function(){return this.construct(this.segments,this.offset,this.length-1)}},{key:"firstSegment",value:function(){return this.segments[this.offset]}},{key:"lastSegment",value:function(){return this.get(this.length-1)}},{key:"get",value:function(e){return this.segments[this.offset+e]}},{key:"isEmpty",value:function(){return 0===this.length}},{key:"isPrefixOf",value:function(e){if(e.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}},{key:"isImmediateParentOf",value:function(e){if(this.length+1!==e.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}},{key:"forEach",value:function(e){for(var t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}},{key:"toArray",value:function(){return this.segments.slice(this.offset,this.limit())}}],[{key:"comparator",value:function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var i=e.get(r),a=t.get(r);if(i<a)return-1;if(i>a)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}]),e}(),Ll=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n,[{key:"construct",value:function(e,t,r){return new n(e,t,r)}},{key:"canonicalString",value:function(){return this.toArray().join("/")}},{key:"toString",value:function(){return this.canonicalString()}}],[{key:"fromString",value:function(){for(var e=[],t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];for(var a=0,o=r;a<o.length;a++){var u=o[a];if(u.indexOf("//")>=0)throw new hl(fl.INVALID_ARGUMENT,"Invalid segment (".concat(u,"). Paths must not contain // in them."));e.push.apply(e,se(u.split("/").filter((function(e){return e.length>0}))))}return new n(e)}},{key:"emptyPath",value:function(){return new n([])}}]),n}(Rl),Ol=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Pl=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n,[{key:"construct",value:function(e,t,r){return new n(e,t,r)}},{key:"canonicalString",value:function(){return this.toArray().map((function(e){return e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),n.isValidIdentifier(e)||(e="`"+e+"`"),e})).join(".")}},{key:"toString",value:function(){return this.canonicalString()}},{key:"isKeyField",value:function(){return 1===this.length&&"__name__"===this.get(0)}}],[{key:"isValidIdentifier",value:function(e){return Ol.test(e)}},{key:"keyField",value:function(){return new n(["__name__"])}},{key:"fromServerFormat",value:function(e){for(var t=[],r="",i=0,a=function(){if(0===r.length)throw new hl(fl.INVALID_ARGUMENT,"Invalid field path (".concat(e,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"));t.push(r),r=""},o=!1;i<e.length;){var u=e[i];if("\\"===u){if(i+1===e.length)throw new hl(fl.INVALID_ARGUMENT,"Path has trailing escape character: "+e);var s=e[i+1];if("\\"!==s&&"."!==s&&"`"!==s)throw new hl(fl.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=s,i+=2}else"`"===u?(o=!o,i++):"."!==u||o?(r+=u,i++):(a(),i++)}if(a(),o)throw new hl(fl.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new n(t)}},{key:"emptyPath",value:function(){return new n([])}}]),n}(Rl),Dl=function(){function e(t){ie(this,e),this.fields=t,t.sort(Pl.comparator)}return oe(e,[{key:"covers",value:function(e){var t,n=re(this.fields);try{for(n.s();!(t=n.n()).done;){if(t.value.isPrefixOf(e))return!0}}catch(r){n.e(r)}finally{n.f()}return!1}},{key:"isEqual",value:function(e){return Tl(this.fields,e.fields,(function(e,t){return e.isEqual(t)}))}}]),e}();var Ml=function(e){function t(e){ie(this,t),this.binaryString=e}return oe(t,[{key:Symbol.iterator,value:function(){var e=this,t=0;return{next:function(){return t<e.binaryString.length?{value:e.binaryString.charCodeAt(t++),done:!1}:{value:void 0,done:!0}}}}},{key:"toBase64",value:function(){return e=this.binaryString,btoa(e);var e}},{key:"toUint8Array",value:function(){return function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}},{key:"approximateByteSize",value:function(){return 2*this.binaryString.length}},{key:"compareTo",value:function(e){return Sl(this.binaryString,e.binaryString)}},{key:"isEqual",value:function(e){return this.binaryString===e.binaryString}}],[{key:"fromBase64String",value:function(e){return new t(atob(e))}},{key:"fromUint8Array",value:function(e){var n=function(e){for(var t="",n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new t(n)}}]),t}();Ml.EMPTY_BYTE_STRING=new Ml("");var Ul=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Vl(e){if(cl(!!e),"string"==typeof e){var t=0,n=Ul.exec(e);if(cl(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),t=Number(r)}var i=new Date(e);return{seconds:Math.floor(i.getTime()/1e3),nanos:t}}return{seconds:Fl(e.seconds),nanos:Fl(e.nanos)}}function Fl(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function jl(e){return"string"==typeof e?Ml.fromBase64String(e):Ml.fromUint8Array(e)}function zl(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Bl(e){var t=e.mapValue.fields.__previous_value__;return zl(t)?Bl(t):t}function ql(e){var t=Vl(e.mapValue.fields.__local_write_time__.timestampValue);return new xl(t.seconds,t.nanos)}var Hl=oe((function e(t,n,r,i,a,o,u,s){ie(this,e),this.databaseId=t,this.appId=n,this.persistenceKey=r,this.host=i,this.ssl=a,this.forceLongPolling=o,this.autoDetectLongPolling=u,this.useFetchStreams=s})),Kl=function(){function e(t,n){ie(this,e),this.projectId=t,this.database=n||"(default)"}return oe(e,[{key:"isDefaultDatabase",get:function(){return"(default)"===this.database}},{key:"isEqual",value:function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database}}],[{key:"empty",value:function(){return new e("","")}}]),e}();function Wl(e){return null==e}function Gl(e){return 0===e&&1/e==-1/0}function Ql(e){return"number"==typeof e&&Number.isInteger(e)&&!Gl(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}var Xl=function(){function e(t){ie(this,e),this.path=t}return oe(e,[{key:"collectionGroup",get:function(){return this.path.popLast().lastSegment()}},{key:"hasCollectionId",value:function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}},{key:"getCollectionGroup",value:function(){return this.path.get(this.path.length-2)}},{key:"getCollectionPath",value:function(){return this.path.popLast()}},{key:"isEqual",value:function(e){return null!==e&&0===Ll.comparator(this.path,e.path)}},{key:"toString",value:function(){return this.path.toString()}}],[{key:"fromPath",value:function(t){return new e(Ll.fromString(t))}},{key:"fromName",value:function(t){return new e(Ll.fromString(t).popFirst(5))}},{key:"empty",value:function(){return new e(Ll.emptyPath())}},{key:"comparator",value:function(e,t){return Ll.comparator(e.path,t.path)}},{key:"isDocumentKey",value:function(e){return e.length%2==0}},{key:"fromSegments",value:function(t){return new e(new Ll(t.slice()))}}]),e}();function Yl(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?zl(e)?4:ff(e)?9:10:sl()}function Jl(e,t){if(e===t)return!0;var n=Yl(e);if(n!==Yl(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return ql(e).isEqual(ql(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;var n=Vl(e.timestampValue),r=Vl(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return jl(e.bytesValue).isEqual(jl(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Fl(e.geoPointValue.latitude)===Fl(t.geoPointValue.latitude)&&Fl(e.geoPointValue.longitude)===Fl(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Fl(e.integerValue)===Fl(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){var n=Fl(e.doubleValue),r=Fl(t.doubleValue);return n===r?Gl(n)===Gl(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return Tl(e.arrayValue.values||[],t.arrayValue.values||[],Jl);case 10:return function(e,t){var n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(Cl(n)!==Cl(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!Jl(n[i],r[i])))return!1;return!0}(e,t);default:return sl()}}function $l(e,t){return void 0!==(e.values||[]).find((function(e){return Jl(e,t)}))}function Zl(e,t){if(e===t)return 0;var n=Yl(e),r=Yl(t);if(n!==r)return Sl(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Sl(e.booleanValue,t.booleanValue);case 2:return function(e,t){var n=Fl(e.integerValue||e.doubleValue),r=Fl(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return ef(e.timestampValue,t.timestampValue);case 4:return ef(ql(e),ql(t));case 5:return Sl(e.stringValue,t.stringValue);case 6:return function(e,t){var n=jl(e),r=jl(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){for(var n=e.split("/"),r=t.split("/"),i=0;i<n.length&&i<r.length;i++){var a=Sl(n[i],r[i]);if(0!==a)return a}return Sl(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){var n=Sl(Fl(e.latitude),Fl(t.latitude));return 0!==n?n:Sl(Fl(e.longitude),Fl(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){for(var n=e.values||[],r=t.values||[],i=0;i<n.length&&i<r.length;++i){var a=Zl(n[i],r[i]);if(a)return a}return Sl(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){var n=e.fields||{},r=Object.keys(n),i=t.fields||{},a=Object.keys(i);r.sort(),a.sort();for(var o=0;o<r.length&&o<a.length;++o){var u=Sl(r[o],a[o]);if(0!==u)return u;var s=Zl(n[r[o]],i[a[o]]);if(0!==s)return s}return Sl(r.length,a.length)}(e.mapValue,t.mapValue);default:throw sl()}}function ef(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return Sl(e,t);var n=Vl(e),r=Vl(t),i=Sl(n.seconds,r.seconds);return 0!==i?i:Sl(n.nanos,r.nanos)}function tf(e){return nf(e)}function nf(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){var t=Vl(e);return"time(".concat(t.seconds,",").concat(t.nanos,")")}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?jl(e.bytesValue).toBase64():"referenceValue"in e?(n=e.referenceValue,Xl.fromName(n).toString()):"geoPointValue"in e?"geo(".concat((t=e.geoPointValue).latitude,",").concat(t.longitude,")"):"arrayValue"in e?function(e){var t,n="[",r=!0,i=re(e.values||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;r?r=!1:n+=",",n+=nf(a)}}catch(o){i.e(o)}finally{i.f()}return n+"]"}(e.arrayValue):"mapValue"in e?function(e){var t,n="{",r=!0,i=re(Object.keys(e.fields||{}).sort());try{for(i.s();!(t=i.n()).done;){var a=t.value;r?r=!1:n+=",",n+="".concat(a,":").concat(nf(e.fields[a]))}}catch(o){i.e(o)}finally{i.f()}return n+"}"}(e.mapValue):sl();var t,n}function rf(e,t){return{referenceValue:"projects/".concat(e.projectId,"/databases/").concat(e.database,"/documents/").concat(t.path.canonicalString())}}function af(e){return!!e&&"integerValue"in e}function of(e){return!!e&&"arrayValue"in e}function uf(e){return!!e&&"nullValue"in e}function sf(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function cf(e){return!!e&&"mapValue"in e}function lf(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){var t={mapValue:{fields:{}}};return Nl(e.mapValue.fields,(function(e,n){return t.mapValue.fields[e]=lf(n)})),t}if(e.arrayValue){for(var n={arrayValue:{values:[]}},r=0;r<(e.arrayValue.values||[]).length;++r)n.arrayValue.values[r]=lf(e.arrayValue.values[r]);return n}return Object.assign({},e)}function ff(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}var hf=function(){function e(t){ie(this,e),this.value=t}return oe(e,[{key:"field",value:function(e){if(e.isEmpty())return this.value;for(var t=this.value,n=0;n<e.length-1;++n)if(!cf(t=(t.mapValue.fields||{})[e.get(n)]))return null;return(t=(t.mapValue.fields||{})[e.lastSegment()])||null}},{key:"set",value:function(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=lf(t)}},{key:"setAll",value:function(e){var t=this,n=Pl.emptyPath(),r={},i=[];e.forEach((function(e,a){if(!n.isImmediateParentOf(a)){var o=t.getFieldsMap(n);t.applyChanges(o,r,i),r={},i=[],n=a.popLast()}e?r[a.lastSegment()]=lf(e):i.push(a.lastSegment())}));var a=this.getFieldsMap(n);this.applyChanges(a,r,i)}},{key:"delete",value:function(e){var t=this.field(e.popLast());cf(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}},{key:"isEqual",value:function(e){return Jl(this.value,e.value)}},{key:"getFieldsMap",value:function(e){var t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(var n=0;n<e.length;++n){var r=t.mapValue.fields[e.get(n)];cf(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}},{key:"applyChanges",value:function(e,t,n){Nl(t,(function(t,n){return e[t]=n}));var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;delete e[a]}}catch(o){i.e(o)}finally{i.f()}}},{key:"clone",value:function(){return new e(lf(this.value))}}],[{key:"empty",value:function(){return new e({mapValue:{}})}}]),e}();function df(e){var t=[];return Nl(e.fields,(function(e,n){var r=new Pl([e]);if(cf(n)){var i=df(n.mapValue).fields;if(0===i.length)t.push(r);else{var a,o=re(i);try{for(o.s();!(a=o.n()).done;){var u=a.value;t.push(r.child(u))}}catch(s){o.e(s)}finally{o.f()}}}else t.push(r)})),new Dl(t)}var pf=function(){function e(t,n,r,i,a,o){ie(this,e),this.key=t,this.documentType=n,this.version=r,this.readTime=i,this.data=a,this.documentState=o}return oe(e,[{key:"convertToFoundDocument",value:function(e,t){return this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}},{key:"convertToNoDocument",value:function(e){return this.version=e,this.documentType=2,this.data=hf.empty(),this.documentState=0,this}},{key:"convertToUnknownDocument",value:function(e){return this.version=e,this.documentType=3,this.data=hf.empty(),this.documentState=2,this}},{key:"setHasCommittedMutations",value:function(){return this.documentState=2,this}},{key:"setHasLocalMutations",value:function(){return this.documentState=1,this}},{key:"setReadTime",value:function(e){return this.readTime=e,this}},{key:"hasLocalMutations",get:function(){return 1===this.documentState}},{key:"hasCommittedMutations",get:function(){return 2===this.documentState}},{key:"hasPendingWrites",get:function(){return this.hasLocalMutations||this.hasCommittedMutations}},{key:"isValidDocument",value:function(){return 0!==this.documentType}},{key:"isFoundDocument",value:function(){return 1===this.documentType}},{key:"isNoDocument",value:function(){return 2===this.documentType}},{key:"isUnknownDocument",value:function(){return 3===this.documentType}},{key:"isEqual",value:function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}},{key:"mutableCopy",value:function(){return new e(this.key,this.documentType,this.version,this.readTime,this.data.clone(),this.documentState)}},{key:"toString",value:function(){return"Document(".concat(this.key,", ").concat(this.version,", ").concat(JSON.stringify(this.data.value),", {documentType: ").concat(this.documentType,"}), {documentState: ").concat(this.documentState,"})")}}],[{key:"newInvalidDocument",value:function(t){return new e(t,0,Il.min(),Il.min(),hf.empty(),0)}},{key:"newFoundDocument",value:function(t,n,r){return new e(t,1,n,Il.min(),r,0)}},{key:"newNoDocument",value:function(t,n){return new e(t,2,n,Il.min(),hf.empty(),0)}},{key:"newUnknownDocument",value:function(t,n){return new e(t,3,n,Il.min(),hf.empty(),2)}}]),e}(),vf=oe((function e(t,n,r,i){ie(this,e),this.indexId=t,this.collectionGroup=n,this.fields=r,this.indexState=i}));vf.UNKNOWN_ID=-1;function yf(e,t){var n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,i=Il.fromTimestamp(1e9===r?new xl(n+1,0):new xl(n,r));return new gf(i,Xl.empty(),t)}function mf(e){return new gf(e.readTime,e.key,-1)}var gf=function(){function e(t,n,r){ie(this,e),this.readTime=t,this.documentKey=n,this.largestBatchId=r}return oe(e,null,[{key:"min",value:function(){return new e(Il.min(),Xl.empty(),-1)}},{key:"max",value:function(){return new e(Il.max(),Xl.empty(),-1)}}]),e}();function kf(e,t){var n=e.readTime.compareTo(t.readTime);return 0!==n?n:0!==(n=Xl.comparator(e.documentKey,t.documentKey))?n:Sl(e.largestBatchId,t.largestBatchId)}var bf=oe((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;ie(this,e),this.path=t,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=a,this.startAt=o,this.endAt=u,this.P=null}));function wf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;return new bf(e,t,n,r,i,a,o)}function _f(e){var t=ll(e);if(null===t.P){var n=t.path.canonicalString();null!==t.collectionGroup&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map((function(e){return(t=e).field.canonicalString()+t.op.toString()+tf(t.value);var t})).join(","),n+="|ob:",n+=t.orderBy.map((function(e){return function(e){return e.field.canonicalString()+e.dir}(e)})).join(","),Wl(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map((function(e){return tf(e)})).join(",")),t.endAt&&(n+="|ub:",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map((function(e){return tf(e)})).join(",")),t.P=n}return t.P}function Ef(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(var n=0;n<e.orderBy.length;n++)if(!Mf(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(var r=0;r<e.filters.length;r++)if(i=e.filters[r],a=t.filters[r],i.op!==a.op||!i.field.isEqual(a.field)||!Jl(i.value,a.value))return!1;var i,a;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!Vf(e.startAt,t.startAt)&&Vf(e.endAt,t.endAt)}function Sf(e){return Xl.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}var Tf=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this)).field=e,a.op=r,a.value=i,a}return oe(n,[{key:"matches",value:function(e){var t=e.data.field(this.field);return"!="===this.op?null!==t&&this.v(Zl(t,this.value)):null!==t&&Yl(this.value)===Yl(t)&&this.v(Zl(t,this.value))}},{key:"v",value:function(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return sl()}}},{key:"S",value:function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}],[{key:"create",value:function(e,t,r){return e.isKeyField()?"in"===t||"not-in"===t?this.V(e,t,r):new xf(e,t,r):"array-contains"===t?new Af(e,r):"in"===t?new Rf(e,r):"not-in"===t?new Lf(e,r):"array-contains-any"===t?new Of(e,r):new n(e,t,r)}},{key:"V",value:function(e,t,n){return"in"===t?new If(e,n):new Cf(e,n)}}]),n}(function(){return oe((function e(){ie(this,e)}))}()),xf=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this,e,r,i)).key=Xl.fromName(i.referenceValue),a}return oe(n,[{key:"matches",value:function(e){var t=Xl.comparator(e.key,this.key);return this.v(t)}}]),n}(Tf),If=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this,e,"in",r)).keys=Nf("in",r),i}return oe(n,[{key:"matches",value:function(e){return this.keys.some((function(t){return t.isEqual(e.key)}))}}]),n}(Tf),Cf=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this,e,"not-in",r)).keys=Nf("not-in",r),i}return oe(n,[{key:"matches",value:function(e){return!this.keys.some((function(t){return t.isEqual(e.key)}))}}]),n}(Tf);function Nf(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(e){return Xl.fromName(e.referenceValue)}))}var Af=function(e){$(n,e);var t=ne(n);function n(e,r){return ie(this,n),t.call(this,e,"array-contains",r)}return oe(n,[{key:"matches",value:function(e){var t=e.data.field(this.field);return of(t)&&$l(t.arrayValue,this.value)}}]),n}(Tf),Rf=function(e){$(n,e);var t=ne(n);function n(e,r){return ie(this,n),t.call(this,e,"in",r)}return oe(n,[{key:"matches",value:function(e){var t=e.data.field(this.field);return null!==t&&$l(this.value.arrayValue,t)}}]),n}(Tf),Lf=function(e){$(n,e);var t=ne(n);function n(e,r){return ie(this,n),t.call(this,e,"not-in",r)}return oe(n,[{key:"matches",value:function(e){if($l(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var t=e.data.field(this.field);return null!==t&&!$l(this.value.arrayValue,t)}}]),n}(Tf),Of=function(e){$(n,e);var t=ne(n);function n(e,r){return ie(this,n),t.call(this,e,"array-contains-any",r)}return oe(n,[{key:"matches",value:function(e){var t=this,n=e.data.field(this.field);return!(!of(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(e){return $l(t.value.arrayValue,e)}))}}]),n}(Tf),Pf=oe((function e(t,n){ie(this,e),this.position=t,this.inclusive=n})),Df=oe((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";ie(this,e),this.field=t,this.dir=n}));function Mf(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function Uf(e,t,n){for(var r=0,i=0;i<e.position.length;i++){var a=t[i],o=e.position[i];if(r=a.field.isKeyField()?Xl.comparator(Xl.fromName(o.referenceValue),n.key):Zl(o,n.data.field(a.field)),"desc"===a.dir&&(r*=-1),0!==r)break}return r}function Vf(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(var n=0;n<e.position.length;n++)if(!Jl(e.position[n],t.position[n]))return!1;return!0}var Ff=oe((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"F",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;ie(this,e),this.path=t,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=a,this.limitType=o,this.startAt=u,this.endAt=s,this.D=null,this.C=null,this.startAt,this.endAt}));function jf(e,t,n,r,i,a,o,u){return new Ff(e,t,n,r,i,a,o,u)}function zf(e){return new Ff(e)}function Bf(e){return!Wl(e.limit)&&"F"===e.limitType}function qf(e){return!Wl(e.limit)&&"L"===e.limitType}function Hf(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function Kf(e){var t,n=re(e.filters);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.S())return r.field}}catch(i){n.e(i)}finally{n.f()}return null}function Wf(e){return null!==e.collectionGroup}function Gf(e){var t=ll(e);if(null===t.D){t.D=[];var n=Kf(t),r=Hf(t);if(null!==n&&null===r)n.isKeyField()||t.D.push(new Df(n)),t.D.push(new Df(Pl.keyField(),"asc"));else{var i,a=!1,o=re(t.explicitOrderBy);try{for(o.s();!(i=o.n()).done;){var u=i.value;t.D.push(u),u.field.isKeyField()&&(a=!0)}}catch(c){o.e(c)}finally{o.f()}if(!a){var s=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.D.push(new Df(Pl.keyField(),s))}}}return t.D}function Qf(e){var t=ll(e);if(!t.C)if("F"===t.limitType)t.C=wf(t.path,t.collectionGroup,Gf(t),t.filters,t.limit,t.startAt,t.endAt);else{var n,r=[],i=re(Gf(t));try{for(i.s();!(n=i.n()).done;){var a=n.value,o="desc"===a.dir?"asc":"desc";r.push(new Df(a.field,o))}}catch(c){i.e(c)}finally{i.f()}var u=t.endAt?new Pf(t.endAt.position,!t.endAt.inclusive):null,s=t.startAt?new Pf(t.startAt.position,!t.startAt.inclusive):null;t.C=wf(t.path,t.collectionGroup,r,t.filters,t.limit,u,s)}return t.C}function Xf(e,t,n){return new Ff(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Yf(e,t){return Ef(Qf(e),Qf(t))&&e.limitType===t.limitType}function Jf(e){return"".concat(_f(Qf(e)),"|lt:").concat(e.limitType)}function $f(e){return"Query(target=".concat(function(e){var t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: [".concat(e.filters.map((function(e){return"".concat((t=e).field.canonicalString()," ").concat(t.op," ").concat(tf(t.value));var t})).join(", "),"]")),Wl(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: [".concat(e.orderBy.map((function(e){return function(e){return"".concat(e.field.canonicalString()," (").concat(e.dir,")")}(e)})).join(", "),"]")),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((function(e){return tf(e)})).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((function(e){return tf(e)})).join(",")),"Target(".concat(t,")")}(Qf(e)),"; limitType=").concat(e.limitType,")")}function Zf(e,t){return t.isFoundDocument()&&function(e,t){var n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):Xl.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){var n,r=re(e.explicitOrderBy);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!i.field.isKeyField()&&null===t.data.field(i.field))return!1}}catch(a){r.e(a)}finally{r.f()}return!0}(e,t)&&function(e,t){var n,r=re(e.filters);try{for(r.s();!(n=r.n()).done;){if(!n.value.matches(t))return!1}}catch(i){r.e(i)}finally{r.f()}return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){var r=Uf(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Gf(e),t))&&!(e.endAt&&!function(e,t,n){var r=Uf(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Gf(e),t))}(e,t)}function eh(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function th(e){return function(t,n){var r,i=!1,a=re(Gf(e));try{for(a.s();!(r=a.n()).done;){var o=r.value,u=nh(o,t,n);if(0!==u)return u;i=i||o.field.isKeyField()}}catch(s){a.e(s)}finally{a.f()}return 0}}function nh(e,t,n){var r=e.field.isKeyField()?Xl.comparator(t.key,n.key):function(e,t,n){var r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?Zl(r,i):sl()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return sl()}}function rh(e,t){if(e.N){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Gl(t)?"-0":t}}function ih(e){return{integerValue:""+e}}function ah(e,t){return Ql(t)?ih(t):rh(e,t)}var oh=oe((function e(){ie(this,e),this._=void 0}));function uh(e,t,n){return e instanceof lh?function(e,t){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof fh?hh(e,t):e instanceof dh?ph(e,t):function(e,t){var n=ch(e,t),r=yh(n)+yh(e.k);return af(n)&&af(e.k)?ih(r):rh(e.M,r)}(e,t)}function sh(e,t,n){return e instanceof fh?hh(e,t):e instanceof dh?ph(e,t):n}function ch(e,t){return e instanceof vh?af(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}var lh=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n)}(oh),fh=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this)).elements=e,r}return oe(n)}(oh);function hh(e,t){var n,r=mh(t),i=re(e.elements);try{var a=function(){var e=n.value;r.some((function(t){return Jl(t,e)}))||r.push(e)};for(i.s();!(n=i.n()).done;)a()}catch(o){i.e(o)}finally{i.f()}return{arrayValue:{values:r}}}var dh=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this)).elements=e,r}return oe(n)}(oh);function ph(e,t){var n,r=mh(t),i=re(e.elements);try{var a=function(){var e=n.value;r=r.filter((function(t){return!Jl(t,e)}))};for(i.s();!(n=i.n()).done;)a()}catch(o){i.e(o)}finally{i.f()}return{arrayValue:{values:r}}}var vh=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this)).M=e,i.k=r,i}return oe(n)}(oh);function yh(e){return Fl(e.integerValue||e.doubleValue)}function mh(e){return of(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}var gh=oe((function e(t,n){ie(this,e),this.version=t,this.transformResults=n})),kh=function(){function e(t,n){ie(this,e),this.updateTime=t,this.exists=n}return oe(e,[{key:"isNone",get:function(){return void 0===this.updateTime&&void 0===this.exists}},{key:"isEqual",value:function(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}],[{key:"none",value:function(){return new e}},{key:"exists",value:function(t){return new e(void 0,t)}},{key:"updateTime",value:function(t){return new e(t)}}]),e}();function bh(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}var wh=oe((function e(){ie(this,e)}));function _h(e,t,n){e instanceof Ih?function(e,t,n){var r=e.value.clone(),i=Ah(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Ch?function(e,t,n){if(bh(e.precondition,t)){var r=Ah(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(Nh(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}else t.convertToUnknownDocument(n.version)}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function Eh(e,t,n){e instanceof Ih?function(e,t,n){if(bh(e.precondition,t)){var r=e.value.clone(),i=Rh(e.fieldTransforms,n,t);r.setAll(i),t.convertToFoundDocument(xh(t),r).setHasLocalMutations()}}(e,t,n):e instanceof Ch?function(e,t,n){if(bh(e.precondition,t)){var r=Rh(e.fieldTransforms,n,t),i=t.data;i.setAll(Nh(e)),i.setAll(r),t.convertToFoundDocument(xh(t),i).setHasLocalMutations()}}(e,t,n):function(e,t){bh(e.precondition,t)&&t.convertToNoDocument(Il.min())}(e,t)}function Sh(e,t){var n,r=null,i=re(e.fieldTransforms);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=t.data.field(a.field),u=ch(a.transform,o||null);null!=u&&(null==r&&(r=hf.empty()),r.set(a.field,u))}}catch(s){i.e(s)}finally{i.f()}return r||null}function Th(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&Tl(e,t,(function(e,t){return function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof fh&&t instanceof fh||e instanceof dh&&t instanceof dh?Tl(e.elements,t.elements,Jl):e instanceof vh&&t instanceof vh?Jl(e.k,t.k):e instanceof lh&&t instanceof lh}(e.transform,t.transform)}(e,t)}))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}function xh(e){return e.isFoundDocument()?e.version:Il.min()}var Ih=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return ie(this,n),(a=t.call(this)).key=e,a.value=r,a.precondition=i,a.fieldTransforms=o,a.type=0,a}return oe(n)}(wh),Ch=function(e){$(n,e);var t=ne(n);function n(e,r,i,a){var o,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return ie(this,n),(o=t.call(this)).key=e,o.data=r,o.fieldMask=i,o.precondition=a,o.fieldTransforms=u,o.type=1,o}return oe(n)}(wh);function Nh(e){var t=new Map;return e.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var r=e.data.field(n);t.set(n,r)}})),t}function Ah(e,t,n){var r=new Map;cl(e.length===n.length);for(var i=0;i<n.length;i++){var a=e[i],o=a.transform,u=t.data.field(a.field);r.set(a.field,sh(o,u,n[i]))}return r}function Rh(e,t,n){var r,i=new Map,a=re(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,u=o.transform,s=n.data.field(o.field);i.set(o.field,uh(u,s,t))}}catch(c){a.e(c)}finally{a.f()}return i}var Lh,Oh,Ph=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this)).key=e,i.precondition=r,i.type=2,i.fieldTransforms=[],i}return oe(n)}(wh),Dh=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this)).key=e,i.precondition=r,i.type=3,i.fieldTransforms=[],i}return oe(n)}(wh),Mh=oe((function e(t){ie(this,e),this.count=t}));function Uh(e){switch(e){default:return sl();case fl.CANCELLED:case fl.UNKNOWN:case fl.DEADLINE_EXCEEDED:case fl.RESOURCE_EXHAUSTED:case fl.INTERNAL:case fl.UNAVAILABLE:case fl.UNAUTHENTICATED:return!1;case fl.INVALID_ARGUMENT:case fl.NOT_FOUND:case fl.ALREADY_EXISTS:case fl.PERMISSION_DENIED:case fl.FAILED_PRECONDITION:case fl.ABORTED:case fl.OUT_OF_RANGE:case fl.UNIMPLEMENTED:case fl.DATA_LOSS:return!0}}function Vh(e){if(void 0===e)return al("GRPC error has no .code"),fl.UNKNOWN;switch(e){case Lh.OK:return fl.OK;case Lh.CANCELLED:return fl.CANCELLED;case Lh.UNKNOWN:return fl.UNKNOWN;case Lh.DEADLINE_EXCEEDED:return fl.DEADLINE_EXCEEDED;case Lh.RESOURCE_EXHAUSTED:return fl.RESOURCE_EXHAUSTED;case Lh.INTERNAL:return fl.INTERNAL;case Lh.UNAVAILABLE:return fl.UNAVAILABLE;case Lh.UNAUTHENTICATED:return fl.UNAUTHENTICATED;case Lh.INVALID_ARGUMENT:return fl.INVALID_ARGUMENT;case Lh.NOT_FOUND:return fl.NOT_FOUND;case Lh.ALREADY_EXISTS:return fl.ALREADY_EXISTS;case Lh.PERMISSION_DENIED:return fl.PERMISSION_DENIED;case Lh.FAILED_PRECONDITION:return fl.FAILED_PRECONDITION;case Lh.ABORTED:return fl.ABORTED;case Lh.OUT_OF_RANGE:return fl.OUT_OF_RANGE;case Lh.UNIMPLEMENTED:return fl.UNIMPLEMENTED;case Lh.DATA_LOSS:return fl.DATA_LOSS;default:return sl()}}(Oh=Lh||(Lh={}))[Oh.OK=0]="OK",Oh[Oh.CANCELLED=1]="CANCELLED",Oh[Oh.UNKNOWN=2]="UNKNOWN",Oh[Oh.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Oh[Oh.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Oh[Oh.NOT_FOUND=5]="NOT_FOUND",Oh[Oh.ALREADY_EXISTS=6]="ALREADY_EXISTS",Oh[Oh.PERMISSION_DENIED=7]="PERMISSION_DENIED",Oh[Oh.UNAUTHENTICATED=16]="UNAUTHENTICATED",Oh[Oh.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Oh[Oh.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Oh[Oh.ABORTED=10]="ABORTED",Oh[Oh.OUT_OF_RANGE=11]="OUT_OF_RANGE",Oh[Oh.UNIMPLEMENTED=12]="UNIMPLEMENTED",Oh[Oh.INTERNAL=13]="INTERNAL",Oh[Oh.UNAVAILABLE=14]="UNAVAILABLE",Oh[Oh.DATA_LOSS=15]="DATA_LOSS";var Fh=function(){function e(t,n){ie(this,e),this.mapKeyFn=t,this.equalsFn=n,this.inner={},this.innerSize=0}return oe(e,[{key:"get",value:function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n){var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=c(r.value,2),o=a[0],u=a[1];if(this.equalsFn(o,e))return u}}catch(s){i.e(s)}finally{i.f()}}}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"set",value:function(e,t){var n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(var i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return void(r[i]=[e,t]);r.push([e,t]),this.innerSize++}},{key:"delete",value:function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}},{key:"forEach",value:function(e){Nl(this.inner,(function(t,n){var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=c(r.value,2),o=a[0],u=a[1];e(o,u)}}catch(s){i.e(s)}finally{i.f()}}))}},{key:"isEmpty",value:function(){return Al(this.inner)}},{key:"size",value:function(){return this.innerSize}}]),e}(),jh=function(){function e(t,n){ie(this,e),this.comparator=t,this.root=n||Bh.EMPTY}return oe(e,[{key:"insert",value:function(t,n){return new e(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,Bh.BLACK,null,null))}},{key:"remove",value:function(t){return new e(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Bh.BLACK,null,null))}},{key:"get",value:function(e){for(var t=this.root;!t.isEmpty();){var n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}},{key:"indexOf",value:function(e){for(var t=0,n=this.root;!n.isEmpty();){var r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}},{key:"isEmpty",value:function(){return this.root.isEmpty()}},{key:"size",get:function(){return this.root.size}},{key:"minKey",value:function(){return this.root.minKey()}},{key:"maxKey",value:function(){return this.root.maxKey()}},{key:"inorderTraversal",value:function(e){return this.root.inorderTraversal(e)}},{key:"forEach",value:function(e){this.inorderTraversal((function(t,n){return e(t,n),!1}))}},{key:"toString",value:function(){var e=[];return this.inorderTraversal((function(t,n){return e.push("".concat(t,":").concat(n)),!1})),"{".concat(e.join(", "),"}")}},{key:"reverseTraversal",value:function(e){return this.root.reverseTraversal(e)}},{key:"getIterator",value:function(){return new zh(this.root,null,this.comparator,!1)}},{key:"getIteratorFrom",value:function(e){return new zh(this.root,e,this.comparator,!1)}},{key:"getReverseIterator",value:function(){return new zh(this.root,null,this.comparator,!0)}},{key:"getReverseIteratorFrom",value:function(e){return new zh(this.root,e,this.comparator,!0)}}]),e}(),zh=function(){function e(t,n,r,i){ie(this,e),this.isReverse=i,this.nodeStack=[];for(var a=1;!t.isEmpty();)if(a=n?r(t.key,n):1,n&&i&&(a*=-1),a<0)t=this.isReverse?t.left:t.right;else{if(0===a){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return oe(e,[{key:"getNext",value:function(){var e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}},{key:"hasNext",value:function(){return this.nodeStack.length>0}},{key:"peek",value:function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}]),e}(),Bh=function(){function e(t,n,r,i,a){ie(this,e),this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=a?a:e.EMPTY,this.size=this.left.size+1+this.right.size}return oe(e,[{key:"copy",value:function(t,n,r,i,a){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=a?a:this.right)}},{key:"isEmpty",value:function(){return!1}},{key:"inorderTraversal",value:function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}},{key:"reverseTraversal",value:function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}},{key:"min",value:function(){return this.left.isEmpty()?this:this.left.min()}},{key:"minKey",value:function(){return this.min().key}},{key:"maxKey",value:function(){return this.right.isEmpty()?this.key:this.right.maxKey()}},{key:"insert",value:function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()}},{key:"removeMin",value:function(){if(this.left.isEmpty())return e.EMPTY;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()}},{key:"remove",value:function(t,n){var r,i=this;if(n(t,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(t,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(t,i.key)){if(i.right.isEmpty())return e.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(t,n))}return i.fixUp()}},{key:"isRed",value:function(){return this.color}},{key:"fixUp",value:function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}},{key:"moveRedLeft",value:function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e}},{key:"moveRedRight",value:function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e}},{key:"rotateLeft",value:function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}},{key:"rotateRight",value:function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}},{key:"colorFlip",value:function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}},{key:"checkMaxDepth",value:function(){var e=this.check();return Math.pow(2,e)<=this.size+1}},{key:"check",value:function(){if(this.isRed()&&this.left.isRed())throw sl();if(this.right.isRed())throw sl();var e=this.left.check();if(e!==this.right.check())throw sl();return e+(this.isRed()?0:1)}}]),e}();Bh.EMPTY=null,Bh.RED=!0,Bh.BLACK=!1,Bh.EMPTY=new(function(){function e(){ie(this,e),this.size=0}return oe(e,[{key:"key",get:function(){throw sl()}},{key:"value",get:function(){throw sl()}},{key:"color",get:function(){throw sl()}},{key:"left",get:function(){throw sl()}},{key:"right",get:function(){throw sl()}},{key:"copy",value:function(e,t,n,r,i){return this}},{key:"insert",value:function(e,t,n){return new Bh(e,t)}},{key:"remove",value:function(e,t){return this}},{key:"isEmpty",value:function(){return!0}},{key:"inorderTraversal",value:function(e){return!1}},{key:"reverseTraversal",value:function(e){return!1}},{key:"minKey",value:function(){return null}},{key:"maxKey",value:function(){return null}},{key:"isRed",value:function(){return!1}},{key:"checkMaxDepth",value:function(){return!0}},{key:"check",value:function(){return 0}}]),e}());var qh=function(){function e(t){ie(this,e),this.comparator=t,this.data=new jh(this.comparator)}return oe(e,[{key:"has",value:function(e){return null!==this.data.get(e)}},{key:"first",value:function(){return this.data.minKey()}},{key:"last",value:function(){return this.data.maxKey()}},{key:"size",get:function(){return this.data.size}},{key:"indexOf",value:function(e){return this.data.indexOf(e)}},{key:"forEach",value:function(e){this.data.inorderTraversal((function(t,n){return e(t),!1}))}},{key:"forEachInRange",value:function(e,t){for(var n=this.data.getIteratorFrom(e[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}},{key:"forEachWhile",value:function(e,t){var n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}},{key:"firstAfterOrEqual",value:function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}},{key:"getIterator",value:function(){return new Hh(this.data.getIterator())}},{key:"getIteratorFrom",value:function(e){return new Hh(this.data.getIteratorFrom(e))}},{key:"add",value:function(e){return this.copy(this.data.remove(e).insert(e,!0))}},{key:"delete",value:function(e){return this.has(e)?this.copy(this.data.remove(e)):this}},{key:"isEmpty",value:function(){return this.data.isEmpty()}},{key:"unionWith",value:function(e){var t=this;return t.size<e.size&&(t=e,e=this),e.forEach((function(e){t=t.add(e)})),t}},{key:"isEqual",value:function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.data.getIterator(),r=t.data.getIterator();n.hasNext();){var i=n.getNext().key,a=r.getNext().key;if(0!==this.comparator(i,a))return!1}return!0}},{key:"toArray",value:function(){var e=[];return this.forEach((function(t){e.push(t)})),e}},{key:"toString",value:function(){var e=[];return this.forEach((function(t){return e.push(t)})),"SortedSet("+e.toString()+")"}},{key:"copy",value:function(t){var n=new e(this.comparator);return n.data=t,n}}]),e}(),Hh=function(){function e(t){ie(this,e),this.iter=t}return oe(e,[{key:"getNext",value:function(){return this.iter.getNext().key}},{key:"hasNext",value:function(){return this.iter.hasNext()}}]),e}();var Kh=new jh(Xl.comparator);function Wh(){return Kh}var Gh=new jh(Xl.comparator);function Qh(){return Gh}function Xh(){return new Fh((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)}))}var Yh=new jh(Xl.comparator),Jh=new qh(Xl.comparator);function $h(){for(var e=Jh,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];e=e.add(o)}return e}var Zh=new qh(Sl);function ed(){return Zh}var td=function(){function e(t,n,r,i,a){ie(this,e),this.snapshotVersion=t,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=a}return oe(e,null,[{key:"createSynthesizedRemoteEventForCurrentChange",value:function(t,n){var r=new Map;return r.set(t,nd.createSynthesizedTargetChangeForCurrentChange(t,n)),new e(Il.min(),r,ed(),Wh(),$h())}}]),e}(),nd=function(){function e(t,n,r,i,a){ie(this,e),this.resumeToken=t,this.current=n,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=a}return oe(e,null,[{key:"createSynthesizedTargetChangeForCurrentChange",value:function(t,n){return new e(Ml.EMPTY_BYTE_STRING,n,$h(),$h(),$h())}}]),e}(),rd=oe((function e(t,n,r,i){ie(this,e),this.O=t,this.removedTargetIds=n,this.key=r,this.F=i})),id=oe((function e(t,n){ie(this,e),this.targetId=t,this.$=n})),ad=oe((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ml.EMPTY_BYTE_STRING,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;ie(this,e),this.state=t,this.targetIds=n,this.resumeToken=r,this.cause=i})),od=function(){function e(){ie(this,e),this.B=0,this.L=cd(),this.U=Ml.EMPTY_BYTE_STRING,this.q=!1,this.G=!0}return oe(e,[{key:"current",get:function(){return this.q}},{key:"resumeToken",get:function(){return this.U}},{key:"K",get:function(){return 0!==this.B}},{key:"j",get:function(){return this.G}},{key:"W",value:function(e){e.approximateByteSize()>0&&(this.G=!0,this.U=e)}},{key:"H",value:function(){var e=$h(),t=$h(),n=$h();return this.L.forEach((function(r,i){switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:sl()}})),new nd(this.U,this.q,e,t,n)}},{key:"J",value:function(){this.G=!1,this.L=cd()}},{key:"Y",value:function(e,t){this.G=!0,this.L=this.L.insert(e,t)}},{key:"X",value:function(e){this.G=!0,this.L=this.L.remove(e)}},{key:"Z",value:function(){this.B+=1}},{key:"tt",value:function(){this.B-=1}},{key:"et",value:function(){this.G=!0,this.q=!0}}]),e}(),ud=function(){function e(t){ie(this,e),this.nt=t,this.st=new Map,this.it=Wh(),this.rt=sd(),this.ot=new qh(Sl)}return oe(e,[{key:"ut",value:function(e){var t,n=re(e.O);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.F&&e.F.isFoundDocument()?this.at(r,e.F):this.ct(r,e.key,e.F)}}catch(u){n.e(u)}finally{n.f()}var i,a=re(e.removedTargetIds);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.ct(o,e.key,e.F)}}catch(u){a.e(u)}finally{a.f()}}},{key:"ht",value:function(e){var t=this;this.forEachTarget(e,(function(n){var r=t.lt(n);switch(e.state){case 0:t.ft(n)&&r.W(e.resumeToken);break;case 1:r.tt(),r.K||r.J(),r.W(e.resumeToken);break;case 2:r.tt(),r.K||t.removeTarget(n);break;case 3:t.ft(n)&&(r.et(),r.W(e.resumeToken));break;case 4:t.ft(n)&&(t.dt(n),r.W(e.resumeToken));break;default:sl()}}))}},{key:"forEachTarget",value:function(e,t){var n=this;e.targetIds.length>0?e.targetIds.forEach(t):this.st.forEach((function(e,r){n.ft(r)&&t(r)}))}},{key:"_t",value:function(e){var t=e.targetId,n=e.$.count,r=this.wt(t);if(r){var i=r.target;if(Sf(i))if(0===n){var a=new Xl(i.path);this.ct(t,a,pf.newNoDocument(a,Il.min()))}else cl(1===n);else this.gt(t)!==n&&(this.dt(t),this.ot=this.ot.add(t))}}},{key:"yt",value:function(e){var t=this,n=new Map;this.st.forEach((function(r,i){var a=t.wt(i);if(a){if(r.current&&Sf(a.target)){var o=new Xl(a.target.path);null!==t.it.get(o)||t.It(i,o)||t.ct(i,o,pf.newNoDocument(o,e))}r.j&&(n.set(i,r.H()),r.J())}}));var r=$h();this.rt.forEach((function(e,n){var i=!0;n.forEachWhile((function(e){var n=t.wt(e);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(e))})),this.it.forEach((function(t,n){return n.setReadTime(e)}));var i=new td(e,n,this.ot,this.it,r);return this.it=Wh(),this.rt=sd(),this.ot=new qh(Sl),i}},{key:"at",value:function(e,t){if(this.ft(e)){var n=this.It(e,t.key)?2:0;this.lt(e).Y(t.key,n),this.it=this.it.insert(t.key,t),this.rt=this.rt.insert(t.key,this.Tt(t.key).add(e))}}},{key:"ct",value:function(e,t,n){if(this.ft(e)){var r=this.lt(e);this.It(e,t)?r.Y(t,1):r.X(t),this.rt=this.rt.insert(t,this.Tt(t).delete(e)),n&&(this.it=this.it.insert(t,n))}}},{key:"removeTarget",value:function(e){this.st.delete(e)}},{key:"gt",value:function(e){var t=this.lt(e).H();return this.nt.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}},{key:"Z",value:function(e){this.lt(e).Z()}},{key:"lt",value:function(e){var t=this.st.get(e);return t||(t=new od,this.st.set(e,t)),t}},{key:"Tt",value:function(e){var t=this.rt.get(e);return t||(t=new qh(Sl),this.rt=this.rt.insert(e,t)),t}},{key:"ft",value:function(e){var t=null!==this.wt(e);return t||il("WatchChangeAggregator","Detected inactive target",e),t}},{key:"wt",value:function(e){var t=this.st.get(e);return t&&t.K?null:this.nt.Et(e)}},{key:"dt",value:function(e){var t=this;this.st.set(e,new od),this.nt.getRemoteKeysForTarget(e).forEach((function(n){t.ct(e,n,null)}))}},{key:"It",value:function(e,t){return this.nt.getRemoteKeysForTarget(e).has(t)}}]),e}();function sd(){return new jh(Xl.comparator)}function cd(){return new jh(Xl.comparator)}var ld={asc:"ASCENDING",desc:"DESCENDING"},fd={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},hd=oe((function e(t,n){ie(this,e),this.databaseId=t,this.N=n}));function dd(e,t){return e.N?"".concat(new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z",""),".").concat(("000000000"+t.nanoseconds).slice(-9),"Z"):{seconds:""+t.seconds,nanos:t.nanoseconds}}function pd(e,t){return e.N?t.toBase64():t.toUint8Array()}function vd(e,t){return dd(e,t.toTimestamp())}function yd(e){return cl(!!e),Il.fromTimestamp(function(e){var t=Vl(e);return new xl(t.seconds,t.nanos)}(e))}function md(e,t){return function(e){return new Ll(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function gd(e){var t=Ll.fromString(e);return cl(Vd(t)),t}function kd(e,t){return md(e.databaseId,t.path)}function bd(e,t){var n=gd(t);if(n.get(1)!==e.databaseId.projectId)throw new hl(fl.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new hl(fl.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new Xl(Sd(n))}function wd(e,t){return md(e.databaseId,t)}function _d(e){var t=gd(e);return 4===t.length?Ll.emptyPath():Sd(t)}function Ed(e){return new Ll(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Sd(e){return cl(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function Td(e,t,n){return{name:kd(e,t),fields:n.value.mapValue.fields}}function xd(e,t){var n;if(t instanceof Ih)n={update:Td(e,t.key,t.value)};else if(t instanceof Ph)n={delete:kd(e,t.key)};else if(t instanceof Ch)n={update:Td(e,t.key,t.data),updateMask:Ud(t.fieldMask)};else{if(!(t instanceof Dh))return sl();n={verify:kd(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof lh)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof fh)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof dh)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof vh)return{fieldPath:t.field.canonicalString(),increment:n.k};throw sl()}(0,e)}))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:vd(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:sl()}(e,t.precondition)),n}function Id(e,t){return{documents:[wd(e,t.path)]}}function Cd(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=wd(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=wd(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(sf(e.value))return{unaryFilter:{field:Od(e.field),op:"IS_NAN"}};if(uf(e.value))return{unaryFilter:{field:Od(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(sf(e.value))return{unaryFilter:{field:Od(e.field),op:"IS_NOT_NAN"}};if(uf(e.value))return{unaryFilter:{field:Od(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Od(e.field),op:Ld(e.op),value:e.value}}}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var a=function(e){if(0!==e.length)return e.map((function(e){return function(e){return{field:Od(e.field),direction:Rd(e.dir)}}(e)}))}(t.orderBy);a&&(n.structuredQuery.orderBy=a);var o,u=function(e,t){return e.N||Wl(t)?t:{value:t}}(e,t.limit);return null!==u&&(n.structuredQuery.limit=u),t.startAt&&(n.structuredQuery.startAt={before:(o=t.startAt).inclusive,values:o.position}),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),n}function Nd(e){var t=_d(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){cl(1===r);var a=n.from[0];a.allDescendants?i=a.collectionId:t=t.child(a.collectionId)}var o=[];n.where&&(o=Ad(n.where));var u=[];n.orderBy&&(u=n.orderBy.map((function(e){return function(e){return new Df(Pd(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)})));var s=null;n.limit&&(s=function(e){var t;return Wl(t="object"==typeof e?e.value:e)?null:t}(n.limit));var c=null;n.startAt&&(c=function(e){var t=!!e.before,n=e.values||[];return new Pf(n,t)}(n.startAt));var l=null;return n.endAt&&(l=function(e){var t=!e.before,n=e.values||[];return new Pf(n,t)}(n.endAt)),jf(t,i,u,o,s,"F",c,l)}function Ad(e){return e?void 0!==e.unaryFilter?[Md(e)]:void 0!==e.fieldFilter?[Dd(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((function(e){return Ad(e)})).reduce((function(e,t){return e.concat(t)})):sl():[]}function Rd(e){return ld[e]}function Ld(e){return fd[e]}function Od(e){return{fieldPath:e.canonicalString()}}function Pd(e){return Pl.fromServerFormat(e.fieldPath)}function Dd(e){return Tf.create(Pd(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return sl()}}(e.fieldFilter.op),e.fieldFilter.value)}function Md(e){switch(e.unaryFilter.op){case"IS_NAN":var t=Pd(e.unaryFilter.field);return Tf.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=Pd(e.unaryFilter.field);return Tf.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=Pd(e.unaryFilter.field);return Tf.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=Pd(e.unaryFilter.field);return Tf.create(i,"!=",{nullValue:"NULL_VALUE"});default:return sl()}}function Ud(e){var t=[];return e.fields.forEach((function(e){return t.push(e.canonicalString())})),{fieldPaths:t}}function Vd(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}var Fd=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments"].concat(["clientMetadata"]).concat(["remoteDocumentGlobal"]).concat(["collectionParents"]).concat(["bundles","namedQueries"]),jd=([].concat(se(Fd),["documentOverlays"]),["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"]),zd=([].concat(jd,["indexConfiguration","indexState","indexEntries"]),"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."),Bd=function(){function e(){ie(this,e),this.onCommittedListeners=[]}return oe(e,[{key:"addOnCommittedListener",value:function(e){this.onCommittedListeners.push(e)}},{key:"raiseOnCommittedEvent",value:function(){this.onCommittedListeners.forEach((function(e){return e()}))}}]),e}(),qd=function(){function e(t){var n=this;ie(this,e),this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(e){n.isDone=!0,n.result=e,n.nextCallback&&n.nextCallback(e)}),(function(e){n.isDone=!0,n.error=e,n.catchCallback&&n.catchCallback(e)}))}return oe(e,[{key:"catch",value:function(e){return this.next(void 0,e)}},{key:"next",value:function(t,n){var r=this;return this.callbackAttached&&sl(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new e((function(e,i){r.nextCallback=function(n){r.wrapSuccess(t,n).next(e,i)},r.catchCallback=function(t){r.wrapFailure(n,t).next(e,i)}}))}},{key:"toPromise",value:function(){var e=this;return new Promise((function(t,n){e.next(t,n)}))}},{key:"wrapUserFunction",value:function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(t){return e.reject(t)}}},{key:"wrapSuccess",value:function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.resolve(n)}},{key:"wrapFailure",value:function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.reject(n)}}],[{key:"resolve",value:function(t){return new e((function(e,n){e(t)}))}},{key:"reject",value:function(t){return new e((function(e,n){n(t)}))}},{key:"waitFor",value:function(t){return new e((function(e,n){var r=0,i=0,a=!1;t.forEach((function(t){++r,t.next((function(){++i,a&&i===r&&e()}),(function(e){return n(e)}))})),a=!0,i===r&&e()}))}},{key:"or",value:function(t){var n,r=e.resolve(!1),i=re(t);try{var a=function(){var t=n.value;r=r.next((function(n){return n?e.resolve(n):t()}))};for(i.s();!(n=i.n()).done;)a()}catch(o){i.e(o)}finally{i.f()}return r}},{key:"forEach",value:function(e,t){var n=this,r=[];return e.forEach((function(e,i){r.push(t.call(n,e,i))})),this.waitFor(r)}}]),e}();function Hd(e){return"IndexedDbTransactionError"===e.name}var Kd=function(){function e(t,n,r,i){ie(this,e),this.batchId=t,this.localWriteTime=n,this.baseMutations=r,this.mutations=i}return oe(e,[{key:"applyToRemoteDocument",value:function(e,t){for(var n=t.mutationResults,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(e.key)&&_h(i,e,n[r])}}},{key:"applyToLocalView",value:function(e){var t,n=re(this.baseMutations);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.key.isEqual(e.key)&&Eh(r,e,this.localWriteTime)}}catch(u){n.e(u)}finally{n.f()}var i,a=re(this.mutations);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.key.isEqual(e.key)&&Eh(o,e,this.localWriteTime)}}catch(u){a.e(u)}finally{a.f()}}},{key:"applyToLocalDocumentSet",value:function(e){var t=this;this.mutations.forEach((function(n){var r=e.get(n.key),i=r;t.applyToLocalView(i),r.isValidDocument()||i.convertToNoDocument(Il.min())}))}},{key:"keys",value:function(){return this.mutations.reduce((function(e,t){return e.add(t.key)}),$h())}},{key:"isEqual",value:function(e){return this.batchId===e.batchId&&Tl(this.mutations,e.mutations,(function(e,t){return Th(e,t)}))&&Tl(this.baseMutations,e.baseMutations,(function(e,t){return Th(e,t)}))}}]),e}(),Wd=function(){function e(t,n,r,i){ie(this,e),this.batch=t,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}return oe(e,null,[{key:"from",value:function(t,n,r){cl(t.mutations.length===r.length);for(var i=Yh,a=t.mutations,o=0;o<a.length;o++)i=i.insert(a[o].key,r[o].version);return new e(t,n,r,i)}}]),e}(),Gd=function(){function e(t,n){ie(this,e),this.largestBatchId=t,this.mutation=n}return oe(e,[{key:"getKey",value:function(){return this.mutation.key}},{key:"isEqual",value:function(e){return null!==e&&this.mutation===e.mutation}},{key:"toString",value:function(){return"Overlay{\n      largestBatchId: ".concat(this.largestBatchId,",\n      mutation: ").concat(this.mutation.toString(),"\n    }")}}]),e}(),Qd=function(){function e(t,n,r,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Il.min(),o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Il.min(),u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Ml.EMPTY_BYTE_STRING;ie(this,e),this.target=t,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=u}return oe(e,[{key:"withSequenceNumber",value:function(t){return new e(this.target,this.targetId,this.purpose,t,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)}},{key:"withResumeToken",value:function(t,n){return new e(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t)}},{key:"withLastLimboFreeSnapshotVersion",value:function(t){return new e(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,t,this.resumeToken)}}]),e}(),Xd=oe((function e(t){ie(this,e),this.Jt=t}));function Yd(e){var t=Nd({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Xf(t,t.limit,"L"):t}var Jd=function(){function e(){ie(this,e)}return oe(e,[{key:"Zt",value:function(e,t){this.te(e,t),t.ee()}},{key:"te",value:function(e,t){if("nullValue"in e)this.ne(t,5);else if("booleanValue"in e)this.ne(t,10),t.se(e.booleanValue?1:0);else if("integerValue"in e)this.ne(t,15),t.se(Fl(e.integerValue));else if("doubleValue"in e){var n=Fl(e.doubleValue);isNaN(n)?this.ne(t,13):(this.ne(t,15),Gl(n)?t.se(0):t.se(n))}else if("timestampValue"in e){var r=e.timestampValue;this.ne(t,20),"string"==typeof r?t.ie(r):(t.ie("".concat(r.seconds||"")),t.se(r.nanos||0))}else if("stringValue"in e)this.re(e.stringValue,t),this.oe(t);else if("bytesValue"in e)this.ne(t,30),t.ue(jl(e.bytesValue)),this.oe(t);else if("referenceValue"in e)this.ae(e.referenceValue,t);else if("geoPointValue"in e){var i=e.geoPointValue;this.ne(t,45),t.se(i.latitude||0),t.se(i.longitude||0)}else"mapValue"in e?ff(e)?this.ne(t,Number.MAX_SAFE_INTEGER):(this.ce(e.mapValue,t),this.oe(t)):"arrayValue"in e?(this.he(e.arrayValue,t),this.oe(t)):sl()}},{key:"re",value:function(e,t){this.ne(t,25),this.le(e,t)}},{key:"le",value:function(e,t){t.ie(e)}},{key:"ce",value:function(e,t){var n=e.fields||{};this.ne(t,55);for(var r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];this.re(a,t),this.te(n[a],t)}}},{key:"he",value:function(e,t){var n=e.values||[];this.ne(t,50);var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.te(a,t)}}catch(o){i.e(o)}finally{i.f()}}},{key:"ae",value:function(e,t){var n=this;this.ne(t,37),Xl.fromName(e).path.forEach((function(e){n.ne(t,60),n.le(e,t)}))}},{key:"ne",value:function(e,t){e.se(t)}},{key:"oe",value:function(e){e.se(2)}}]),e}();Jd.fe=new Jd;var $d=function(){function e(){ie(this,e),this.qe=new Zd}return oe(e,[{key:"addToCollectionParentIndex",value:function(e,t){return this.qe.add(t),qd.resolve()}},{key:"getCollectionParents",value:function(e,t){return qd.resolve(this.qe.getEntries(t))}},{key:"addFieldIndex",value:function(e,t){return qd.resolve()}},{key:"deleteFieldIndex",value:function(e,t){return qd.resolve()}},{key:"getDocumentsMatchingTarget",value:function(e,t){return qd.resolve(null)}},{key:"getFieldIndex",value:function(e,t){return qd.resolve(null)}},{key:"getFieldIndexes",value:function(e,t){return qd.resolve([])}},{key:"getNextCollectionGroupToUpdate",value:function(e){return qd.resolve(null)}},{key:"updateCollectionGroup",value:function(e,t,n){return qd.resolve()}},{key:"updateIndexEntries",value:function(e,t){return qd.resolve()}}]),e}(),Zd=function(){function e(){ie(this,e),this.index={}}return oe(e,[{key:"add",value:function(e){var t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new qh(Ll.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}},{key:"has",value:function(e){var t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}},{key:"getEntries",value:function(e){return(this.index[e]||new qh(Ll.comparator)).toArray()}}]),e}();new Uint8Array(0);var ep=function(){function e(t,n,r){ie(this,e),this.cacheSizeCollectionThreshold=t,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}return oe(e,null,[{key:"withCacheSize",value:function(t){return new e(t,e.DEFAULT_COLLECTION_PERCENTILE,e.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}]),e}();ep.DEFAULT_COLLECTION_PERCENTILE=10,ep.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ep.DEFAULT=new ep(41943040,ep.DEFAULT_COLLECTION_PERCENTILE,ep.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ep.DISABLED=new ep(-1,0,0);var tp=function(){function e(t){ie(this,e),this.wn=t}return oe(e,[{key:"next",value:function(){return this.wn+=2,this.wn}}],[{key:"mn",value:function(){return new e(0)}},{key:"gn",value:function(){return new e(-1)}}]),e}();function np(e){return rp.apply(this,arguments)}function rp(){return rp=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.code===fl.FAILED_PRECONDITION&&t.message===zd){e.next=2;break}throw t;case 2:il("LocalStore","Unexpectedly lost primary lease");case 3:case"end":return e.stop()}}),e)}))),rp.apply(this,arguments)}var ip=function(){function e(){ie(this,e),this.changes=new Fh((function(e){return e.toString()}),(function(e,t){return e.isEqual(t)})),this.changesApplied=!1}return oe(e,[{key:"addEntry",value:function(e){this.assertNotApplied(),this.changes.set(e.key,e)}},{key:"removeEntry",value:function(e,t){this.assertNotApplied(),this.changes.set(e,pf.newInvalidDocument(e).setReadTime(t))}},{key:"getEntry",value:function(e,t){this.assertNotApplied();var n=this.changes.get(t);return void 0!==n?qd.resolve(n):this.getFromCache(e,t)}},{key:"getEntries",value:function(e,t){return this.getAllFromCache(e,t)}},{key:"apply",value:function(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}},{key:"assertNotApplied",value:function(){}}]),e}();var ap=function(){function e(t,n,r){ie(this,e),this.fs=t,this.$s=n,this.indexManager=r}return oe(e,[{key:"Bs",value:function(e,t){var n=this;return this.$s.getAllMutationBatchesAffectingDocumentKey(e,t).next((function(r){return n.Ls(e,t,r)}))}},{key:"Ls",value:function(e,t,n){return this.fs.getEntry(e,t).next((function(e){var t,r=re(n);try{for(r.s();!(t=r.n()).done;){t.value.applyToLocalView(e)}}catch(i){r.e(i)}finally{r.f()}return e}))}},{key:"Us",value:function(e,t){e.forEach((function(e,n){var r,i=re(t);try{for(i.s();!(r=i.n()).done;){r.value.applyToLocalView(n)}}catch(a){i.e(a)}finally{i.f()}}))}},{key:"qs",value:function(e,t){var n=this;return this.fs.getEntries(e,t).next((function(t){return n.Gs(e,t).next((function(){return t}))}))}},{key:"Gs",value:function(e,t){var n=this;return this.$s.getAllMutationBatchesAffectingDocumentKeys(e,t).next((function(e){return n.Us(t,e)}))}},{key:"Ks",value:function(e,t,n){return function(e){return Xl.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.Qs(e,t.path):Wf(t)?this.js(e,t,n):this.Ws(e,t,n)}},{key:"Qs",value:function(e,t){return this.Bs(e,new Xl(t)).next((function(e){var t=Qh();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t}))}},{key:"js",value:function(e,t,n){var r=this,i=t.collectionGroup,a=Qh();return this.indexManager.getCollectionParents(e,i).next((function(o){return qd.forEach(o,(function(o){var u=function(e,t){return new Ff(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,o.child(i));return r.Ws(e,u,n).next((function(e){e.forEach((function(e,t){a=a.insert(e,t)}))}))})).next((function(){return a}))}))}},{key:"Ws",value:function(e,t,n){var r,i=this;return this.fs.getAllFromCollection(e,t.path,n).next((function(n){return r=n,i.$s.getAllMutationBatchesAffectingQuery(e,t)})).next((function(e){var t,n=re(e);try{for(n.s();!(t=n.n()).done;){var i,a=t.value,o=re(a.mutations);try{for(o.s();!(i=o.n()).done;){var u=i.value,s=u.key,c=r.get(s);null==c&&(c=pf.newInvalidDocument(s),r=r.insert(s,c)),Eh(u,c,a.localWriteTime),c.isFoundDocument()||(r=r.remove(s))}}catch(l){o.e(l)}finally{o.f()}}}catch(l){n.e(l)}finally{n.f()}})).next((function(){return r.forEach((function(e,n){Zf(t,n)||(r=r.remove(e))})),r}))}}]),e}(),op=function(){function e(t,n,r,i){ie(this,e),this.targetId=t,this.fromCache=n,this.zs=r,this.Hs=i}return oe(e,null,[{key:"Js",value:function(t,n){var r,i=$h(),a=$h(),o=re(n.docChanges);try{for(o.s();!(r=o.n()).done;){var u=r.value;switch(u.type){case 0:i=i.add(u.doc.key);break;case 1:a=a.add(u.doc.key)}}}catch(s){o.e(s)}finally{o.f()}return new e(t,n.fromCache,i,a)}}]),e}(),up=function(){function e(){ie(this,e)}return oe(e,[{key:"Ys",value:function(e){this.Xs=e}},{key:"Ks",value:function(e,t,n,r){var i=this;return function(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}(t)||n.isEqual(Il.min())?this.Zs(e,t):this.Xs.qs(e,r).next((function(a){var o=i.ti(t,a);return(Bf(t)||qf(t))&&i.ei(t.limitType,o,r,n)?i.Zs(e,t):(rl()<=qe.DEBUG&&il("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),$f(t)),i.Xs.Ks(e,t,yf(n,-1)).next((function(e){return o.forEach((function(t){e=e.insert(t.key,t)})),e})))}))}},{key:"ti",value:function(e,t){var n=new qh(th(e));return t.forEach((function(t,r){Zf(e,r)&&(n=n.add(r))})),n}},{key:"ei",value:function(e,t,n,r){if(n.size!==t.size)return!0;var i="F"===e?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}},{key:"Zs",value:function(e,t){return rl()<=qe.DEBUG&&il("QueryEngine","Using full collection scan to execute query:",$f(t)),this.Xs.Ks(e,t,gf.min())}}]),e}(),sp=function(){function e(t,n,r,i){ie(this,e),this.persistence=t,this.ni=n,this.M=i,this.si=new jh(Sl),this.ii=new Fh((function(e){return _f(e)}),Ef),this.ri=new Map,this.oi=t.getRemoteDocumentCache(),this.ls=t.getTargetCache(),this.ds=t.getBundleCache(),this.ui(r)}return oe(e,[{key:"ui",value:function(e){this.indexManager=this.persistence.getIndexManager(e),this.$s=this.persistence.getMutationQueue(e,this.indexManager),this.ai=new ap(this.oi,this.$s,this.indexManager),this.oi.setIndexManager(this.indexManager),this.ni.Ys(this.ai)}},{key:"collectGarbage",value:function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.collect(n,t.si)}))}}]),e}();function cp(e,t,n,r){return new sp(e,t,n,r)}function lp(e,t){return fp.apply(this,arguments)}function fp(){return fp=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ll(t),e.next=3,r.persistence.runTransaction("Handle user change","readonly",(function(e){var t;return r.$s.getAllMutationBatches(e).next((function(i){return t=i,r.ui(n),r.$s.getAllMutationBatches(e)})).next((function(n){var i,a=[],o=[],u=$h(),s=re(t);try{for(s.s();!(i=s.n()).done;){var c=i.value;a.push(c.batchId);var l,f=re(c.mutations);try{for(f.s();!(l=f.n()).done;){var h=l.value;u=u.add(h.key)}}catch(k){f.e(k)}finally{f.f()}}}catch(k){s.e(k)}finally{s.f()}var d,p=re(n);try{for(p.s();!(d=p.n()).done;){var v=d.value;o.push(v.batchId);var y,m=re(v.mutations);try{for(m.s();!(y=m.n()).done;){var g=y.value;u=u.add(g.key)}}catch(k){m.e(k)}finally{m.f()}}}catch(k){p.e(k)}finally{p.f()}return r.ai.qs(e,u).next((function(e){return{ci:e,removedBatchIds:a,addedBatchIds:o}}))}))}));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),fp.apply(this,arguments)}function hp(e,t){var n=ll(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(e){var r=t.batch.keys(),i=n.oi.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){var i=n.batch,a=i.keys(),o=qd.resolve();return a.forEach((function(e){o=o.next((function(){return r.getEntry(t,e)})).next((function(t){var a=n.docVersions.get(e);cl(null!==a),t.version.compareTo(a)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))}))})),o.next((function(){return e.$s.removeMutationBatch(t,i)}))}(n,e,t,i).next((function(){return i.apply(e)})).next((function(){return n.$s.performConsistencyCheck(e)})).next((function(){return n.ai.qs(e,r)}))}))}function dp(e){var t=ll(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.ls.getLastRemoteSnapshotVersion(e)}))}function pp(e,t){var n=ll(e),r=t.snapshotVersion,i=n.si;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(e){var a=n.oi.newChangeBuffer({trackRemovals:!0});i=n.si;var o=[];t.targetChanges.forEach((function(a,u){var s=i.get(u);if(s){o.push(n.ls.removeMatchingKeys(e,a.removedDocuments,u).next((function(){return n.ls.addMatchingKeys(e,a.addedDocuments,u)})));var c=s.withSequenceNumber(e.currentSequenceNumber);t.targetMismatches.has(u)?c=c.withResumeToken(Ml.EMPTY_BYTE_STRING,Il.min()).withLastLimboFreeSnapshotVersion(Il.min()):a.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(a.resumeToken,r)),i=i.insert(u,c),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||(t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)}(s,c,a)&&o.push(n.ls.updateTargetData(e,c))}}));var u=Wh();if(t.documentUpdates.forEach((function(r){t.resolvedLimboDocuments.has(r)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),o.push(vp(e,a,t.documentUpdates).next((function(e){u=e}))),!r.isEqual(Il.min())){var s=n.ls.getLastRemoteSnapshotVersion(e).next((function(t){return n.ls.setTargetsMetadata(e,e.currentSequenceNumber,r)}));o.push(s)}return qd.waitFor(o).next((function(){return a.apply(e)})).next((function(){return n.ai.Gs(e,u)})).next((function(){return u}))})).then((function(e){return n.si=i,e}))}function vp(e,t,n){var r=$h();return n.forEach((function(e){return r=r.add(e)})),t.getEntries(e,r).next((function(e){var r=Wh();return n.forEach((function(n,i){var a=e.get(n);i.isNoDocument()&&i.version.isEqual(Il.min())?(t.removeEntry(n,i.readTime),r=r.insert(n,i)):!a.isValidDocument()||i.version.compareTo(a.version)>0||0===i.version.compareTo(a.version)&&a.hasPendingWrites?(t.addEntry(i),r=r.insert(n,i)):il("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",i.version)})),r}))}function yp(e,t){var n=ll(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n.$s.getNextMutationBatchAfterBatchId(e,t)}))}function mp(e,t){var n=ll(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.ls.getTargetData(e,t).next((function(i){return i?(r=i,qd.resolve(r)):n.ls.allocateTargetId(e).next((function(i){return r=new Qd(t,i,0,e.currentSequenceNumber),n.ls.addTargetData(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.si.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.si=n.si.insert(e.targetId,e),n.ii.set(t,e.targetId)),e}))}function gp(e,t,n){return kp.apply(this,arguments)}function kp(){return kp=i(h().mark((function e(t,n,r){var i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=ll(t),a=i.si.get(n),o=r?"readwrite":"readwrite-primary",e.prev=1,e.t0=r,e.t0){e.next=6;break}return e.next=6,i.persistence.runTransaction("Release target",o,(function(e){return i.persistence.referenceDelegate.removeTarget(e,a)}));case 6:e.next=13;break;case 8:if(e.prev=8,e.t1=e.catch(1),Hd(e.t1)){e.next=12;break}throw e.t1;case 12:il("LocalStore","Failed to update sequence numbers for target ".concat(n,": ").concat(e.t1));case 13:i.si=i.si.remove(n),i.ii.delete(a.target);case 14:case"end":return e.stop()}}),e,null,[[1,8]])}))),kp.apply(this,arguments)}function bp(e,t,n){var r=ll(e),i=Il.min(),a=$h();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=ll(e),i=r.ii.get(n);return void 0!==i?qd.resolve(r.si.get(i)):r.ls.getTargetData(t,n)}(r,e,Qf(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.ls.getMatchingKeysForTargetId(e,t.targetId).next((function(e){a=e}))})).next((function(){return r.ni.Ks(e,t,n?i:Il.min(),n?a:$h())})).next((function(e){return wp(r,eh(t),e),{documents:e,hi:a}}))}))}function wp(e,t,n){var r=Il.min();n.forEach((function(e,t){t.readTime.compareTo(r)>0&&(r=t.readTime)})),e.ri.set(t,r)}var _p=function(){function e(t){ie(this,e),this.M=t,this._i=new Map,this.wi=new Map}return oe(e,[{key:"getBundleMetadata",value:function(e,t){return qd.resolve(this._i.get(t))}},{key:"saveBundleMetadata",value:function(e,t){var n;return this._i.set(t.id,{id:(n=t).id,version:n.version,createTime:yd(n.createTime)}),qd.resolve()}},{key:"getNamedQuery",value:function(e,t){return qd.resolve(this.wi.get(t))}},{key:"saveNamedQuery",value:function(e,t){return this.wi.set(t.name,function(e){return{name:e.name,query:Yd(e.bundledQuery),readTime:yd(e.readTime)}}(t)),qd.resolve()}}]),e}(),Ep=function(){function e(){ie(this,e),this.overlays=new jh(Xl.comparator),this.mi=new Map}return oe(e,[{key:"getOverlay",value:function(e,t){return qd.resolve(this.overlays.get(t))}},{key:"saveOverlays",value:function(e,t,n){var r=this;return n.forEach((function(n,i){r.Xt(e,t,i)})),qd.resolve()}},{key:"removeOverlaysForBatchId",value:function(e,t,n){var r=this,i=this.mi.get(n);return void 0!==i&&(i.forEach((function(e){return r.overlays=r.overlays.remove(e)})),this.mi.delete(n)),qd.resolve()}},{key:"getOverlaysForCollection",value:function(e,t,n){for(var r=Xh(),i=t.length+1,a=new Xl(t.child("")),o=this.overlays.getIteratorFrom(a);o.hasNext();){var u=o.getNext().value,s=u.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&u.largestBatchId>n&&r.set(u.getKey(),u)}return qd.resolve(r)}},{key:"getOverlaysForCollectionGroup",value:function(e,t,n,r){for(var i=new jh((function(e,t){return e-t})),a=this.overlays.getIterator();a.hasNext();){var o=a.getNext().value;if(o.getKey().getCollectionGroup()===t&&o.largestBatchId>n){var u=i.get(o.largestBatchId);null===u&&(u=Xh(),i=i.insert(o.largestBatchId,u)),u.set(o.getKey(),o)}}for(var s=Xh(),c=i.getIterator();c.hasNext()&&(c.getNext().value.forEach((function(e,t){return s.set(e,t)})),!(s.size()>=r)););return qd.resolve(s)}},{key:"Xt",value:function(e,t,n){if(null!==n){var r=this.overlays.get(n.key);if(null!==r){var i=this.mi.get(r.largestBatchId).delete(n.key);this.mi.set(r.largestBatchId,i)}this.overlays=this.overlays.insert(n.key,new Gd(t,n));var a=this.mi.get(t);void 0===a&&(a=$h(),this.mi.set(t,a)),this.mi.set(t,a.add(n.key))}}}]),e}(),Sp=function(){function e(){ie(this,e),this.gi=new qh(Tp.yi),this.pi=new qh(Tp.Ii)}return oe(e,[{key:"isEmpty",value:function(){return this.gi.isEmpty()}},{key:"addReference",value:function(e,t){var n=new Tp(e,t);this.gi=this.gi.add(n),this.pi=this.pi.add(n)}},{key:"Ti",value:function(e,t){var n=this;e.forEach((function(e){return n.addReference(e,t)}))}},{key:"removeReference",value:function(e,t){this.Ei(new Tp(e,t))}},{key:"Ai",value:function(e,t){var n=this;e.forEach((function(e){return n.removeReference(e,t)}))}},{key:"Ri",value:function(e){var t=this,n=new Xl(new Ll([])),r=new Tp(n,e),i=new Tp(n,e+1),a=[];return this.pi.forEachInRange([r,i],(function(e){t.Ei(e),a.push(e.key)})),a}},{key:"bi",value:function(){var e=this;this.gi.forEach((function(t){return e.Ei(t)}))}},{key:"Ei",value:function(e){this.gi=this.gi.delete(e),this.pi=this.pi.delete(e)}},{key:"Pi",value:function(e){var t=new Xl(new Ll([])),n=new Tp(t,e),r=new Tp(t,e+1),i=$h();return this.pi.forEachInRange([n,r],(function(e){i=i.add(e.key)})),i}},{key:"containsKey",value:function(e){var t=new Tp(e,0),n=this.gi.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}]),e}(),Tp=function(){function e(t,n){ie(this,e),this.key=t,this.Vi=n}return oe(e,null,[{key:"yi",value:function(e,t){return Xl.comparator(e.key,t.key)||Sl(e.Vi,t.Vi)}},{key:"Ii",value:function(e,t){return Sl(e.Vi,t.Vi)||Xl.comparator(e.key,t.key)}}]),e}(),xp=function(){function e(t,n){ie(this,e),this.indexManager=t,this.referenceDelegate=n,this.$s=[],this.vi=1,this.Si=new qh(Tp.yi)}return oe(e,[{key:"checkEmpty",value:function(e){return qd.resolve(0===this.$s.length)}},{key:"addMutationBatch",value:function(e,t,n,r){var i=this.vi;this.vi++,this.$s.length>0&&this.$s[this.$s.length-1];var a=new Kd(i,t,n,r);this.$s.push(a);var o,u=re(r);try{for(u.s();!(o=u.n()).done;){var s=o.value;this.Si=this.Si.add(new Tp(s.key,i)),this.indexManager.addToCollectionParentIndex(e,s.key.path.popLast())}}catch(c){u.e(c)}finally{u.f()}return qd.resolve(a)}},{key:"lookupMutationBatch",value:function(e,t){return qd.resolve(this.Di(t))}},{key:"getNextMutationBatchAfterBatchId",value:function(e,t){var n=t+1,r=this.Ci(n),i=r<0?0:r;return qd.resolve(this.$s.length>i?this.$s[i]:null)}},{key:"getHighestUnacknowledgedBatchId",value:function(){return qd.resolve(0===this.$s.length?-1:this.vi-1)}},{key:"getAllMutationBatches",value:function(e){return qd.resolve(this.$s.slice())}},{key:"getAllMutationBatchesAffectingDocumentKey",value:function(e,t){var n=this,r=new Tp(t,0),i=new Tp(t,Number.POSITIVE_INFINITY),a=[];return this.Si.forEachInRange([r,i],(function(e){var t=n.Di(e.Vi);a.push(t)})),qd.resolve(a)}},{key:"getAllMutationBatchesAffectingDocumentKeys",value:function(e,t){var n=this,r=new qh(Sl);return t.forEach((function(e){var t=new Tp(e,0),i=new Tp(e,Number.POSITIVE_INFINITY);n.Si.forEachInRange([t,i],(function(e){r=r.add(e.Vi)}))})),qd.resolve(this.xi(r))}},{key:"getAllMutationBatchesAffectingQuery",value:function(e,t){var n=t.path,r=n.length+1,i=n;Xl.isDocumentKey(i)||(i=i.child(""));var a=new Tp(new Xl(i),0),o=new qh(Sl);return this.Si.forEachWhile((function(e){var t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(o=o.add(e.Vi)),!0)}),a),qd.resolve(this.xi(o))}},{key:"xi",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.Di(e);null!==r&&n.push(r)})),n}},{key:"removeMutationBatch",value:function(e,t){var n=this;cl(0===this.Ni(t.batchId,"removed")),this.$s.shift();var r=this.Si;return qd.forEach(t.mutations,(function(i){var a=new Tp(i.key,t.batchId);return r=r.delete(a),n.referenceDelegate.markPotentiallyOrphaned(e,i.key)})).next((function(){n.Si=r}))}},{key:"dn",value:function(e){}},{key:"containsKey",value:function(e,t){var n=new Tp(t,0),r=this.Si.firstAfterOrEqual(n);return qd.resolve(t.isEqual(r&&r.key))}},{key:"performConsistencyCheck",value:function(e){return this.$s.length,qd.resolve()}},{key:"Ni",value:function(e,t){return this.Ci(e)}},{key:"Ci",value:function(e){return 0===this.$s.length?0:e-this.$s[0].batchId}},{key:"Di",value:function(e){var t=this.Ci(e);return t<0||t>=this.$s.length?null:this.$s[t]}}]),e}(),Ip=function(){function e(t){ie(this,e),this.ki=t,this.docs=new jh(Xl.comparator),this.size=0}return oe(e,[{key:"setIndexManager",value:function(e){this.indexManager=e}},{key:"addEntry",value:function(e,t){var n=t.key,r=this.docs.get(n),i=r?r.size:0,a=this.ki(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:a}),this.size+=a-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}},{key:"removeEntry",value:function(e){var t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}},{key:"getEntry",value:function(e,t){var n=this.docs.get(t);return qd.resolve(n?n.document.mutableCopy():pf.newInvalidDocument(t))}},{key:"getEntries",value:function(e,t){var n=this,r=Wh();return t.forEach((function(e){var t=n.docs.get(e);r=r.insert(e,t?t.document.mutableCopy():pf.newInvalidDocument(e))})),qd.resolve(r)}},{key:"getAllFromCollection",value:function(e,t,n){for(var r=Wh(),i=new Xl(t.child("")),a=this.docs.getIteratorFrom(i);a.hasNext();){var o=a.getNext(),u=o.key,s=o.value.document;if(!t.isPrefixOf(u.path))break;u.path.length>t.length+1||kf(mf(s),n)<=0||(r=r.insert(s.key,s.mutableCopy()))}return qd.resolve(r)}},{key:"getAllFromCollectionGroup",value:function(e,t,n,r){sl()}},{key:"Mi",value:function(e,t){return qd.forEach(this.docs,(function(e){return t(e)}))}},{key:"newChangeBuffer",value:function(e){return new Cp(this)}},{key:"getSize",value:function(e){return qd.resolve(this.size)}}]),e}(),Cp=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this)).qn=e,r}return oe(n,[{key:"applyChanges",value:function(e){var t=this,n=[];return this.changes.forEach((function(r,i){i.isValidDocument()?n.push(t.qn.addEntry(e,i)):t.qn.removeEntry(r)})),qd.waitFor(n)}},{key:"getFromCache",value:function(e,t){return this.qn.getEntry(e,t)}},{key:"getAllFromCache",value:function(e,t){return this.qn.getEntries(e,t)}}]),n}(ip),Np=function(){function e(t){ie(this,e),this.persistence=t,this.Oi=new Fh((function(e){return _f(e)}),Ef),this.lastRemoteSnapshotVersion=Il.min(),this.highestTargetId=0,this.Fi=0,this.$i=new Sp,this.targetCount=0,this.Bi=tp.mn()}return oe(e,[{key:"forEachTarget",value:function(e,t){return this.Oi.forEach((function(e,n){return t(n)})),qd.resolve()}},{key:"getLastRemoteSnapshotVersion",value:function(e){return qd.resolve(this.lastRemoteSnapshotVersion)}},{key:"getHighestSequenceNumber",value:function(e){return qd.resolve(this.Fi)}},{key:"allocateTargetId",value:function(e){return this.highestTargetId=this.Bi.next(),qd.resolve(this.highestTargetId)}},{key:"setTargetsMetadata",value:function(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Fi&&(this.Fi=t),qd.resolve()}},{key:"In",value:function(e){this.Oi.set(e.target,e);var t=e.targetId;t>this.highestTargetId&&(this.Bi=new tp(t),this.highestTargetId=t),e.sequenceNumber>this.Fi&&(this.Fi=e.sequenceNumber)}},{key:"addTargetData",value:function(e,t){return this.In(t),this.targetCount+=1,qd.resolve()}},{key:"updateTargetData",value:function(e,t){return this.In(t),qd.resolve()}},{key:"removeTargetData",value:function(e,t){return this.Oi.delete(t.target),this.$i.Ri(t.targetId),this.targetCount-=1,qd.resolve()}},{key:"removeTargets",value:function(e,t,n){var r=this,i=0,a=[];return this.Oi.forEach((function(o,u){u.sequenceNumber<=t&&null===n.get(u.targetId)&&(r.Oi.delete(o),a.push(r.removeMatchingKeysForTargetId(e,u.targetId)),i++)})),qd.waitFor(a).next((function(){return i}))}},{key:"getTargetCount",value:function(e){return qd.resolve(this.targetCount)}},{key:"getTargetData",value:function(e,t){var n=this.Oi.get(t)||null;return qd.resolve(n)}},{key:"addMatchingKeys",value:function(e,t,n){return this.$i.Ti(t,n),qd.resolve()}},{key:"removeMatchingKeys",value:function(e,t,n){this.$i.Ai(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((function(t){i.push(r.markPotentiallyOrphaned(e,t))})),qd.waitFor(i)}},{key:"removeMatchingKeysForTargetId",value:function(e,t){return this.$i.Ri(t),qd.resolve()}},{key:"getMatchingKeysForTargetId",value:function(e,t){var n=this.$i.Pi(t);return qd.resolve(n)}},{key:"containsKey",value:function(e,t){return qd.resolve(this.$i.containsKey(t))}}]),e}(),Ap=function(){function e(t,n){var r=this;ie(this,e),this.Li={},this.overlays={},this.ts=new wl(0),this.es=!1,this.es=!0,this.referenceDelegate=t(this),this.ls=new Np(this),this.indexManager=new $d,this.fs=new Ip((function(e){return r.referenceDelegate.Ui(e)})),this.M=new Xd(n),this.ds=new _p(this.M)}return oe(e,[{key:"start",value:function(){return Promise.resolve()}},{key:"shutdown",value:function(){return this.es=!1,Promise.resolve()}},{key:"started",get:function(){return this.es}},{key:"setDatabaseDeletedListener",value:function(){}},{key:"setNetworkEnabled",value:function(){}},{key:"getIndexManager",value:function(e){return this.indexManager}},{key:"getDocumentOverlayCache",value:function(e){var t=this.overlays[e.toKey()];return t||(t=new Ep,this.overlays[e.toKey()]=t),t}},{key:"getMutationQueue",value:function(e,t){var n=this.Li[e.toKey()];return n||(n=new xp(t,this.referenceDelegate),this.Li[e.toKey()]=n),n}},{key:"getTargetCache",value:function(){return this.ls}},{key:"getRemoteDocumentCache",value:function(){return this.fs}},{key:"getBundleCache",value:function(){return this.ds}},{key:"runTransaction",value:function(e,t,n){var r=this;il("MemoryPersistence","Starting transaction:",e);var i=new Rp(this.ts.next());return this.referenceDelegate.qi(),n(i).next((function(e){return r.referenceDelegate.Gi(i).next((function(){return e}))})).toPromise().then((function(e){return i.raiseOnCommittedEvent(),e}))}},{key:"Ki",value:function(e,t){return qd.or(Object.values(this.Li).map((function(n){return function(){return n.containsKey(e,t)}})))}}]),e}(),Rp=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this)).currentSequenceNumber=e,r}return oe(n)}(Bd),Lp=function(){function e(t){ie(this,e),this.persistence=t,this.Qi=new Sp,this.ji=null}return oe(e,[{key:"zi",get:function(){if(this.ji)return this.ji;throw sl()}},{key:"addReference",value:function(e,t,n){return this.Qi.addReference(n,t),this.zi.delete(n.toString()),qd.resolve()}},{key:"removeReference",value:function(e,t,n){return this.Qi.removeReference(n,t),this.zi.add(n.toString()),qd.resolve()}},{key:"markPotentiallyOrphaned",value:function(e,t){return this.zi.add(t.toString()),qd.resolve()}},{key:"removeTarget",value:function(e,t){var n=this;this.Qi.Ri(t.targetId).forEach((function(e){return n.zi.add(e.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next((function(e){e.forEach((function(e){return n.zi.add(e.toString())}))})).next((function(){return r.removeTargetData(e,t)}))}},{key:"qi",value:function(){this.ji=new Set}},{key:"Gi",value:function(e){var t=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return qd.forEach(this.zi,(function(r){var i=Xl.fromPath(r);return t.Hi(e,i).next((function(e){e||n.removeEntry(i,Il.min())}))})).next((function(){return t.ji=null,n.apply(e)}))}},{key:"updateLimboDocument",value:function(e,t){var n=this;return this.Hi(e,t).next((function(e){e?n.zi.delete(t.toString()):n.zi.add(t.toString())}))}},{key:"Ui",value:function(e){return 0}},{key:"Hi",value:function(e,t){var n=this;return qd.or([function(){return qd.resolve(n.Qi.containsKey(t))},function(){return n.persistence.getTargetCache().containsKey(e,t)},function(){return n.persistence.Ki(e,t)}])}}],[{key:"Wi",value:function(t){return new e(t)}}]),e}();var Op=function(){function e(){ie(this,e),this.activeTargetIds=ed()}return oe(e,[{key:"Xi",value:function(e){this.activeTargetIds=this.activeTargetIds.add(e)}},{key:"Zi",value:function(e){this.activeTargetIds=this.activeTargetIds.delete(e)}},{key:"Yi",value:function(){var e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}]),e}(),Pp=function(){function e(){ie(this,e),this.Fr=new Op,this.$r={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return oe(e,[{key:"addPendingMutation",value:function(e){}},{key:"updateMutationState",value:function(e,t,n){}},{key:"addLocalQueryTarget",value:function(e){return this.Fr.Xi(e),this.$r[e]||"not-current"}},{key:"updateQueryState",value:function(e,t,n){this.$r[e]=t}},{key:"removeLocalQueryTarget",value:function(e){this.Fr.Zi(e)}},{key:"isLocalQueryTarget",value:function(e){return this.Fr.activeTargetIds.has(e)}},{key:"clearQueryState",value:function(e){delete this.$r[e]}},{key:"getAllActiveQueryTargets",value:function(){return this.Fr.activeTargetIds}},{key:"isActiveQueryTarget",value:function(e){return this.Fr.activeTargetIds.has(e)}},{key:"start",value:function(){return this.Fr=new Op,Promise.resolve()}},{key:"handleUserChange",value:function(e,t,n){}},{key:"setOnlineState",value:function(e){}},{key:"shutdown",value:function(){}},{key:"writeSequenceNumber",value:function(e){}},{key:"notifyBundleLoaded",value:function(e){}}]),e}(),Dp=function(){function e(){ie(this,e)}return oe(e,[{key:"Br",value:function(e){}},{key:"shutdown",value:function(){}}]),e}(),Mp=function(){function e(){var t=this;ie(this,e),this.Lr=function(){return t.Ur()},this.qr=function(){return t.Gr()},this.Kr=[],this.Qr()}return oe(e,[{key:"Br",value:function(e){this.Kr.push(e)}},{key:"shutdown",value:function(){window.removeEventListener("online",this.Lr),window.removeEventListener("offline",this.qr)}},{key:"Qr",value:function(){window.addEventListener("online",this.Lr),window.addEventListener("offline",this.qr)}},{key:"Ur",value:function(){il("ConnectivityMonitor","Network connectivity changed: AVAILABLE");var e,t=re(this.Kr);try{for(t.s();!(e=t.n()).done;){(0,e.value)(0)}}catch(n){t.e(n)}finally{t.f()}}},{key:"Gr",value:function(){il("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");var e,t=re(this.Kr);try{for(t.s();!(e=t.n()).done;){(0,e.value)(1)}}catch(n){t.e(n)}finally{t.f()}}}],[{key:"vt",value:function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}]),e}(),Up={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},Vp=function(){function e(t){ie(this,e),this.jr=t.jr,this.Wr=t.Wr}return oe(e,[{key:"zr",value:function(e){this.Hr=e}},{key:"Jr",value:function(e){this.Yr=e}},{key:"onMessage",value:function(e){this.Xr=e}},{key:"close",value:function(){this.Wr()}},{key:"send",value:function(e){this.jr(e)}},{key:"Zr",value:function(){this.Hr()}},{key:"eo",value:function(e){this.Yr(e)}},{key:"no",value:function(e){this.Xr(e)}}]),e}(),Fp=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this,e)).forceLongPolling=e.forceLongPolling,r.autoDetectLongPolling=e.autoDetectLongPolling,r.useFetchStreams=e.useFetchStreams,r}return oe(n,[{key:"ao",value:function(e,t,n,r){return new Promise((function(i,a){var o=new $c;o.listenOnce(Gc.COMPLETE,(function(){try{switch(o.getLastErrorCode()){case Wc.NO_ERROR:var t=o.getResponseJson();il("Connection","XHR received:",JSON.stringify(t)),i(t);break;case Wc.TIMEOUT:il("Connection",'RPC "'+e+'" timed out'),a(new hl(fl.DEADLINE_EXCEEDED,"Request time out"));break;case Wc.HTTP_ERROR:var n=o.getStatus();if(il("Connection",'RPC "'+e+'" failed with status:',n,"response text:",o.getResponseText()),n>0){var r=o.getResponseJson().error;if(r&&r.status&&r.message){var u=function(e){var t=e.toLowerCase().replace(/_/g,"-");return Object.values(fl).indexOf(t)>=0?t:fl.UNKNOWN}(r.status);a(new hl(u,r.message))}else a(new hl(fl.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new hl(fl.UNAVAILABLE,"Connection failed."));break;default:sl()}}finally{il("Connection",'RPC "'+e+'" completed.')}}));var u=JSON.stringify(r);o.send(t,"POST",u,n,15)}))}},{key:"ho",value:function(e,t,n){var r=[this.so,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=Hc(),a=Kc(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/".concat(this.databaseId.projectId,"/databases/").concat(this.databaseId.database)},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(o.xmlHttpFactory=new Yc({})),this.uo(o.initMessageHeaders,t,n),ge()||be()||me().indexOf("Electron/")>=0||we()||me().indexOf("MSAppHost/")>=0||ke()||(o.httpHeadersOverwriteParam="$httpHeaders");var u=r.join("");il("Connection","Creating WebChannel: "+u,o);var s=i.createWebChannel(u,o),c=!1,l=!1,f=new Vp({jr:function(e){l?il("Connection","Not sending because WebChannel is closed:",e):(c||(il("Connection","Opening WebChannel transport."),s.open(),c=!0),il("Connection","WebChannel sending:",e),s.send(e))},Wr:function(){return s.close()}}),h=function(e,t,n){e.listen(t,(function(e){try{n(e)}catch(e){setTimeout((function(){throw e}),0)}}))};return h(s,Jc.EventType.OPEN,(function(){l||il("Connection","WebChannel transport opened.")})),h(s,Jc.EventType.CLOSE,(function(){l||(l=!0,il("Connection","WebChannel transport closed"),f.eo())})),h(s,Jc.EventType.ERROR,(function(e){l||(l=!0,ol("Connection","WebChannel transport errored:",e),f.eo(new hl(fl.UNAVAILABLE,"The operation could not be completed")))})),h(s,Jc.EventType.MESSAGE,(function(e){var t;if(!l){var n=e.data[0];cl(!!n);var r=n,i=r.error||(null===(t=r[0])||void 0===t?void 0:t.error);if(i){il("Connection","WebChannel received error:",i);var a=i.status,o=function(e){var t=Lh[e];if(void 0!==t)return Vh(t)}(a),u=i.message;void 0===o&&(o=fl.INTERNAL,u="Unknown error status: "+a+" with message "+i.message),l=!0,f.eo(new hl(o,u)),s.close()}else il("Connection","WebChannel received:",n),f.no(n)}})),h(a,Qc.STAT_EVENT,(function(e){e.stat===Xc.PROXY?il("Connection","Detected buffering proxy"):e.stat===Xc.NOPROXY&&il("Connection","Detected no buffering proxy")})),setTimeout((function(){f.Zr()}),0),f}}]),n}(function(){function e(t){ie(this,e),this.databaseInfo=t,this.databaseId=t.databaseId;var n=t.ssl?"https":"http";this.so=n+"://"+t.host,this.io="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return oe(e,[{key:"ro",value:function(e,t,n,r,i){var a=this.oo(e,t);il("RestConnection","Sending: ",a,n);var o={};return this.uo(o,r,i),this.ao(e,a,o,n).then((function(e){return il("RestConnection","Received: ",e),e}),(function(t){throw ol("RestConnection","".concat(e," failed with error: "),t,"url: ",a,"request:",n),t}))}},{key:"co",value:function(e,t,n,r,i){return this.ro(e,t,n,r,i)}},{key:"uo",value:function(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+tl,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((function(t,n){return e[n]=t})),n&&n.headers.forEach((function(t,n){return e[n]=t}))}},{key:"oo",value:function(e,t){var n=Up[e];return"".concat(this.so,"/v1/").concat(t,":").concat(n)}}]),e}());function jp(){return"undefined"!=typeof document?document:null}function zp(e){return new hd(e,!0)}var Bp=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.5,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6e4;ie(this,e),this.Jn=t,this.timerId=n,this.lo=r,this.fo=i,this._o=a,this.wo=0,this.mo=null,this.yo=Date.now(),this.reset()}return oe(e,[{key:"reset",value:function(){this.wo=0}},{key:"po",value:function(){this.wo=this._o}},{key:"Io",value:function(e){var t=this;this.cancel();var n=Math.floor(this.wo+this.To()),r=Math.max(0,Date.now()-this.yo),i=Math.max(0,n-r);i>0&&il("ExponentialBackoff","Backing off for ".concat(i," ms (base delay: ").concat(this.wo," ms, delay with jitter: ").concat(n," ms, last attempt: ").concat(r," ms ago)")),this.mo=this.Jn.enqueueAfterDelay(this.timerId,i,(function(){return t.yo=Date.now(),e()})),this.wo*=this.fo,this.wo<this.lo&&(this.wo=this.lo),this.wo>this._o&&(this.wo=this._o)}},{key:"Eo",value:function(){null!==this.mo&&(this.mo.skipDelay(),this.mo=null)}},{key:"cancel",value:function(){null!==this.mo&&(this.mo.cancel(),this.mo=null)}},{key:"To",value:function(){return(Math.random()-.5)*this.wo}}]),e}(),qp=function(){function e(t,n,r,i,a,o,u,s){ie(this,e),this.Jn=t,this.Ao=r,this.Ro=i,this.bo=a,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=u,this.listener=s,this.state=0,this.Po=0,this.Vo=null,this.vo=null,this.stream=null,this.So=new Bp(t,n)}return oe(e,[{key:"Do",value:function(){return 1===this.state||5===this.state||this.Co()}},{key:"Co",value:function(){return 2===this.state||3===this.state}},{key:"start",value:function(){4!==this.state?this.auth():this.xo()}},{key:"stop",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.Do(),!e.t0){e.next=4;break}return e.next=4,this.close(0);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"No",value:function(){this.state=0,this.So.reset()}},{key:"ko",value:function(){var e=this;this.Co()&&null===this.Vo&&(this.Vo=this.Jn.enqueueAfterDelay(this.Ao,6e4,(function(){return e.Mo()})))}},{key:"Oo",value:function(e){this.Fo(),this.stream.send(e)}},{key:"Mo",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.Co()){e.next=2;break}return e.abrupt("return",this.close(0));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"Fo",value:function(){this.Vo&&(this.Vo.cancel(),this.Vo=null)}},{key:"$o",value:function(){this.vo&&(this.vo.cancel(),this.vo=null)}},{key:"close",value:function(){var e=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.Fo(),this.$o(),this.So.cancel(),this.Po++,4!==t?this.So.reset():n&&n.code===fl.RESOURCE_EXHAUSTED?(al(n.toString()),al("Using maximum backoff delay to prevent overloading the backend."),this.So.po()):n&&n.code===fl.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Bo(),this.stream.close(),this.stream=null),this.state=t,e.next=9,this.listener.Jr(n);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"Bo",value:function(){}},{key:"auth",value:function(){var e=this;this.state=1;var t=this.Lo(this.Po),n=this.Po;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((function(t){var r=c(t,2),i=r[0],a=r[1];e.Po===n&&e.Uo(i,a)}),(function(n){t((function(){var t=new hl(fl.UNKNOWN,"Fetching auth token failed: "+n.message);return e.qo(t)}))}))}},{key:"Uo",value:function(e,t){var n=this,r=this.Lo(this.Po);this.stream=this.Go(e,t),this.stream.zr((function(){r((function(){return n.state=2,n.vo=n.Jn.enqueueAfterDelay(n.Ro,1e4,(function(){return n.Co()&&(n.state=3),Promise.resolve()})),n.listener.zr()}))})),this.stream.Jr((function(e){r((function(){return n.qo(e)}))})),this.stream.onMessage((function(e){r((function(){return n.onMessage(e)}))}))}},{key:"xo",value:function(){var e=this;this.state=5,this.So.Io(i(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.state=0,e.start();case 1:case"end":return t.stop()}}),t)}))))}},{key:"qo",value:function(e){return il("PersistentStream","close with error: ".concat(e)),this.stream=null,this.close(4,e)}},{key:"Lo",value:function(e){var t=this;return function(n){t.Jn.enqueueAndForget((function(){return t.Po===e?n():(il("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}}}]),e}(),Hp=function(e){$(n,e);var t=ne(n);function n(e,r,i,a,o,u){var s;return ie(this,n),(s=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,i,a,u)).M=o,s}return oe(n,[{key:"Go",value:function(e,t){return this.bo.ho("Listen",e,t)}},{key:"onMessage",value:function(e){this.So.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:sl()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],a=function(e,t){return e.N?(cl(void 0===t||"string"==typeof t),Ml.fromBase64String(t||"")):(cl(void 0===t||t instanceof Uint8Array),Ml.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,u=o&&function(e){var t=void 0===e.code?fl.UNKNOWN:Vh(e.code);return new hl(t,e.message||"")}(o);n=new ad(r,i,a,u||null)}else if("documentChange"in t){t.documentChange;var s=t.documentChange;s.document,s.document.name,s.document.updateTime;var c=bd(e,s.document.name),l=yd(s.document.updateTime),f=new hf({mapValue:{fields:s.document.fields}}),h=pf.newFoundDocument(c,l,f),d=s.targetIds||[],p=s.removedTargetIds||[];n=new rd(d,p,h.key,h)}else if("documentDelete"in t){t.documentDelete;var v=t.documentDelete;v.document;var y=bd(e,v.document),m=v.readTime?yd(v.readTime):Il.min(),g=pf.newNoDocument(y,m),k=v.removedTargetIds||[];n=new rd([],k,g.key,g)}else if("documentRemove"in t){t.documentRemove;var b=t.documentRemove;b.document;var w=bd(e,b.document),_=b.removedTargetIds||[];n=new rd([],_,w,null)}else{if(!("filter"in t))return sl();t.filter;var E=t.filter;E.targetId;var S=E.count||0,T=new Mh(S),x=E.targetId;n=new id(x,T)}return n}(this.M,e),n=function(e){if(!("targetChange"in e))return Il.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?Il.min():t.readTime?yd(t.readTime):Il.min()}(e);return this.listener.Ko(t,n)}},{key:"Qo",value:function(e){var t={};t.database=Ed(this.M),t.addTarget=function(e,t){var n,r=t.target;return(n=Sf(r)?{documents:Id(e,r)}:{query:Cd(e,r)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0?n.resumeToken=pd(e,t.resumeToken):t.snapshotVersion.compareTo(Il.min())>0&&(n.readTime=dd(e,t.snapshotVersion.toTimestamp())),n}(this.M,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return sl()}}(0,t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.M,e);n&&(t.labels=n),this.Oo(t)}},{key:"jo",value:function(e){var t={};t.database=Ed(this.M),t.removeTarget=e,this.Oo(t)}}]),n}(qp),Kp=function(e){$(n,e);var t=ne(n);function n(e,r,i,a,o,u){var s;return ie(this,n),(s=t.call(this,e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,i,a,u)).M=o,s.Wo=!1,s}return oe(n,[{key:"zo",get:function(){return this.Wo}},{key:"start",value:function(){this.Wo=!1,this.lastStreamToken=void 0,X(G(n.prototype),"start",this).call(this)}},{key:"Bo",value:function(){this.Wo&&this.Ho([])}},{key:"Go",value:function(e,t){return this.bo.ho("Write",e,t)}},{key:"onMessage",value:function(e){if(cl(!!e.streamToken),this.lastStreamToken=e.streamToken,this.Wo){this.So.reset();var t=function(e,t){return e&&e.length>0?(cl(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?yd(e.updateTime):yd(t);return n.isEqual(Il.min())&&(n=yd(t)),new gh(n,e.transformResults||[])}(e,t)}))):[]}(e.writeResults,e.commitTime),n=yd(e.commitTime);return this.listener.Jo(n,t)}return cl(!e.writeResults||0===e.writeResults.length),this.Wo=!0,this.listener.Yo()}},{key:"Xo",value:function(){var e={};e.database=Ed(this.M),this.Oo(e)}},{key:"Ho",value:function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return xd(t.M,e)}))};this.Oo(n)}}]),n}(qp),Wp=function(e){$(n,e);var t=ne(n);function n(e,r,i,a){var o;return ie(this,n),(o=t.call(this)).authCredentials=e,o.appCheckCredentials=r,o.bo=i,o.M=a,o.Zo=!1,o}return oe(n,[{key:"tu",value:function(){if(this.Zo)throw new hl(fl.FAILED_PRECONDITION,"The client has already been terminated.")}},{key:"ro",value:function(e,t,n){var r=this;return this.tu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((function(i){var a=c(i,2),o=a[0],u=a[1];return r.bo.ro(e,t,n,o,u)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===fl.UNAUTHENTICATED&&(r.authCredentials.invalidateToken(),r.appCheckCredentials.invalidateToken()),e):new hl(fl.UNKNOWN,e.toString())}))}},{key:"co",value:function(e,t,n){var r=this;return this.tu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((function(i){var a=c(i,2),o=a[0],u=a[1];return r.bo.co(e,t,n,o,u)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===fl.UNAUTHENTICATED&&(r.authCredentials.invalidateToken(),r.appCheckCredentials.invalidateToken()),e):new hl(fl.UNKNOWN,e.toString())}))}},{key:"terminate",value:function(){this.Zo=!0}}]),n}(function(){return oe((function e(){ie(this,e)}))}()),Gp=function(){function e(t,n){ie(this,e),this.asyncQueue=t,this.onlineStateHandler=n,this.state="Unknown",this.eu=0,this.nu=null,this.su=!0}return oe(e,[{key:"iu",value:function(){var e=this;0===this.eu&&(this.ru("Unknown"),this.nu=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return e.nu=null,e.ou("Backend didn't respond within 10 seconds."),e.ru("Offline"),Promise.resolve()})))}},{key:"uu",value:function(e){"Online"===this.state?this.ru("Unknown"):(this.eu++,this.eu>=1&&(this.au(),this.ou("Connection failed 1 times. Most recent error: ".concat(e.toString())),this.ru("Offline")))}},{key:"set",value:function(e){this.au(),this.eu=0,"Online"===e&&(this.su=!1),this.ru(e)}},{key:"ru",value:function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}},{key:"ou",value:function(e){var t="Could not reach Cloud Firestore backend. ".concat(e,"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.");this.su?(al(t),this.su=!1):il("OnlineStateTracker",t)}},{key:"au",value:function(){null!==this.nu&&(this.nu.cancel(),this.nu=null)}}]),e}(),Qp=oe((function e(t,n,r,a,o){var u=this;ie(this,e),this.localStore=t,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.cu=[],this.hu=new Map,this.lu=new Set,this.fu=[],this.du=o,this.du.Br((function(e){r.enqueueAndForget(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=av(u),!e.t0){e.next=5;break}return il("RemoteStore","Restarting streams for network reachability change."),e.next=5,function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=ll(t)).lu.add(4),e.next=4,Jp(n);case 4:return n._u.set("Unknown"),n.lu.delete(4),e.next=8,Xp(n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()(u);case 5:case"end":return e.stop()}}),e)}))))})),this._u=new Gp(r,a)}));function Xp(e){return Yp.apply(this,arguments)}function Yp(){return Yp=i(h().mark((function e(t){var n,r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!av(t)){e.next=18;break}n=re(t.fu),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=10;break}return i=r.value,e.next=8,i(!0);case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),n.e(e.t0);case 15:return e.prev=15,n.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,12,15,18]])}))),Yp.apply(this,arguments)}function Jp(e){return $p.apply(this,arguments)}function $p(){return $p=i(h().mark((function e(t){var n,r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=re(t.fu),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return i=r.value,e.next=7,i(!1);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))),$p.apply(this,arguments)}function Zp(e,t){var n=ll(e);n.hu.has(t.targetId)||(n.hu.set(t.targetId,t),iv(n)?rv(n):Pv(n).Co()&&tv(n,t))}function ev(e,t){var n=ll(e),r=Pv(n);n.hu.delete(t),r.Co()&&nv(n,t),0===n.hu.size&&(r.Co()?r.ko():av(n)&&n._u.set("Unknown"))}function tv(e,t){e.wu.Z(t.targetId),Pv(e).Qo(t)}function nv(e,t){e.wu.Z(t),Pv(e).jo(t)}function rv(e){e.wu=new ud({getRemoteKeysForTarget:function(t){return e.remoteSyncer.getRemoteKeysForTarget(t)},Et:function(t){return e.hu.get(t)||null}}),Pv(e).start(),e._u.iu()}function iv(e){return av(e)&&!Pv(e).Do()&&e.hu.size>0}function av(e){return 0===ll(e).lu.size}function ov(e){e.wu=void 0}function uv(e){return sv.apply(this,arguments)}function sv(){return sv=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.hu.forEach((function(e,n){tv(t,e)}));case 1:case"end":return e.stop()}}),e)}))),sv.apply(this,arguments)}function cv(e,t){return lv.apply(this,arguments)}function lv(){return lv=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ov(t),iv(t)?(t._u.uu(n),rv(t)):t._u.set("Unknown");case 1:case"end":return e.stop()}}),e)}))),lv.apply(this,arguments)}function fv(e,t,n){return hv.apply(this,arguments)}function hv(){return hv=i(h().mark((function e(t,n,r){var a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t._u.set("Online"),!(n instanceof ad&&2===n.state&&n.cause)){e.next=13;break}return e.prev=1,e.next=4,function(){var e=i(h().mark((function e(t,n){var r,i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.cause,i=re(n.targetIds),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=14;break}if(o=a.value,e.t0=t.hu.has(o),!e.t0){e.next=12;break}return e.next=10,t.remoteSyncer.rejectListen(o,r);case 10:t.hu.delete(o),t.wu.removeTarget(o);case 12:e.next=4;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(2),i.e(e.t1);case 19:return e.prev=19,i.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[2,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()(t,n);case 4:e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(1),il("RemoteStore","Failed to remove targets %s: %s ",n.targetIds.join(","),e.t0),e.next=11,dv(t,e.t0);case 11:case 22:e.next=29;break;case 13:if(n instanceof rd?t.wu.ut(n):n instanceof id?t.wu._t(n):t.wu.ht(n),r.isEqual(Il.min())){e.next=29;break}return e.prev=14,e.next=17,dp(t.localStore);case 17:if(a=e.sent,e.t1=r.compareTo(a)>=0,!e.t1){e.next=22;break}return e.next=22,function(e,t){var n=e.wu.yt(t);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=e.hu.get(r);i&&e.hu.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach((function(t){var n=e.hu.get(t);if(n){e.hu.set(t,n.withResumeToken(Ml.EMPTY_BYTE_STRING,n.snapshotVersion)),nv(e,t);var r=new Qd(n.target,t,1,n.sequenceNumber);tv(e,r)}})),e.remoteSyncer.applyRemoteEvent(n)}(t,r);case 24:return e.prev=24,e.t2=e.catch(14),il("RemoteStore","Failed to raise snapshot:",e.t2),e.next=29,dv(t,e.t2);case 29:case"end":return e.stop()}}),e,null,[[1,6],[14,24]])}))),hv.apply(this,arguments)}function dv(e,t,n){return pv.apply(this,arguments)}function pv(){return pv=i(h().mark((function e(t,n,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Hd(n)){e.next=2;break}throw n;case 2:return t.lu.add(1),e.next=5,Jp(t);case 5:t._u.set("Offline"),r||(r=function(){return dp(t.localStore)}),t.asyncQueue.enqueueRetryable(i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return il("RemoteStore","Retrying IndexedDB access"),e.next=3,r();case 3:return t.lu.delete(1),e.next=6,Xp(t);case 6:case"end":return e.stop()}}),e)}))));case 8:case"end":return e.stop()}}),e)}))),pv.apply(this,arguments)}function vv(e,t){return t().catch((function(n){return dv(e,n,t)}))}function yv(e){return mv.apply(this,arguments)}function mv(){return mv=i(h().mark((function e(t){var n,r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ll(t),r=Dv(n),i=n.cu.length>0?n.cu[n.cu.length-1].batchId:-1;case 2:if(!gv(n)){e.next=19;break}return e.prev=3,e.next=6,yp(n.localStore,i);case 6:if(null!==(a=e.sent)){e.next=10;break}return 0===n.cu.length&&r.ko(),e.abrupt("break",19);case 10:i=a.batchId,kv(n,a),e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(3),e.next=17,dv(n,e.t0);case 17:e.next=2;break;case 19:bv(n)&&wv(n);case 20:case"end":return e.stop()}}),e,null,[[3,13]])}))),mv.apply(this,arguments)}function gv(e){return av(e)&&e.cu.length<10}function kv(e,t){e.cu.push(t);var n=Dv(e);n.Co()&&n.zo&&n.Ho(t.mutations)}function bv(e){return av(e)&&!Dv(e).Do()&&e.cu.length>0}function wv(e){Dv(e).start()}function _v(e){return Ev.apply(this,arguments)}function Ev(){return Ev=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Dv(t).Xo();case 1:case"end":return e.stop()}}),e)}))),Ev.apply(this,arguments)}function Sv(e){return Tv.apply(this,arguments)}function Tv(){return Tv=i(h().mark((function e(t){var n,r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Dv(t),r=re(t.cu);try{for(r.s();!(i=r.n()).done;)a=i.value,n.Ho(a.mutations)}catch(o){r.e(o)}finally{r.f()}case 3:case"end":return e.stop()}}),e)}))),Tv.apply(this,arguments)}function xv(e,t,n){return Iv.apply(this,arguments)}function Iv(){return Iv=i(h().mark((function e(t,n,r){var i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.cu.shift(),a=Wd.from(i,n,r),e.next=3,vv(t,(function(){return t.remoteSyncer.applySuccessfulWrite(a)}));case 3:return e.next=5,yv(t);case 5:case"end":return e.stop()}}),e)}))),Iv.apply(this,arguments)}function Cv(e,t){return Nv.apply(this,arguments)}function Nv(){return Nv=i(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=n&&Dv(t).zo,!e.t0){e.next=4;break}return e.next=4,function(){var e=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Uh(i=n.code)||i===fl.ABORTED){e.next=7;break}return r=t.cu.shift(),Dv(t).No(),e.next=5,vv(t,(function(){return t.remoteSyncer.rejectFailedWrite(r.batchId,n)}));case 5:return e.next=7,yv(t);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()(t,n);case 4:bv(t)&&wv(t);case 5:case"end":return e.stop()}}),e)}))),Nv.apply(this,arguments)}function Av(e,t){return Rv.apply(this,arguments)}function Rv(){return Rv=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=ll(t)).asyncQueue.verifyOperationInProgress(),il("RemoteStore","RemoteStore received new credentials"),i=av(r),r.lu.add(3),e.next=6,Jp(r);case 6:return i&&r._u.set("Unknown"),e.next=9,r.remoteSyncer.handleCredentialChange(n);case 9:return r.lu.delete(3),e.next=12,Xp(r);case 12:case"end":return e.stop()}}),e)}))),Rv.apply(this,arguments)}function Lv(e,t){return Ov.apply(this,arguments)}function Ov(){return Ov=i(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ll(t),!n){e.next=7;break}return r.lu.delete(2),e.next=5,Xp(r);case 5:e.next=13;break;case 7:if(e.t0=n,e.t0){e.next=13;break}return r.lu.add(2),e.next=12,Jp(r);case 12:r._u.set("Unknown");case 13:case"end":return e.stop()}}),e)}))),Ov.apply(this,arguments)}function Pv(e){return e.mu||(e.mu=function(e,t,n){var r=ll(e);return r.tu(),new Hp(t,r.bo,r.authCredentials,r.appCheckCredentials,r.M,n)}(e.datastore,e.asyncQueue,{zr:uv.bind(null,e),Jr:cv.bind(null,e),Ko:fv.bind(null,e)}),e.fu.push(function(){var t=i(h().mark((function t(n){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=4;break}e.mu.No(),iv(e)?rv(e):e._u.set("Unknown"),t.next=7;break;case 4:return t.next=6,e.mu.stop();case 6:ov(e);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())),e.mu}function Dv(e){return e.gu||(e.gu=function(e,t,n){var r=ll(e);return r.tu(),new Kp(t,r.bo,r.authCredentials,r.appCheckCredentials,r.M,n)}(e.datastore,e.asyncQueue,{zr:_v.bind(null,e),Jr:Cv.bind(null,e),Yo:Sv.bind(null,e),Jo:xv.bind(null,e)}),e.fu.push(function(){var t=i(h().mark((function t(n){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=6;break}return e.gu.No(),t.next=4,yv(e);case 4:t.next=9;break;case 6:return t.next=8,e.gu.stop();case 8:e.cu.length>0&&(il("RemoteStore","Stopping write stream with ".concat(e.cu.length," pending writes")),e.cu=[]);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())),e.gu}var Mv=function(){function e(t,n,r,i,a){ie(this,e),this.asyncQueue=t,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=a,this.deferred=new dl,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(e){}))}return oe(e,[{key:"start",value:function(e){var t=this;this.timerHandle=setTimeout((function(){return t.handleDelayElapsed()}),e)}},{key:"skipDelay",value:function(){return this.handleDelayElapsed()}},{key:"cancel",value:function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new hl(fl.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}},{key:"handleDelayElapsed",value:function(){var e=this;this.asyncQueue.enqueueAndForget((function(){return null!==e.timerHandle?(e.clearTimeout(),e.op().then((function(t){return e.deferred.resolve(t)}))):Promise.resolve()}))}},{key:"clearTimeout",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}))}],[{key:"createAndSchedule",value:function(t,n,r,i,a){var o=new e(t,n,Date.now()+r,i,a);return o.start(r),o}}]),e}();function Uv(e,t){if(al("AsyncQueue","".concat(t,": ").concat(e)),Hd(e))return new hl(fl.UNAVAILABLE,"".concat(t,": ").concat(e));throw e}var Vv=function(){function e(t){ie(this,e),this.comparator=t?function(e,n){return t(e,n)||Xl.comparator(e.key,n.key)}:function(e,t){return Xl.comparator(e.key,t.key)},this.keyedMap=Qh(),this.sortedSet=new jh(this.comparator)}return oe(e,[{key:"has",value:function(e){return null!=this.keyedMap.get(e)}},{key:"get",value:function(e){return this.keyedMap.get(e)}},{key:"first",value:function(){return this.sortedSet.minKey()}},{key:"last",value:function(){return this.sortedSet.maxKey()}},{key:"isEmpty",value:function(){return this.sortedSet.isEmpty()}},{key:"indexOf",value:function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}},{key:"size",get:function(){return this.sortedSet.size}},{key:"forEach",value:function(e){this.sortedSet.inorderTraversal((function(t,n){return e(t),!1}))}},{key:"add",value:function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}},{key:"delete",value:function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}},{key:"isEqual",value:function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),r=t.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,a=r.getNext().key;if(!i.isEqual(a))return!1}return!0}},{key:"toString",value:function(){var e=[];return this.forEach((function(t){e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}},{key:"copy",value:function(t,n){var r=new e;return r.comparator=this.comparator,r.keyedMap=t,r.sortedSet=n,r}}],[{key:"emptySet",value:function(t){return new e(t.comparator)}}]),e}(),Fv=function(){function e(){ie(this,e),this.yu=new jh(Xl.comparator)}return oe(e,[{key:"track",value:function(e){var t=e.doc.key,n=this.yu.get(t);n?0!==e.type&&3===n.type?this.yu=this.yu.insert(t,e):3===e.type&&1!==n.type?this.yu=this.yu.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.yu=this.yu.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.yu=this.yu.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.yu=this.yu.remove(t):1===e.type&&2===n.type?this.yu=this.yu.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.yu=this.yu.insert(t,{type:2,doc:e.doc}):sl():this.yu=this.yu.insert(t,e)}},{key:"pu",value:function(){var e=[];return this.yu.inorderTraversal((function(t,n){e.push(n)})),e}}]),e}(),jv=function(){function e(t,n,r,i,a,o,u,s){ie(this,e),this.query=t,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=a,this.fromCache=o,this.syncStateChanged=u,this.excludesMetadataChanges=s}return oe(e,[{key:"hasPendingWrites",get:function(){return!this.mutatedKeys.isEmpty()}},{key:"isEqual",value:function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Yf(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0}}],[{key:"fromInitialDocuments",value:function(t,n,r,i){var a=[];return n.forEach((function(e){a.push({type:0,doc:e})})),new e(t,n,Vv.emptySet(n),a,r,i,!0,!1)}}]),e}(),zv=oe((function e(){ie(this,e),this.Iu=void 0,this.listeners=[]})),Bv=oe((function e(){ie(this,e),this.queries=new Fh((function(e){return Jf(e)}),Yf),this.onlineState="Unknown",this.Tu=new Set}));function qv(e,t){return Hv.apply(this,arguments)}function Hv(){return Hv=i(h().mark((function e(t,n){var r,i,a,o,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ll(t),i=n.query,a=!1,(o=r.queries.get(i))||(a=!0,o=new zv),!a){e.next=13;break}return e.prev=3,e.next=6,r.onListen(i);case 6:o.Iu=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),u=Uv(e.t0,"Initialization of query '".concat($f(n.query),"' failed")),e.abrupt("return",void n.onError(u));case 13:r.queries.set(i,o),o.listeners.push(n),n.Eu(r.onlineState),o.Iu&&n.Au(o.Iu)&&Xv(r);case 14:case"end":return e.stop()}}),e,null,[[3,9]])}))),Hv.apply(this,arguments)}function Kv(e,t){return Wv.apply(this,arguments)}function Wv(){return Wv=i(h().mark((function e(t,n){var r,i,a,o,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ll(t),i=n.query,a=!1,(o=r.queries.get(i))&&(u=o.listeners.indexOf(n))>=0&&(o.listeners.splice(u,1),a=0===o.listeners.length),!a){e.next=6;break}return e.abrupt("return",(r.queries.delete(i),r.onUnlisten(i)));case 6:case"end":return e.stop()}}),e)}))),Wv.apply(this,arguments)}function Gv(e,t){var n,r=ll(e),i=!1,a=re(t);try{for(a.s();!(n=a.n()).done;){var o=n.value,u=o.query,s=r.queries.get(u);if(s){var c,l=re(s.listeners);try{for(l.s();!(c=l.n()).done;){c.value.Au(o)&&(i=!0)}}catch(f){l.e(f)}finally{l.f()}s.Iu=o}}}catch(f){a.e(f)}finally{a.f()}i&&Xv(r)}function Qv(e,t,n){var r=ll(e),i=r.queries.get(t);if(i){var a,o=re(i.listeners);try{for(o.s();!(a=o.n()).done;){a.value.onError(n)}}catch(u){o.e(u)}finally{o.f()}}r.queries.delete(t)}function Xv(e){e.Tu.forEach((function(e){e.next()}))}var Yv=function(){function e(t,n,r){ie(this,e),this.query=t,this.Ru=n,this.bu=!1,this.Pu=null,this.onlineState="Unknown",this.options=r||{}}return oe(e,[{key:"Au",value:function(e){if(!this.options.includeMetadataChanges){var t,n=[],r=re(e.docChanges);try{for(r.s();!(t=r.n()).done;){var i=t.value;3!==i.type&&n.push(i)}}catch(o){r.e(o)}finally{r.f()}e=new jv(e.query,e.docs,e.oldDocs,n,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0)}var a=!1;return this.bu?this.Vu(e)&&(this.Ru.next(e),a=!0):this.vu(e,this.onlineState)&&(this.Su(e),a=!0),this.Pu=e,a}},{key:"onError",value:function(e){this.Ru.error(e)}},{key:"Eu",value:function(e){this.onlineState=e;var t=!1;return this.Pu&&!this.bu&&this.vu(this.Pu,e)&&(this.Su(this.Pu),t=!0),t}},{key:"vu",value:function(e,t){if(!e.fromCache)return!0;var n="Offline"!==t;return(!this.options.Du||!n)&&(!e.docs.isEmpty()||"Offline"===t)}},{key:"Vu",value:function(e){if(e.docChanges.length>0)return!0;var t=this.Pu&&this.Pu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}},{key:"Su",value:function(e){e=jv.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.bu=!0,this.Ru.next(e)}}]),e}();var Jv=oe((function e(t){ie(this,e),this.key=t})),$v=oe((function e(t){ie(this,e),this.key=t})),Zv=function(){function e(t,n){ie(this,e),this.query=t,this.Fu=n,this.$u=null,this.current=!1,this.Bu=$h(),this.mutatedKeys=$h(),this.Lu=th(t),this.Uu=new Vv(this.Lu)}return oe(e,[{key:"qu",get:function(){return this.Fu}},{key:"Gu",value:function(e,t){var n=this,r=t?t.Ku:new Fv,i=t?t.Uu:this.Uu,a=t?t.mutatedKeys:this.mutatedKeys,o=i,u=!1,s=Bf(this.query)&&i.size===this.query.limit?i.last():null,c=qf(this.query)&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((function(e,t){var l=i.get(e),f=Zf(n.query,t)?t:null,h=!!l&&n.mutatedKeys.has(l.key),d=!!f&&(f.hasLocalMutations||n.mutatedKeys.has(f.key)&&f.hasCommittedMutations),p=!1;l&&f?l.data.isEqual(f.data)?h!==d&&(r.track({type:3,doc:f}),p=!0):n.Qu(l,f)||(r.track({type:2,doc:f}),p=!0,(s&&n.Lu(f,s)>0||c&&n.Lu(f,c)<0)&&(u=!0)):!l&&f?(r.track({type:0,doc:f}),p=!0):l&&!f&&(r.track({type:1,doc:l}),p=!0,(s||c)&&(u=!0)),p&&(f?(o=o.add(f),a=d?a.add(e):a.delete(e)):(o=o.delete(e),a=a.delete(e)))})),Bf(this.query)||qf(this.query))for(;o.size>this.query.limit;){var l=Bf(this.query)?o.last():o.first();o=o.delete(l.key),a=a.delete(l.key),r.track({type:1,doc:l})}return{Uu:o,Ku:r,ei:u,mutatedKeys:a}}},{key:"Qu",value:function(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}},{key:"applyChanges",value:function(e,t,n){var r=this,i=this.Uu;this.Uu=e.Uu,this.mutatedKeys=e.mutatedKeys;var a=e.Ku.pu();a.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return sl()}};return n(e)-n(t)}(e.type,t.type)||r.Lu(e.doc,t.doc)})),this.ju(n);var o=t?this.Wu():[],u=0===this.Bu.size&&this.current?1:0,s=u!==this.$u;return this.$u=u,0!==a.length||s?{snapshot:new jv(this.query,e.Uu,i,a,e.mutatedKeys,0===u,s,!1),zu:o}:{zu:o}}},{key:"Eu",value:function(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Uu:this.Uu,Ku:new Fv,mutatedKeys:this.mutatedKeys,ei:!1},!1)):{zu:[]}}},{key:"Hu",value:function(e){return!this.Fu.has(e)&&!!this.Uu.has(e)&&!this.Uu.get(e).hasLocalMutations}},{key:"ju",value:function(e){var t=this;e&&(e.addedDocuments.forEach((function(e){return t.Fu=t.Fu.add(e)})),e.modifiedDocuments.forEach((function(e){})),e.removedDocuments.forEach((function(e){return t.Fu=t.Fu.delete(e)})),this.current=e.current)}},{key:"Wu",value:function(){var e=this;if(!this.current)return[];var t=this.Bu;this.Bu=$h(),this.Uu.forEach((function(t){e.Hu(t.key)&&(e.Bu=e.Bu.add(t.key))}));var n=[];return t.forEach((function(t){e.Bu.has(t)||n.push(new $v(t))})),this.Bu.forEach((function(e){t.has(e)||n.push(new Jv(e))})),n}},{key:"Ju",value:function(e){this.Fu=e.hi,this.Bu=$h();var t=this.Gu(e.documents);return this.applyChanges(t,!0)}},{key:"Yu",value:function(){return jv.fromInitialDocuments(this.query,this.Uu,this.mutatedKeys,0===this.$u)}}]),e}(),ey=oe((function e(t,n,r){ie(this,e),this.query=t,this.targetId=n,this.view=r})),ty=oe((function e(t){ie(this,e),this.key=t,this.Xu=!1})),ny=function(){function e(t,n,r,i,a,o){ie(this,e),this.localStore=t,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=a,this.maxConcurrentLimboResolutions=o,this.Zu={},this.ta=new Fh((function(e){return Jf(e)}),Yf),this.ea=new Map,this.na=new Set,this.sa=new jh(Xl.comparator),this.ia=new Map,this.ra=new Sp,this.oa={},this.ua=new Map,this.aa=tp.gn(),this.onlineState="Unknown",this.ca=void 0}return oe(e,[{key:"isPrimaryClient",get:function(){return!0===this.ca}}]),e}();function ry(e,t){return iy.apply(this,arguments)}function iy(){return iy=i(h().mark((function e(t,n){var r,i,a,o,u,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ly(t),!(o=r.ta.get(n))){e.next=6;break}i=o.targetId,r.sharedClientState.addLocalQueryTarget(i),a=o.view.Yu(),e.next=15;break;case 6:return e.next=8,mp(r.localStore,Qf(n));case 8:return u=e.sent,r.isPrimaryClient&&Zp(r.remoteStore,u),s=r.sharedClientState.addLocalQueryTarget(u.targetId),i=u.targetId,e.next=14,ay(r,n,i,"current"===s);case 14:a=e.sent;case 15:return e.abrupt("return",a);case 16:case"end":return e.stop()}}),e)}))),iy.apply(this,arguments)}function ay(e,t,n,r){return oy.apply(this,arguments)}function oy(){return oy=i(h().mark((function e(t,n,r,a){var o,u,s,c,l,f;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.ha=function(e,n,r){return function(){var e=i(h().mark((function e(t,n,r,i){var a,o,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.view.Gu(r),e.t0=a.ei,!e.t0){e.next=6;break}return e.next=5,bp(t.localStore,n.query,!1).then((function(e){var t=e.documents;return n.view.Gu(t,a)}));case 5:a=e.sent;case 6:return o=i&&i.targetChanges.get(n.targetId),u=n.view.applyChanges(a,t.isPrimaryClient,o),e.abrupt("return",(Sy(t,n.targetId,u.zu),u.snapshot));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,i){return e.apply(this,arguments)}}()(t,e,n,r)},e.next=3,bp(t.localStore,n,!0);case 3:return o=e.sent,u=new Zv(n,o.hi),s=u.Gu(o.documents),c=nd.createSynthesizedTargetChangeForCurrentChange(r,a&&"Offline"!==t.onlineState),l=u.applyChanges(s,t.isPrimaryClient,c),Sy(t,r,l.zu),f=new ey(n,r,u),e.abrupt("return",(t.ta.set(n,f),t.ea.has(r)?t.ea.get(r).push(n):t.ea.set(r,[n]),l.snapshot));case 11:case"end":return e.stop()}}),e)}))),oy.apply(this,arguments)}function uy(e,t){return sy.apply(this,arguments)}function sy(){return sy=i(h().mark((function e(t,n){var r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ll(t),i=r.ta.get(n),!((a=r.ea.get(i.targetId)).length>1)){e.next=3;break}return e.abrupt("return",(r.ea.set(i.targetId,a.filter((function(e){return!Yf(e,n)}))),void r.ta.delete(n)));case 3:if(!r.isPrimaryClient){e.next=11;break}if(r.sharedClientState.removeLocalQueryTarget(i.targetId),e.t0=r.sharedClientState.isActiveQueryTarget(i.targetId),e.t0){e.next=9;break}return e.next=9,gp(r.localStore,i.targetId,!1).then((function(){r.sharedClientState.clearQueryState(i.targetId),ev(r.remoteStore,i.targetId),_y(r,i.targetId)})).catch(np);case 9:e.next=14;break;case 11:return _y(r,i.targetId),e.next=14,gp(r.localStore,i.targetId,!0);case 14:case"end":return e.stop()}}),e)}))),sy.apply(this,arguments)}function cy(e,t,n){return ly.apply(this,arguments)}function ly(){return ly=i(h().mark((function e(t,n,r){var i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Oy(t),e.prev=1,e.next=4,function(e,t){var n,r=ll(e),i=xl.now(),a=t.reduce((function(e,t){return e.add(t.key)}),$h());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.ai.qs(e,a).next((function(a){n=a;var o,u=[],s=re(t);try{for(s.s();!(o=s.n()).done;){var c=o.value,l=Sh(c,n.get(c.key));null!=l&&u.push(new Ch(c.key,l,df(l.value.mapValue),kh.exists(!0)))}}catch(f){s.e(f)}finally{s.f()}return r.$s.addMutationBatch(e,i,u,t)}))})).then((function(e){return e.applyToLocalDocumentSet(n),{batchId:e.batchId,changes:n}}))}(i.localStore,n);case 4:return a=e.sent,i.sharedClientState.addPendingMutation(a.batchId),function(e,t,n){var r=e.oa[e.currentUser.toKey()];r||(r=new jh(Sl)),r=r.insert(t,n),e.oa[e.currentUser.toKey()]=r}(i,a.batchId,r),e.next=9,Iy(i,a.changes);case 9:return e.next=11,yv(i.remoteStore);case 11:e.next=17;break;case 13:e.prev=13,e.t0=e.catch(1),o=Uv(e.t0,"Failed to persist write"),r.reject(o);case 17:case"end":return e.stop()}}),e,null,[[1,13]])}))),ly.apply(this,arguments)}function fy(e,t){return hy.apply(this,arguments)}function hy(){return hy=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ll(t),e.prev=1,e.next=4,pp(r.localStore,n);case 4:return i=e.sent,n.targetChanges.forEach((function(e,t){var n=r.ia.get(t);n&&(cl(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?n.Xu=!0:e.modifiedDocuments.size>0?cl(n.Xu):e.removedDocuments.size>0&&(cl(n.Xu),n.Xu=!1))})),e.next=8,Iy(r,i,n);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,np(e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,10]])}))),hy.apply(this,arguments)}function dy(e,t,n){var r=ll(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.ta.forEach((function(e,n){var r=n.view.Eu(t);r.snapshot&&i.push(r.snapshot)})),function(e,t){var n=ll(e);n.onlineState=t;var r=!1;n.queries.forEach((function(e,n){var i,a=re(n.listeners);try{for(a.s();!(i=a.n()).done;){i.value.Eu(t)&&(r=!0)}}catch(o){a.e(o)}finally{a.f()}})),r&&Xv(n)}(r.eventManager,t),i.length&&r.Zu.Ko(i),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}function py(e,t,n){return vy.apply(this,arguments)}function vy(){return vy=i(h().mark((function e(t,n,r){var i,a,o,u,s,c;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((i=ll(t)).sharedClientState.updateQueryState(n,"rejected",r),a=i.ia.get(n),!(o=a&&a.key)){e.next=14;break}return u=(u=new jh(Xl.comparator)).insert(o,pf.newNoDocument(o,Il.min())),s=$h().add(o),c=new td(Il.min(),new Map,new qh(Sl),u,s),e.next=9,fy(i,c);case 9:i.sa=i.sa.remove(o),i.ia.delete(n),xy(i),e.next=16;break;case 14:return e.next=16,gp(i.localStore,n,!1).then((function(){return _y(i,n,r)})).catch(np);case 16:case"end":return e.stop()}}),e)}))),vy.apply(this,arguments)}function yy(e,t){return my.apply(this,arguments)}function my(){return my=i(h().mark((function e(t,n){var r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ll(t),i=n.batch.batchId,e.prev=1,e.next=4,hp(r.localStore,n);case 4:return a=e.sent,wy(r,i,null),by(r,i),r.sharedClientState.updateMutationState(i,"acknowledged"),e.next=10,Iy(r,a);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(1),e.next=16,np(e.t0);case 16:case"end":return e.stop()}}),e,null,[[1,12]])}))),my.apply(this,arguments)}function gy(e,t,n){return ky.apply(this,arguments)}function ky(){return ky=i(h().mark((function e(t,n,r){var i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=ll(t),e.prev=1,e.next=4,function(e,t){var n=ll(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(e){var r;return n.$s.lookupMutationBatch(e,t).next((function(t){return cl(null!==t),r=t.keys(),n.$s.removeMutationBatch(e,t)})).next((function(){return n.$s.performConsistencyCheck(e)})).next((function(){return n.ai.qs(e,r)}))}))}(i.localStore,n);case 4:return a=e.sent,wy(i,n,r),by(i,n),i.sharedClientState.updateMutationState(n,"rejected",r),e.next=10,Iy(i,a);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(1),e.next=16,np(e.t0);case 16:case"end":return e.stop()}}),e,null,[[1,12]])}))),ky.apply(this,arguments)}function by(e,t){(e.ua.get(t)||[]).forEach((function(e){e.resolve()})),e.ua.delete(t)}function wy(e,t,n){var r=ll(e),i=r.oa[r.currentUser.toKey()];if(i){var a=i.get(t);a&&(n?a.reject(n):a.resolve(),i=i.remove(t)),r.oa[r.currentUser.toKey()]=i}}function _y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.sharedClientState.removeLocalQueryTarget(t);var r,i=re(e.ea.get(t));try{for(i.s();!(r=i.n()).done;){var a=r.value;e.ta.delete(a),n&&e.Zu.la(a,n)}}catch(o){i.e(o)}finally{i.f()}e.ea.delete(t),e.isPrimaryClient&&e.ra.Ri(t).forEach((function(t){e.ra.containsKey(t)||Ey(e,t)}))}function Ey(e,t){e.na.delete(t.path.canonicalString());var n=e.sa.get(t);null!==n&&(ev(e.remoteStore,n),e.sa=e.sa.remove(t),e.ia.delete(n),xy(e))}function Sy(e,t,n){var r,i=re(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;a instanceof Jv?(e.ra.addReference(a.key,t),Ty(e,a)):a instanceof $v?(il("SyncEngine","Document no longer in limbo: "+a.key),e.ra.removeReference(a.key,t),e.ra.containsKey(a.key)||Ey(e,a.key)):sl()}}catch(o){i.e(o)}finally{i.f()}}function Ty(e,t){var n=t.key,r=n.path.canonicalString();e.sa.get(n)||e.na.has(r)||(il("SyncEngine","New document in limbo: "+n),e.na.add(r),xy(e))}function xy(e){for(;e.na.size>0&&e.sa.size<e.maxConcurrentLimboResolutions;){var t=e.na.values().next().value;e.na.delete(t);var n=new Xl(Ll.fromString(t)),r=e.aa.next();e.ia.set(r,new ty(n)),e.sa=e.sa.insert(n,r),Zp(e.remoteStore,new Qd(Qf(zf(n.path)),r,2,wl.A))}}function Iy(e,t,n){return Cy.apply(this,arguments)}function Cy(){return Cy=i(h().mark((function e(t,n,r){var a,o,u,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=ll(t),o=[],u=[],s=[],e.t0=a.ta.isEmpty(),e.t0){e.next=9;break}return a.ta.forEach((function(e,t){s.push(a.ha(t,n,r).then((function(e){if(e){a.isPrimaryClient&&a.sharedClientState.updateQueryState(t.targetId,e.fromCache?"not-current":"current"),o.push(e);var n=op.Js(t.targetId,e);u.push(n)}})))})),e.next=6,Promise.all(s);case 6:return a.Zu.Ko(o),e.next=9,function(){var e=i(h().mark((function e(t,n){var r,i,a,o,u,s,c,l;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ll(t),e.prev=1,e.next=4,r.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(e){return qd.forEach(n,(function(t){return qd.forEach(t.zs,(function(n){return r.persistence.referenceDelegate.addReference(e,t.targetId,n)})).next((function(){return qd.forEach(t.Hs,(function(n){return r.persistence.referenceDelegate.removeReference(e,t.targetId,n)}))}))}))}));case 4:e.next=11;break;case 6:if(e.prev=6,e.t0=e.catch(1),Hd(e.t0)){e.next=10;break}throw e.t0;case 10:il("LocalStore","Failed to update sequence numbers: "+e.t0);case 11:i=re(n);try{for(i.s();!(a=i.n()).done;)o=a.value,u=o.targetId,o.fromCache||(s=r.si.get(u),c=s.snapshotVersion,l=s.withLastLimboFreeSnapshotVersion(c),r.si=r.si.insert(u,l))}catch(f){i.e(f)}finally{i.f()}case 13:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n){return e.apply(this,arguments)}}()(a.localStore,u);case 9:case"end":return e.stop()}}),e)}))),Cy.apply(this,arguments)}function Ny(e,t){return Ay.apply(this,arguments)}function Ay(){return Ay=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=ll(t)).currentUser.isEqual(n)){e.next=11;break}return il("SyncEngine","User change. New user:",n.toKey()),e.next=5,lp(r.localStore,n);case 5:return i=e.sent,r.currentUser=n,function(e,t){e.ua.forEach((function(e){e.forEach((function(e){e.reject(new hl(fl.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),e.ua.clear()}(r),r.sharedClientState.handleUserChange(n,i.removedBatchIds,i.addedBatchIds),e.next=11,Iy(r,i.ci);case 11:case"end":return e.stop()}}),e)}))),Ay.apply(this,arguments)}function Ry(e,t){var n=ll(e),r=n.ia.get(t);if(r&&r.Xu)return $h().add(r.key);var i=$h(),a=n.ea.get(t);if(!a)return i;var o,u=re(a);try{for(u.s();!(o=u.n()).done;){var s=o.value,c=n.ta.get(s);i=i.unionWith(c.view.qu)}}catch(l){u.e(l)}finally{u.f()}return i}function Ly(e){var t=ll(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=fy.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=Ry.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=py.bind(null,t),t.Zu.Ko=Gv.bind(null,t.eventManager),t.Zu.la=Qv.bind(null,t.eventManager),t}function Oy(e){var t=ll(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=yy.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=gy.bind(null,t),t}var Py=function(){function e(){ie(this,e),this.synchronizeTabs=!1}return oe(e,[{key:"initialize",value:function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.M=zp(t.databaseInfo.databaseId),this.sharedClientState=this.da(t),this.persistence=this._a(t),e.next=5,this.persistence.start();case 5:this.gcScheduler=this.wa(t),this.localStore=this.ma(t);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"wa",value:function(e){return null}},{key:"ma",value:function(e){return cp(this.persistence,new up,e.initialUser,this.M)}},{key:"_a",value:function(e){return new Ap(Lp.Wi,this.M)}},{key:"da",value:function(e){return new Pp}},{key:"terminate",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.gcScheduler&&this.gcScheduler.stop(),e.next=3,this.sharedClientState.shutdown();case 3:return e.next=5,this.persistence.shutdown();case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),Dy=function(){function e(){ie(this,e)}return oe(e,[{key:"initialize",value:function(){var e=i(h().mark((function e(t,n){var r=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.localStore,e.t0){e.next=12;break}return this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(e){return dy(r.syncEngine,e,1)},this.remoteStore.remoteSyncer.handleCredentialChange=Ny.bind(null,this.syncEngine),e.next=12,Lv(this.remoteStore,this.syncEngine.isPrimaryClient);case 12:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"createEventManager",value:function(e){return new Bv}},{key:"createDatastore",value:function(e){var t,n=zp(e.databaseInfo.databaseId),r=(t=e.databaseInfo,new Fp(t));return function(e,t,n,r){return new Wp(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,r,n)}},{key:"createRemoteStore",value:function(e){var t,n,r,i,a,o=this;return t=this.localStore,n=this.datastore,r=e.asyncQueue,i=function(e){return dy(o.syncEngine,e,0)},a=Mp.vt()?new Mp:new Dp,new Qp(t,n,r,i,a)}},{key:"createSyncEngine",value:function(e,t){return function(e,t,n,r,i,a,o){var u=new ny(e,t,n,r,i,a);return o&&(u.ca=!0),u}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}},{key:"terminate",value:function(){return function(){var e=i(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ll(t),il("RemoteStore","RemoteStore shutting down."),n.lu.add(5),e.next=5,Jp(n);case 5:n.du.shutdown(),n._u.set("Unknown");case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()(this.remoteStore)}}]),e}();var My=function(){function e(t){ie(this,e),this.observer=t,this.muted=!1}return oe(e,[{key:"next",value:function(e){this.observer.next&&this.ya(this.observer.next,e)}},{key:"error",value:function(e){this.observer.error?this.ya(this.observer.error,e):console.error("Uncaught Error in snapshot listener:",e)}},{key:"pa",value:function(){this.muted=!0}},{key:"ya",value:function(e,t){var n=this;this.muted||setTimeout((function(){n.muted||e(t)}),0)}}]),e}(),Uy=function(){function e(t,n,r,a){var o=this;ie(this,e),this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=a,this.user=el.UNAUTHENTICATED,this.clientId=El.R(),this.authCredentialListener=function(){return Promise.resolve()},this.appCheckCredentialListener=function(){return Promise.resolve()},this.authCredentials.start(r,function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return il("FirestoreClient","Received user=",t.uid),e.next=3,o.authCredentialListener(t);case 3:o.user=t;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.appCheckCredentials.start(r,(function(e){return il("FirestoreClient","Received new app check token=",e),o.appCheckCredentialListener(e,o.user)}))}return oe(e,[{key:"getConfiguration",value:function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100});case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setCredentialChangeListener",value:function(e){this.authCredentialListener=e}},{key:"setAppCheckTokenChangeListener",value:function(e){this.appCheckCredentialListener=e}},{key:"verifyNotTerminated",value:function(){if(this.asyncQueue.isShuttingDown)throw new hl(fl.FAILED_PRECONDITION,"The client has already been terminated.")}},{key:"terminate",value:function(){var e=this;this.asyncQueue.enterRestrictedMode();var t=new dl;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(i(h().mark((function n(){var r;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,n.t0=e.onlineComponents,!n.t0){n.next=5;break}return n.next=5,e.onlineComponents.terminate();case 5:if(n.t1=e.offlineComponents,!n.t1){n.next=9;break}return n.next=9,e.offlineComponents.terminate();case 9:e.authCredentials.shutdown(),e.appCheckCredentials.shutdown(),t.resolve(),n.next=18;break;case 14:n.prev=14,n.t2=n.catch(0),r=Uv(n.t2,"Failed to shutdown persistence"),t.reject(r);case 18:case"end":return n.stop()}}),n,null,[[0,14]])})))),t.promise}}]),e}();function Vy(e,t){return Fy.apply(this,arguments)}function Fy(){return Fy=i(h().mark((function e(t,n){var r,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.asyncQueue.verifyOperationInProgress(),il("FirestoreClient","Initializing OfflineComponentProvider"),e.next=3,t.getConfiguration();case 3:return r=e.sent,e.next=6,n.initialize(r);case 6:a=r.initialUser,t.setCredentialChangeListener(function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=a.isEqual(t),e.t0){e.next=5;break}return e.next=4,lp(n.localStore,t);case 4:a=t;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n.persistence.setDatabaseDeletedListener((function(){return t.terminate()})),t.offlineComponents=n;case 8:case"end":return e.stop()}}),e)}))),Fy.apply(this,arguments)}function jy(e,t){return zy.apply(this,arguments)}function zy(){return zy=i(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.asyncQueue.verifyOperationInProgress(),e.next=3,By(t);case 3:return r=e.sent,il("FirestoreClient","Initializing OnlineComponentProvider"),e.next=7,t.getConfiguration();case 7:return i=e.sent,e.next=10,n.initialize(r,i);case 10:t.setCredentialChangeListener((function(e){return Av(n.remoteStore,e)})),t.setAppCheckTokenChangeListener((function(e,t){return Av(n.remoteStore,t)})),t.onlineComponents=n;case 13:case"end":return e.stop()}}),e)}))),zy.apply(this,arguments)}function By(e){return qy.apply(this,arguments)}function qy(){return qy=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t.offlineComponents,e.t0){e.next=5;break}return il("FirestoreClient","Using default OfflineComponentProvider"),e.next=5,Vy(t,new Py);case 5:return e.abrupt("return",t.offlineComponents);case 6:case"end":return e.stop()}}),e)}))),qy.apply(this,arguments)}function Hy(e){return Ky.apply(this,arguments)}function Ky(){return Ky=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t.onlineComponents,e.t0){e.next=5;break}return il("FirestoreClient","Using default OnlineComponentProvider"),e.next=5,jy(t,new Dy);case 5:return e.abrupt("return",t.onlineComponents);case 6:case"end":return e.stop()}}),e)}))),Ky.apply(this,arguments)}function Wy(e){return Hy(e).then((function(e){return e.syncEngine}))}function Gy(e){return Qy.apply(this,arguments)}function Qy(){return Qy=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hy(t);case 2:return n=e.sent,r=n.eventManager,e.abrupt("return",(r.onListen=ry.bind(null,n.syncEngine),r.onUnlisten=uy.bind(null,n.syncEngine),r));case 5:case"end":return e.stop()}}),e)}))),Qy.apply(this,arguments)}function Xy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new dl;return e.asyncQueue.enqueueAndForget(i(h().mark((function i(){return h().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.t0=function(e,t,n,r,i){var a=new My({next:function(n){t.enqueueAndForget((function(){return Kv(e,o)})),n.fromCache&&"server"===r.source?i.reject(new hl(fl.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:function(e){return i.reject(e)}}),o=new Yv(n,a,{includeMetadataChanges:!0,Du:!0});return qv(e,o)},i.next=3,Gy(e);case 3:return i.t1=i.sent,i.t2=e.asyncQueue,i.t3=t,i.t4=n,i.t5=r,i.abrupt("return",(0,i.t0)(i.t1,i.t2,i.t3,i.t4,i.t5));case 9:case"end":return i.stop()}}),i)})))),r.promise}var Yy=new Map;function Jy(e,t,n){if(!n)throw new hl(fl.INVALID_ARGUMENT,"Function ".concat(e,"() cannot be called with an empty ").concat(t,"."))}function $y(e){if(!Xl.isDocumentKey(e))throw new hl(fl.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but ".concat(e," has ").concat(e.length,"."))}function Zy(e){if(Xl.isDocumentKey(e))throw new hl(fl.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but ".concat(e," has ").concat(e.length,"."))}function em(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e="".concat(e.substring(0,20),"...")),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){return e.constructor?e.constructor.name:null}(e);return t?"a custom ".concat(t," object"):"an object"}return"function"==typeof e?"a function":sl()}function tm(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new hl(fl.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=em(e);throw new hl(fl.INVALID_ARGUMENT,"Expected type '".concat(t.name,"', but it was: ").concat(n))}return e}var nm=function(){function e(t){var n;if(ie(this,e),void 0===t.host){if(void 0!==t.ssl)throw new hl(fl.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(n=t.ssl)||void 0===n||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new hl(fl.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,function(e,t,n,r){if(!0===t&&!0===r)throw new hl(fl.INVALID_ARGUMENT,"".concat(e," and ").concat(n," cannot be used together."))}("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return oe(e,[{key:"isEqual",value:function(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}]),e}(),rm=function(){function e(t,n,r){ie(this,e),this._authCredentials=n,this._appCheckCredentials=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new nm({}),this._settingsFrozen=!1,t instanceof Kl?this._databaseId=t:(this._app=t,this._databaseId=function(e){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new hl(fl.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kl(e.options.projectId)}(t))}return oe(e,[{key:"app",get:function(){if(!this._app)throw new hl(fl.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}},{key:"_initialized",get:function(){return this._settingsFrozen}},{key:"_terminated",get:function(){return void 0!==this._terminateTask}},{key:"_setSettings",value:function(e){if(this._settingsFrozen)throw new hl(fl.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new nm(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new vl;switch(e.type){case"gapi":var t=e.client;return cl(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new gl(t,e.sessionIndex||"0",e.iamToken||null);case"provider":return e.client;default:throw new hl(fl.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}},{key:"_getSettings",value:function(){return this._settings}},{key:"_freezeSettings",value:function(){return this._settingsFrozen=!0,this._settings}},{key:"_delete",value:function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}},{key:"toJSON",value:function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}},{key:"_terminate",value:function(){return function(e){var t=Yy.get(e);t&&(il("ComponentProvider","Removing Datastore"),Yy.delete(e),t.terminate())}(this),Promise.resolve()}}]),e}();var im=function(){function e(t,n,r){ie(this,e),this.converter=n,this._key=r,this.type="document",this.firestore=t}return oe(e,[{key:"_path",get:function(){return this._key.path}},{key:"id",get:function(){return this._key.path.lastSegment()}},{key:"path",get:function(){return this._key.path.canonicalString()}},{key:"parent",get:function(){return new om(this.firestore,this.converter,this._key.path.popLast())}},{key:"withConverter",value:function(t){return new e(this.firestore,t,this._key)}}]),e}(),am=function(){function e(t,n,r){ie(this,e),this.converter=n,this._query=r,this.type="query",this.firestore=t}return oe(e,[{key:"withConverter",value:function(t){return new e(this.firestore,t,this._query)}}]),e}(),om=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this,e,r,zf(i)))._path=i,a.type="collection",a}return oe(n,[{key:"id",get:function(){return this._query.path.lastSegment()}},{key:"path",get:function(){return this._query.path.canonicalString()}},{key:"parent",get:function(){var e=this._path.popLast();return e.isEmpty()?null:new im(this.firestore,null,new Xl(e))}},{key:"withConverter",value:function(e){return new n(this.firestore,e,this._path)}}]),n}(am);function um(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(e=Oe(e),Jy("collection","path",t),e instanceof rm){var a=Ll.fromString.apply(Ll,[t].concat(r));return Zy(a),new om(e,null,a)}if(!(e instanceof im||e instanceof om))throw new hl(fl.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");var o=e._path.child(Ll.fromString.apply(Ll,[t].concat(r)));return Zy(o),new om(e.firestore,null,o)}function sm(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(e=Oe(e),1===arguments.length&&(t=El.R()),Jy("doc","path",t),e instanceof rm){var a=Ll.fromString.apply(Ll,[t].concat(r));return $y(a),new im(e,null,new Xl(a))}if(!(e instanceof im||e instanceof om))throw new hl(fl.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");var o=e._path.child(Ll.fromString.apply(Ll,[t].concat(r)));return $y(o),new im(e.firestore,e instanceof om?e.converter:null,new Xl(o))}var cm=function(){function e(){var t=this;ie(this,e),this.Na=Promise.resolve(),this.ka=[],this.Ma=!1,this.Oa=[],this.Fa=null,this.$a=!1,this.Ba=!1,this.La=[],this.So=new Bp(this,"async_queue_retry"),this.Ua=function(){var e=jp();e&&il("AsyncQueue","Visibility state changed to "+e.visibilityState),t.So.Eo()};var n=jp();n&&"function"==typeof n.addEventListener&&n.addEventListener("visibilitychange",this.Ua)}return oe(e,[{key:"isShuttingDown",get:function(){return this.Ma}},{key:"enqueueAndForget",value:function(e){this.enqueue(e)}},{key:"enqueueAndForgetEvenWhileRestricted",value:function(e){this.qa(),this.Ga(e)}},{key:"enterRestrictedMode",value:function(e){if(!this.Ma){this.Ma=!0,this.Ba=e||!1;var t=jp();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Ua)}}},{key:"enqueue",value:function(e){var t=this;if(this.qa(),this.Ma)return new Promise((function(){}));var n=new dl;return this.Ga((function(){return t.Ma&&t.Ba?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)})).then((function(){return n.promise}))}},{key:"enqueueRetryable",value:function(e){var t=this;this.enqueueAndForget((function(){return t.ka.push(e),t.Ka()}))}},{key:"Ka",value:function(){var e=i(h().mark((function e(){var t=this;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.ka.length){e.next=14;break}return e.prev=1,e.next=4,this.ka[0]();case 4:this.ka.shift(),this.So.reset(),e.next=13;break;case 8:if(e.prev=8,e.t0=e.catch(1),Hd(e.t0)){e.next=12;break}throw e.t0;case 12:il("AsyncQueue","Operation failed with retryable error: "+e.t0);case 13:this.ka.length>0&&this.So.Io((function(){return t.Ka()}));case 14:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"Ga",value:function(e){var t=this,n=this.Na.then((function(){return t.$a=!0,e().catch((function(e){t.Fa=e,t.$a=!1;var n=function(e){var t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e);throw al("INTERNAL UNHANDLED ERROR: ",n),e})).then((function(e){return t.$a=!1,e}))}));return this.Na=n,n}},{key:"enqueueAfterDelay",value:function(e,t,n){var r=this;this.qa(),this.La.indexOf(e)>-1&&(t=0);var i=Mv.createAndSchedule(this,e,t,n,(function(e){return r.Qa(e)}));return this.Oa.push(i),i}},{key:"qa",value:function(){this.Fa&&sl()}},{key:"verifyOperationInProgress",value:function(){}},{key:"ja",value:function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.Na,e.next=3,t;case 3:if(t!==this.Na){e.next=0;break}case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"Wa",value:function(e){var t,n=re(this.Oa);try{for(n.s();!(t=n.n()).done;){if(t.value.timerId===e)return!0}}catch(r){n.e(r)}finally{n.f()}return!1}},{key:"za",value:function(e){var t=this;return this.ja().then((function(){t.Oa.sort((function(e,t){return e.targetTimeMs-t.targetTimeMs}));var n,r=re(t.Oa);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.skipDelay(),"all"!==e&&i.timerId===e)break}}catch(a){r.e(a)}finally{r.f()}return t.ja()}))}},{key:"Ha",value:function(e){this.La.push(e)}},{key:"Qa",value:function(e){var t=this.Oa.indexOf(e);this.Oa.splice(t,1)}}]),e}();var lm=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this,e,r,i)).type="firestore",a._queue=new cm,a._persistenceKey="name"in e?e.name:"[DEFAULT]",a}return oe(n,[{key:"_terminate",value:function(){return this._firestoreClient||hm(this),this._firestoreClient.terminate()}}]),n}(rm);function fm(e){return e._firestoreClient||hm(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function hm(e){var t,n=e._freezeSettings(),r=function(e,t,n,r){return new Hl(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,n);e._firestoreClient=new Uy(e._authCredentials,e._appCheckCredentials,e._queue,r)}var dm=function(){function e(){ie(this,e);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0;i<n.length;++i)if(0===n[i].length)throw new hl(fl.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Pl(n)}return oe(e,[{key:"isEqual",value:function(e){return this._internalPath.isEqual(e._internalPath)}}]),e}();var pm=function(){function e(t){ie(this,e),this._byteString=t}return oe(e,[{key:"toBase64",value:function(){return this._byteString.toBase64()}},{key:"toUint8Array",value:function(){return this._byteString.toUint8Array()}},{key:"toString",value:function(){return"Bytes(base64: "+this.toBase64()+")"}},{key:"isEqual",value:function(e){return this._byteString.isEqual(e._byteString)}}],[{key:"fromBase64String",value:function(t){try{return new e(Ml.fromBase64String(t))}catch(t){throw new hl(fl.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}},{key:"fromUint8Array",value:function(t){return new e(Ml.fromUint8Array(t))}}]),e}(),vm=oe((function e(t){ie(this,e),this._methodName=t})),ym=function(){function e(t,n){if(ie(this,e),!isFinite(t)||t<-90||t>90)throw new hl(fl.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(n)||n<-180||n>180)throw new hl(fl.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=t,this._long=n}return oe(e,[{key:"latitude",get:function(){return this._lat}},{key:"longitude",get:function(){return this._long}},{key:"isEqual",value:function(e){return this._lat===e._lat&&this._long===e._long}},{key:"toJSON",value:function(){return{latitude:this._lat,longitude:this._long}}},{key:"_compareTo",value:function(e){return Sl(this._lat,e._lat)||Sl(this._long,e._long)}}]),e}(),mm=/^__.*__$/,gm=function(){function e(t,n,r){ie(this,e),this.data=t,this.fieldMask=n,this.fieldTransforms=r}return oe(e,[{key:"toMutation",value:function(e,t){return null!==this.fieldMask?new Ch(e,this.data,this.fieldMask,t,this.fieldTransforms):new Ih(e,this.data,t,this.fieldTransforms)}}]),e}();function km(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw sl()}}var bm=function(){function e(t,n,r,i,a,o){ie(this,e),this.settings=t,this.databaseId=n,this.M=r,this.ignoreUndefinedProperties=i,void 0===a&&this.Ja(),this.fieldTransforms=a||[],this.fieldMask=o||[]}return oe(e,[{key:"path",get:function(){return this.settings.path}},{key:"Ya",get:function(){return this.settings.Ya}},{key:"Xa",value:function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.M,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}},{key:"Za",value:function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Xa({path:n,tc:!1});return r.ec(e),r}},{key:"nc",value:function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Xa({path:n,tc:!1});return r.Ja(),r}},{key:"sc",value:function(e){return this.Xa({path:void 0,tc:!0})}},{key:"ic",value:function(e){return Lm(e,this.settings.methodName,this.settings.rc||!1,this.path,this.settings.oc)}},{key:"contains",value:function(e){return void 0!==this.fieldMask.find((function(t){return e.isPrefixOf(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.isPrefixOf(t.field)}))}},{key:"Ja",value:function(){if(this.path)for(var e=0;e<this.path.length;e++)this.ec(this.path.get(e))}},{key:"ec",value:function(e){if(0===e.length)throw this.ic("Document fields must not be empty");if(km(this.Ya)&&mm.test(e))throw this.ic('Document fields cannot begin and end with "__"')}}]),e}(),wm=function(){function e(t,n,r){ie(this,e),this.databaseId=t,this.ignoreUndefinedProperties=n,this.M=r||zp(t)}return oe(e,[{key:"uc",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new bm({Ya:e,methodName:t,oc:n,path:Pl.emptyPath(),tc:!1,rc:r},this.databaseId,this.M,this.ignoreUndefinedProperties)}}]),e}();function _m(e){var t=e._freezeSettings(),n=zp(e._databaseId);return new wm(e._databaseId,!!t.ignoreUndefinedProperties,n)}function Em(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=e.uc(a.merge||a.mergeFields?2:0,t,n,i);Cm("Data must be an object, but it was:",o,r);var u,s,c=xm(r,o);if(a.merge)u=new Dl(o.fieldMask),s=o.fieldTransforms;else if(a.mergeFields){var l,f=[],h=re(a.mergeFields);try{for(h.s();!(l=h.n()).done;){var d=l.value,p=Nm(t,d,n);if(!o.contains(p))throw new hl(fl.INVALID_ARGUMENT,"Field '".concat(p,"' is specified in your field mask but missing from your input data."));Om(f,p)||f.push(p)}}catch(v){h.e(v)}finally{h.f()}u=new Dl(f),s=o.fieldTransforms.filter((function(e){return u.covers(e.field)}))}else u=null,s=o.fieldTransforms;return new gm(new hf(c),u,s)}function Sm(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Tm(n,e.uc(r?4:3,t))}function Tm(e,t){if(Im(e=Oe(e)))return Cm("Unsupported field value:",t,e),xm(e,t);if(e instanceof vm)return function(e,t){if(!km(t.Ya))throw t.ic("".concat(e._methodName,"() can only be used with update() and set()"));if(!t.path)throw t.ic("".concat(e._methodName,"() is not currently supported inside arrays"));var n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.tc&&4!==t.Ya)throw t.ic("Nested arrays are not supported");return function(e,t){var n,r=[],i=0,a=re(e);try{for(a.s();!(n=a.n()).done;){var o=Tm(n.value,t.sc(i));null==o&&(o={nullValue:"NULL_VALUE"}),r.push(o),i++}}catch(u){a.e(u)}finally{a.f()}return{arrayValue:{values:r}}}(e,t)}return function(e,t){if(null===(e=Oe(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return ah(t.M,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){var n=xl.fromDate(e);return{timestampValue:dd(t.M,n)}}if(e instanceof xl){var r=new xl(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:dd(t.M,r)}}if(e instanceof ym)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof pm)return{bytesValue:pd(t.M,e._byteString)};if(e instanceof im){var i=t.databaseId,a=e.firestore._databaseId;if(!a.isEqual(i))throw t.ic("Document reference is for database ".concat(a.projectId,"/").concat(a.database," but should be for database ").concat(i.projectId,"/").concat(i.database));return{referenceValue:md(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.ic("Unsupported field value: ".concat(em(e)))}(e,t)}function xm(e,t){var n={};return Al(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):Nl(e,(function(e,r){var i=Tm(r,t.Za(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Im(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof xl||e instanceof ym||e instanceof pm||e instanceof im||e instanceof vm)}function Cm(e,t,n){if(!Im(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){var r=em(n);throw"an object"===r?t.ic(e+" a custom object"):t.ic(e+" "+r)}}function Nm(e,t,n){if((t=Oe(t))instanceof dm)return t._internalPath;if("string"==typeof t)return Rm(e,t);throw Lm("Field path arguments must be of type string or ",e,!1,void 0,n)}var Am=new RegExp("[~\\*/\\[\\]]");function Rm(e,t,n){if(t.search(Am)>=0)throw Lm("Invalid field path (".concat(t,"). Paths must not contain '~', '*', '/', '[', or ']'"),e,!1,void 0,n);try{return le(dm,se(t.split(".")))._internalPath}catch(r){throw Lm("Invalid field path (".concat(t,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"),e,!1,void 0,n)}}function Lm(e,t,n,r,i){var a=r&&!r.isEmpty(),o=void 0!==i,u="Function ".concat(t,"() called with invalid data");n&&(u+=" (via `toFirestore()`)"),u+=". ";var s="";return(a||o)&&(s+=" (found",a&&(s+=" in field ".concat(r)),o&&(s+=" in document ".concat(i)),s+=")"),new hl(fl.INVALID_ARGUMENT,u+e+s)}function Om(e,t){return e.some((function(e){return e.isEqual(t)}))}var Pm=function(){function e(t,n,r,i,a){ie(this,e),this._firestore=t,this._userDataWriter=n,this._key=r,this._document=i,this._converter=a}return oe(e,[{key:"id",get:function(){return this._key.path.lastSegment()}},{key:"ref",get:function(){return new im(this._firestore,this._converter,this._key)}},{key:"exists",value:function(){return null!==this._document}},{key:"data",value:function(){if(this._document){if(this._converter){var e=new Dm(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}},{key:"get",value:function(e){if(this._document){var t=this._document.data.field(Mm("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}]),e}(),Dm=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n,[{key:"data",value:function(){return X(G(n.prototype),"data",this).call(this)}}]),n}(Pm);function Mm(e,t){return"string"==typeof t?Rm(e,t):t instanceof dm?t._internalPath:t._delegate._internalPath}var Um=function(){function e(t,n){ie(this,e),this.hasPendingWrites=t,this.fromCache=n}return oe(e,[{key:"isEqual",value:function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}]),e}(),Vm=function(e){$(n,e);var t=ne(n);function n(e,r,i,a,o,u){var s;return ie(this,n),(s=t.call(this,e,r,i,a,u))._firestore=e,s._firestoreImpl=e,s.metadata=o,s}return oe(n,[{key:"exists",value:function(){return X(G(n.prototype),"exists",this).call(this)}},{key:"data",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._document){if(this._converter){var t=new Fm(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._document){var n=this._document.data.field(Mm("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}]),n}(Pm),Fm=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n,[{key:"data",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return X(G(n.prototype),"data",this).call(this,e)}}]),n}(Vm),jm=function(){function e(t,n,r,i){ie(this,e),this._firestore=t,this._userDataWriter=n,this._snapshot=i,this.metadata=new Um(i.hasPendingWrites,i.fromCache),this.query=r}return oe(e,[{key:"docs",get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e}},{key:"size",get:function(){return this._snapshot.docs.size}},{key:"empty",get:function(){return 0===this.size}},{key:"forEach",value:function(e,t){var n=this;this._snapshot.docs.forEach((function(r){e.call(t,new Fm(n._firestore,n._userDataWriter,r.key,r,new Um(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))}},{key:"docChanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new hl(fl.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){var n=0;return e._snapshot.docChanges.map((function(t){return{type:"added",doc:new Fm(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Um(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),oldIndex:-1,newIndex:n++}}))}var r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var n=new Fm(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Um(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,a=-1;return 0!==t.type&&(i=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(a=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:zm(t.type),doc:n,oldIndex:i,newIndex:a}}))}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}]),e}();function zm(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return sl()}}function Bm(e){if(qf(e)&&0===e.explicitOrderBy.length)throw new hl(fl.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var qm=oe((function e(){ie(this,e)}));function Hm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];e=o._apply(e)}return e}var Km=function(e){$(n,e);var t=ne(n);function n(e,r,i){var a;return ie(this,n),(a=t.call(this)).hc=e,a.lc=r,a.fc=i,a.type="where",a}return oe(n,[{key:"_apply",value:function(e){var t=_m(e.firestore),n=function(e,t,n,r,i,a,o){var u;if(i.isKeyField()){if("array-contains"===a||"array-contains-any"===a)throw new hl(fl.INVALID_ARGUMENT,"Invalid Query. You can't perform '".concat(a,"' queries on documentId()."));if("in"===a||"not-in"===a){Qm(o,a);var s,c=[],l=re(o);try{for(l.s();!(s=l.n()).done;){var f=s.value;c.push(Gm(r,e,f))}}catch(d){l.e(d)}finally{l.f()}u={arrayValue:{values:c}}}else u=Gm(r,e,o)}else"in"!==a&&"not-in"!==a&&"array-contains-any"!==a||Qm(o,a),u=Sm(n,"where",o,"in"===a||"not-in"===a);var h=Tf.create(i,a,u);return function(e,t){if(t.S()){var n=Kf(e);if(null!==n&&!n.isEqual(t.field))throw new hl(fl.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '".concat(n.toString(),"' and '").concat(t.field.toString(),"'"));var r=Hf(e);null!==r&&Xm(e,t.field,r)}var i=function(e,t){var n,r=re(e.filters);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t.indexOf(i.op)>=0)return i.op}}catch(d){r.e(d)}finally{r.f()}return null}(e,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new hl(fl.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '".concat(t.op.toString(),"' filter.")):new hl(fl.INVALID_ARGUMENT,"Invalid query. You cannot use '".concat(t.op.toString(),"' filters with '").concat(i.toString(),"' filters."))}(e,h),h}(e._query,0,t,e.firestore._databaseId,this.hc,this.lc,this.fc);return new am(e.firestore,e.converter,function(e,t){var n=e.filters.concat([t]);return new Ff(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}(e._query,n))}}]),n}(qm);function Wm(e,t,n){var r=t,i=Mm("where",e);return new Km(i,r,n)}function Gm(e,t,n){if("string"==typeof(n=Oe(n))){if(""===n)throw new hl(fl.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Wf(t)&&-1!==n.indexOf("/"))throw new hl(fl.INVALID_ARGUMENT,"Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n,"' contains a '/' character."));var r=t.path.child(Ll.fromString(n));if(!Xl.isDocumentKey(r))throw new hl(fl.INVALID_ARGUMENT,"Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(r,"' is not because it has an odd number of segments (").concat(r.length,")."));return rf(e,new Xl(r))}if(n instanceof im)return rf(e,n._key);throw new hl(fl.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(em(n),"."))}function Qm(e,t){if(!Array.isArray(e)||0===e.length)throw new hl(fl.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '".concat(t.toString(),"' filters."));if(e.length>10)throw new hl(fl.INVALID_ARGUMENT,"Invalid Query. '".concat(t.toString(),"' filters support a maximum of 10 elements in the value array."))}function Xm(e,t,n){if(!n.isEqual(t))throw new hl(fl.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '".concat(t.toString(),"' and so you must also use '").concat(t.toString(),"' as your first argument to orderBy(), but your first orderBy() is on field '").concat(n.toString(),"' instead."))}var Ym=function(){function e(){ie(this,e)}return oe(e,[{key:"convertValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";switch(Yl(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Fl(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(jl(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw sl()}}},{key:"convertObject",value:function(e,t){var n=this,r={};return Nl(e.fields,(function(e,i){r[e]=n.convertValue(i,t)})),r}},{key:"convertGeoPoint",value:function(e){return new ym(Fl(e.latitude),Fl(e.longitude))}},{key:"convertArray",value:function(e,t){var n=this;return(e.values||[]).map((function(e){return n.convertValue(e,t)}))}},{key:"convertServerTimestamp",value:function(e,t){switch(t){case"previous":var n=Bl(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(ql(e));default:return null}}},{key:"convertTimestamp",value:function(e){var t=Vl(e);return new xl(t.seconds,t.nanos)}},{key:"convertDocumentKey",value:function(e,t){var n=Ll.fromString(e);cl(Vd(n));var r=new Kl(n.get(1),n.get(3)),i=new Xl(n.popFirst(5));return r.isEqual(t)||al("Document ".concat(i," contains a document reference within a different database (").concat(r.projectId,"/").concat(r.database,") which is not supported. It will be treated as a reference in the current database (").concat(t.projectId,"/").concat(t.database,") instead.")),i}}]),e}();function Jm(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var $m=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),(r=t.call(this)).firestore=e,r}return oe(n,[{key:"convertBytes",value:function(e){return new pm(e)}},{key:"convertReference",value:function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new im(this.firestore,null,t)}}]),n}(Ym);function Zm(e){e=tm(e,am);var t=tm(e.firestore,lm),n=fm(t),r=new $m(t);return Bm(e._query),Xy(n,e._query).then((function(n){return new jm(t,r,e,n)}))}function eg(e,t,n){e=tm(e,im);var r=tm(e.firestore,lm),i=Jm(e.converter,t,n);return ng(r,[Em(_m(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,kh.none())])}function tg(e,t){var n=tm(e.firestore,lm),r=sm(e),i=Jm(e.converter,t);return ng(n,[Em(_m(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,kh.exists(!1))]).then((function(){return r}))}function ng(e,t){return function(e,t){var n=new dl;return e.asyncQueue.enqueueAndForget(i(h().mark((function r(){return h().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=cy,r.next=3,Wy(e);case 3:return r.t1=r.sent,r.t2=t,r.t3=n,r.abrupt("return",(0,r.t0)(r.t1,r.t2,r.t3));case 7:case"end":return r.stop()}}),r)})))),n.promise}(fm(e),t)}!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];tl="9.6.10",st(new Fe("firestore",(function(e,n){var r=n.options,i=e.getProvider("app").getImmediate(),a=new lm(i,new yl(e.getProvider("auth-internal")),new bl(e.getProvider("app-check-internal")));return r=Object.assign({useFetchStreams:t},r),a._setSettings(r),a}),"PUBLIC")),vt(Zc,"3.4.7",e),vt(Zc,"3.4.7","esm2017")}();var rg="firebasestorage.googleapis.com",ig=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),(i=t.call(this,ag(e),"Firebase Storage: ".concat(r," (").concat(ag(e),")"))).customData={serverResponse:null},i._baseMessage=i.message,Object.setPrototypeOf(Y(i),n.prototype),i}return oe(n,[{key:"_codeEquals",value:function(e){return ag(e)===this.code}},{key:"serverResponse",get:function(){return this.customData.serverResponse},set:function(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message="".concat(this._baseMessage,"\n").concat(this.customData.serverResponse):this.message=this._baseMessage}}]),n}(_e);function ag(e){return"storage/"+e}function og(){return new ig("unknown","An unknown error occurred, please check the error payload for server response.")}function ug(){return new ig("canceled","User canceled the upload/download.")}function sg(e){return new ig("invalid-argument",e)}function cg(){return new ig("app-deleted","The Firebase app was deleted.")}var lg,fg=function(){function e(t,n){ie(this,e),this.bucket=t,this.path_=n}return oe(e,[{key:"path",get:function(){return this.path_}},{key:"isRoot",get:function(){return 0===this.path.length}},{key:"fullServerUrl",value:function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}},{key:"bucketOnlyServerUrl",value:function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}}],[{key:"makeFromBucketSpec",value:function(t,n){var r;try{r=e.makeFromUrl(t,n)}catch(i){return new e(t,"")}if(""===r.path)return r;throw new ig("invalid-default-bucket","Invalid default bucket '"+t+"'.")}},{key:"makeFromUrl",value:function(t,n){var r=null,i="([A-Za-z0-9.\\-_]+)";var a=new RegExp("^gs://"+i+"(/(.*))?$","i");function o(e){e.path_=decodeURIComponent(e.path)}for(var u=n.replace(/[.]/g,"\\."),s=[{regex:a,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp("^https?://".concat(u,"/").concat("v[A-Za-z0-9_]+","/b/").concat(i,"/o").concat("(/([^?#]*).*)?$"),"i"),indices:{bucket:1,path:3},postModify:o},{regex:new RegExp("^https?://".concat(n===rg?"(?:storage.googleapis.com|storage.cloud.google.com)":n,"/").concat(i,"/").concat("([^?#]*)"),"i"),indices:{bucket:1,path:2},postModify:o}],c=0;c<s.length;c++){var l=s[c],f=l.regex.exec(t);if(f){var h=f[l.indices.bucket],d=f[l.indices.path];d||(d=""),r=new e(h,d),l.postModify(r);break}}if(null==r)throw function(e){return new ig("invalid-url","Invalid URL '"+e+"'.")}(t);return r}}]),e}(),hg=function(){function e(t){ie(this,e),this.promise_=Promise.reject(t)}return oe(e,[{key:"getPromise",value:function(){return this.promise_}},{key:"cancel",value:function(){}}]),e}();function dg(e,t,n,r){if(r<t)throw sg("Invalid value for '".concat(e,"'. Expected ").concat(t," or greater."));if(r>n)throw sg("Invalid value for '".concat(e,"'. Expected ").concat(n," or less."))}function pg(e){var t=encodeURIComponent,n="?";for(var r in e){if(e.hasOwnProperty(r))n=n+(t(r)+"="+t(e[r]))+"&"}return n=n.slice(0,-1)}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(lg||(lg={}));var vg=function(){function e(t,n,r,i,a,o,u,s,c,l,f){var h=this;ie(this,e),this.url_=t,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=a,this.additionalRetryCodes_=o,this.callback_=u,this.errorCallback_=s,this.timeout_=c,this.progressCallback_=l,this.connectionFactory_=f,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((function(e,t){h.resolve_=e,h.reject_=t,h.start_()}))}return oe(e,[{key:"start_",value:function(){var e=this,t=function(t,n){var r=e.resolve_,i=e.reject_,a=n.connection;if(n.wasSuccessCode)try{var o=e.callback_(a,a.getResponse());!function(e){return void 0!==e}(o)?r():r(o)}catch(s){i(s)}else if(null!==a){var u=og();u.serverResponse=a.getErrorText(),e.errorCallback_?i(e.errorCallback_(a,u)):i(u)}else{if(n.canceled)i(e.appDelete_?cg():ug());else i(new ig("retry-limit-exceeded","Max retry time for operation exceeded, please try again."))}};this.canceled_?t(0,new yg(!1,null,!0)):this.backoffId_=function(e,t,n){var r=1,i=null,a=null,o=!1,u=0;function s(){return 2===u}var c=!1;function l(){if(!c){c=!0;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.apply(null,n)}}function f(t){i=setTimeout((function(){i=null,e(d,s())}),t)}function h(){a&&clearTimeout(a)}function d(e){if(c)h();else{for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(e)return h(),void l.call.apply(l,[null,e].concat(n));var a;if(s()||o)return h(),void l.call.apply(l,[null,e].concat(n));r<64&&(r*=2),1===u?(u=2,a=0):a=1e3*(r+Math.random()),f(a)}}var p=!1;function v(e){p||(p=!0,h(),c||(null!==i?(e||(u=2),clearTimeout(i),f(0)):e||(u=1)))}return f(0),a=setTimeout((function(){o=!0,v(!0)}),n),v}((function(t,n){if(n)t(!1,new yg(!1,null,!0));else{var r=e.connectionFactory_();e.pendingConnection_=r;var i=function(t){var n=t.loaded,r=t.lengthComputable?t.total:-1;null!==e.progressCallback_&&e.progressCallback_(n,r)};null!==e.progressCallback_&&r.addUploadProgressListener(i),r.send(e.url_,e.method_,e.body_,e.headers_).then((function(){null!==e.progressCallback_&&r.removeUploadProgressListener(i),e.pendingConnection_=null;var n=r.getErrorCode()===lg.NO_ERROR,a=r.getStatus();if(n&&!e.isRetryStatusCode_(a)){var o=-1!==e.successCodes_.indexOf(a);t(!0,new yg(o,r))}else{var u=r.getErrorCode()===lg.ABORT;t(!1,new yg(!1,null,u))}}))}}),t,this.timeout_)}},{key:"getPromise",value:function(){return this.promise_}},{key:"cancel",value:function(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&function(e){e(!1)}(this.backoffId_),null!==this.pendingConnection_&&this.pendingConnection_.abort()}},{key:"isRetryStatusCode_",value:function(e){var t=e>=500&&e<600,n=-1!==[408,429].indexOf(e),r=-1!==this.additionalRetryCodes_.indexOf(e);return t||n||r}}]),e}(),yg=oe((function e(t,n,r){ie(this,e),this.wasSuccessCode=t,this.connection=n,this.canceled=!!r}));function mg(e){var t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}var gg=function(){function e(t,n){ie(this,e),this._service=t,this._location=n instanceof fg?n:fg.makeFromUrl(n,t.host)}return oe(e,[{key:"toString",value:function(){return"gs://"+this._location.bucket+"/"+this._location.path}},{key:"_newRef",value:function(t,n){return new e(t,n)}},{key:"root",get:function(){var e=new fg(this._location.bucket,"");return this._newRef(this._service,e)}},{key:"bucket",get:function(){return this._location.bucket}},{key:"fullPath",get:function(){return this._location.path}},{key:"name",get:function(){return mg(this._location.path)}},{key:"storage",get:function(){return this._service}},{key:"parent",get:function(){var t=function(e){if(0===e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===t)return null;var n=new fg(this._location.bucket,t);return new e(this._service,n)}},{key:"_throwIfRoot",value:function(e){if(""===this._location.path)throw function(e){return new ig("invalid-root-operation","The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}]),e}();function kg(e,t){var n=null===t||void 0===t?void 0:t.storageBucket;return null==n?null:fg.makeFromBucketSpec(n,e)}var bg=function(){function e(t,n,r,i,a){ie(this,e),this.app=t,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=a,this._bucket=null,this._host=rg,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=i?fg.makeFromBucketSpec(i,this._host):kg(this._host,this.app.options)}return oe(e,[{key:"host",get:function(){return this._host},set:function(e){this._host=e,null!=this._url?this._bucket=fg.makeFromBucketSpec(this._url,e):this._bucket=kg(e,this.app.options)}},{key:"maxUploadRetryTime",get:function(){return this._maxUploadRetryTime},set:function(e){dg("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}},{key:"maxOperationRetryTime",get:function(){return this._maxOperationRetryTime},set:function(e){dg("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}},{key:"_getAuthToken",value:function(){var e=i(h().mark((function e(){var t,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._overrideAuthToken){e.next=2;break}return e.abrupt("return",this._overrideAuthToken);case 2:if(!(t=this._authProvider.getImmediate({optional:!0}))){e.next=9;break}return e.next=6,t.getToken();case 6:if(null===(n=e.sent)){e.next=9;break}return e.abrupt("return",n.accessToken);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_getAppCheckToken",value:function(){var e=i(h().mark((function e(){var t,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this._appCheckProvider.getImmediate({optional:!0}))){e.next=6;break}return e.next=4,t.getToken();case 4:return n=e.sent,e.abrupt("return",n.token);case 6:return e.abrupt("return",null);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_delete",value:function(){return this._deleted||(this._deleted=!0,this._requests.forEach((function(e){return e.cancel()})),this._requests.clear()),Promise.resolve()}},{key:"_makeStorageReference",value:function(e){return new gg(this,e)}},{key:"_makeRequest",value:function(e,t,n,r){var i=this;if(this._deleted)return new hg(cg());var a=function(e,t,n,r,i,a){var o=pg(e.urlParams),u=e.url+o,s=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(s,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(s,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!==t&&void 0!==t?t:"AppManager")}(s,a),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(s,r),new vg(u,e.method,s,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i)}(e,this._appId,n,r,t,this._firebaseVersion);return this._requests.add(a),a.getPromise().then((function(){return i._requests.delete(a)}),(function(){return i._requests.delete(a)})),a}},{key:"makeRequestWithTokens",value:function(){var e=i(h().mark((function e(t,n){var r,i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this._getAuthToken(),this._getAppCheckToken()]);case 2:return r=e.sent,i=c(r,2),a=i[0],o=i[1],e.abrupt("return",this._makeRequest(t,n,a,o).getPromise());case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}(),wg="@firebase/storage",_g="0.9.4",Eg="storage";function Sg(e,t){var n=t.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal");return new bg(r,i,a,n,dt)}st(new Fe(Eg,Sg,"PUBLIC").setMultipleInstances(!0)),vt(wg,_g,""),vt(wg,_g,"esm2017");var Tg,xg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==typeof t){var n=t;t={name:n}}var r=Object.assign({name:rt,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!==typeof i||!i)throw ft.create("bad-app-name",{appName:String(i)});var a=at.get(i);if(a){if(xe(e,a.options)&&xe(r,a.config))return a;throw ft.create("duplicate-app",{appName:i})}var o,u=new He(i),s=re(ot.values());try{for(s.s();!(o=s.n()).done;){var c=o.value;u.addComponent(c)}}catch(f){s.e(f)}finally{s.f()}var l=new ht(e,r,u);return at.set(i,l),l}({apiKey:"AIzaSyDeF1-t9q4__CZrOpqvBr4t2hryjv_S_KE",authDomain:"twitterclone-sdb.firebaseapp.com",projectId:"twitterclone-sdb",storageBucket:"twitterclone-sdb.appspot.com",messagingSenderId:"105460700478",appId:"1:105460700478:web:da060364784ff8535c886f"}),Ig=Va(),Cg=new Ir,Ng=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt();return ct(e,"firestore").getImmediate()}(xg),Ag=(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt(),t=arguments.length>1?arguments[1]:void 0,n=ct(e=Oe(e),Eg),r=n.getImmediate({identifier:t})}(xg),n(184)),Rg=function(){var t=c((0,e.useState)(null),2),n=t[0],r=t[1],a=c((0,e.useState)(""),2),o=a[0],u=a[1],s=c((0,e.useState)(""),2),l=s[0],f=s[1],d=c((0,e.useState)(!1),2),p=d[0],v=d[1],y=function(){var e=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ji(Ig);case 3:(t=e.sent)&&(console.log(t),r(t.user),v(!1)),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),m=L();(0,e.useEffect)((function(){y()})),(0,e.useEffect)((function(){n&&m("main")}),[n]),n&&m("main");var g=function(){var e=i(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),v(!0),e.prev=2,e.next=5,Xi(Ig,Cg);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(t){return e.apply(this,arguments)}}();return(0,Ag.jsxs)("div",{className:"login-card",children:[(0,Ag.jsxs)("form",{className:"login-form",children:[(0,Ag.jsx)("h3",{className:"login-heading",children:"Login"}),(0,Ag.jsx)("input",{className:"loginInput",type:"email",placeholder:"Email",value:o,onChange:function(e){return u(e.target.value)}}),(0,Ag.jsx)("input",{className:"loginInput",type:"password",placeholder:"Password",value:l,onChange:function(e){return f(e.target.value)}}),(0,Ag.jsx)("button",{className:"loginSubmitBtn",type:"submit",onClick:function(e){e.preventDefault(),v(!0),setTimeout((function(){}),2e3),function(e,t,n){return Br(Oe(e),Er.credential(t,n))}(Ig,o,l).then((function(e){var t=e.user;r(t),v(!1)})).catch((function(e){var t=e.code,n=e.message;console.log(t,n),v(!1),alert("error",n,t)}))},children:"Login"}),(0,Ag.jsx)("div",{className:"divider",children:"or continue with"}),(0,Ag.jsx)("button",{className:"googleSigninBtn",onClick:g,children:"Sign in with Google"}),(0,Ag.jsxs)("p",{style:{textAlign:"center"},children:["Don't have an account?"," ",(0,Ag.jsx)("strong",{onClick:function(){m("signup",{replace:!0})},children:"Sign up"})]})]}),p&&(0,Ag.jsx)("div",{className:"loading-container",children:(0,Ag.jsxs)("div",{className:"lds-ellipsis",children:[(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{})]})})]})},Lg=n(254),Og=new Uint8Array(16);function Pg(){if(!Tg&&!(Tg="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tg(Og)}var Dg=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Mg=function(e){return"string"===typeof e&&Dg.test(e)},Ug=[],Vg=0;Vg<256;++Vg)Ug.push((Vg+256).toString(16).substr(1));var Fg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Ug[e[t+0]]+Ug[e[t+1]]+Ug[e[t+2]]+Ug[e[t+3]]+"-"+Ug[e[t+4]]+Ug[e[t+5]]+"-"+Ug[e[t+6]]+Ug[e[t+7]]+"-"+Ug[e[t+8]]+Ug[e[t+9]]+"-"+Ug[e[t+10]]+Ug[e[t+11]]+Ug[e[t+12]]+Ug[e[t+13]]+Ug[e[t+14]]+Ug[e[t+15]]).toLowerCase();if(!Mg(n))throw TypeError("Stringified UUID is invalid");return n};var jg=function(e,t,n){var r=(e=e||{}).random||(e.rng||Pg)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Fg(r)};function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qg={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hg=e.createContext&&e.createContext(qg),Kg=function(){return Kg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Kg.apply(this,arguments)},Wg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Gg(t){return t&&t.map((function(t,n){return e.createElement(t.tag,Kg({key:n},t.attr),Gg(t.child))}))}function Qg(t){return function(n){return e.createElement(Xg,Kg({attr:Kg({},t.attr)},n),Gg(t.child))}}function Xg(t){var n=function(n){var r,i=t.attr,a=t.size,o=t.title,u=Wg(t,["attr","size","title"]),s=a||n.size||"1em";return n.className&&(r=n.className),t.className&&(r=(r?r+" ":"")+t.className),e.createElement("svg",Kg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,u,{className:r,style:Kg(Kg({color:t.color||n.color},n.style),t.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&e.createElement("title",null,o),t.children)};return void 0!==Hg?e.createElement(Hg.Consumer,null,(function(e){return n(e)})):n(qg)}function Yg(e){return Qg({tag:"svg",attr:{version:"1",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFCDD2",d:"M34,9c-4.2,0-7.9,2.1-10,5.4C21.9,11.1,18.2,9,14,9C7.4,9,2,14.4,2,21c0,11.9,22,24,22,24s22-12,22-24 C46,14.4,40.6,9,34,9z"}}]})(e)}function Jg(e){return Qg({tag:"svg",attr:{version:"1",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#F44336",d:"M34,9c-4.2,0-7.9,2.1-10,5.4C21.9,11.1,18.2,9,14,9C7.4,9,2,14.4,2,21c0,11.9,22,24,22,24s22-12,22-24 C46,14.4,40.6,9,34,9z"}}]})(e)}var $g=n(862);function Zg(e){return Qg({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(e)}function ek(e){var t=new Date(0);return t.setSeconds(e),t}function tk(e){var t=((new Date).getTime()-e.getTime())/1e3;return t<60?Math.round(t)+" s":t<3600?Math.round(t/60)+" mins":t<86400?Math.round(t/3600)+" hrs":t<604800?Math.round(t/86400)+" d":t<2419200?Math.round(t/604800)+" wk":t<29030400?Math.round(t/2419200)+" mnths":Math.round(t/29030400)+" yrs"}function nk(t){var n=t.post,r=t.setShowSinglePost;return(0,e.useEffect)((function(){console.log(n)}),[n]),(0,Ag.jsx)("div",{className:"post-card",children:n&&(0,Ag.jsx)("div",{className:"post-card",children:(0,Ag.jsxs)("div",{className:"post-card-body",children:[(0,Ag.jsx)("div",{className:"post-flex",children:(0,Ag.jsx)("img",{src:n.photoURL?n.photoURL:"https://i.imgur.com/2Y8WQYv.png",alt:"user"})}),(0,Ag.jsxs)("div",{style:{width:"90%"},children:[(0,Ag.jsxs)("p",{className:"post-username",children:[(0,Ag.jsxs)("div",{children:[" ",n.userName,(0,Ag.jsx)("span",{className:"post-hours",children:tk(ek(n.time.seconds))})]}),(0,Ag.jsx)("div",{className:"post-cross",children:(0,Ag.jsx)(Zg,{onClick:function(){return r(!1)}})})]}),(0,Ag.jsx)("span",{className:"post-body",style:{whiteSpace:"pre-warp"},children:n.postText.split("\n").map((function(e,t){return(0,Ag.jsxs)("span",{children:[e,(0,Ag.jsx)("br",{})]},t)}))}),(0,Ag.jsx)("button",{className:"post-like-btn",onClick:function(e){},children:n.postLikes.includes(Va().currentUser.uid)?(0,Ag.jsx)(Jg,{}):(0,Ag.jsx)(Yg,{})}),(0,Ag.jsxs)("span",{className:"post-like-count",children:[" ","  "+n.postLikes.length]})]})]})})})}function rk(t){var n=t.change,r=c(e.useState([]),2),a=r[0],o=r[1],u=c(e.useState(null),2),s=u[0],l=u[1],f=c(e.useState(!1),2),d=f[0],p=f[1],v=c((0,e.useState)(!1),2),y=v[0],m=v[1],g=c((0,e.useState)(!0),2),k=g[0],b=g[1];e.useEffect((function(){!function(){w.apply(this,arguments)}()}),[n,a]);function w(){return w=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],e.next=3,Zm(um(Ng,"posts"));case 3:e.sent.forEach((function(e){t.push(Bg(Bg({},e.data()),{},{id:e.id}))})),t.sort((function(e,t){return t.time.seconds-e.time.seconds})),o(y?t.filter((function(e){return e.userId===Va().currentUser.uid})):t);case 7:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}function _(e){var t=new Date(0);return t.setSeconds(e),t}function E(e){var t=((new Date).getTime()-e.getTime())/1e3;return t<60?Math.round(t)+" s":t<3600?Math.round(t/60)+" mins":t<86400?Math.round(t/3600)+" hrs":t<604800?Math.round(t/86400)+" d":t<2419200?Math.round(t/604800)+" wk":t<29030400?Math.round(t/2419200)+" mnths":Math.round(t/29030400)+" yrs"}function S(){return S=i(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.postId,r=Hm(um(Ng,"posts"),Wm("postId","==",n)),e.next=4,Zm(r);case 4:e.sent.forEach((function(e){var n=Va().currentUser.uid;console.log(e.id," => ",e.data()),console.log(n);var r=sm(Ng,"posts",e.id),i=t.postLikes;i.push(n);var a=se(new Set(i));console.log(e.data()),console.log(t),eg(r,Bg(Bg({},t),{},{postLikes:a}))}));case 6:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}return(0,Ag.jsx)("div",{children:d?(0,Ag.jsx)(nk,{post:s,showSinglePost:d,setShowSinglePost:p}):(0,Ag.jsxs)("div",{className:"post-cards-container",children:[(0,Ag.jsxs)("div",{className:"post-heading",children:[(0,Ag.jsx)("h3",{children:"Feeds "}),(0,Ag.jsxs)("label",{className:"post-seeAll-switch-container",children:[(0,Ag.jsx)($g.default,{onChange:function(){m(!y),b(!k)},checked:k}),(0,Ag.jsx)("span",{children:"See All"})]})]}),a.map((function(e,t){return(0,Ag.jsx)("div",{className:"post-card",onClick:function(){return function(e){l(e),p(!0)}(e)},children:(0,Ag.jsxs)("div",{className:"post-card-body",children:[(0,Ag.jsx)("div",{className:"post-flex",children:(0,Ag.jsx)("img",{src:e.photoURL?e.photoURL:"https://i.imgur.com/2Y8WQYv.png",alt:"user"})}),(0,Ag.jsxs)("div",{children:[(0,Ag.jsxs)("p",{className:"post-username",children:[e.userName,(0,Ag.jsx)("span",{className:"post-hours",children:E(_(e.time.seconds))})]}),(0,Ag.jsx)("span",{className:"post-body",style:{whiteSpace:"pre-warp"},children:e.postText.split("\n").map((function(e,t){return(0,Ag.jsxs)("span",{children:[e,(0,Ag.jsx)("br",{})]},t)}))}),(0,Ag.jsx)("button",{className:"post-like-btn",onClick:function(t){!function(e){S.apply(this,arguments)}(e)},children:e.postLikes.includes(Va().currentUser.uid)?(0,Ag.jsx)(Jg,{}):(0,Ag.jsx)(Yg,{})}),(0,Ag.jsxs)("span",{className:"post-like-count",children:[" ","  "+e.postLikes.length]})]})]})},t)}))]})})}function ik(e){return a(e)||ue(e)||u(e)||s()}function ak(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ok=["override"],uk=["default"],sk=["cachePolicyForParams_UNSTABLE"],ck=h().mark(Rb),lk=h().mark(Ww);var fk=function(e){var t=new Error(e);if(void 0===t.stack)try{throw t}catch(n){}return t};var hk=function(e){return!!e&&"function"===typeof e.then};var dk=function(e,t){if(null!=e)return e;throw fk(null!==t&&void 0!==t?t:"Got unexpected null or undefined")};function pk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vk=function(){function e(){ie(this,e)}return oe(e,[{key:"getValue",value:function(){throw fk("BaseLoadable")}},{key:"toPromise",value:function(){throw fk("BaseLoadable")}},{key:"valueMaybe",value:function(){throw fk("BaseLoadable")}},{key:"valueOrThrow",value:function(){throw fk('Loadable expected value, but in "'.concat(this.state,'" state'))}},{key:"promiseMaybe",value:function(){throw fk("BaseLoadable")}},{key:"promiseOrThrow",value:function(){throw fk('Loadable expected promise, but in "'.concat(this.state,'" state'))}},{key:"errorMaybe",value:function(){throw fk("BaseLoadable")}},{key:"errorOrThrow",value:function(){throw fk('Loadable expected error, but in "'.concat(this.state,'" state'))}},{key:"is",value:function(e){return e.state===this.state&&e.contents===this.contents}},{key:"map",value:function(e){throw fk("BaseLoadable")}}]),e}(),yk=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),pk(Y(r=t.call(this)),"state","hasValue"),pk(Y(r),"contents",void 0),r.contents=e,r}return oe(n,[{key:"getValue",value:function(){return this.contents}},{key:"toPromise",value:function(){return Promise.resolve(this.contents)}},{key:"valueMaybe",value:function(){return this.contents}},{key:"valueOrThrow",value:function(){return this.contents}},{key:"promiseMaybe",value:function(){}},{key:"errorMaybe",value:function(){}},{key:"map",value:function(e){var t=this;try{var n=e(this.contents);return hk(n)?wk(n):Ek(n)?n:kk(n)}catch(r){return hk(r)?wk(r.next((function(){return t.map(e)}))):bk(r)}}}]),n}(vk),mk=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),pk(Y(r=t.call(this)),"state","hasError"),pk(Y(r),"contents",void 0),r.contents=e,r}return oe(n,[{key:"getValue",value:function(){throw this.contents}},{key:"toPromise",value:function(){return Promise.reject(this.contents)}},{key:"valueMaybe",value:function(){}},{key:"promiseMaybe",value:function(){}},{key:"errorMaybe",value:function(){return this.contents}},{key:"errorOrThrow",value:function(){return this.contents}},{key:"map",value:function(e){return this}}]),n}(vk),gk=function(e){$(n,e);var t=ne(n);function n(e){var r;return ie(this,n),pk(Y(r=t.call(this)),"state","loading"),pk(Y(r),"contents",void 0),r.contents=e,r}return oe(n,[{key:"getValue",value:function(){throw this.contents}},{key:"toPromise",value:function(){return this.contents}},{key:"valueMaybe",value:function(){}},{key:"promiseMaybe",value:function(){return this.contents}},{key:"promiseOrThrow",value:function(){return this.contents}},{key:"errorMaybe",value:function(){}},{key:"map",value:function(e){var t=this;return wk(this.contents.then((function(t){var n=e(t);if(Ek(n)){var r=n;switch(r.state){case"hasValue":case"loading":return r.contents;case"hasError":throw r.contents}}return n})).catch((function(n){if(hk(n))return n.then((function(){return t.map(e).contents}));throw n})))}}]),n}(vk);function kk(e){return Object.freeze(new yk(e))}function bk(e){return Object.freeze(new mk(e))}function wk(e){return Object.freeze(new gk(e))}function _k(e){var t=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map((function(t){return e[t]}))).map((function(e){return Ek(e)?e:hk(e)?wk(e):kk(e)})),n=function(e){return e.every((function(e){return"hasValue"===e.state}))?kk(e.map((function(e){return e.contents}))):e.some((function(e){return"hasError"===e.state}))?bk(dk(e.find((function(e){return"hasError"===e.state})),"Invalid loadable passed to loadableAll").contents):wk(Promise.all(e.map((function(e){return e.contents}))))}(t);return Array.isArray(e)?n:n.map((function(t){return Object.getOwnPropertyNames(e).reduce((function(e,n,r){return Bg(Bg({},e),{},ce({},n,t[r]))}),{})}))}function Ek(e){return e instanceof vk}var Sk={of:function(e){return hk(e)?wk(e):Ek(e)?e:kk(e)},error:function(e){return bk(e)},all:_k,isLoadable:Ek},Tk={loadableWithValue:kk,loadableWithError:bk,loadableWithPromise:wk,loadableLoading:function(){return Object.freeze(new gk(new Promise((function(){}))))},loadableAll:_k,isLoadable:Ek,RecoilLoadable:Sk},xk=Tk.loadableWithValue,Ik=Tk.loadableWithError,Ck=Tk.loadableWithPromise,Nk=Tk.loadableLoading,Ak=Tk.loadableAll,Rk=Tk.isLoadable,Lk=Tk.RecoilLoadable,Ok=Object.freeze({__proto__:null,loadableWithValue:xk,loadableWithError:Ik,loadableWithPromise:Ck,loadableLoading:Nk,loadableAll:Ak,isLoadable:Rk,RecoilLoadable:Lk}),Pk=oe((function e(t){ie(this,e),pk(this,"key",void 0),this.key=t})),Dk=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n)}(Pk),Mk=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n)}(Pk);var Uk={AbstractRecoilValue:Pk,RecoilState:Dk,RecoilValueReadOnly:Mk,isRecoilValue:function(e){return e instanceof Dk||e instanceof Mk}},Vk=Uk.AbstractRecoilValue,Fk=Uk.RecoilState,jk=Uk.RecoilValueReadOnly,zk=Uk.isRecoilValue,Bk=Object.freeze({__proto__:null,AbstractRecoilValue:Vk,RecoilState:Fk,RecoilValueReadOnly:jk,isRecoilValue:zk});var qk=function(e){},Hk=(new Map).set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function Kk(e){var t;return null!==(t=Hk.get(e))&&void 0!==t&&t}Kk.setPass=function(e){Hk.set(e,!0)},Kk.setFail=function(e){Hk.set(e,!1)},Kk.clear=function(){Hk.clear()};var Wk=Kk;var Gk=function(e,t){return h().mark((function n(){var r,i,a,o;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=0,i=re(e),n.prev=2,i.s();case 4:if((a=i.n()).done){n.next=10;break}return o=a.value,n.next=8,t(o,r++);case 8:n.next=4;break;case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(2),i.e(n.t0);case 15:return n.prev=15,i.f(),n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[2,12,15,18]])}))()};var Qk=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.error,null},Xk=Qk,Yk=oe((function e(){ie(this,e)})),Jk=new Yk,$k=function(e){$(n,e);var t=ne(n);function n(e){return ie(this,n),t.call(this,"Tried to set the value of Recoil selector ".concat(e," using an updater function, but it is an async selector in a pending or error state; this is not supported."))}return oe(n)}(fe(Error)),Zk=new Map,eb=new Map;var tb=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n)}(fe(Error));var nb=new Map;function rb(e){return nb.get(e)}var ib={nodes:Zk,recoilValues:eb,registerNode:function(e){if(Zk.has(e.key)){var t='Duplicate atom key "'.concat(e.key,'". This is a FATAL ERROR in\n      production. But it is safe to ignore this warning if it occurred because of\n      hot module replacement.');console.warn(t)}Zk.set(e.key,e);var n=null==e.set?new Bk.RecoilValueReadOnly(e.key):new Bk.RecoilState(e.key);return eb.set(e.key,n),n},getNode:function(e){var t=Zk.get(e);if(null==t)throw new tb('Missing definition for RecoilValue: "'.concat(e,'""'));return t},getNodeMaybe:function(e){return Zk.get(e)},deleteNodeConfigIfPossible:function(e){var t;if(Wk("recoil_memory_managament_2020")){var n,r=Zk.get(e);if(null!==r&&void 0!==r&&null!==(t=r.shouldDeleteConfigOnRelease)&&void 0!==t&&t.call(r))Zk.delete(e),null===(n=rb(e))||void 0===n||n(),nb.delete(e)}},setConfigDeletionHandler:function(e,t){Wk("recoil_memory_managament_2020")&&(void 0===t?nb.delete(e):nb.set(e,t))},getConfigDeletionHandler:rb,recoilValuesForKeys:function(e){return Gk(e,(function(e){return dk(eb.get(e))}))},NodeMissingError:tb,DefaultValue:Yk,DEFAULT_VALUE:Jk,RecoilValueNotReady:$k};var ab={enqueueExecution:function(e,t){t()}};var ob=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n={},r=Math.pow(2,5),i=r-1,a=r/2,o=r/4,u={},s=function(e){return function(){return e}},c=n.hash=function(e){var n="undefined"===typeof e?"undefined":t(e);if("number"===n)return e;"string"!==n&&(e+="");for(var r=0,i=0,a=e.length;i<a;++i){r=(r<<5)-r+e.charCodeAt(i)|0}return r},l=function(e,t){return t>>>e&i},f=function(e){return 1<<e},h=function(e,t){return function(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&e+(e>>16)}(e&t-1)},d=function(e,t,n,r){var i=r;if(!e){var a=r.length;i=new Array(a);for(var o=0;o<a;++o)i[o]=r[o]}return i[t]=n,i},p=function(e,t,n){var r=n.length-1,i=0,a=0,o=n;if(e)i=a=t;else for(o=new Array(r);i<t;)o[a++]=n[i++];for(++i;i<=r;)o[a++]=n[i++];return e&&(o.length=r),o},v={__hamt_isEmpty:!0},y=function(e){return e===v||e&&e.__hamt_isEmpty},m=function(e,t,n,r){return{type:1,edit:e,hash:t,key:n,value:r,_modify:E}},g=function(e,t,n){return{type:2,edit:e,hash:t,children:n,_modify:S}},k=function(e,t,n){return{type:3,edit:e,mask:t,children:n,_modify:T}},b=function(e,t,n){return{type:4,edit:e,size:t,children:n,_modify:x}},w=function e(t,n,r,i,a,o){if(r===a)return g(t,r,[o,i]);var u=l(n,r),s=l(n,a);return k(t,f(u)|f(s),u===s?[e(t,n+5,r,i,a,o)]:u<s?[i,o]:[o,i])},_=function(e,t){return e===t.edit},E=function(e,t,n,r,i,a,o){if(t(a,this.key)){var s=r(this.value);return s===this.value?this:s===u?(--o.value,v):_(e,this)?(this.value=s,this):m(e,i,a,s)}var c=r();return c===u?this:(++o.value,w(e,n,this.hash,this,i,m(e,i,a,c)))},S=function(e,t,n,r,i,a,o){if(i===this.hash){var s=function(e,t,n,r,i,a,o,s){for(var c=i.length,l=0;l<c;++l){var f=i[l];if(n(o,f.key)){var h=f.value,v=a(h);return v===h?i:v===u?(--s.value,p(e,l,i)):d(e,l,m(t,r,o,v),i)}}var y=a();return y===u?i:(++s.value,d(e,c,m(t,r,o,y),i))}(_(e,this),e,t,this.hash,this.children,r,a,o);return s===this.children?this:s.length>1?g(e,this.hash,s):s[0]}var c=r();return c===u?this:(++o.value,w(e,n,this.hash,this,i,m(e,i,a,c)))},T=function(e,t,n,r,i,o,u){var s=this.mask,c=this.children,m=l(n,i),g=f(m),w=h(s,g),E=s&g,S=E?c[w]:v,T=S._modify(e,t,n+5,r,i,o,u);if(S===T)return this;var x,I=_(e,this),C=s,N=void 0;if(E&&y(T)){if(!(C&=~g))return v;if(c.length<=2&&((x=c[1^w])===v||1===x.type||2===x.type))return c[1^w];N=p(I,w,c)}else if(E||y(T))N=d(I,w,T,c);else{if(c.length>=a)return function(e,t,n,r,i){for(var a=[],o=r,u=0,s=0;o;++s)1&o&&(a[s]=i[u++]),o>>>=1;return a[t]=n,b(e,u+1,a)}(e,m,T,s,c);C|=g,N=function(e,t,n,r){var i=r.length;if(e){for(var a=i;a>=t;)r[a--]=r[a];return r[t]=n,r}for(var o=0,u=0,s=new Array(i+1);o<t;)s[u++]=r[o++];for(s[t]=n;o<i;)s[++u]=r[o++];return s}(I,w,T,c)}return I?(this.mask=C,this.children=N,this):k(e,C,N)},x=function(e,t,n,r,i,a,u){var s=this.size,c=this.children,f=l(n,i),h=c[f],p=(h||v)._modify(e,t,n+5,r,i,a,u);if(h===p)return this;var m=_(e,this),g=void 0;if(y(h)&&!y(p))++s,g=d(m,f,p,c);else if(!y(h)&&y(p)){if(--s<=o)return function(e,t,n,r){for(var i=new Array(t-1),a=0,o=0,u=0,s=r.length;u<s;++u)if(u!==n){var c=r[u];c&&!y(c)&&(i[a++]=c,o|=1<<u)}return k(e,o,i)}(e,s,f,c);g=d(m,f,v,c)}else g=d(m,f,p,c);return m?(this.size=s,this.children=g,this):b(e,s,g)};function I(e,t,n,r,i){this._editable=e,this._edit=t,this._config=n,this._root=r,this._size=i}v._modify=function(e,t,n,r,i,a,o){var s=r();return s===u?v:(++o.value,m(e,i,a,s))},I.prototype.setTree=function(e,t){return this._editable?(this._root=e,this._size=t,this):e===this._root?this:new I(this._editable,this._edit,this._config,e,t)};var C=n.tryGetHash=function(e,t,n,r){for(var i=r._root,a=0,o=r._config.keyEq;;)switch(i.type){case 1:return o(n,i.key)?i.value:e;case 2:if(t===i.hash)for(var u=i.children,s=0,c=u.length;s<c;++s){var d=u[s];if(o(n,d.key))return d.value}return e;case 3:var p=l(a,t),v=f(p);if(i.mask&v){i=i.children[h(i.mask,v)],a+=5;break}return e;case 4:if(i=i.children[l(a,t)]){a+=5;break}return e;default:return e}};I.prototype.tryGetHash=function(e,t,n){return C(e,t,n,this)};var N=n.tryGet=function(e,t,n){return C(e,n._config.hash(t),t,n)};I.prototype.tryGet=function(e,t){return N(e,t,this)};var A=n.getHash=function(e,t,n){return C(void 0,e,t,n)};I.prototype.getHash=function(e,t){return A(e,t,this)};n.get=function(e,t){return C(void 0,t._config.hash(e),e,t)};I.prototype.get=function(e,t){return N(t,e,this)};var R=n.has=function(e,t,n){return C(u,e,t,n)!==u};I.prototype.hasHash=function(e,t){return R(e,t,this)};var L=n.has=function(e,t){return R(t._config.hash(e),e,t)};I.prototype.has=function(e){return L(e,this)};var O=function(e,t){return e===t};n.make=function(e){return new I(0,0,{keyEq:e&&e.keyEq||O,hash:e&&e.hash||c},v,0)},n.empty=n.make();var P=n.isEmpty=function(e){return e&&!!y(e._root)};I.prototype.isEmpty=function(){return P(this)};var D=n.modifyHash=function(e,t,n,r){var i={value:r._size},a=r._root._modify(r._editable?r._edit:NaN,r._config.keyEq,0,e,t,n,i);return r.setTree(a,i.value)};I.prototype.modifyHash=function(e,t,n){return D(n,e,t,this)};var M=n.modify=function(e,t,n){return D(e,n._config.hash(t),t,n)};I.prototype.modify=function(e,t){return M(t,e,this)};var U=n.setHash=function(e,t,n,r){return D(s(n),e,t,r)};I.prototype.setHash=function(e,t,n){return U(e,t,n,this)};var V=n.set=function(e,t,n){return U(n._config.hash(e),e,t,n)};I.prototype.set=function(e,t){return V(e,t,this)};var F=s(u),j=n.removeHash=function(e,t,n){return D(F,e,t,n)};I.prototype.removeHash=I.prototype.deleteHash=function(e,t){return j(e,t,this)};var z=n.remove=function(e,t){return j(t._config.hash(e),e,t)};I.prototype.remove=I.prototype.delete=function(e){return z(e,this)};var B=n.beginMutation=function(e){return new I(e._editable+1,e._edit+1,e._config,e._root,e._size)};I.prototype.beginMutation=function(){return B(this)};var q=n.endMutation=function(e){return e._editable=e._editable&&e._editable-1,e};I.prototype.endMutation=function(){return q(this)};var H=n.mutate=function(e,t){var n=B(t);return e(n),q(n)};I.prototype.mutate=function(e){return H(e,this)};var K=function(e){return e&&W(e[0],e[1],e[2],e[3],e[4])},W=function(e,t,n,r,i){for(;n<e;){var a=t[n++];if(a&&!y(a))return G(a,r,[e,t,n,r,i])}return K(i)},G=function(e,t,n){switch(e.type){case 1:return{value:t(e),rest:n};case 2:case 4:case 3:var r=e.children;return W(r.length,r,0,t,n);default:return K(n)}},Q={done:!0};function X(e){this.v=e}X.prototype.next=function(){if(!this.v)return Q;var e=this.v;return this.v=K(e.rest),e},X.prototype[Symbol.iterator]=function(){return this};var Y=function(e,t){return new X(G(e._root,t))},J=function(e){return[e.key,e.value]},$=n.entries=function(e){return Y(e,J)};I.prototype.entries=I.prototype[Symbol.iterator]=function(){return $(this)};var Z=function(e){return e.key},ee=n.keys=function(e){return Y(e,Z)};I.prototype.keys=function(){return ee(this)};var te=function(e){return e.value},ne=n.values=I.prototype.values=function(e){return Y(e,te)};I.prototype.values=function(){return ne(this)};var re=n.fold=function(e,t,n){var r=n._root;if(1===r.type)return e(t,r.value,r.key);for(var i=[r.children],a=void 0;a=i.pop();)for(var o=0,u=a.length;o<u;){var s=a[o++];s&&s.type&&(1===s.type?t=e(t,s.value,s.key):i.push(s.children))}return t};I.prototype.fold=function(e,t){return re(e,t,this)};var ie=n.forEach=function(e,t){return re((function(n,r,i){return e(r,i,t)}),null,t)};I.prototype.forEach=function(e){return ie(e,this)};var ae=n.count=function(e){return e._size};I.prototype.count=function(){return ae(this)},Object.defineProperty(I.prototype,"size",{get:I.prototype.count}),e.exports?e.exports=n:(void 0).hamt=n})),ub=function(){function e(t){ie(this,e),pk(this,"_map",void 0),this._map=new Map(null===t||void 0===t?void 0:t.entries())}return oe(e,[{key:"keys",value:function(){return this._map.keys()}},{key:"entries",value:function(){return this._map.entries()}},{key:"get",value:function(e){return this._map.get(e)}},{key:"has",value:function(e){return this._map.has(e)}},{key:"set",value:function(e,t){return this._map.set(e,t),this}},{key:"delete",value:function(e){return this._map.delete(e),this}},{key:"clone",value:function(){return cb(this)}},{key:"toMap",value:function(){return new Map(this._map)}}]),e}(),sb=function(){function e(t){if(ie(this,e),pk(this,"_hamt",ob.empty.beginMutation()),t instanceof e){var n=t._hamt.endMutation();t._hamt=n.beginMutation(),this._hamt=n.beginMutation()}else if(t){var r,i=re(t.entries());try{for(i.s();!(r=i.n()).done;){var a=c(r.value,2),o=a[0],u=a[1];this._hamt.set(o,u)}}catch(s){i.e(s)}finally{i.f()}}}return oe(e,[{key:"keys",value:function(){return this._hamt.keys()}},{key:"entries",value:function(){return this._hamt.entries()}},{key:"get",value:function(e){return this._hamt.get(e)}},{key:"has",value:function(e){return this._hamt.has(e)}},{key:"set",value:function(e,t){return this._hamt.set(e,t),this}},{key:"delete",value:function(e){return this._hamt.delete(e),this}},{key:"clone",value:function(){return cb(this)}},{key:"toMap",value:function(){return new Map(this._hamt)}}]),e}();function cb(e){return Wk("recoil_hamt_2020")?new sb(e):new ub(e)}var lb=cb;var fb=function(e){for(var t=new Set,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a,o=re(e);try{e:for(o.s();!(a=o.n()).done;){var u,s=a.value,c=re(r);try{for(c.s();!(u=c.n()).done;){var l=u.value;if(l.has(s))continue e}}catch(f){c.e(f)}finally{c.f()}t.add(s)}}catch(f){o.e(f)}finally{o.f()}return t};var hb=function(e,t){var n=new Map;return e.forEach((function(e,r){n.set(r,t(e,r))})),n};function db(e,t,n){var r=t.nodeDeps,i=t.nodeToNodeSubscriptions;e.forEach((function(e,t){var a=r.get(t);a&&n&&a!==n.nodeDeps.get(t)||(r.set(t,new Set(e)),(null==a?e:fb(e,a)).forEach((function(e){i.has(e)||i.set(e,new Set),dk(i.get(e)).add(t)})),a&&fb(a,e).forEach((function(e){if(i.has(e)){var n=dk(i.get(e));n.delete(t),0===n.size&&i.delete(e)}})))}))}var pb=function(e){return{nodeDeps:hb(e.nodeDeps,(function(e){return new Set(e)})),nodeToNodeSubscriptions:hb(e.nodeToNodeSubscriptions,(function(e){return new Set(e)}))}},vb=function(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}},yb=function(e,t,n){var r,i,a,o,u=t.getState();n!==u.currentTree.version&&n!==(null===(r=u.nextTree)||void 0===r?void 0:r.version)&&n!==(null===(i=u.previousTree)||void 0===i?void 0:i.version)&&Xk("Tried to save dependencies to a discarded tree");var s=t.getGraph(n);if(db(e,s),n===(null===(a=u.previousTree)||void 0===a?void 0:a.version)&&db(e,t.getGraph(u.currentTree.version),s),n===(null===(o=u.previousTree)||void 0===o?void 0:o.version)||n===u.currentTree.version){var c,l=null===(c=u.nextTree)||void 0===c?void 0:c.version;if(void 0!==l)db(e,t.getGraph(l),s)}},mb=0,gb=0,kb=0,bb=function(){return mb++},wb=function(){return gb++},_b=function(){return kb++},Eb=Object.freeze({__proto__:null,persistentMap:lb}).persistentMap,Sb=vb,Tb=bb;function xb(){var e=Tb();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:Eb(),nonvalidatedAtoms:Eb()}}var Ib={makeEmptyTreeState:xb,makeEmptyStoreState:function(){var e=xb();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(e.version,Sb()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}},getNextTreeStateVersion:Tb},Cb=oe((function e(){ie(this,e)}));var Nb={RetentionZone:Cb,retentionZone:function(){return new Cb}};var Ab=function(e,t){var n=new Set(e);return n.add(t),n};function Rb(e,t){var n,r,i,a;return h().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:n=0,r=re(e),o.prev=2,r.s();case 4:if((i=r.n()).done){o.next=11;break}if(a=i.value,!t(a,n++)){o.next=9;break}return o.next=9,a;case 9:o.next=4;break;case 11:o.next=16;break;case 13:o.prev=13,o.t0=o.catch(2),r.e(o.t0);case 16:return o.prev=16,r.f(),o.finish(16);case 19:case"end":return o.stop()}}),ck,null,[[2,13,16,19]])}var Lb=Rb;var Ob=function(e,t){return new Proxy(e,{get:function(e,n){return!(n in e)&&n in t&&(e[n]=t[n]()),e[n]},ownKeys:function(e){return Object.keys(e)}})},Pb=ib.getNode,Db=ib.getNodeMaybe,Mb=ib.recoilValuesForKeys,Ub=Nb.RetentionZone,Vb=Ab,Fb=Object.freeze(new Set),jb=function(e){$(n,e);var t=ne(n);function n(){return ie(this,n),t.apply(this,arguments)}return oe(n)}(fe(Error));function zb(e,t,n,r){var i=e.getState();if(!i.nodeCleanupFunctions.has(n)){var a=Pb(n),o=function(e,t,n){if(!Wk("recoil_memory_managament_2020"))return function(){};var r=e.getState().retention.nodesRetainedByZone;function i(e){var n=r.get(e);n||r.set(e,n=new Set),n.add(t)}if(n instanceof Ub)i(n);else if(Array.isArray(n)){var a,o=re(n);try{for(o.s();!(a=o.n()).done;)i(a.value)}catch(u){o.e(u)}finally{o.f()}}return function(){if(Wk("recoil_memory_managament_2020")){var r=e.getState().retention;if(n instanceof Ub)o(n);else if(Array.isArray(n)){var i,a=re(n);try{for(a.s();!(i=a.n()).done;)o(i.value)}catch(u){a.e(u)}finally{a.f()}}}function o(e){var n=r.nodesRetainedByZone.get(e);null===n||void 0===n||n.delete(t),n&&0===n.size&&r.nodesRetainedByZone.delete(e)}}}(e,n,a.retainedBy),u=a.init(e,t,r);i.nodeCleanupFunctions.set(n,(function(){u(),o()}))}}function Bb(e,t,n){return Pb(n).peek(e,t)}function qb(e,t,n){for(var r=new Set,i=Array.from(n),a=e.getGraph(t.version),o=i.pop();o;o=i.pop()){var u;r.add(o);var s,c=re(null!==(u=a.nodeToNodeSubscriptions.get(o))&&void 0!==u?u:Fb);try{for(c.s();!(s=c.n()).done;){var l=s.value;r.has(l)||i.push(l)}}catch(f){c.e(f)}finally{c.f()}}return r}var Hb,Kb,Wb,Gb=function(e,t,n){return zb(e,t,n,"get"),Pb(n).get(e,t)},Qb=Bb,Xb=function(e,t,n,r){var i=Pb(n);if(null==i.set)throw new jb("Attempt to set read-only RecoilValue: ".concat(n));var a=i.set;return zb(e,t,n,"set"),a(e,t,r)},Yb=function(e,t,n){zb(e,e.getState().currentTree,t,n)},Jb=function(e,t){var n,r=e.getState();null===(n=r.nodeCleanupFunctions.get(t))||void 0===n||n(),r.nodeCleanupFunctions.delete(t)},$b=function(e,t,n){var r,i=Db(t);return null===i||void 0===i||null===(r=i.invalidate)||void 0===r||r.call(i,e),Bg(Bg({},e),{},{atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:Vb(e.dirtyAtoms,t)})},Zb=function(e,t,n){var r=e.getState(),i=e.getGraph(t.version),a=Pb(n).nodeType;return Ob({type:a},{loadable:function(){return Bb(e,t,n)},isActive:function(){return r.knownAtoms.has(n)||r.knownSelectors.has(n)},isSet:function(){return"selector"!==a&&t.atomValues.has(n)},isModified:function(){return t.dirtyAtoms.has(n)},deps:function(){var e;return Mb(null!==(e=i.nodeDeps.get(n))&&void 0!==e?e:[])},subscribers:function(){var i,a;return{nodes:Mb(Lb(qb(e,t,new Set([n])),(function(e){return e!==n}))),components:Gk(null!==(i=null===(a=r.nodeToComponentSubscriptions.get(n))||void 0===a?void 0:a.values())&&void 0!==i?i:[],(function(e){return{name:c(e,1)[0]}}))}}})},ew=qb,tw=null!==(Hb=e.createMutableSource)&&void 0!==Hb?Hb:e.unstable_createMutableSource,nw=null!==(Kb=e.useMutableSource)&&void 0!==Kb?Kb:e.unstable_useMutableSource,rw=null!==(Wb=e.useSyncExternalStore)&&void 0!==Wb?Wb:e.unstable_useSyncExternalStore;var iw={createMutableSource:tw,useMutableSource:nw,useSyncExternalStore:rw,reactMode:function(){return Wk("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Wk("recoil_sync_external_store")&&null!=rw?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Wk("recoil_mutable_source")&&null!=nw&&"undefined"!==typeof window&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Wk("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Wk("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}},aw=ew,ow=Gb,uw=Xb,sw=_b,cw=ib.getNode,lw=ib.getNodeMaybe,fw=ib.DefaultValue,hw=ib.RecoilValueNotReady,dw=iw.reactMode,pw=Bk.AbstractRecoilValue,vw=Bk.RecoilState,yw=Bk.RecoilValueReadOnly,mw=Bk.isRecoilValue;function gw(e,t,n){if("set"===n.type){var r,i=n.recoilValue,a=function(e,t,n,r){var i=n.key;if("function"===typeof r){var a=ow(e,t,i);if("loading"===a.state)throw new hw(i);if("hasError"===a.state)throw a.contents;return r(a.contents)}return r}(e,t,i,n.valueOrUpdater),o=re(uw(e,t,i.key,a).entries());try{for(o.s();!(r=o.n()).done;){var u=c(r.value,2);kw(t,u[0],u[1])}}catch(p){o.e(p)}finally{o.f()}}else if("setLoadable"===n.type){kw(t,n.recoilValue.key,n.loadable)}else if("markModified"===n.type){var s=n.recoilValue.key;t.dirtyAtoms.add(s)}else if("setUnvalidated"===n.type){var l,f=n.recoilValue.key,h=n.unvalidatedValue,d=lw(f);null===d||void 0===d||null===(l=d.invalidate)||void 0===l||l.call(d,t),t.atomValues.delete(f),t.nonvalidatedAtoms.set(f,h),t.dirtyAtoms.add(f)}else Xk("Unknown action ".concat(n.type))}function kw(e,t,n){"hasValue"===n.state&&n.contents instanceof fw?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function bw(e,t){e.replaceState((function(n){var r,i=Ew(n),a=re(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;gw(e,i,o)}}catch(u){a.e(u)}finally{a.f()}return Sw(e,i),i}))}function ww(e,t){if(_w.length){var n=_w[_w.length-1],r=n.get(e);r||n.set(e,r=[]),r.push(t)}else bw(e,[t])}var _w=[];function Ew(e){return Bg(Bg({},e),{},{atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)})}function Sw(e,t){var n,r=re(aw(e,t,t.dirtyAtoms));try{for(r.s();!(n=r.n()).done;){var i,a,o=n.value;null===(i=lw(o))||void 0===i||null===(a=i.invalidate)||void 0===a||a.call(i,t)}}catch(u){r.e(u)}finally{r.f()}}function Tw(e,t,n){ww(e,{type:"set",recoilValue:t,valueOrUpdater:n})}var xw={RecoilValueReadOnly:yw,AbstractRecoilValue:pw,RecoilState:vw,getRecoilValueAsLoadable:function(e,t){var n,r,i=t.key,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.getState().currentTree,o=e.getState();a.version!==o.currentTree.version&&a.version!==(null===(n=o.nextTree)||void 0===n?void 0:n.version)&&a.version!==(null===(r=o.previousTree)||void 0===r?void 0:r.version)&&Xk("Tried to read from a discarded tree");var u=ow(e,a,i);return"loading"===u.state&&u.contents.catch((function(){})),u},setRecoilValue:Tw,setRecoilValueLoadable:function(e,t,n){if(n instanceof fw)return Tw(e,t,n);ww(e,{type:"setLoadable",recoilValue:t,loadable:n})},markRecoilValueModified:function(e,t){ww(e,{type:"markModified",recoilValue:t})},setUnvalidatedRecoilValue:function(e,t,n){ww(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})},subscribeToRecoilValue:function(e,t,n){var r=t.key,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=sw(),o=e.getState();o.nodeToComponentSubscriptions.has(r)||o.nodeToComponentSubscriptions.set(r,new Map),dk(o.nodeToComponentSubscriptions.get(r)).set(a,[null!==i&&void 0!==i?i:"<not captured>",n]);var u=dw();if(u.early&&("LEGACY"===u.mode||"MUTABLE_SOURCE"===u.mode)){var s=e.getState().nextTree;s&&s.dirtyAtoms.has(r)&&n(s)}return{release:function(){var t=e.getState(),n=t.nodeToComponentSubscriptions.get(r);void 0!==n&&n.has(a)?(n.delete(a),0===n.size&&t.nodeToComponentSubscriptions.delete(r)):Xk("Subscription missing at release time for atom ".concat(r,". This is a bug in Recoil."))}}},isRecoilValue:mw,applyAtomValueWrites:function(e,t){var n=e.clone();return t.forEach((function(e,t){"hasValue"===e.state&&e.contents instanceof fw?n.delete(t):n.set(t,e)})),n},batchStart:function(){var e=new Map;return _w.push(e),function(){var t,n=re(e);try{for(n.s();!(t=n.n()).done;){var r=c(t.value,2);bw(r[0],r[1])}}catch(i){n.e(i)}finally{n.f()}_w.pop()!==e&&Xk("Incorrect order of batch popping")}},writeLoadableToTreeState:kw,invalidateDownstreams:Sw,copyTreeState:Ew,refreshRecoilValue:function(e,t){var n,r=e.getState().currentTree,i=cw(t.key);null===(n=i.clearCache)||void 0===n||n.call(i,e,r)},invalidateDownstreams_FOR_TESTING:Sw};var Iw=function(e,t,n){for(var r=e.entries(),i=r.next();!i.done;){var a=i.value;if(t.call(n,a[1],a[0],e))return!0;i=r.next()}return!1},Cw=Jb,Nw=ib.deleteNodeConfigIfPossible,Aw=ib.getNode,Rw=Nb.RetentionZone,Lw=new Set;function Ow(e,t){var n=e.getState(),r=n.currentTree;if(n.nextTree)Xk("releaseNodesNowOnCurrentTree should only be called at the end of a batch");else{var i,a=new Set,o=re(t);try{for(o.s();!(i=o.n()).done;){var u=i.value;if(u instanceof Rw){var s,c=re(Dw(n,u));try{for(c.s();!(s=c.n()).done;){var l=s.value;a.add(l)}}catch(p){c.e(p)}finally{c.f()}}else a.add(u)}}catch(p){o.e(p)}finally{o.f()}var f,h=function(e,t){var n=e.getState(),r=n.currentTree,i=e.getGraph(r.version),a=new Set,o=new Set;return u(t),a;function u(t){var s,c=new Set,l=function(e,t,n,r,i){var a=e.getGraph(t.version),o=[],u=new Set;for(;n.size>0;)s(dk(n.values().next().value));return o;function s(e){if(r.has(e)||i.has(e))n.delete(e);else if(!u.has(e)){var t=a.nodeToNodeSubscriptions.get(e);if(t){var c,l=re(t);try{for(l.s();!(c=l.n()).done;){s(c.value)}}catch(p){l.e(p)}finally{l.f()}}u.add(e),n.delete(e),o.push(e)}}}(e,r,t,a,o),f=re(l);try{for(f.s();!(s=f.n()).done;){var h,d=s.value;if("recoilRoot"!==Aw(d).retainedBy)if((null!==(h=n.retention.referenceCounts.get(d))&&void 0!==h?h:0)>0)o.add(d);else if(Mw(d).some((function(e){return n.retention.referenceCounts.get(e)})))o.add(d);else{var v=i.nodeToNodeSubscriptions.get(d);v&&Iw(v,(function(e){return o.has(e)}))?o.add(d):(a.add(d),c.add(d))}else o.add(d)}}catch(p){f.e(p)}finally{f.f()}var y,m=new Set,g=re(c);try{for(g.s();!(y=g.n()).done;){var k,b=y.value,w=re(null!==(_=i.nodeDeps.get(b))&&void 0!==_?_:Lw);try{for(w.s();!(k=w.n()).done;){var _,E=k.value;a.has(E)||m.add(E)}}catch(p){w.e(p)}finally{w.f()}}}catch(p){g.e(p)}finally{g.f()}m.size&&u(m)}}(e,a),d=re(h);try{for(d.s();!(f=d.n()).done;){Pw(e,r,f.value)}}catch(p){d.e(p)}finally{d.f()}}}function Pw(e,t,n){if(Wk("recoil_memory_managament_2020")){Cw(e,n);var r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);var i,a=re(Mw(n));try{for(a.s();!(i=a.n()).done;){var o,u=i.value;null===(o=r.retention.nodesRetainedByZone.get(u))||void 0===o||o.delete(n)}}catch(p){a.e(p)}finally{a.f()}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);var s=r.graphsByVersion.get(t.version);if(s){var c=s.nodeDeps.get(n);if(void 0!==c){s.nodeDeps.delete(n);var l,f=re(c);try{for(f.s();!(l=f.n()).done;){var h,d=l.value;null===(h=s.nodeToNodeSubscriptions.get(d))||void 0===h||h.delete(n)}}catch(p){f.e(p)}finally{f.f()}}s.nodeToNodeSubscriptions.delete(n)}Nw(n)}}function Dw(e,t){var n;return null!==(n=e.retention.nodesRetainedByZone.get(t))&&void 0!==n?n:Lw}function Mw(e){var t=Aw(e).retainedBy;return void 0===t||"components"===t||"recoilRoot"===t?[]:t instanceof Rw?[t]:t}function Uw(e,t){Wk("recoil_memory_managament_2020")&&(e.getState().retention.referenceCounts.delete(t),function(e,t){var n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):Ow(e,new Set([t]))}(e,t))}var Vw=12e4,Fw=function(e,t,n){var r;if(Wk("recoil_memory_managament_2020")){var i=e.getState().retention.referenceCounts,a=(null!==(r=i.get(t))&&void 0!==r?r:0)+n;0===a?Uw(e,t):i.set(t,a)}},jw=function(e){if(Wk("recoil_memory_managament_2020")){var t=e.getState();Ow(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}},zw=function(e){return void 0===e?"recoilRoot":e},Bw=t.unstable_batchedUpdates,qw=xw.batchStart,Hw={unstable_batchedUpdates:{unstable_batchedUpdates:Bw}.unstable_batchedUpdates}.unstable_batchedUpdates,Kw=function(e){Hw((function(){var t=function(){};try{t=qw(),e()}finally{t()}}))};function Ww(e){var t,n,r,i,a,o;return h().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:t=re(e),u.prev=1,t.s();case 3:if((n=t.n()).done){u.next=24;break}r=n.value,i=re(r),u.prev=6,i.s();case 8:if((a=i.n()).done){u.next=14;break}return o=a.value,u.next=12,o;case 12:u.next=8;break;case 14:u.next=19;break;case 16:u.prev=16,u.t0=u.catch(6),i.e(u.t0);case 19:return u.prev=19,i.f(),u.finish(19);case 22:u.next=3;break;case 24:u.next=29;break;case 26:u.prev=26,u.t1=u.catch(1),t.e(u.t1);case 29:return u.prev=29,t.f(),u.finish(29);case 32:case"end":return u.stop()}}),lk,null,[[1,26,29,32],[6,16,19,22]])}var Gw=Ww,Qw={isSSR:"undefined"===typeof window,isReactNative:"undefined"!==typeof navigator&&"ReactNative"===navigator.product};var Xw=function(e,t){var n,r,i=this;return[function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var s=t.apply(void 0,o);return n===s?r:(n=s,r=e.apply(i,o))},function(){n=null}]},Yw=Kw,Jw=Yb,$w=Zb,Zw=vb,e_=wb,t_=ib.DEFAULT_VALUE,n_=ib.recoilValues,r_=ib.recoilValuesForKeys,i_=xw.AbstractRecoilValue,a_=xw.getRecoilValueAsLoadable,o_=xw.setRecoilValue,u_=xw.setUnvalidatedRecoilValue,s_=Fw,c_=Ib.getNextTreeStateVersion,l_=Ib.makeEmptyStoreState,f_=Qw.isSSR,h_=Xw,d_=function(){function e(t){var n=this;ie(this,e),pk(this,"_store",void 0),pk(this,"_refCount",1),pk(this,"getLoadable",(function(e){return n.checkRefCount_INTERNAL(),a_(n._store,e)})),pk(this,"getPromise",(function(e){return n.checkRefCount_INTERNAL(),n.getLoadable(e).toPromise()})),pk(this,"getNodes_UNSTABLE",(function(e){if(n.checkRefCount_INTERNAL(),!0===(null===e||void 0===e?void 0:e.isModified)){if(!1===(null===e||void 0===e?void 0:e.isInitialized))return[];var t=n._store.getState().currentTree;return r_(t.dirtyAtoms)}var r=n._store.getState().knownAtoms,i=n._store.getState().knownSelectors;return null==(null===e||void 0===e?void 0:e.isInitialized)?n_.values():!0===e.isInitialized?r_(Gw([n._store.getState().knownAtoms,n._store.getState().knownSelectors])):Lb(n_.values(),(function(e){var t=e.key;return!r.has(t)&&!i.has(t)}))})),pk(this,"getInfo_UNSTABLE",(function(e){var t=e.key;return n.checkRefCount_INTERNAL(),$w(n._store,n._store.getState().currentTree,t)})),pk(this,"map",(function(e){n.checkRefCount_INTERNAL();var t=new k_(n,Yw);return e(t),t})),pk(this,"asyncMap",function(){var e=i(h().mark((function e(t){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.checkRefCount_INTERNAL(),(r=new k_(n,Yw)).retain(),e.next=5,t(r);case 5:return r.autoRelease_INTERNAL(),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this._store={storeID:e_(),getState:function(){return t},replaceState:function(e){t.currentTree=e(t.currentTree)},getGraph:function(e){var n=t.graphsByVersion;if(n.has(e))return dk(n.get(e));var r=Zw();return n.set(e,r),r},subscribeToTransactions:function(){return{release:function(){}}},addTransactionMetadata:function(){throw fk("Cannot subscribe to Snapshots")}};var r,a=re(this._store.getState().knownAtoms);try{for(a.s();!(r=a.n()).done;){var o=r.value;Jw(this._store,o,"get"),s_(this._store,o,1)}}catch(u){a.e(u)}finally{a.f()}this.autoRelease_INTERNAL()}return oe(e,[{key:"retain",value:function(){var e=this;this._refCount<=0&&Xk("Attempt to retain() Snapshot that was already released."),this._refCount++;var t=!1;return function(){t||(t=!0,e._release())}}},{key:"autoRelease_INTERNAL",value:function(){var e=this;f_||window.setTimeout((function(){return e._release()}),0)}},{key:"_release",value:function(){if(this._refCount--,0===this._refCount){if(this._store.getState().nodeCleanupFunctions.forEach((function(e){return e()})),this._store.getState().nodeCleanupFunctions.clear(),!Wk("recoil_memory_managament_2020"))return}else this._refCount}},{key:"isRetained",value:function(){return this._refCount>0}},{key:"checkRefCount_INTERNAL",value:function(){Wk("recoil_memory_managament_2020")&&this._refCount}},{key:"getStore_INTERNAL",value:function(){return this.checkRefCount_INTERNAL(),this._store}},{key:"getID",value:function(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}}]),e}();function p_(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.getState(),i=n?c_():t.version;return{currentTree:n?{version:i,stateID:i,transactionMetadata:Bg({},t.transactionMetadata),dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()}:t,commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:(new Map).set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Gk(r.nodeCleanupFunctions.entries(),(function(e){return[c(e,1)[0],function(){}]})))}}var v_=h_((function(e,t){var n=e.getState(),r="current"===t?n.currentTree:dk(n.previousTree);return new d_(p_(e,r))}),(function(e,t){var n;return String(t)+String(e.storeID)+String(e.getState().currentTree.version)+String(null===(n=e.getState().previousTree)||void 0===n?void 0:n.version)})),y_=c(v_,2),m_=y_[0],g_=y_[1];var k_=function(e){$(n,e);var t=ne(n);function n(e,r){var i;return ie(this,n),pk(Y(i=t.call(this,p_(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0))),"_batch",void 0),pk(Y(i),"set",(function(e,t){i.checkRefCount_INTERNAL();var n=i.getStore_INTERNAL();i._batch((function(){s_(n,e.key,1),o_(i.getStore_INTERNAL(),e,t)}))})),pk(Y(i),"reset",(function(e){i.checkRefCount_INTERNAL();var t=i.getStore_INTERNAL();i._batch((function(){s_(t,e.key,1),o_(i.getStore_INTERNAL(),e,t_)}))})),pk(Y(i),"setUnvalidatedAtomValues_DEPRECATED",(function(e){i.checkRefCount_INTERNAL();var t=i.getStore_INTERNAL();Yw((function(){var n,r=re(e.entries());try{for(r.s();!(n=r.n()).done;){var i=c(n.value,2),a=i[0],o=i[1];s_(t,a,1),u_(t,new i_(a),o)}}catch(u){r.e(u)}finally{r.f()}}))})),i._batch=r,i}return oe(n)}(d_),b_={Snapshot:d_,MutableSnapshot:k_,freshSnapshot:function(e){var t=new d_(l_());return null!=e?t.map(e):t},cloneSnapshot:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"current",n=m_(e,t);return n.isRetained()?n:(g_(),m_(e,t))}},w_=b_.Snapshot,__=b_.MutableSnapshot,E_=b_.freshSnapshot,S_=b_.cloneSnapshot,T_=Object.freeze({__proto__:null,Snapshot:w_,MutableSnapshot:__,freshSnapshot:E_,cloneSnapshot:S_});var x_=function(){for(var e=new Set,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o,u=a[i],s=re(u);try{for(s.s();!(o=s.n()).done;){var c=o.value;e.add(c)}}catch(l){s.e(l)}finally{s.f()}}return e},I_=e.useRef;var C_=function(e){var t=I_(e);return t.current===e&&"function"===typeof e&&(t.current=e()),t},N_=Ib.getNextTreeStateVersion,A_=Ib.makeEmptyStoreState,R_=Jb,L_=ew,O_=Yb,P_=Xb,D_=$b,M_=vb,U_=pb,V_=wb,F_=iw.createMutableSource,j_=iw.reactMode,z_=xw.applyAtomValueWrites,B_=jw,q_=T_.freshSnapshot,H_=e.useCallback,K_=e.useContext,W_=e.useEffect,G_=e.useMemo,Q_=e.useRef,X_=e.useState;function Y_(){throw fk("This component must be used inside a <RecoilRoot> component.")}var J_=Object.freeze({storeID:V_(),getState:Y_,replaceState:Y_,getGraph:Y_,subscribeToTransactions:Y_,addTransactionMetadata:Y_}),$_=!1;function Z_(e){if($_)throw fk("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");var t=e.getState();if(null===t.nextTree){Wk("recoil_memory_managament_2020")&&Wk("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&B_(e);var n=t.currentTree.version,r=N_();t.nextTree=Bg(Bg({},t.currentTree),{},{version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}}),t.graphsByVersion.set(r,U_(dk(t.graphsByVersion.get(n))))}}var eE=e.createContext({current:J_}),tE=function(){return K_(eE)},nE=e.createContext(null);function rE(e,t,n){var r,i=re(L_(e,n,n.dirtyAtoms));try{for(i.s();!(r=i.n()).done;){var a=r.value,o=t.nodeToComponentSubscriptions.get(a);if(o){var u,s=re(o);try{for(s.s();!(u=s.n()).done;){var l=c(u.value,2),f=(l[0],c(l[1],2));f[0];(0,f[1])(n)}}catch(h){s.e(h)}finally{s.f()}}}}catch(h){i.e(h)}finally{i.f()}}function iE(e){var t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){var i,a=re(t.nodeTransactionSubscriptions);try{for(a.s();!(i=a.n()).done;){var o=c(i.value,2),u=o[0],s=o[1];if(r.has(u)){var l,f=re(s);try{for(f.s();!(l=f.n()).done;){var h=c(l.value,2);h[0];(0,h[1])(e)}}catch(y){f.e(y)}finally{f.f()}}}}catch(y){a.e(y)}finally{a.f()}var d,p=re(t.transactionSubscriptions);try{for(p.s();!(d=p.n()).done;){var v=c(d.value,2);v[0];(0,v[1])(e)}}catch(y){p.e(y)}finally{p.f()}(!j_().early||t.suspendedComponentResolvers.size>0)&&(rE(e,t,n),t.suspendedComponentResolvers.forEach((function(e){return e()})),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach((function(e){return e(n)})),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function aE(e){var t=e.setNotifyBatcherOfChange,n=tE(),r=c(X_([]),2)[1];return t((function(){return r({})})),W_((function(){return t((function(){return r({})})),function(){t((function(){}))}}),[t]),W_((function(){ab.enqueueExecution("Batcher",(function(){!function(e){var t=e.getState();t.commitDepth++;try{var n=t.nextTree;if(null===n)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,iE(e),null!=t.previousTree?t.graphsByVersion.delete(t.previousTree.version):Xk("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Wk("recoil_memory_managament_2020")&&B_(e)}finally{t.commitDepth--}}(n.current)}))})),null}var oE=0;function uE(t){var n,r=t.initializeState_DEPRECATED,i=t.initializeState,a=t.store_INTERNAL,o=t.children,u=function(e){var t=n.current.graphsByVersion;if(t.has(e))return dk(t.get(e));var r=M_();return t.set(e,r),r},s=function(e,t){if(null==t){var n=d.current.getState().transactionSubscriptions,r=oE++;return n.set(r,e),{release:function(){n.delete(r)}}}var i=d.current.getState().nodeTransactionSubscriptions;i.has(t)||i.set(t,new Map);var a=oE++;return dk(i.get(t)).set(a,e),{release:function(){var e=i.get(t);e&&(e.delete(a),0===e.size&&i.delete(t))}}},c=function(e){Z_(d.current);for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];dk(d.current.getState().nextTree).transactionMetadata[r]=e[r]}},l=function(e){Z_(d.current);var t,r=dk(n.current.nextTree);try{$_=!0,t=e(r)}finally{$_=!1}t!==r&&(n.current.nextTree=t,j_().early&&rE(d.current,n.current,t),dk(f.current)())},f=Q_(null),h=H_((function(e){f.current=e}),[f]),d=C_((function(){return null!==a&&void 0!==a?a:{storeID:V_(),getState:function(){return n.current},replaceState:l,getGraph:u,subscribeToTransactions:s,addTransactionMetadata:c}}));null!=a&&(d.current=a),n=C_((function(){return null!=r?function(e,t){var n=A_();return t({set:function(t,r){var i,a=n.currentTree,o=P_(e,a,t.key,r),u=new Set(o.keys()),s=a.nonvalidatedAtoms.clone(),c=re(u);try{for(c.s();!(i=c.n()).done;){var l=i.value;s.delete(l)}}catch(f){c.e(f)}finally{c.f()}n.currentTree=Bg(Bg({},a),{},{dirtyAtoms:x_(a.dirtyAtoms,u),atomValues:z_(a.atomValues,o),nonvalidatedAtoms:s})},setUnvalidatedAtomValues:function(e){e.forEach((function(e,t){n.currentTree=D_(n.currentTree,t,e)}))}}),n}(d.current,r):null!=i?function(e){var t=q_().map(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach((function(e){return e()})),n.nodeCleanupFunctions.clear(),n}(i):A_()}));var p=G_((function(){return null===F_||void 0===F_?void 0:F_(n,(function(){return n.current.currentTree.version}))}),[n]);return W_((function(){var e,t=d.current,n=re(new Set(t.getState().knownAtoms));try{for(n.s();!(e=n.n()).done;){var r=e.value;O_(t,r,"get")}}catch(i){n.e(i)}finally{n.f()}return function(){var e,n=re(t.getState().knownAtoms);try{for(n.s();!(e=n.n()).done;){var r=e.value;R_(t,r)}}catch(i){n.e(i)}finally{n.f()}}}),[d]),e.createElement(eE.Provider,{value:d},e.createElement(nE.Provider,{value:p},e.createElement(aE,{setNotifyBatcherOfChange:h}),o))}var sE=function(t){var n=t.override,r=ak(t,ok),i=tE();return!1===n&&i.current!==J_?t.children:e.createElement(uE,r)},cE=tE,lE=function(){var e=K_(nE);return null==e&&qk("Attempted to use a Recoil hook outside of a <RecoilRoot>. <RecoilRoot> must be an ancestor of any component that uses Recoil hooks."),e},fE=function(){return tE().current.storeID};var hE=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0},dE=e.useEffect,pE=e.useRef;var vE=function(e){var t=pE();return dE((function(){t.current=e})),t.current},yE=cE,mE=Vw,gE=Fw,kE=Nb.RetentionZone,bE=e.useEffect,wE=e.useRef,_E=Qw.isSSR;var EE=function(e){if(Wk("recoil_memory_managament_2020"))return function(e){var t=(Array.isArray(e)?e:[e]).map((function(e){return e instanceof kE?e:e.key})),n=yE();bE((function(){if(Wk("recoil_memory_managament_2020")){var e=n.current;if(r.current&&!_E)window.clearTimeout(r.current),r.current=null;else{var i,a=re(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;gE(e,o,1)}}catch(u){a.e(u)}finally{a.f()}}return function(){var n,r=re(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;gE(e,i,-1)}}catch(u){r.e(u)}finally{r.f()}}}}),[n].concat(se(t)));var r=wE(),i=vE(t);if(!_E&&(void 0===i||!hE(i,t))){var a,o=n.current,u=re(t);try{for(u.s();!(a=u.n()).done;){var s=a.value;gE(o,s,1)}}catch(h){u.e(h)}finally{u.f()}if(i){var c,l=re(i);try{for(l.s();!(c=l.n()).done;){var f=c.value;gE(o,f,-1)}}catch(h){l.e(h)}finally{l.f()}}r.current&&window.clearTimeout(r.current),r.current=window.setTimeout((function(){r.current=null;var e,n=re(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;gE(o,i,-1)}}catch(h){n.e(h)}finally{n.f()}}),mE)}}(e)};var SE=e.useRef;var TE=function(){return SE(),"<component name not available>"},xE=ib.DEFAULT_VALUE,IE=iw.reactMode,CE=iw.useMutableSource,NE=iw.useSyncExternalStore,AE=lE,RE=cE,LE=(Bk.isRecoilValue,xw.getRecoilValueAsLoadable),OE=xw.setRecoilValue,PE=xw.subscribeToRecoilValue,DE=e.useCallback,ME=e.useEffect,UE=e.useMemo,VE=e.useRef,FE=e.useState;function jE(e,t,n){if("hasValue"===e.state)return e.contents;if("loading"===e.state)throw new Promise((function(e){n.current.getState().suspendedComponentResolvers.add(e)}));throw"hasError"===e.state?e.contents:fk('Invalid value of loadable atom "'.concat(t.key,'"'))}function zE(e){var t=RE(),n=TE(),r=DE((function(){var n;var r=t.current,i=r.getState(),a=IE().early&&null!==(n=i.nextTree)&&void 0!==n?n:i.currentTree;return{loadable:LE(r,e,a),key:e.key}}),[t,e]),i=DE((function(e){var t;return function(){var n,r,i=e();return null!==(n=t)&&void 0!==n&&n.loadable.is(i.loadable)&&(null===(r=t)||void 0===r?void 0:r.key)===i.key?t:(t=i,i)}}),[]),a=UE((function(){return i(r)}),[r,i]),o=DE((function(r){var i=t.current;return PE(i,e,r,n).release}),[t,e,n]);return NE(o,a,a).loadable}function BE(e){var t=RE(),n=DE((function(){var n,r=t.current,i=r.getState(),a=IE().early&&null!==(n=i.nextTree)&&void 0!==n?n:i.currentTree;return LE(r,e,a)}),[t,e]),r=DE((function(){return n()}),[n]),i=TE(),a=DE((function(r,a){var o=t.current;return PE(o,e,(function(){if(!Wk("recoil_suppress_rerender_in_callback"))return a();var e=n();s.current.is(e)||a(),s.current=e}),i).release}),[t,e,i,n]),o=AE();if(null==o)throw fk("Recoil hooks must be used in components contained within a <RecoilRoot> component.");var u=CE(o,r,a),s=VE(u);return ME((function(){s.current=u})),u}function qE(e){var t=RE(),n=TE(),r=DE((function(){var n;var r=t.current,i=r.getState(),a=IE().early&&null!==(n=i.nextTree)&&void 0!==n?n:i.currentTree;return LE(r,e,a)}),[t,e]),i=DE((function(){return{loadable:r(),key:e.key}}),[r,e.key]),a=DE((function(e){var t=i();return e.loadable.is(t.loadable)&&e.key===t.key?e:t}),[i]);ME((function(){var r=PE(t.current,e,(function(e){s(a)}),n);return s(a),r.release}),[n,e,t,a]);var o=c(FE(i),2),u=o[0],s=o[1];return u.key!==e.key?i().loadable:u.loadable}function HE(e){var t=RE(),n=c(FE([]),2)[1],r=TE(),i=DE((function(){var n;var r=t.current,i=r.getState(),a=IE().early&&null!==(n=i.nextTree)&&void 0!==n?n:i.currentTree;return LE(r,e,a)}),[t,e]),a=i(),o=VE(a);return ME((function(){o.current=a})),ME((function(){var a=t.current,u=a.getState(),s=PE(a,e,(function(e){var t;if(!Wk("recoil_suppress_rerender_in_callback"))return n([]);var r=i();null!==(t=o.current)&&void 0!==t&&t.is(r)||n(r),o.current=r}),r);if(u.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push((function(){o.current=null,n([])}));else{var c;if(!Wk("recoil_suppress_rerender_in_callback"))return n([]);var l=i();null!==(c=o.current)&&void 0!==c&&c.is(l)||n(l),o.current=l}return s.release}),[r,i,e,t]),a}function KE(e){return Wk("recoil_memory_managament_2020")&&EE(e),{TRANSITION_SUPPORT:qE,SYNC_EXTERNAL_STORE:zE,MUTABLE_SOURCE:BE,LEGACY:HE}[IE().mode](e)}function WE(e){var t=RE();return jE(KE(e),e,t)}function GE(e){var t=RE();return DE((function(n){OE(t.current,e,n)}),[t,e])}function QE(e){return Wk("recoil_memory_managament_2020")&&EE(e),qE(e)}function XE(e){var t=RE();return jE(QE(e),e,t)}var YE=function(e){return[WE(e),GE(e)]},JE=function(e){return[KE(e),GE(e)]},$E=WE,ZE=KE,eS=function(e){var t=RE();return DE((function(){OE(t.current,e,xE)}),[t,e])},tS=GE,nS=QE,rS=XE,iS=function(e){return[XE(e),GE(e)]};var aS=Kw,oS=ib.DEFAULT_VALUE,uS=ib.getNode,sS=cE,cS=xw.AbstractRecoilValue,lS=xw.setRecoilValueLoadable,fS=Vw,hS=T_.cloneSnapshot,dS=e.useCallback,pS=e.useEffect,vS=e.useRef,yS=e.useState,mS=Qw.isSSR;function gS(e){var t=sS();pS((function(){return t.current.subscribeToTransactions(e).release}),[e,t])}function kS(e,t){var n,r=e.getState(),i=null!==(n=r.nextTree)&&void 0!==n?n:r.currentTree,a=t.getStore_INTERNAL().getState().currentTree;aS((function(){for(var n=new Set,r=0,o=[i.atomValues.keys(),a.atomValues.keys()];r<o.length;r++){var u,s=re(o[r]);try{for(s.s();!(u=s.n()).done;){var c,l,f=u.value;(null===(c=i.atomValues.get(f))||void 0===c?void 0:c.contents)!==(null===(l=a.atomValues.get(f))||void 0===l?void 0:l.contents)&&uS(f).shouldRestoreFromSnapshots&&n.add(f)}}catch(h){s.e(h)}finally{s.f()}}n.forEach((function(t){lS(e,new cS(t),a.atomValues.has(t)?dk(a.atomValues.get(t)):oS)})),e.replaceState((function(e){return Bg(Bg({},e),{},{stateID:t.getID()})}))}))}var bS=function(){var e=sS(),t=c(yS((function(){return hS(e.current)})),2),n=t[0],r=t[1],i=vE(n),a=vS(),o=vS();if(gS(dS((function(e){return r(hS(e))}),[])),pS((function(){var e,t=n.retain();a.current&&!mS&&(window.clearTimeout(a.current),a.current=null,null===(e=o.current)||void 0===e||e.call(o),o.current=null);return t}),[n]),i!==n&&!mS){var u;if(a.current)window.clearTimeout(a.current),a.current=null,null===(u=o.current)||void 0===u||u.call(o),o.current=null;o.current=n.retain(),a.current=window.setTimeout((function(){var e;a.current=null,null===(e=o.current)||void 0===e||e.call(o),o.current=null}),fS)}return n},wS=kS,_S=function(){var e=sS();return dS((function(t){return kS(e.current,t)}),[e])},ES=function(e){gS(dS((function(t){var n=hS(t,"current"),r=hS(t,"previous");e({snapshot:n,previousSnapshot:r})}),[e]))},SS=Zb,TS=cE;var xS=function(){var e=TS();return function(t){var n=t.key;return SS(e.current,e.current.getState().currentTree,n)}},IS=iw.reactMode,CS=sE,NS=cE,AS=e.useMemo;var RS=function(){"MUTABLE_SOURCE"===IS().mode&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode.  Please consider upgrading to recoil_sync_external_store mode.");var t=NS().current;return AS((function(){return function(n){var r=n.children;return e.createElement(CS,{store_INTERNAL:t},r)}}),[t])},LS=Ok.loadableWithValue,OS=Yb,PS=ib.DEFAULT_VALUE,DS=ib.getNode,MS=xw.copyTreeState,US=xw.getRecoilValueAsLoadable,VS=xw.invalidateDownstreams,FS=xw.writeLoadableToTreeState;function jS(e){return"atom"===DS(e.key).nodeType}var zS=function(){function e(t,n){var r=this;ie(this,e),pk(this,"_store",void 0),pk(this,"_treeState",void 0),pk(this,"_changes",void 0),pk(this,"get",(function(e){if(r._changes.has(e.key))return r._changes.get(e.key);if(!jS(e))throw fk("Reading selectors within atomicUpdate is not supported");var t=US(r._store,e,r._treeState);if("hasValue"===t.state)return t.contents;throw"hasError"===t.state?t.contents:fk("Expected Recoil atom ".concat(e.key," to have a value, but it is in a loading state."))})),pk(this,"set",(function(e,t){if(!jS(e))throw fk("Setting selectors within atomicUpdate is not supported");if("function"===typeof t){var n=r.get(e);r._changes.set(e.key,t(n))}else OS(r._store,e.key,"set"),r._changes.set(e.key,t)})),pk(this,"reset",(function(e){r.set(e,PS)})),this._store=t,this._treeState=n,this._changes=new Map}return oe(e,[{key:"newTreeState_INTERNAL",value:function(){if(0===this._changes.size)return this._treeState;var e,t=MS(this._treeState),n=re(this._changes);try{for(n.s();!(e=n.n()).done;){var r=c(e.value,2),i=r[0],a=r[1];FS(t,i,LS(a))}}catch(o){n.e(o)}finally{n.f()}return VS(this._store,t),t}}]),e}();var BS=function(e){return function(t){e.replaceState((function(n){var r=new zS(e,n);return t(r),r.newTreeState_INTERNAL()}))}},qS=BS,HS=Object.freeze({__proto__:null,atomicUpdater:qS});var KS=function(e,t){if(!e)throw new Error(t)},WS=HS.atomicUpdater,GS=Kw,QS=ib.DEFAULT_VALUE,XS=cE,YS=xw.refreshRecoilValue,JS=xw.setRecoilValue,$S=(T_.Snapshot,T_.cloneSnapshot),ZS=wS,eT=e.useCallback,tT=oe((function e(){ie(this,e)})),nT=new tT;function rT(e,t,n,r){var i=nT;return GS((function(){var a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create.  Please see the docs at recoiljs.org for details.";if("function"!==typeof t)throw fk(a);var o=Ob(Bg(Bg({},null!==r&&void 0!==r?r:{}),{},{set:function(t,n){return JS(e,t,n)},reset:function(t){return JS(e,t,QS)},refresh:function(t){return YS(e,t)},gotoSnapshot:function(t){return ZS(e,t)},transact_UNSTABLE:function(t){return WS(e)(t)}}),{snapshot:function(){return $S(e)}}),u=t(o);if("function"!==typeof u)throw fk(a);i=u.apply(void 0,se(n))})),i instanceof tT&&KS(!1),i}var iT=rT,aT=function(e,t){var n=XS();return eT((function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return rT(n.current,e,r)}),null!=t?[].concat(se(t),[n]):void 0)},oT=cE,uT=xw.refreshRecoilValue,sT=e.useCallback;var cT=function(e){var t=oT();return sT((function(){var n=t.current;uT(n,e)}),[e,t])},lT=HS.atomicUpdater,fT=cE,hT=e.useMemo;var dT=function(e,t){var n=fT();return hT((function(){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a=lT(n.current);a((function(t){e(t).apply(void 0,r)}))}}),null!=t?[].concat(se(t),[n]):void 0)},pT=function(){function e(t){var n,r,i;ie(this,e),pk(this,"_numLeafs",void 0),pk(this,"_root",void 0),pk(this,"_onHit",void 0),pk(this,"_onSet",void 0),pk(this,"_mapNodeValue",void 0),this._numLeafs=0,this._root=null,this._onHit=null!==(n=null===t||void 0===t?void 0:t.onHit)&&void 0!==n?n:function(){},this._onSet=null!==(r=null===t||void 0===t?void 0:t.onSet)&&void 0!==r?r:function(){},this._mapNodeValue=null!==(i=null===t||void 0===t?void 0:t.mapNodeValue)&&void 0!==i?i:function(e){return e}}return oe(e,[{key:"size",value:function(){return this._numLeafs}},{key:"root",value:function(){return this._root}},{key:"get",value:function(e,t){var n;return null===(n=this.getLeafNode(e,t))||void 0===n?void 0:n.value}},{key:"getLeafNode",value:function(e,t){var n=this;return vT(this.root(),(function(t){return n._mapNodeValue(e(t))}),{onNodeVisit:function(e){null===t||void 0===t||t.onNodeVisit(e),"leaf"===e.type&&n._onHit(e)}})}},{key:"set",value:function(e,t,n){var r,i=this,a=null;!function o(){a=yT(i.root(),e.map((function(e){var t=c(e,2),n=t[0],r=t[1];return[n,i._mapNodeValue(r)]})),null,t,null,{onNodeVisit:function(e){null===n||void 0===n||n.onNodeVisit(e),"leaf"===e.type&&(r=e)}},(function(){i.clear(),o()}))}(),this.root()||(this._root=a),this._numLeafs++,this._onSet(dk(r))}},{key:"delete",value:function(e){if(!this.root())return!1;var t=dk(this.root());return!!mT(t,e,e.parent)&&(e===t||"branch"===t.type&&!t.branches.size?(this._root=null,this._numLeafs=0,!0):(this._numLeafs-=kT(e),!0))}},{key:"clear",value:function(){this._numLeafs=0,this._root=null}}]),e}(),vT=function e(t,n,r){var i;if(null!=t){if(null===r||void 0===r||null===(i=r.onNodeVisit)||void 0===i||i.call(r,t),"leaf"===t.type)return t;var a=n(t.nodeKey);return e(t.branches.get(a),n,r)}},yT=function e(t,n,r,i,a,o,u){var s,l;if(null==t)if(0===n.length)l={type:"leaf",value:i,parent:r,branchKey:a};else{var f=ik(n),h=f[0],d=f.slice(1),p=c(h,2),v=p[0],y=p[1];(l={type:"branch",nodeKey:v,parent:r,branches:new Map,branchKey:a}).branches.set(y,e(null,d,l,i,y,o,u))}else if(l=t,n.length){var m=ik(n),g=m[0],k=m.slice(1),b=c(g,2),w=b[0],_=b[1];if("branch"!==t.type||t.nodeKey!==w)return Xk("Existing cache must have a branch midway through the route with matching node key. Resetting cache."),u(),l;t.branches.set(_,e(t.branches.get(_),k,t,i,_,o,u))}return null===o||void 0===o||null===(s=o.onNodeVisit)||void 0===s||s.call(o,l),l},mT=function(e,t,n){return n?(n.branches.delete(t.branchKey),gT(e,n,n.parent)):e===t},gT=function e(t,n,r){return r?(0===n.branches.size&&r.branches.delete(n.branchKey),e(t,r,r.parent)):t===n},kT=function e(t){return"leaf"===t.type?1:Array.from(t.branches.values()).reduce((function(t,n){return t+e(n)}),0)},bT={TreeCache:pT}.TreeCache,wT=Object.freeze({__proto__:null,TreeCache:bT}),_T=function(){function e(t){var n;ie(this,e),pk(this,"_maxSize",void 0),pk(this,"_size",void 0),pk(this,"_head",void 0),pk(this,"_tail",void 0),pk(this,"_map",void 0),pk(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=null!==(n=t.mapKey)&&void 0!==n?n:function(e){return e}}return oe(e,[{key:"head",value:function(){return this._head}},{key:"tail",value:function(){return this._tail}},{key:"size",value:function(){return this._size}},{key:"maxSize",value:function(){return this._maxSize}},{key:"has",value:function(e){return this._map.has(this._keyMapper(e))}},{key:"get",value:function(e){var t=this._keyMapper(e),n=this._map.get(t);if(n)return this.set(e,n.value),n.value}},{key:"set",value:function(e,t){var n=this._keyMapper(e);this._map.get(n)&&this.delete(e);var r=this.head(),i={key:e,right:r,left:null,value:t};r?r.left=i:this._tail=i,this._map.set(n,i),this._head=i,this._size++,this._maybeDeleteLRU()}},{key:"_maybeDeleteLRU",value:function(){this.size()>this.maxSize()&&this.deleteLru()}},{key:"deleteLru",value:function(){var e=this.tail();e&&this.delete(e.key)}},{key:"delete",value:function(e){var t=this._keyMapper(e);if(this._size&&this._map.has(t)){var n=dk(this._map.get(t)),r=n.right,i=n.left;r&&(r.left=n.left),i&&(i.right=n.right),n===this.head()&&(this._head=r),n===this.tail()&&(this._tail=i),this._map.delete(t),this._size--}}},{key:"clear",value:function(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}]),e}(),ET={LRUCache:_T}.LRUCache,ST=Object.freeze({__proto__:null,LRUCache:ET}),TT=ST.LRUCache,xT=wT.TreeCache;var IT=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=new TT({maxSize:e}),r=new xT({mapNodeValue:t,onHit:function(e){n.set(e,!0)},onSet:function(t){var i=n.tail();n.set(t,!0),i&&r.size()>e&&r.delete(i.key)}});return r};function CT(e,t,n){if("string"===typeof e&&!e.includes('"')&&!e.includes("\\"))return'"'.concat(e,'"');switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if(!0!==(null===t||void 0===t?void 0:t.allowFunctions))throw fk("Attempt to serialize function in a Recoil cache key");return"__FUNCTION(".concat(e.name,")__")}if(null===e)return"null";var r;if("object"!==typeof e)return null!==(r=JSON.stringify(e))&&void 0!==r?r:"";if(hk(e))return"__PROMISE__";if(Array.isArray(e))return"[".concat(e.map((function(e,n){return CT(e,t,n.toString())})),"]");if("function"===typeof e.toJSON)return CT(e.toJSON(n),t,n);if(e instanceof Map){var i,a={},o=re(e);try{for(o.s();!(i=o.n()).done;){var u=c(i.value,2),s=u[0],l=u[1];a["string"===typeof s?s:CT(s,t)]=l}}catch(f){o.e(f)}finally{o.f()}return CT(a,t,n)}return e instanceof Set?CT(Array.from(e).sort((function(e,n){return CT(e,t).localeCompare(CT(n,t))})),t,n):void 0!==Symbol&&null!=e[Symbol.iterator]&&"function"===typeof e[Symbol.iterator]?CT(Array.from(e),t,n):"{".concat(Object.keys(e).filter((function(t){return void 0!==e[t]})).sort().map((function(n){return"".concat(CT(n,t),":").concat(CT(e[n],t,n))})).join(","),"}")}var NT=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{allowFunctions:!1};return CT(e,t)},AT=wT.TreeCache,RT={equality:"reference",eviction:"keep-all",maxSize:1/0};function LT(e){switch(e){case"reference":return function(e){return e};case"value":return function(e){return NT(e)}}throw fk("Unrecognized equality policy ".concat(e))}function OT(e,t,n){switch(e){case"keep-all":return new AT({mapNodeValue:n});case"lru":return IT(dk(t),n);case"most-recent":return IT(1,n)}throw fk("Unrecognized eviction policy ".concat(e))}var PT=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:RT,t=e.equality,n=void 0===t?RT.equality:t,r=e.eviction,i=void 0===r?RT.eviction:r,a=e.maxSize,o=void 0===a?RT.maxSize:a,u=LT(n),s=OT(i,o,u);return s};var DT=function(e){return function(){return null}},MT=Ok.loadableWithError,UT=Ok.loadableWithPromise,VT=Ok.loadableWithValue,FT=Gb,jT=Qb,zT=Xb,BT=yb,qT=ib.DEFAULT_VALUE,HT=ib.RecoilValueNotReady,KT=ib.getConfigDeletionHandler,WT=ib.getNode,GT=ib.registerNode,QT=Bk.isRecoilValue,XT=xw.markRecoilValueModified,YT=zw,JT=iT,$T=DT,ZT=oe((function e(){ie(this,e)})),ex=new ZT,tx=[],nx=new Map,rx=function(){var e=0;return function(){return e++}}();var ix=function(e){var t=null,n=e.key,r=e.get,i=e.cachePolicy_UNSTABLE,a=null!=e.set?e.set:void 0,o=new Set,u=PT(null!==i&&void 0!==i?i:{equality:"reference",eviction:"keep-all"}),s=YT(e.retainedBy_UNSTABLE),l=new Map,f=0;function h(){return!Wk("recoil_memory_managament_2020")||f>0}function d(e){return e.getState().knownSelectors.add(n),f++,function(){f--}}function p(){return void 0!==KT(n)&&!h()}function v(e,t,n,r,i){A(t,r,i),b(e,t,new Set(i.keys()),n),y(e,n)}function y(e,n){N(e,n)&&C(e);var r=nx.get(n);if(void 0!==r){var i,a=re(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;XT(o,dk(t))}}catch(u){a.e(u)}finally{a.f()}nx.delete(n)}}function m(e,t){var n=nx.get(t);null==n&&nx.set(t,n=new Set),n.add(e)}function g(e,t,n){var r=e.getState().knownSelectors.has(n);if(r&&t.atomValues.has(n))return dk(t.atomValues.get(n));var i=FT(e,t,n);return"loading"!==i.state&&r&&t.atomValues.set(n,i),i}function k(e,t,n,r,i,a){return t.then((function(r){if(!h())throw C(e),ex;null!=a.loadingDepKey&&a.loadingDepPromise===t?n.atomValues.set(a.loadingDepKey,VT(r)):e.getState().knownSelectors.forEach((function(e){n.atomValues.delete(e)}));var o=_(e,n);if(o&&"loading"!==o.state){if((N(e,i)||null==x(e))&&y(e,i),"hasValue"===o.state)return o.contents;throw o.contents}if(!N(e,i)){var u=S(n);if("loading"===(null===u||void 0===u?void 0:u.latestLoadable.state))return u.latestLoadable.contents}var s=c(w(e,n,i),2),l=s[0],f=s[1];if(I(e,i,f),"loading"!==l.state&&v(e,n,i,l,f),"hasError"===l.state)throw l.contents;return l.contents})).catch((function(t){if(t instanceof ZT)throw ex;if(!h())throw C(e),ex;var a=MT(t);throw v(e,n,i,a,r),t}))}function b(e,t,r,i){var a,u,s,c,l,f,h;(N(e,i)||t.version===(null===(a=e.getState())||void 0===a||null===(u=a.currentTree)||void 0===u?void 0:u.version)||t.version===(null===(s=e.getState())||void 0===s||null===(c=s.nextTree)||void 0===c?void 0:c.version))&&(BT(new Map([[n,r]]),e,null!==(l=null===(f=e.getState())||void 0===f||null===(h=f.nextTree)||void 0===h?void 0:h.version)&&void 0!==l?l:e.getState().currentTree.version),r.forEach((function(e){return o.add(e)})))}function w(e,i,a){var o,u=$T(n),s=!0,c=function(){u(),s=!1},l=!1,f={loadingDepKey:null,loadingDepPromise:null},d=new Map,p=new Set;function y(t){var n=t.key;!function(e,t,n,r,i){n.add(r),b(e,t,n,i)}(e,i,p,n,a);var r=g(e,i,n);switch(d.set(n,r),r.state){case"hasValue":return r.contents;case"hasError":throw r.contents;case"loading":throw f.loadingDepKey=n,f.loadingDepPromise=r.contents,r.contents}throw fk("Invalid Loadable state")}b(e,i,p,a);try{o=r({get:y,getCallback:function(n){return function(){if(s)throw fk("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated.  It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");null==t&&KS(!1);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return JT(e,n,i,{node:t})}}}),o=QT(o)?y(o):o,hk(o)?o=function(e,t,n,r,i,a){return t.then((function(t){if(!h())throw C(e),ex;var a=VT(t);return v(e,n,i,a,r),t})).catch((function(t){if(!h())throw C(e),ex;if(I(e,i,r),hk(t))return k(e,t,n,r,i,a);var o=MT(t);throw v(e,n,i,o,r),t}))}(e,o,i,d,a,f).finally(c):c()}catch(m){hk(o=m)?o=k(e,o,i,d,a,f).finally(c):(l=!0,c())}return[l?MT(o):hk(o)?UT(o):VT(o),d]}function _(e,t){var r,i=new Set,a=x(e);try{r=u.get((function(n){return"string"!==typeof n&&KS(!1),g(e,t,n).contents}),{onNodeVisit:function(e){"branch"===e.type&&e.nodeKey!==n&&i.add(e.nodeKey)}})}catch(o){throw fk('Problem with cache lookup for selector "'.concat(n,'": ').concat(o.message))}return r&&b(e,t,i,null===a||void 0===a?void 0:a.latestExecutionId),r}function E(e,t){var n=rx(),r=c(w(e,t,n),2),i=r[0],a=r[1];return"loading"===i.state?(!function(e,t,n,r,i){l.set(e,{depValuesDiscoveredSoFarDuringAsyncWork:r,latestExecutionId:t,latestLoadable:n,stateVersion:i.version})}(e,n,i,a,t),m(e,n)):(C(e),A(t,i,a)),i}function S(e){var t,n=null!==(t=Array.from(l.entries()).find((function(t){var n=c(t,2),r=n[0],i=n[1];return null!=i.latestLoadable&&null!=i.latestExecutionId&&!function(e,t){var n,r,i=x(e),a=null!==(n=null===i||void 0===i?void 0:i.depValuesDiscoveredSoFarDuringAsyncWork)&&void 0!==n?n:new Map,o=Array((null!==(r=T.get(t.version))&&void 0!==r?r:new Map).entries()),u=T.has(t.version)&&o.length===a.size&&o.every((function(e){var t=c(e,2),n=t[0],r=t[1];return a.get(n)===r}));if(null==a||t.version===(null===i||void 0===i?void 0:i.stateVersion)||u)return!1;return T.set(t.version,new Map(a)),Array.from(a).some((function(n){var r=c(n,2),i=r[0],a=r[1];return g(e,t,i).contents!==a.contents}))}(r,e)})))&&void 0!==t?t:[];return c(n,2)[1]}var T=new Map;function x(e){return l.get(e)}function I(e,t,n){if(N(e,t)){var r=x(e);null!=r&&(r.depValuesDiscoveredSoFarDuringAsyncWork=n)}}function C(e){l.delete(e)}function N(e,t){var n;return t===(null===(n=x(e))||void 0===n?void 0:n.latestExecutionId)}function A(e,t,r){e.atomValues.set(n,t);try{u.set(function(e){return Array.from(e.entries()).map((function(e){var t=c(e,2);return[t[0],t[1].contents]}))}(r),t)}catch(i){throw fk('Problem with setting cache for selector "'.concat(n,'": ').concat(i.message))}}function R(e,t){return u.get((function(n){var r;return"string"!==typeof n&&KS(!1),null===(r=jT(e,t,n))||void 0===r?void 0:r.contents}))}function L(e,t){return function(e){if(tx.includes(n)){var t="Recoil selector has circular dependencies: ".concat(tx.slice(tx.indexOf(n)).join(" \u2192 "));return MT(fk(t))}tx.push(n);try{return e()}finally{tx.pop()}}((function(){return function(e,t){var n=_(e,t);if(null!=n)return C(e),n;var r,i=S(t);return null!=i?("loading"===(null===(r=i.latestLoadable)||void 0===r?void 0:r.state)&&m(e,dk(i.latestExecutionId)),dk(i.latestLoadable)):E(e,t)}(e,t)}))}function O(e){e.atomValues.delete(n)}function P(e,n){null==t&&KS(!1);var r,i=re(o);try{for(i.s();!(r=i.n()).done;){var a,s=r.value,c=WT(s);null===(a=c.clearCache)||void 0===a||a.call(c,e,n)}}catch(l){i.e(l)}finally{i.f()}o.clear(),O(n),u.clear(),XT(e,t)}if(null!=a){return t=GT({key:n,nodeType:"selector",peek:R,get:L,set:function(e,t,n){var r=!1,i=new Map;function o(n){var i=n.key;if(r)throw fk("Recoil: Async selector sets are not currently supported.");var a=g(e,t,i);if("hasValue"===a.state)return a.contents;throw"loading"===a.state?new HT(i):a.contents}function u(n,a){if(r)throw fk("Recoil: Async selector sets are not currently supported.");var u="function"===typeof a?a(o(n)):a;zT(e,t,n.key,u).forEach((function(e,t){return i.set(t,e)}))}var s=a({set:u,get:o,reset:function(e){u(e,qT)}},n);if(void 0!==s)throw hk(s)?fk("Recoil: Async selector sets are not currently supported."):fk("Recoil: selector set should be a void function.");return r=!0,i},init:d,invalidate:O,clearCache:P,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:s})}return t=GT({key:n,nodeType:"selector",peek:R,get:L,init:d,invalidate:O,clearCache:P,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:s})},ax=Ok.loadableWithError,ox=Ok.loadableWithPromise,ux=Ok.loadableWithValue,sx=Zb,cx=ib.DEFAULT_VALUE,lx=ib.DefaultValue,fx=ib.getConfigDeletionHandler,hx=ib.registerNode,dx=ib.setConfigDeletionHandler,px=Bk.isRecoilValue,vx=xw.getRecoilValueAsLoadable,yx=xw.markRecoilValueModified,mx=xw.setRecoilValue,gx=xw.setRecoilValueLoadable,kx=zw;function bx(e){var t=e.key,n=e.persistence_UNSTABLE,r=kx(e.retainedBy_UNSTABLE),i=0,a=hk(e.default)?ox(e.default.then((function(e){return a=ux(e),e})).catch((function(e){throw a=ax(e),e}))):ux(e.default);s(e.default);var o=void 0,u=new Map;function s(e){return e}function c(e,n){var r,i;return null!==(r=null!==(i=n.atomValues.get(t))&&void 0!==i?i:o)&&void 0!==r?r:a}var l=hx({key:t,nodeType:"atom",peek:c,get:function(e,r){if(r.atomValues.has(t))return dk(r.atomValues.get(t));if(r.nonvalidatedAtoms.has(t)){if(null!=o)return o;if(null==n)return qk("Tried to restore a persisted value for atom ".concat(t," but it has no persistence settings.")),a;var i=r.nonvalidatedAtoms.get(t),u=n.validator(i,cx),s=u instanceof lx?a:ux(u);return o=s}return a},set:function(e,n,r){if(n.atomValues.has(t)){var i=dk(n.atomValues.get(t));if("hasValue"===i.state&&r===i.contents)return new Map}else if(!n.nonvalidatedAtoms.has(t)&&r instanceof lx)return new Map;return o=void 0,(new Map).set(t,ux(r))},init:function(n,r,o){var s;if(i++,n.getState().knownAtoms.add(t),"loading"===a.state){a.contents.finally((function(){var e;(null!==(e=n.getState().nextTree)&&void 0!==e?e:n.getState().currentTree).atomValues.has(t)||yx(n,l)}))}var f=null!==(s=e.effects)&&void 0!==s?s:e.effects_UNSTABLE;if(null!=f){var h,d=function(e){if(y&&e.key===t){var i=m;return i instanceof lx?c(n,r):hk(i)?ox(i.then((function(e){return e instanceof lx?a.toPromise():e}))):ux(i)}return vx(n,e)},p=function(e){return d(e).toPromise()},v=function(e){var r,i=sx(n,null!==(r=n.getState().nextTree)&&void 0!==r?r:n.getState().currentTree,e.key);return!y||e.key!==t||m instanceof lx?i:Bg(Bg({},i),{},{isSet:!0,loadable:d(e)})},y=!0,m=cx,g=!1,k=null,b=function(e){return function(t){if(y){var r=d(l),i="hasValue"===r.state?r.contents:cx;m="function"===typeof t?t(i):t,hk(m)&&(m=m.then((function(t){return k={effect:e,value:t},t})))}else{if(hk(t))throw fk("Setting atoms to async values is not implemented.");"function"!==typeof t&&(k={effect:e,value:t}),mx(n,l,"function"===typeof t?function(n){var r=t(n);return k={effect:e,value:r},r}:t)}}},w=function(e){return function(){return b(e)(cx)}},_=function(e){return function(r){var i,o=n.subscribeToTransactions((function(n){var i,o=n.getState(),u=o.currentTree,s=o.previousTree;s||(Xk("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),s=u);var c=null!==(i=u.atomValues.get(t))&&void 0!==i?i:a;if("hasValue"===c.state){var l,f,h,d,p=c.contents,v=null!==(l=s.atomValues.get(t))&&void 0!==l?l:a,y="hasValue"===v.state?v.contents:cx;(null===(f=k)||void 0===f?void 0:f.effect)!==e||(null===(h=k)||void 0===h?void 0:h.value)!==p?r(p,y,!u.atomValues.has(t)):(null===(d=k)||void 0===d?void 0:d.effect)===e&&(k=null)}}),t).release;u.set(n,[].concat(se(null!==(i=u.get(n))&&void 0!==i?i:[]),[o]))}},E=re(f);try{for(E.s();!(h=E.n()).done;){var S=h.value;try{var T,x=S({node:l,storeID:n.storeID,trigger:o,setSelf:b(S),resetSelf:w(S),onSet:_(S),getPromise:p,getLoadable:d,getInfo_UNSTABLE:v});if(null!=x)u.set(n,[].concat(se(null!==(T=u.get(n))&&void 0!==T?T:[]),[x]))}catch(A){m=A,g=!0}}}catch(R){E.e(R)}finally{E.f()}if(y=!1,!(m instanceof lx)){var I,C=m,N=g?ax(m):hk(C)?ox(function(e,n){var r=n.then((function(n){var i,a;return(null===(a=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===a?void 0:a.contents)===r&&mx(e,l,n),n})).catch((function(n){var i,a;throw(null===(a=(null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree).atomValues.get(t))||void 0===a?void 0:a.contents)===r&&gx(e,l,ax(n)),n}));return r}(n,C)):ux(C);r.atomValues.set(t,N),null===(I=n.getState().nextTree)||void 0===I||I.atomValues.set(t,N)}}return function(){var e;i--,null===(e=u.get(n))||void 0===e||e.forEach((function(e){return e()})),u.delete(n)}},invalidate:function(){o=void 0},shouldDeleteConfigOnRelease:function(){return void 0!==fx(t)&&i<=0},dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return l}function wx(e){var t=e.default,n=ak(e,uk);return px(t)?function(e){var t=wx(Bg(Bg({},e),{},{default:cx,persistence_UNSTABLE:void 0===e.persistence_UNSTABLE?void 0:Bg(Bg({},e.persistence_UNSTABLE),{},{validator:function(t){return t instanceof lx?t:dk(e.persistence_UNSTABLE).validator(t,cx)}}),effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE})),n=ix({key:"".concat(e.key,"__withFallback"),get:function(n){var r=(0,n.get)(t);return r instanceof lx?e.default:r},set:function(e,n){return(0,e.set)(t,n)},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return dx(n.key,fx(e.key)),n}(Bg(Bg({},n),{},{default:t})):bx(Bg(Bg({},n),{},{default:t}))}var _x=wx,Ex=function(){function e(t){var n;ie(this,e),pk(this,"_map",void 0),pk(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=null!==(n=null===t||void 0===t?void 0:t.mapKey)&&void 0!==n?n:function(e){return e}}return oe(e,[{key:"size",value:function(){return this._map.size}},{key:"has",value:function(e){return this._map.has(this._keyMapper(e))}},{key:"get",value:function(e){return this._map.get(this._keyMapper(e))}},{key:"set",value:function(e,t){this._map.set(this._keyMapper(e),t)}},{key:"delete",value:function(e){this._map.delete(this._keyMapper(e))}},{key:"clear",value:function(){this._map.clear()}}]),e}(),Sx={MapCache:Ex}.MapCache,Tx=Object.freeze({__proto__:null,MapCache:Sx}),xx=ST.LRUCache,Ix=Tx.MapCache,Cx={equality:"reference",eviction:"none",maxSize:1/0};function Nx(e){switch(e){case"reference":return function(e){return e};case"value":return function(e){return NT(e)}}throw fk("Unrecognized equality policy ".concat(e))}function Ax(e,t,n){switch(e){case"keep-all":return new Ix({mapKey:n});case"lru":return new xx({mapKey:n,maxSize:dk(t)});case"most-recent":return new xx({mapKey:n,maxSize:1})}throw fk("Unrecognized eviction policy ".concat(e))}var Rx=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cx,t=e.equality,n=void 0===t?Cx.equality:t,r=e.eviction,i=void 0===r?Cx.eviction:r,a=e.maxSize,o=void 0===a?Cx.maxSize:a,u=Nx(n),s=Ax(i,o,u);return s},Lx=ib.setConfigDeletionHandler;var Ox=function(e){var t,n,r=Rx({equality:null!==(t=null===(n=e.cachePolicyForParams_UNSTABLE)||void 0===n?void 0:n.equality)&&void 0!==t?t:"value",eviction:"keep-all"});return function(t){var n,i,a=r.get(t);if(null!=a)return a;e.cachePolicyForParams_UNSTABLE;var o=ak(e,sk),u=_x(Bg(Bg({},o),{},{key:"".concat(e.key,"__").concat(null!==(n=NT(t))&&void 0!==n?n:"void"),default:"function"===typeof e.default?e.default(t):e.default,retainedBy_UNSTABLE:"function"===typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE,effects:"function"===typeof e.effects?e.effects(t):"function"===typeof e.effects_UNSTABLE?e.effects_UNSTABLE(t):null!==(i=e.effects)&&void 0!==i?i:e.effects_UNSTABLE}));return r.set(t,u),Lx(u.key,(function(){r.delete(t)})),u}},Px=ib.setConfigDeletionHandler,Dx=0;var Mx=function(e){var t,n,r=Rx({equality:null!==(t=null===(n=e.cachePolicyForParams_UNSTABLE)||void 0===n?void 0:n.equality)&&void 0!==t?t:"value",eviction:"keep-all"});return function(t){var n,i=r.get(t);if(null!=i)return i;var a,o="".concat(e.key,"__selectorFamily/").concat(null!==(n=NT(t,{allowFunctions:!0}))&&void 0!==n?n:"void","/").concat(Dx++),u=function(n){return e.get(t)(n)},s=e.cachePolicy_UNSTABLE,c="function"===typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE;if(null!=e.set){var l=e.set;a=ix({key:o,get:u,set:function(e,n){return l(t)(e,n)},cachePolicy_UNSTABLE:s,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else a=ix({key:o,get:u,cachePolicy_UNSTABLE:s,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(t,a),Px(a.key,(function(){r.delete(t)})),a}},Ux=Mx({key:"__constant",get:function(e){return function(){return e}},cachePolicyForParams_UNSTABLE:{equality:"reference"}});var Vx=function(e){return Ux(e)},Fx=Mx({key:"__error",get:function(e){return function(){throw fk(e)}},cachePolicyForParams_UNSTABLE:{equality:"reference"}});var jx=function(e){return Fx(e)};var zx=function(e){return e},Bx=Ok.loadableWithError,qx=Ok.loadableWithPromise,Hx=Ok.loadableWithValue;function Kx(e,t){var n,r=Array(t.length).fill(void 0),i=Array(t.length).fill(void 0),a=re(t.entries());try{for(a.s();!(n=a.n()).done;){var o=c(n.value,2),u=o[0],s=o[1];try{r[u]=e(s)}catch(l){i[u]=l}}}catch(f){a.e(f)}finally{a.f()}return[r,i]}function Wx(e){return null!=e&&!hk(e)}function Gx(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map((function(t){return e[t]}))}function Qx(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((function(e,n,r){return Bg(Bg({},e),{},ce({},n,t[r]))}),{})}function Xx(e,t,n){return Qx(e,n.map((function(e,n){return null==e?Hx(t[n]):hk(e)?qx(e):Bx(e)})))}var Yx=Mx({key:"__waitForNone",get:function(e){return function(t){var n=c(Kx(t.get,Gx(e)),2),r=n[0],i=n[1];return Xx(e,r,i)}},dangerouslyAllowMutability:!0}),Jx=Mx({key:"__waitForAny",get:function(e){return function(t){var n=c(Kx(t.get,Gx(e)),2),r=n[0],i=n[1];return i.some((function(e){return!hk(e)}))?Xx(e,r,i):new Promise((function(t){var n,a=re(i.entries());try{var o=function(){var a=c(n.value,2),o=a[0],u=a[1];hk(u)&&u.then((function(n){r[o]=n,i[o]=void 0,t(Xx(e,r,i))})).catch((function(n){i[o]=n,t(Xx(e,r,i))}))};for(a.s();!(n=a.n()).done;)o()}catch(u){a.e(u)}finally{a.f()}}))}},dangerouslyAllowMutability:!0}),$x=Mx({key:"__waitForAll",get:function(e){return function(t){var n=c(Kx(t.get,Gx(e)),2),r=n[0],i=n[1];if(i.every((function(e){return null==e})))return Qx(e,r);var a=i.find(Wx);if(null!=a)throw a;return Promise.all(i).then((function(t){return Qx(e,(n=r,t.map((function(e,t){return void 0===e?n[t]:e}))));var n}))}},dangerouslyAllowMutability:!0}),Zx=Mx({key:"__waitForAllSettled",get:function(e){return function(t){var n=c(Kx(t.get,Gx(e)),2),r=n[0],i=n[1];return i.every((function(e){return!hk(e)}))?Xx(e,r,i):Promise.all(i.map((function(e,t){return hk(e)?e.then((function(e){r[t]=e,i[t]=void 0})).catch((function(e){r[t]=void 0,i[t]=e})):null}))).then((function(){return Xx(e,r,i)}))}},dangerouslyAllowMutability:!0}),eI={waitForNone:Yx,waitForAny:Jx,waitForAll:$x,waitForAllSettled:Zx,noWait:Mx({key:"__noWait",get:function(e){return function(t){var n=t.get;try{return Hx(n(e))}catch(r){return hk(r)?qx(r):Bx(r)}}},dangerouslyAllowMutability:!0})},tI=Ok.RecoilLoadable,nI=ib.DefaultValue,rI=sE,iI=fE,aI=Bk.isRecoilValue,oI=Nb.retentionZone,uI=T_.freshSnapshot,sI={DefaultValue:nI,isRecoilValue:aI,RecoilLoadable:tI,RecoilRoot:rI,useRecoilStoreID:iI,useRecoilBridgeAcrossReactRoots_UNSTABLE:RS,atom:_x,selector:ix,atomFamily:Ox,selectorFamily:Mx,constSelector:Vx,errorSelector:jx,readOnlySelector:zx,noWait:eI.noWait,waitForNone:eI.waitForNone,waitForAny:eI.waitForAny,waitForAll:eI.waitForAll,waitForAllSettled:eI.waitForAllSettled,useRecoilValue:$E,useRecoilValueLoadable:ZE,useRecoilState:YE,useRecoilStateLoadable:JE,useSetRecoilState:tS,useResetRecoilState:eS,useGetRecoilValueInfo_UNSTABLE:xS,useRecoilRefresher_UNSTABLE:cT,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:nS,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:rS,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:iS,useRecoilCallback:aT,useRecoilTransaction_UNSTABLE:dT,useGotoRecoilSnapshot:_S,useRecoilSnapshot:bS,useRecoilTransactionObserver_UNSTABLE:ES,snapshot_UNSTABLE:uI,useRetain:EE,retentionZone:oI},cI=sI.RecoilRoot,lI=sI.atom,fI=sI.selector,hI=sI.useRecoilValue,dI=sI.useRecoilState;var pI=lI({key:"usersState",default:[]}),vI=fI({key:"charCountState",get:function(e){return(0,e.get)(pI)}}),yI=lI({key:"userState",default:null});fI({key:"userDataState",get:function(e){return(0,e.get)(yI)}});function mI(){var t=c(dI(pI),2),n=(t[0],t[1]),r=hI(vI),a=Va();function o(){return(o=i(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],e.next=3,Zm(um(Ng,"users"));case 3:e.sent.forEach((function(e){t.push(Bg({},e.data()))})),n(t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,e.useEffect)((function(){!function(){o.apply(this,arguments)}()}),[a.currentUser]),(0,Ag.jsxs)("div",{className:"main-ul-container",children:[(0,Ag.jsx)("h3",{children:"Users"}),(0,Ag.jsx)("div",{className:"user-list-container",children:(0,Ag.jsx)("div",{children:r.map((function(e){return(0,Ag.jsxs)("div",{className:"user-list-item",children:[(0,Ag.jsx)("div",{className:"user-list-img-container",children:(0,Ag.jsx)("img",{className:"user-list-img",src:e.photoURL,alt:"profile"})}),(0,Ag.jsx)("div",{className:"user-list-name",children:e.userName})]},e.userId)}))})})]})}function gI(e){return Qg({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(e)}function kI(e){return Qg({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854 12.854c-0-0-0-0-0-0l-4.854-4.854 4.854-4.854c0-0 0-0 0-0 0.052-0.052 0.090-0.113 0.114-0.178 0.066-0.178 0.028-0.386-0.114-0.529l-2.293-2.293c-0.143-0.143-0.351-0.181-0.529-0.114-0.065 0.024-0.126 0.062-0.178 0.114 0 0-0 0-0 0l-4.854 4.854-4.854-4.854c-0-0-0-0-0-0-0.052-0.052-0.113-0.090-0.178-0.114-0.178-0.066-0.386-0.029-0.529 0.114l-2.293 2.293c-0.143 0.143-0.181 0.351-0.114 0.529 0.024 0.065 0.062 0.126 0.114 0.178 0 0 0 0 0 0l4.854 4.854-4.854 4.854c-0 0-0 0-0 0-0.052 0.052-0.090 0.113-0.114 0.178-0.066 0.178-0.029 0.386 0.114 0.529l2.293 2.293c0.143 0.143 0.351 0.181 0.529 0.114 0.065-0.024 0.126-0.062 0.178-0.114 0-0 0-0 0-0l4.854-4.854 4.854 4.854c0 0 0 0 0 0 0.052 0.052 0.113 0.090 0.178 0.114 0.178 0.066 0.386 0.029 0.529-0.114l2.293-2.293c0.143-0.143 0.181-0.351 0.114-0.529-0.024-0.065-0.062-0.126-0.114-0.178z"}}]})(e)}function bI(){var t=Va(),n=c((0,e.useState)(t),2),r=n[0],a=(n[1],c((0,e.useState)(""),2)),o=a[0],u=a[1],s=c((0,e.useState)(!1),2),l=s[0],f=s[1],d=c((0,e.useState)(""),2),p=d[0],v=d[1],y=c((0,e.useState)([]),2),m=y[0],g=y[1],k=c((0,e.useState)([]),2),b=k[0],w=k[1],_=c((0,e.useState)(!1),2),E=_[0],S=_[1],T=c(e.useState(t.currentUser),2),x=T[0],I=T[1],C=c(e.useState(!1),2),N=C[0],A=C[1],R=L();(0,e.useEffect)((function(){if(m.length>0)for(var e=function(e){w((function(t){return[].concat(se(t),[URL.createObjectURL(m[e])])}))},t=0;t<m.length;t++)e(t)}),[m]),(0,e.useEffect)((function(){console.count(),function(e,t,n,r){Oe(e).onAuthStateChanged(t,n,r)}(r,(function(e){e?I(e):R("../")}))}),[]),(0,e.useEffect)((function(){var e=function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,eg(sm(Ng,"users",x.uid),{userId:x.uid,userName:x.displayName?x.displayName:"Anonymous",email:x.email,time:xl.now(),photoURL:x.photoURL?x.photoURL:Lg}).then((function(){console.log("user added")}));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Error adding document: ",e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}();x&&e()}),[x]);var O=function(e){e.preventDefault(),function(e,t){Gr(e.currentUser,{displayName:t}).then((function(){alert("Name updated!")})).catch((function(e){alert("Error updating name!",e.message),console.log(e.message)}))}(r,o),f(!1)},P=function(){(function(e){return Oe(e).signOut()})(r).then((function(){})).catch((function(e){alert(e.message)}))},D=function(){var e=i(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,tg(um(Ng,"posts"),{postId:jg(),userId:x.uid,userName:x.displayName?x.displayName:"Anonymous",email:x.email,postText:p,time:xl.now(),photoURL:x.photoURL?x.photoURL:Lg,postImage:b,postLikes:[]}).then((function(){v(""),g([]),w([]),S(!E)}));case 3:v(""),g([]),w([]),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error("Error adding document: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();b.map((function(e){return console.log(e),(0,Ag.jsx)("img",{className:"main-input-image",src:e,alt:"user"})}));return(0,Ag.jsx)(Ag.Fragment,{children:x&&(0,Ag.jsxs)("div",{className:"main-container",children:[(0,Ag.jsx)("div",{className:"main-container-left",children:x&&(0,Ag.jsx)("div",{className:"main-card",children:(0,Ag.jsxs)("div",{className:"main-card-body",children:[(0,Ag.jsxs)("div",{className:"main-user-info-container",children:[(0,Ag.jsx)("img",{className:"main-user-img",src:x.photoURL?x.photoURL:Lg,alt:"user"}),(0,Ag.jsx)("h5",{className:"main-card-title",children:x.displayName}),(0,Ag.jsx)("p",{className:"main-card-text",children:x.email}),(0,Ag.jsx)("button",{className:"main-btn",onClick:P,children:"Logout"})]}),l&&(0,Ag.jsxs)(Ag.Fragment,{children:[(0,Ag.jsx)("input",{className:"main-input",type:"text",placeholder:"Name",onChange:function(e){return u(e.target.value)}}),(0,Ag.jsx)("button",{className:"main-btn",onClick:function(e){return O(e)},children:"update Name"})]}),(0,Ag.jsx)(mI,{})]})})}),(0,Ag.jsxs)("div",{className:"main-container-body",children:[(0,Ag.jsxs)("div",{className:"main-heading",children:[(0,Ag.jsx)("h3",{children:"Home "}),(0,Ag.jsx)("div",{className:"main-container-hamburger",onClick:function(){A(!N)},children:N?(0,Ag.jsx)(kI,{}):(0,Ag.jsx)(gI,{})})]}),(0,Ag.jsxs)("div",{children:[x&&(0,Ag.jsxs)("div",{className:"input-container",children:[(0,Ag.jsxs)("div",{className:"input-post-holder",children:[(0,Ag.jsx)("img",{className:"main-input-user-img",src:x.photoURL?x.photoURL:Lg,alt:"user"}),(0,Ag.jsx)("textarea",{className:"main-input-post",type:"text",placeholder:"What's Happening?",value:p,onChange:function(e){v(e.target.value)}})]}),(0,Ag.jsx)("div",{className:"main-post-btn-container",children:(0,Ag.jsx)("button",{disabled:function(e){return e.length}(p)<1,className:"main-input-btn",onClick:D,children:"Post"})})]}),(0,Ag.jsx)("div",{className:"main-post-container",children:(0,Ag.jsx)(rk,{change:E})}),N&&(0,Ag.jsx)("div",{className:"main-menu-container",children:(0,Ag.jsx)("div",{className:"main-menu-container-body",children:(0,Ag.jsxs)("div",{className:"main-menu-container-body-user",children:[(0,Ag.jsx)("img",{className:"main-menu-user-img",src:x.photoURL?x.photoURL:Lg,alt:"user"}),(0,Ag.jsx)("h5",{className:"main-menu-user-name",children:x.displayName}),(0,Ag.jsx)("p",{className:"main-menu-user-name",children:x.email}),(0,Ag.jsx)("button",{className:"main-btn",onClick:P,children:"Logout"})]})})})]})]})]})})}function wI(){var t=c((0,e.useState)(null),2),n=t[0],r=t[1],i=c((0,e.useState)(""),2),a=i[0],o=i[1],u=c((0,e.useState)(""),2),s=u[0],l=u[1],f=c((0,e.useState)(""),2),h=f[0],d=f[1],p=c((0,e.useState)(Va()),2),v=p[0],y=(p[1],c((0,e.useState)(!1),2)),m=y[0],g=y[1],k=L();(0,e.useEffect)((function(){}),[n]);var b=function(e,t){(function(e,t,n){return Hr.apply(this,arguments)})(v,e,t).then((function(e){var t=e.user;!function(e,t){Gr(e.currentUser,{displayName:t}).then((function(){})).catch((function(e){alert("Error updating name!",e.message),console.log(e.message)}))}(v,h),setTimeout((function(){r(t)}),3e3),g(!1),k("../main",{replace:!0})})).catch((function(e){e.code;var t=e.message;alert(t),g(!1)}))};return(0,Ag.jsxs)("div",{style:{display:"flex",height:"70vh",justifyContent:"center",alignItems:"center"},children:[(0,Ag.jsxs)("form",{className:"signup-form",children:[(0,Ag.jsx)("h3",{children:"Sign Up"}),(0,Ag.jsx)("input",{placeholder:"name",type:"text",value:h,onChange:function(e){return d(e.target.value)}}),(0,Ag.jsx)("input",{type:"email",placeholder:"email",onChange:function(e){o(e.target.value)}}),(0,Ag.jsx)("input",{type:"password",placeholder:"Password",onChange:function(e){l(e.target.value)}}),(0,Ag.jsx)("button",{onClick:function(e){g(!0),e.preventDefault(),b(a,s)},children:"Signup"})]}),m&&(0,Ag.jsx)("div",{className:"loading-container",children:(0,Ag.jsxs)("div",{className:"lds-ellipsis",children:[(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{}),(0,Ag.jsx)("div",{})]})})]})}var _I=function(){return(0,Ag.jsx)(cI,{children:(0,Ag.jsxs)(N,{children:[(0,Ag.jsx)(I,{path:"/",element:(0,Ag.jsx)(Rg,{})}),(0,Ag.jsx)(I,{path:"main",element:(0,Ag.jsx)(bI,{})}),(0,Ag.jsx)(I,{path:"signup",element:(0,Ag.jsx)(wI,{})})]})})},EI=function(e){e&&e instanceof Function&&n.e(787).then(n.bind(n,787)).then((function(t){var n=t.getCLS,r=t.getFID,i=t.getFCP,a=t.getLCP,o=t.getTTFB;n(e),r(e),i(e),a(e),o(e)}))};function SI(t){var n=t.basename,r=t.children,i=t.window,a=(0,e.useRef)();null==a.current&&(a.current=m({window:i}));var o=a.current,u=c((0,e.useState)({action:o.action,location:o.location}),2),s=u[0],l=u[1];return(0,e.useLayoutEffect)((function(){return o.listen(l)}),[o]),(0,e.createElement)(C,{basename:n,children:r,location:s.location,navigationType:s.action,navigator:o})}t.render((0,Ag.jsx)(e.StrictMode,{children:(0,Ag.jsx)(SI,{children:(0,Ag.jsx)(_I,{})})}),document.getElementById("root")),EI()}()}();
//# sourceMappingURL=main.2e2b9692.js.map