diff --git a/asset-manifest.json b/asset-manifest.json index 464d4b6..080539d 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,21 +1,21 @@ { "files": { "main.css": "/apollon-3/static/css/main.e6c13ad2.css", - "main.js": "/apollon-3/static/js/main.9289b7f4.js", + "main.js": "/apollon-3/static/js/main.e51459e9.js", "static/js/453.5d81ad51.chunk.js": "/apollon-3/static/js/453.5d81ad51.chunk.js", - "static/media/effect_shader.frag": "/apollon-3/static/media/effect_shader.8c34cd036049268c0f03.frag", - "static/media/ink_shader.frag": "/apollon-3/static/media/ink_shader.b760bd01c758ded4dfb8.frag", + "static/media/effect_shader.frag": "/apollon-3/static/media/effect_shader.a583703bff76f2ba51ea.frag", + "static/media/ink_shader.frag": "/apollon-3/static/media/ink_shader.84ad6b7397a34b52cc57.frag", "static/media/ink_data_shader.frag": "/apollon-3/static/media/ink_data_shader.24f0a81113228b1411af.frag", - "static/media/mix_shader.frag": "/apollon-3/static/media/mix_shader.dcef4763205dbdfb1519.frag", - "static/media/mix_data_shader.frag": "/apollon-3/static/media/mix_data_shader.73838f26b25ce85d76ae.frag", + "static/media/mix_shader.frag": "/apollon-3/static/media/mix_shader.b9ad274581af963626ed.frag", + "static/media/mix_data_shader.frag": "/apollon-3/static/media/mix_data_shader.4376ae1fe1e8e0d549d6.frag", "index.html": "/apollon-3/index.html", "static/media/vertex.vert": "/apollon-3/static/media/vertex.3647e2f99127a5dfc6f9.vert", "main.e6c13ad2.css.map": "/apollon-3/static/css/main.e6c13ad2.css.map", - "main.9289b7f4.js.map": "/apollon-3/static/js/main.9289b7f4.js.map", + "main.e51459e9.js.map": "/apollon-3/static/js/main.e51459e9.js.map", "453.5d81ad51.chunk.js.map": "/apollon-3/static/js/453.5d81ad51.chunk.js.map" }, "entrypoints": [ "static/css/main.e6c13ad2.css", - "static/js/main.9289b7f4.js" + "static/js/main.e51459e9.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 2864b1a..66672fe 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Apollon
\ No newline at end of file +Apollon
\ No newline at end of file diff --git a/static/js/main.9289b7f4.js b/static/js/main.e51459e9.js similarity index 77% rename from static/js/main.9289b7f4.js rename to static/js/main.e51459e9.js index 6863905..eb18dbe 100644 --- a/static/js/main.9289b7f4.js +++ b/static/js/main.e51459e9.js @@ -1,3 +1,3 @@ -/*! For license information please see main.9289b7f4.js.LICENSE.txt */ -(()=>{var __webpack_modules__={9529:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=9529,e.exports=t},5513:(t,r,n)=>{"use strict";n.d(r,{A:()=>oe});var i=function(){function t(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var r=t.prototype;return r.hydrate=function(e){e.forEach(this._insertTag)},r.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?d(w,--b):0,g--,10===_&&(g=1,y--),_}function T(){return _=b2||j(_)>3?"":" "}function R(e,t){for(;--t&&T()&&!(_<48||_>102||_>57&&_<65||_>70&&_<97););return C(e,k()+(t<6&&32==M()&&32==T()))}function D(e){for(;T();)switch(_){case e:return b;case 34:case 39:34!==e&&39!==e&&D(_);break;case 40:41===e&&D(e);break;case 92:T()}return b}function L(e,t){for(;T()&&e+_!==57&&(e+_!==84||47!==M()););return"/*"+C(t,b-1)+"*"+a(47===e?e:T())}function N(e){for(;!j(M());)T();return C(e,b)}var F="-ms-",U="-moz-",B="-webkit-",z="comm",V="rule",G="decl",W="@keyframes";function H(e,t){for(var r="",n=p(e),i=0;i0&&f(F)-g&&m(b>32?Q(F+";",n,r,g-1):Q(l(F," ","")+";",n,r,g-2),h);break;case 59:F+=";";default:if(m(D=K(F,t,r,p,y,i,u,j,O=[],A=[],g),o),123===C)if(0===y)X(F,t,D,D,O,o,g,u,A);else switch(99===v&&110===d(F,3)?100:v){case 100:case 108:case 109:case 115:X(e,D,D,n&&m(K(e,D,D,0,0,i,u,j,i,O=[],g),A),i,A,g,u,n?O:A);break;default:X(F,D,D,D,[""],A,0,u,A)}}p=y=b=0,w=S=1,j=F="",g=s;break;case 58:g=1+f(F),b=_;default:if(w<1)if(123==C)--w;else if(125==C&&0==w++&&125==E())continue;switch(F+=a(C),C*w){case 38:S=y>0?1:(F+="\f",-1);break;case 44:u[p++]=(f(F)-1)*S,S=1;break;case 64:45===M()&&(F+=P(T())),v=M(),y=g=f(j=F+=N(k())),C++;break;case 45:45===_&&2==f(F)&&(w=0)}}return o}function K(e,t,r,n,i,a,s,c,d,f,m){for(var y=i-1,g=0===i?a:[""],v=p(g),b=0,_=0,w=0;b0?g[S]+" "+E:l(E,/&\f/g,g[S])))&&(d[w++]=T);return x(e,t,r,0===i?V:c,d,f,m)}function $(e,t,r){return x(e,t,r,z,a(_),h(e,2,-2),0)}function Q(e,t,r,n){return x(e,t,r,G,h(e,0,n),h(e,n+1,-1),n)}var J=function(e,t,r){for(var n=0,i=0;n=i,i=M(),38===n&&12===i&&(t[r]=1),!j(i);)T();return C(e,b)},Z=function(e,t){return A(function(e,t){var r=-1,n=44;do{switch(j(n)){case 0:38===n&&12===M()&&(t[r]=1),e[r]+=J(b-1,t,r);break;case 2:e[r]+=P(n);break;case 4:if(44===n){e[++r]=58===M()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=a(n)}}while(n=T());return e}(O(e),t))},ee=new WeakMap,te=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ee.get(r))&&!n){ee.set(e,!0);for(var i=[],o=Z(t,i),a=r.props,s=0,u=0;s6)switch(d(e,t+1)){case 109:if(45!==d(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+B+"$2-$3$1"+U+(108==d(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?ne(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==d(e,t+1))break;case 6444:switch(d(e,f(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+B)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+B+(45===d(e,14)?"inline-":"")+"box$3$1"+B+"$2$3$1"+F+"$2box$3")+e}break;case 5936:switch(d(e,t+11)){case 114:return B+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return B+e+F+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return B+e+F+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return B+e+F+e+e}return e}var ie=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case G:e.return=ne(e.value,e.length);break;case W:return H([S(e,{value:l(e.value,"@","@"+B)})],n);case V:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return H([S(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return H([S(e,{props:[l(t,/:(plac\w+)/,":"+B+"input-$1")]}),S(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),S(e,{props:[l(t,/:(plac\w+)/,F+"input-$1")]})],n)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n=e.stylisPlugins||ie;var o,a,s={},u=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r{"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{A:()=>n})},5756:(e,t,r)=>{"use strict";r.d(t,{C:()=>s,T:()=>l,i:()=>o,w:()=>u});var n=r(5043),i=r(5513),o=(r(2830),r(9436),!0),a=n.createContext("undefined"!==typeof HTMLElement?(0,i.A)({key:"css"}):null);var s=a.Provider,u=function(e){return(0,n.forwardRef)((function(t,r){var i=(0,n.useContext)(a);return e(t,i,r)}))};o||(u=function(e){return function(t){var r=(0,n.useContext)(a);return null===r?(r=(0,i.A)({key:"css"}),n.createElement(a.Provider,{value:r},e(t,r))):e(t,r)}});var l=n.createContext({})},3290:(e,t,r)=>{"use strict";r.d(t,{AH:()=>l,i7:()=>c,mL:()=>u});var n=r(5756),i=r(5043),o=r(1722),a=r(9436),s=r(2830),u=(r(5513),r(219),(0,n.w)((function(e,t){var r=e.styles,u=(0,s.J)([r],void 0,i.useContext(n.T));if(!n.i){for(var l,c=u.name,d=u.styles,h=u.next;void 0!==h;)c+=" "+h.name,d+=h.styles,h=h.next;var f=!0===t.compat,p=t.insert("",{name:c,styles:d},t.sheet,f);return f?null:i.createElement("style",((l={})["data-emotion"]=t.key+"-global "+c,l.dangerouslySetInnerHTML={__html:p},l.nonce=t.sheet.nonce,l))}var m=i.useRef();return(0,a.i)((function(){var e=t.key+"-global",r=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),n=!1,i=document.querySelector('style[data-emotion="'+e+" "+u.name+'"]');return t.sheet.tags.length&&(r.before=t.sheet.tags[0]),null!==i&&(n=!0,i.setAttribute("data-emotion",e),r.hydrate([i])),m.current=[r,n],function(){r.flush()}}),[t]),(0,a.i)((function(){var e=m.current,r=e[0];if(e[1])e[1]=!1;else{if(void 0!==u.next&&(0,o.sk)(t,u.next,!0),r.tags.length){var n=r.tags[r.tags.length-1].nextElementSibling;r.before=n,r.flush()}t.insert("",u,r,!1)}}),[t,u.name]),null})));function l(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";r.d(t,{J:()=>p});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=r(918),o=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!==typeof e},l=(0,i.A)((function(e){return s(e)?e:e.replace(o,"-$&").toLowerCase()})),c=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(a,(function(e,t,r){return h={name:t,styles:r,next:h},t}))}return 1===n[e]||s(e)||"number"!==typeof t||0===t?t:t+"px"};function d(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return h={name:r.name,styles:r.styles,next:h},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)h={name:n.name,styles:n.styles,next:h},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:l,styles:i,next:h}}},9436:(e,t,r)=>{"use strict";var n;r.d(t,{i:()=>s,s:()=>a});var i=r(5043),o=!!(n||(n=r.t(i,2))).useInsertionEffect&&(n||(n=r.t(i,2))).useInsertionEffect,a=o||function(e){return e()},s=o||i.useLayoutEffect},1722:(e,t,r)=>{"use strict";r.d(t,{Rk:()=>n,SF:()=>i,sk:()=>o});function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var i=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},o=function(e,t,r){i(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}},869:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});r(5043);var n=r(3290),i=r(579);function o(e){const{styles:t,defaultTheme:r={}}=e,o="function"===typeof t?e=>{return t(void 0===(n=e)||null===n||0===Object.keys(n).length?r:e);var n}:t;return(0,i.jsx)(n.mL,{styles:o})}},3174:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalStyles:()=>S.A,StyledEngineProvider:()=>x,ThemeContext:()=>u.T,css:()=>v.AH,default:()=>E,internal_processStyles:()=>T,keyframes:()=>v.i7});var n=r(8168),i=r(5043),o=r(918),a=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(0,o.A)((function(e){return a.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),u=r(5756),l=r(1722),c=r(2830),d=r(9436),h=s,f=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?h:f},m=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},y=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,l.SF)(t,r,n),(0,d.s)((function(){return(0,l.sk)(t,r,n)})),null},g=function e(t,r){var o,a,s=t.__emotion_real===t,d=s&&t.__emotion_base||t;void 0!==r&&(o=r.label,a=r.target);var h=m(t,r,s),f=h||p(d),g=!f("as");return function(){var v=arguments,b=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&b.push("label:"+o+";"),null==v[0]||void 0===v[0].raw)b.push.apply(b,v);else{0,b.push(v[0][0]);for(var _=v.length,w=1;w<_;w++)b.push(v[w],v[0][w])}var x=(0,u.w)((function(e,t,r){var n=g&&e.as||d,o="",s=[],m=e;if(null==e.theme){for(var v in m={},e)m[v]=e[v];m.theme=i.useContext(u.T)}"string"===typeof e.className?o=(0,l.Rk)(t.registered,s,e.className):null!=e.className&&(o=e.className+" ");var _=(0,c.J)(b.concat(s),t.registered,m);o+=t.key+"-"+_.name,void 0!==a&&(o+=" "+a);var w=g&&void 0===h?p(n):f,x={};for(var S in e)g&&"as"===S||w(S)&&(x[S]=e[S]);return x.className=o,x.ref=r,i.createElement(i.Fragment,null,i.createElement(y,{cache:t,serialized:_,isStringTag:"string"===typeof n}),i.createElement(n,x))}));return x.displayName=void 0!==o?o:"Styled("+("string"===typeof d?d:d.displayName||d.name||"Component")+")",x.defaultProps=t.defaultProps,x.__emotion_real=x,x.__emotion_base=d,x.__emotion_styles=b,x.__emotion_forwardProp=h,Object.defineProperty(x,"toString",{value:function(){return"."+a}}),x.withComponent=function(t,i){return e(t,(0,n.A)({},r,i,{shouldForwardProp:m(x,i,!0)})).apply(void 0,b)},x}}.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){g[e]=g(e)}));var v=r(3290),b=r(5513),_=r(579);let w;function x(e){const{injectFirst:t,children:r}=e;return t&&w?(0,_.jsx)(u.C,{value:w,children:r}):r}"object"===typeof document&&(w=(0,b.A)({key:"css",prepend:!0}));var S=r(869);function E(e,t){return g(e,t)}const T=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},7266:(e,t,r)=>{"use strict";var n=r(4994);t.X4=f,t.e$=p,t.tL=y,t.eM=function(e,t){const r=h(e),n=h(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)},t.a=m;var i=n(r(7245)),o=n(r(5383));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,o.default)(e,t,r)}function s(e){e=e.slice(1);const t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map((e=>e+e))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", "),")"):""}function u(e){if(e.type)return e;if("#"===e.charAt(0))return u(s(e));const t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,i.default)(9,e));let n,o=e.substring(t+1,e.length-1);if("color"===r){if(o=o.split(" "),n=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error((0,i.default)(10,n))}else o=o.split(",");return o=o.map((e=>parseFloat(e))),{type:r,values:o,colorSpace:n}}const l=e=>{const t=u(e);return t.values.slice(0,3).map(((e,r)=>-1!==t.type.indexOf("hsl")&&0!==r?"".concat(e,"%"):e)).join(" ")};function c(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return-1!==t.indexOf("rgb")?n=n.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=-1!==t.indexOf("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(t,"(").concat(n,")")}function d(e){e=u(e);const{values:t}=e,r=t[0],n=t[1]/100,i=t[2]/100,o=n*Math.min(i,1-i),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),c({type:s,values:l})}function h(e){let t="hsl"===(e=u(e)).type||"hsla"===e.type?u(d(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function f(e,t){return e=u(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,c(e)}function p(e,t){if(e=u(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return c(e)}function m(e,t){if(e=u(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(-1!==e.type.indexOf("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return c(e)}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return h(e)>.5?p(e,t):m(e,t)}},8052:(e,t,r)=>{"use strict";var n=r(4994);t.Ay=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:r=m,rootShouldForwardProp:n=p,slotShouldForwardProp:u=p}=e,c=e=>(0,l.default)((0,i.default)({},e,{theme:g((0,i.default)({},e,{defaultTheme:r,themeId:t}))}));return c.__mui_systemSx=!0,function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:d,slot:f,skipVariantsResolver:m,skipSx:_,overridesResolver:w=v(y(f))}=l,x=(0,o.default)(l,h),S=void 0!==m?m:f&&"Root"!==f&&"root"!==f||!1,E=_||!1;let T=p;"Root"===f||"root"===f?T=n:f?T=u:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(T=void 0);const M=(0,a.default)(e,(0,i.default)({shouldForwardProp:T,label:undefined},x)),k=e=>"function"===typeof e&&e.__emotion_real!==e||(0,s.isPlainObject)(e)?n=>b(e,(0,i.default)({},n,{theme:g({theme:n.theme,defaultTheme:r,themeId:t})})):e,C=function(n){let o=k(n);for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u{const n=g((0,i.default)({},e,{defaultTheme:r,themeId:t}));if(!n.components||!n.components[d]||!n.components[d].styleOverrides)return null;const o=n.components[d].styleOverrides,a={};return Object.entries(o).forEach((t=>{let[r,o]=t;a[r]=b(o,(0,i.default)({},e,{theme:n}))})),w(e,a)})),d&&!S&&l.push((e=>{var n;const o=g((0,i.default)({},e,{defaultTheme:r,themeId:t}));return b({variants:null==o||null==(n=o.components)||null==(n=n[d])?void 0:n.variants},(0,i.default)({},e,{theme:o}))})),E||l.push(c);const h=l.length-s.length;if(Array.isArray(n)&&h>0){const e=new Array(h).fill("");o=[...n,...e],o.raw=[...n.raw,...e]}const f=M(o,...l);return e.muiName&&(f.muiName=e.muiName),f};return M.withConfig&&(C.withConfig=M.withConfig),C}};var i=n(r(4634)),o=n(r(4893)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(3174)),s=r(4534),u=(n(r(578)),n(r(2046)),n(r(4989))),l=n(r(3234));const c=["ownerState"],d=["variants"],h=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}function p(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const m=(0,u.default)(),y=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function g(e){let{defaultTheme:t,theme:r,themeId:n}=e;return i=r,0===Object.keys(i).length?t:r[n]||r;var i}function v(e){return e?(t,r)=>r[e]:null}function b(e,t){let{ownerState:r}=t,n=(0,o.default)(t,c);const a="function"===typeof e?e((0,i.default)({ownerState:r},n)):e;if(Array.isArray(a))return a.flatMap((e=>b(e,(0,i.default)({ownerState:r},n))));if(a&&"object"===typeof a&&Array.isArray(a.variants)){const{variants:e=[]}=a;let t=(0,o.default)(a,d);return e.forEach((e=>{let o=!0;"function"===typeof e.props?o=e.props((0,i.default)({ownerState:r},n,r)):Object.keys(e.props).forEach((t=>{(null==r?void 0:r[t])!==e.props[t]&&n[t]!==e.props[t]&&(o=!1)})),o&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,i.default)({ownerState:r},n,r)):e.style))})),t}return a}},9751:(e,t,r)=>{"use strict";r.d(t,{EU:()=>s,NI:()=>a,iZ:()=>l,kW:()=>c,vf:()=>u,zu:()=>i});var n=r(3216);const i={xs:0,sm:600,md:900,lg:1200,xl:1536},o={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(i[e],"px)")};function a(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||o;return t.reduce(((n,i,o)=>(n[e.up(e.keys[o])]=r(t[o]),n)),{})}if("object"===typeof t){const e=n.breakpoints||o;return Object.keys(t).reduce(((n,o)=>{if(-1!==Object.keys(e.values||i).indexOf(o)){n[e.up(o)]=r(t[o],o)}else{const e=o;n[e]=t[e]}return n}),{})}return r(t)}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;return(null==(t=e.keys)?void 0:t.reduce(((t,r)=>(t[e.up(r)]={},t)),{}))||{}}function u(e,t){return e.reduce(((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function l(e){const t=s(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o(0,n.A)(e,t)),{});return u(Object.keys(t),a)}function c(e){let{values:t,breakpoints:r,base:n}=e;const i=n||function(e,t){if("object"!==typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach(((t,n)=>{n{null!=e[t]&&(r[t]=!0)})),r}(t,r),o=Object.keys(i);if(0===o.length)return t;let a;return o.reduce(((e,r,n)=>(Array.isArray(t)?(e[r]=null!=t[n]?t[n]:t[a],a=n):"object"===typeof t?(e[r]=null!=t[r]?t[r]:t[a],a=r):e[r]=t,e)),{})}},9703:(e,t,r)=>{"use strict";function n(e,t){const r=this;if(r.vars&&"function"===typeof r.getColorSchemeSelector){const n=r.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[n]:t}}return r.palette.mode===e?t:{}}r.d(t,{A:()=>n})},4853:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(8587),i=r(8168);const o=["values","unit","step"],a=e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>(0,i.A)({},e,{[t.key]:t.val})),{})};function s(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:s=5}=e,u=(0,n.A)(e,o),l=a(t),c=Object.keys(l);function d(e){const n="number"===typeof t[e]?t[e]:e;return"@media (min-width:".concat(n).concat(r,")")}function h(e){const n="number"===typeof t[e]?t[e]:e;return"@media (max-width:".concat(n-s/100).concat(r,")")}function f(e,n){const i=c.indexOf(n);return"@media (min-width:".concat("number"===typeof t[e]?t[e]:e).concat(r,") and ")+"(max-width:".concat((-1!==i&&"number"===typeof t[c[i]]?t[c[i]]:n)-s/100).concat(r,")")}return(0,i.A)({keys:c,values:l,up:d,down:h,between:f,only:function(e){return c.indexOf(e)+1{"use strict";r.d(t,{A:()=>f});var n=r(8168),i=r(8587),o=r(3216),a=r(4853);const s={borderRadius:4};var u=r(8604);var l=r(8812),c=r(7758),d=r(9703);const h=["breakpoints","palette","spacing","shape"];const f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:r={},spacing:f,shape:p={}}=e,m=(0,i.A)(e,h),y=(0,a.A)(t),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=(0,u.LX)({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n{const r=t(e);return"number"===typeof r?"".concat(r,"px"):r})).join(" ")};return r.mui=!0,r}(f);let v=(0,o.A)({breakpoints:y,direction:"ltr",components:{},palette:(0,n.A)({mode:"light"},r),spacing:g,shape:(0,n.A)({},s,p)},m);v.applyStyles=d.A;for(var b=arguments.length,_=new Array(b>1?b-1:0),w=1;w(0,o.A)(e,t)),v),v.unstable_sxConfig=(0,n.A)({},c.A,null==m?void 0:m.unstable_sxConfig),v.unstable_sx=function(e){return(0,l.A)({sx:e,theme:this})},v}},4989:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,private_createBreakpoints:()=>i.A,unstable_applyStyles:()=>o.A});var n=r(8280),i=r(4853),o=r(9703)},3815:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(3216);const i=function(e,t){return t?(0,n.A)(e,t,{clone:!1}):e}},8604:(e,t,r)=>{"use strict";r.d(t,{LX:()=>p,MA:()=>f,_W:()=>m,Lc:()=>v,Ms:()=>b});var n=r(9751),i=r(7162),o=r(3815);const a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},u={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},l=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}((e=>{if(e.length>2){if(!u[e])return[e];e=u[e]}const[t,r]=e.split(""),n=a[t],i=s[r]||"";return Array.isArray(i)?i.map((e=>n+e)):[n+i]})),c=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[...c,...d];function f(e,t,r,n){var o;const a=null!=(o=(0,i.Yn)(e,t,!1))?o:r;return"number"===typeof a?e=>"string"===typeof e?e:a*e:Array.isArray(a)?e=>"string"===typeof e?e:a[e]:"function"===typeof a?a:()=>{}}function p(e){return f(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}function y(e,t,r,i){if(-1===t.indexOf(r))return null;const o=function(e,t){return r=>e.reduce(((e,n)=>(e[n]=m(t,r),e)),{})}(l(r),i),a=e[r];return(0,n.NI)(e,a,o)}function g(e,t){const r=p(e.theme);return Object.keys(e).map((n=>y(e,t,n,r))).reduce(o.A,{})}function v(e){return g(e,c)}function b(e){return g(e,d)}function _(e){return g(e,h)}v.propTypes={},v.filterProps=c,b.propTypes={},b.filterProps=d,_.propTypes={},_.filterProps=h},7162:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s,BO:()=>a,Yn:()=>o});var n=r(410),i=r(9751);function o(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r="vars.".concat(t).split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=r)return r}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function a(e,t,r){let n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||i:o(e,r)||i,t&&(n=t(n,i,e)),n}const s=function(e){const{prop:t,cssProperty:r=e.prop,themeKey:s,transform:u}=e,l=e=>{if(null==e[t])return null;const l=e[t],c=o(e.theme,s)||{};return(0,i.NI)(e,l,(e=>{let i=a(c,u,e);return e===i&&"string"===typeof e&&(i=a(c,u,"".concat(t).concat("default"===e?"":(0,n.A)(e)),e)),!1===r?i:{[r]:i}}))};return l.propTypes={},l.filterProps=[t],l}},7758:(e,t,r)=>{"use strict";r.d(t,{A:()=>R});var n=r(8604),i=r(7162),o=r(3815);const a=function(){for(var e=arguments.length,t=new Array(e),r=0;r(t.filterProps.forEach((r=>{e[r]=t})),e)),{}),i=e=>Object.keys(e).reduce(((t,r)=>n[r]?(0,o.A)(t,n[r](e)):t),{});return i.propTypes={},i.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),i};var s=r(9751);function u(e){return"number"!==typeof e?e:"".concat(e,"px solid")}function l(e,t){return(0,i.Ay)({prop:e,themeKey:"borders",transform:t})}const c=l("border",u),d=l("borderTop",u),h=l("borderRight",u),f=l("borderBottom",u),p=l("borderLeft",u),m=l("borderColor"),y=l("borderTopColor"),g=l("borderRightColor"),v=l("borderBottomColor"),b=l("borderLeftColor"),_=l("outline",u),w=l("outlineColor"),x=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=(0,n.MA)(e.theme,"shape.borderRadius",4,"borderRadius"),r=e=>({borderRadius:(0,n._W)(t,e)});return(0,s.NI)(e,e.borderRadius,r)}return null};x.propTypes={},x.filterProps=["borderRadius"];a(c,d,h,f,p,m,y,g,v,b,x,_,w);const S=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,n.MA)(e.theme,"spacing",8,"gap"),r=e=>({gap:(0,n._W)(t,e)});return(0,s.NI)(e,e.gap,r)}return null};S.propTypes={},S.filterProps=["gap"];const E=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,n.MA)(e.theme,"spacing",8,"columnGap"),r=e=>({columnGap:(0,n._W)(t,e)});return(0,s.NI)(e,e.columnGap,r)}return null};E.propTypes={},E.filterProps=["columnGap"];const T=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,n.MA)(e.theme,"spacing",8,"rowGap"),r=e=>({rowGap:(0,n._W)(t,e)});return(0,s.NI)(e,e.rowGap,r)}return null};T.propTypes={},T.filterProps=["rowGap"];a(S,E,T,(0,i.Ay)({prop:"gridColumn"}),(0,i.Ay)({prop:"gridRow"}),(0,i.Ay)({prop:"gridAutoFlow"}),(0,i.Ay)({prop:"gridAutoColumns"}),(0,i.Ay)({prop:"gridAutoRows"}),(0,i.Ay)({prop:"gridTemplateColumns"}),(0,i.Ay)({prop:"gridTemplateRows"}),(0,i.Ay)({prop:"gridTemplateAreas"}),(0,i.Ay)({prop:"gridArea"}));function M(e,t){return"grey"===t?t:e}a((0,i.Ay)({prop:"color",themeKey:"palette",transform:M}),(0,i.Ay)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:M}),(0,i.Ay)({prop:"backgroundColor",themeKey:"palette",transform:M}));function k(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}const C=(0,i.Ay)({prop:"width",transform:k}),j=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var r,n;const i=(null==(r=e.theme)||null==(r=r.breakpoints)||null==(r=r.values)?void 0:r[t])||s.zu[t];return i?"px"!==(null==(n=e.theme)||null==(n=n.breakpoints)?void 0:n.unit)?{maxWidth:"".concat(i).concat(e.theme.breakpoints.unit)}:{maxWidth:i}:{maxWidth:k(t)}};return(0,s.NI)(e,e.maxWidth,t)}return null};j.filterProps=["maxWidth"];const O=(0,i.Ay)({prop:"minWidth",transform:k}),A=(0,i.Ay)({prop:"height",transform:k}),P=(0,i.Ay)({prop:"maxHeight",transform:k}),I=(0,i.Ay)({prop:"minHeight",transform:k}),R=((0,i.Ay)({prop:"size",cssProperty:"width",transform:k}),(0,i.Ay)({prop:"size",cssProperty:"height",transform:k}),a(C,j,O,A,P,I,(0,i.Ay)({prop:"boxSizing"})),{border:{themeKey:"borders",transform:u},borderTop:{themeKey:"borders",transform:u},borderRight:{themeKey:"borders",transform:u},borderBottom:{themeKey:"borders",transform:u},borderLeft:{themeKey:"borders",transform:u},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:u},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:x},color:{themeKey:"palette",transform:M},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:M},backgroundColor:{themeKey:"palette",transform:M},p:{style:n.Ms},pt:{style:n.Ms},pr:{style:n.Ms},pb:{style:n.Ms},pl:{style:n.Ms},px:{style:n.Ms},py:{style:n.Ms},padding:{style:n.Ms},paddingTop:{style:n.Ms},paddingRight:{style:n.Ms},paddingBottom:{style:n.Ms},paddingLeft:{style:n.Ms},paddingX:{style:n.Ms},paddingY:{style:n.Ms},paddingInline:{style:n.Ms},paddingInlineStart:{style:n.Ms},paddingInlineEnd:{style:n.Ms},paddingBlock:{style:n.Ms},paddingBlockStart:{style:n.Ms},paddingBlockEnd:{style:n.Ms},m:{style:n.Lc},mt:{style:n.Lc},mr:{style:n.Lc},mb:{style:n.Lc},ml:{style:n.Lc},mx:{style:n.Lc},my:{style:n.Lc},margin:{style:n.Lc},marginTop:{style:n.Lc},marginRight:{style:n.Lc},marginBottom:{style:n.Lc},marginLeft:{style:n.Lc},marginX:{style:n.Lc},marginY:{style:n.Lc},marginInline:{style:n.Lc},marginInlineStart:{style:n.Lc},marginInlineEnd:{style:n.Lc},marginBlock:{style:n.Lc},marginBlockStart:{style:n.Lc},marginBlockEnd:{style:n.Lc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:S},rowGap:{style:T},columnGap:{style:E},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:k},maxWidth:{style:j},minWidth:{transform:k},height:{transform:k},maxHeight:{transform:k},minHeight:{transform:k},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}})},8698:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(8168),i=r(8587),o=r(3216),a=r(7758);const s=["sx"],u=e=>{var t,r;const n={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:a.A;return Object.keys(e).forEach((t=>{i[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]})),n};function l(e){const{sx:t}=e,r=(0,i.A)(e,s),{systemProps:a,otherProps:l}=u(r);let c;return c=Array.isArray(t)?[a,...t]:"function"===typeof t?function(){const e=t(...arguments);return(0,o.Q)(e)?(0,n.A)({},a,e):a}:(0,n.A)({},a,t),(0,n.A)({},l,{sx:c})}},3234:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,extendSxProp:()=>i.A,unstable_createStyleFunctionSx:()=>n.k,unstable_defaultSxConfig:()=>o.A});var n=r(8812),i=r(8698),o=r(7758)},8812:(e,t,r)=>{"use strict";r.d(t,{A:()=>c,k:()=>u});var n=r(410),i=r(3815),o=r(7162),a=r(9751),s=r(7758);function u(){function e(e,t,r,i){const s={[e]:t,theme:r},u=i[e];if(!u)return{[e]:t};const{cssProperty:l=e,themeKey:c,transform:d,style:h}=u;if(null==t)return null;if("typography"===c&&"inherit"===t)return{[e]:t};const f=(0,o.Yn)(r,c)||{};if(h)return h(s);return(0,a.NI)(s,t,(t=>{let r=(0,o.BO)(f,d,t);return t===r&&"string"===typeof t&&(r=(0,o.BO)(f,d,"".concat(e).concat("default"===t?"":(0,n.A)(t)),t)),!1===l?r:{[l]:r}}))}return function t(r){var n;const{sx:o,theme:u={}}=r||{};if(!o)return null;const l=null!=(n=u.unstable_sxConfig)?n:s.A;function c(r){let n=r;if("function"===typeof r)n=r(u);else if("object"!==typeof r)return r;if(!n)return null;const o=(0,a.EU)(u.breakpoints),s=Object.keys(o);let c=o;return Object.keys(n).forEach((r=>{const o=(s=n[r],d=u,"function"===typeof s?s(d):s);var s,d;if(null!==o&&void 0!==o)if("object"===typeof o)if(l[r])c=(0,i.A)(c,e(r,o,u,l));else{const e=(0,a.NI)({theme:u},o,(e=>({[r]:e})));!function(){for(var e=arguments.length,t=new Array(e),r=0;re.concat(Object.keys(t))),[]),i=new Set(n);return t.every((e=>i.size===Object.keys(e).length))}(e,o)?c=(0,i.A)(c,e):c[r]=t({sx:o,theme:u})}else c=(0,i.A)(c,e(r,o,u,l))})),(0,a.vf)(s,c)}return Array.isArray(o)?o.map(c):c(o)}}const l=u();l.filterProps=["sx"];const c=l},2374:(e,t,r)=>{"use strict";t.A=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(r(5043)),i=r(3174);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}t.A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=n.useContext(i.ThemeContext);return t&&(r=t,0!==Object.keys(r).length)?t:e;var r}},410:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(6632);function i(e){if("string"!==typeof e)throw new Error((0,n.A)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},578:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(410)},7040:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))}},5383:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(7040)},3216:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,Q:()=>i});var n=r(8168);function i(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function o(e){if(!i(e))return e;const t={};return Object.keys(e).forEach((r=>{t[r]=o(e[r])})),t}function a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const s=r.clone?(0,n.A)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((n=>{"__proto__"!==n&&(i(t[n])&&n in e&&i(e[n])?s[n]=a(e[n],t[n],r):r.clone?s[n]=i(t[n])?o(t[n]):t[n]:s[n]=t[n])})),s}},4534:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,isPlainObject:()=>n.Q});var n=r(3216)},6632:(e,t,r)=>{"use strict";function n(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rn})},7245:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(6632)},2046:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u,getFunctionName:()=>o});var n=r(2086);const i=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function o(e){const t="".concat(e).match(i);return t&&t[1]||""}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||o(e)||t}function s(e,t,r){const n=a(t);return e.displayName||(""!==n?"".concat(r,"(").concat(n,")"):r)}function u(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return a(e,"Component");if("object"===typeof e)switch(e.$$typeof){case n.ForwardRef:return s(e,e.render,"ForwardRef");case n.Memo:return s(e,e.type,"memo");default:return}}}},9291:(e,t,r)=>{parcelRequire=function(t,n,i,o){var a,s="function"==typeof parcelRequire&&parcelRequire;function u(e,i){if(!n[e]){if(!t[e]){var o="function"==typeof parcelRequire&&parcelRequire;if(!i&&o)return o(e,!0);if(s)return s(e,!0);if("string"==typeof e)return r(9529)(e);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}c.resolve=function(r){return t[e][1][r]||r},c.cache={};var l=n[e]=new u.Module(e);t[e][0].call(l.exports,c,l,l.exports,this)}return n[e].exports;function c(e){return u(c.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=t,u.cache=n,u.parent=s,u.register=function(e,r){t[e]=[function(e,t){t.exports=r},{}]};for(var l=0;l1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof u?Promise.resolve(r.value.v).then(l,c):d(o[0][2],r)}catch(n){d(o[0][3],n)}var r}function l(e){s("next",e)}function c(e){s("throw",e)}function d(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}},r.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=a(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},r.__await=u,r.__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},r.__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},r.__classPrivateFieldIn=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)},r.__classPrivateFieldSet=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},r.__createBinding=void 0,r.__decorate=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},r.__exportStar=function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)},r.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r.__generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function u(e){return this instanceof u?(this.v=e,this):new u(e)}r.__createBinding=o;var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}},{}],IMGL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isFunction=function(e){return"function"==typeof e}},{}],Le7P:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},{}],Ns3F:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UnsubscriptionError=void 0;var n=(0,e("./createErrorClass").createErrorClass)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));r.UnsubscriptionError=n},{"./createErrorClass":"Le7P"}],h9cX:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},{}],Atlq:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Subscription=r.EMPTY_SUBSCRIPTION=void 0,r.isSubscription=function(e){return e instanceof s||e&&"closed"in e&&(0,i.isFunction)(e.remove)&&(0,i.isFunction)(e.add)&&(0,i.isFunction)(e.unsubscribe)};var n=e("tslib"),i=e("./util/isFunction"),o=e("./util/UnsubscriptionError"),a=e("./util/arrRemove"),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,a,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.__values)(u),d=c.next();!d.done;d=c.next())d.value.remove(this)}catch(g){e={error:g}}finally{try{d&&!d.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this);var h=this.initialTeardown;if((0,i.isFunction)(h))try{h()}catch(v){s=v instanceof o.UnsubscriptionError?v.errors:[v]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var p=(0,n.__values)(f),m=p.next();!m.done;m=p.next()){var y=m.value;try{l(y)}catch(b){s=null!=s?s:[],b instanceof o.UnsubscriptionError?s=(0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(s)),(0,n.__read)(b.errors)):s.push(b)}}}catch(_){r={error:_}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}}if(s)throw new o.UnsubscriptionError(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,a.arrRemove)(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&(0,a.arrRemove)(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();r.Subscription=s;var u=s.EMPTY;function l(e){(0,i.isFunction)(e)?e():e.unsubscribe()}r.EMPTY_SUBSCRIPTION=u},{tslib:"vCxL","./util/isFunction":"IMGL","./util/UnsubscriptionError":"Ns3F","./util/arrRemove":"h9cX"}],nBrU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.config=void 0;r.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},{}],a7wS:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.timeoutProvider=void 0;var n=e("tslib"),i={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?o.EMPTY_SUBSCRIPTION:(this.currentObservers=null,i.push(e),new o.Subscription((function(){t.currentObservers=null,(0,s.arrRemove)(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.Observable);r.Subject=l;var c=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.__extends)(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:o.EMPTY_SUBSCRIPTION},t}(l);r.AnonymousSubject=c},{tslib:"vCxL","./Observable":"EkNV","./Subscription":"Atlq","./util/ObjectUnsubscribedError":"gdWq","./util/arrRemove":"h9cX","./util/errorContext":"X9Ul"}],dUFA:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BehaviorSubject=void 0;var n=e("tslib"),i=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(e("./Subject").Subject);r.BehaviorSubject=i},{tslib:"vCxL","./Subject":"BDW7"}],x2eE:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.dateTimestampProvider=void 0;var n={now:function(){return(n.delegate||Date).now()},delegate:void 0};r.dateTimestampProvider=n},{}],dbtS:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReplaySubject=void 0;var n=e("tslib"),i=e("./Subject"),o=e("./scheduler/dateTimestampProvider"),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=o.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,n.__extends)(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,a=r._timestampProvider,s=r._windowTime;n||(i.push(t),!o&&i.push(a.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=o.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var a=t.actions;null!=r&&(null===(i=a[a.length-1])||void 0===i?void 0:i.id)!==r&&(o.immediateProvider.clearImmediate(r),t._scheduled=void 0)},t}(i.AsyncAction);r.AsapAction=a},{tslib:"vCxL","./AsyncAction":"bN66","./immediateProvider":"CDhB"}],bUPD:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Scheduler=void 0;var n=e("./scheduler/dateTimestampProvider"),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();r.Scheduler=i},{"./scheduler/dateTimestampProvider":"x2eE"}],XfcJ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncScheduler=void 0;var n=e("tslib"),i=e("../Scheduler"),o=function(e){function t(t,r){void 0===r&&(r=i.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,n.__extends)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(i.Scheduler);r.AsyncScheduler=o},{tslib:"vCxL","../Scheduler":"bUPD"}],UZ9W:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AsapScheduler=void 0;var n=e("tslib"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.__extends)(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(e("./AsyncScheduler").AsyncScheduler);r.AsapScheduler=i},{tslib:"vCxL","./AsyncScheduler":"XfcJ"}],XpND:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.asapScheduler=r.asap=void 0;var n=e("./AsapAction"),i=new(e("./AsapScheduler").AsapScheduler)(n.AsapAction);r.asapScheduler=i;var o=i;r.asap=o},{"./AsapAction":"zI1V","./AsapScheduler":"UZ9W"}],WQPT:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.asyncScheduler=r.async=void 0;var n=e("./AsyncAction"),i=new(e("./AsyncScheduler").AsyncScheduler)(n.AsyncAction);r.asyncScheduler=i;var o=i;r.async=o},{"./AsyncAction":"bN66","./AsyncScheduler":"XfcJ"}],FPao:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QueueAction=void 0;var n=e("tslib"),i=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return(0,n.__extends)(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(e("./AsyncAction").AsyncAction);r.QueueAction=i},{tslib:"vCxL","./AsyncAction":"bN66"}],HDHt:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QueueScheduler=void 0;var n=e("tslib"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.__extends)(t,e),t}(e("./AsyncScheduler").AsyncScheduler);r.QueueScheduler=i},{tslib:"vCxL","./AsyncScheduler":"XfcJ"}],QfBT:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.queueScheduler=r.queue=void 0;var n=e("./QueueAction"),i=new(e("./QueueScheduler").QueueScheduler)(n.QueueAction);r.queueScheduler=i;var o=i;r.queue=o},{"./QueueAction":"FPao","./QueueScheduler":"HDHt"}],FePd:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AnimationFrameAction=void 0;var n=e("tslib"),i=e("./AsyncAction"),o=e("./animationFrameProvider"),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return(0,n.__extends)(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=o.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var a=t.actions;null!=r&&(null===(i=a[a.length-1])||void 0===i?void 0:i.id)!==r&&(o.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(i.AsyncAction);r.AnimationFrameAction=a},{tslib:"vCxL","./AsyncAction":"bN66","./animationFrameProvider":"CtkU"}],W7kg:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AnimationFrameScheduler=void 0;var n=e("tslib"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.__extends)(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(e("./AsyncScheduler").AsyncScheduler);r.AnimationFrameScheduler=i},{tslib:"vCxL","./AsyncScheduler":"XfcJ"}],lAIc:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.animationFrameScheduler=r.animationFrame=void 0;var n=e("./AnimationFrameAction"),i=new(e("./AnimationFrameScheduler").AnimationFrameScheduler)(n.AnimationFrameAction);r.animationFrameScheduler=i;var o=i;r.animationFrame=o},{"./AnimationFrameAction":"FePd","./AnimationFrameScheduler":"W7kg"}],dFvp:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.VirtualTimeScheduler=r.VirtualAction=void 0;var n=e("tslib"),i=e("./AsyncAction"),o=e("../Subscription"),a=function(e){function t(t,r){void 0===t&&(t=s),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return(0,n.__extends)(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(e("./AsyncScheduler").AsyncScheduler);r.VirtualTimeScheduler=a;var s=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return(0,n.__extends)(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return o.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(i.AsyncAction);r.VirtualAction=s},{tslib:"vCxL","./AsyncAction":"bN66","../Subscription":"Atlq","./AsyncScheduler":"XfcJ"}],qOvc:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.EMPTY=void 0,r.empty=function(e){return e?o(e):i};var n=e("../Observable"),i=new n.Observable((function(e){return e.complete()}));function o(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}r.EMPTY=i},{"../Observable":"EkNV"}],HI7M:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isScheduler=function(e){return e&&(0,n.isFunction)(e.schedule)};var n=e("./isFunction")},{"./isFunction":"IMGL"}],cFBb:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t},r.popResultSelector=function(e){return(0,n.isFunction)(o(e))?e.pop():void 0},r.popScheduler=function(e){return(0,i.isScheduler)(o(e))?e.pop():void 0};var n=e("./isFunction"),i=e("./isScheduler");function o(e){return e[e.length-1]}},{"./isFunction":"IMGL","./isScheduler":"HI7M"}],ztpI:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isArrayLike=void 0;r.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},{}],fAfA:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isPromise=function(e){return(0,n.isFunction)(null==e?void 0:e.then)};var n=e("./isFunction")},{"./isFunction":"IMGL"}],Q2vg:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isInteropObservable=function(e){return(0,i.isFunction)(e[n.observable])};var n=e("../symbol/observable"),i=e("./isFunction")},{"../symbol/observable":"ubx8","./isFunction":"IMGL"}],YLLt:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=function(e){return Symbol.asyncIterator&&(0,n.isFunction)(null==e?void 0:e[Symbol.asyncIterator])};var n=e("./isFunction")},{"./isFunction":"IMGL"}],R9ez:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},{}],fyC7:[function(e,t,r){"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(r,"__esModule",{value:!0}),r.getSymbolIterator=n,r.iterator=void 0;var i=n();r.iterator=i},{}],MKUL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isIterable=function(e){return(0,i.isFunction)(null==e?void 0:e[n.iterator])};var n=e("../symbol/iterator"),i=e("./isFunction")},{"../symbol/iterator":"fyC7","./isFunction":"IMGL"}],xfoE:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isReadableStreamLike=function(e){return(0,i.isFunction)(null==e?void 0:e.getReader)},r.readableStreamLikeToAsyncGenerator=function(e){return(0,n.__asyncGenerator)(this,arguments,(function(){var t,r,i;return(0,n.__generator)(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,(0,n.__await)(t.read())];case 3:return r=o.sent(),i=r.value,r.done?[4,(0,n.__await)(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,(0,n.__await)(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))};var n=e("tslib"),i=e("./isFunction")},{tslib:"vCxL","./isFunction":"IMGL"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(o){try{return n.call(null,e,0)}catch(o){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(o){try{return i.call(null,e)}catch(o){return i.call(this,e)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(o){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(o){i=s}}();var c,d=[],h=!1,f=-1;function p(){h&&c&&(h=!1,c.length?d=c.concat(d):f=-1,d.length&&m())}function m(){if(!h){var e=u(p);h=!0;for(var t=d.length;t;){for(c=d,d=[];++f1)for(var r=1;r0&&d(c)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&d(null!=s?"number"==typeof s?s:+s-m.now():c)}))};var n=e("../scheduler/async"),i=e("../util/isDate"),o=e("../util/lift"),a=e("../observable/innerFrom"),s=e("../util/createErrorClass"),u=e("./OperatorSubscriber"),l=e("../util/executeSchedule"),c=(0,s.createErrorClass)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function d(e){throw new c(e)}r.TimeoutError=c},{"../scheduler/async":"WQPT","../util/isDate":"NBBr","../util/lift":"gwDu","../observable/innerFrom":"pOze","../util/createErrorClass":"Le7P","./OperatorSubscriber":"qno3","../util/executeSchedule":"WVgR"}],N8Yl:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.map=function(e,t){return(0,n.operate)((function(r,n){var o=0;r.subscribe((0,i.createOperatorSubscriber)(n,(function(r){n.next(e.call(t,r,o++))})))}))};var n=e("../util/lift"),i=e("./OperatorSubscriber")},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],An60:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.mapOneOrManyArgs=function(e){return(0,i.map)((function(t){return a(e,t)}))};var n=e("tslib"),i=e("../operators/map"),o=Array.isArray;function a(e,t){return o(t)?e.apply(void 0,(0,n.__spreadArray)([],(0,n.__read)(t))):e(t)}},{tslib:"vCxL","../operators/map":"N8Yl"}],fHIw:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bindCallbackInternals=function e(t,r,c,d){if(c){if(!(0,i.isScheduler)(c))return function(){for(var n=[],i=0;i0){var e=void 0;try{e=(0,o.innerFrom)(i.shift())}catch(r){return void a()}var n=(0,s.createOperatorSubscriber)(t,void 0,u.noop,u.noop);e.subscribe(n),n.add(a)}else t.complete()};a()}))};var n=e("tslib"),i=e("../util/lift"),o=e("../observable/innerFrom"),a=e("../util/argsOrArgArray"),s=e("./OperatorSubscriber"),u=e("../util/noop")},{tslib:"vCxL","../util/lift":"gwDu","../observable/innerFrom":"pOze","../util/argsOrArgArray":"h72L","./OperatorSubscriber":"qno3","../util/noop":"hNvY"}],C1Ne:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.onErrorResumeNext=function(){for(var e=[],t=0;t=0?(0,c.executeSchedule)(r,f,d,p,!0):u=!0,d();var h=(0,a.createOperatorSubscriber)(r,(function(e){var t,r,i=o.slice();try{for(var a=(0,n.__values)(i),s=a.next();!s.done;s=a.next()){var u=s.value,c=u.buffer;c.push(e),m<=c.length&&l(u)}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==h||h.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(h)}))};var n=e("tslib"),i=e("../Subscription"),o=e("../util/lift"),a=e("./OperatorSubscriber"),s=e("../util/arrRemove"),u=e("../scheduler/async"),l=e("../util/args"),c=e("../util/executeSchedule")},{tslib:"vCxL","../Subscription":"Atlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/arrRemove":"h9cX","../scheduler/async":"WQPT","../util/args":"cFBb","../util/executeSchedule":"WVgR"}],sEzB:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bufferToggle=function(e,t){return(0,o.operate)((function(r,o){var c=[];(0,a.innerFrom)(e).subscribe((0,s.createOperatorSubscriber)(o,(function(e){var r=[];c.push(r);var n=new i.Subscription;n.add((0,a.innerFrom)(t(e)).subscribe((0,s.createOperatorSubscriber)(o,(function(){(0,l.arrRemove)(c,r),o.next(r),n.unsubscribe()}),u.noop)))}),u.noop)),r.subscribe((0,s.createOperatorSubscriber)(o,(function(e){var t,r;try{for(var i=(0,n.__values)(c),o=i.next();!o.done;o=i.next())o.value.push(e)}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;c.length>0;)o.next(c.shift());o.complete()})))}))};var n=e("tslib"),i=e("../Subscription"),o=e("../util/lift"),a=e("../observable/innerFrom"),s=e("./OperatorSubscriber"),u=e("../util/noop"),l=e("../util/arrRemove")},{tslib:"vCxL","../Subscription":"Atlq","../util/lift":"gwDu","../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3","../util/noop":"hNvY","../util/arrRemove":"h9cX"}],DhIa:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bufferWhen=function(e){return(0,n.operate)((function(t,r){var n=null,s=null,u=function(){null==s||s.unsubscribe();var t=n;n=[],t&&r.next(t),(0,a.innerFrom)(e()).subscribe(s=(0,o.createOperatorSubscriber)(r,u,i.noop))};u(),t.subscribe((0,o.createOperatorSubscriber)(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=s=null})))}))};var n=e("../util/lift"),i=e("../util/noop"),o=e("./OperatorSubscriber"),a=e("../observable/innerFrom")},{"../util/lift":"gwDu","../util/noop":"hNvY","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze"}],ZY8e:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.catchError=function e(t){return(0,o.operate)((function(r,o){var a,s=null,u=!1;s=r.subscribe((0,i.createOperatorSubscriber)(o,void 0,void 0,(function(i){a=(0,n.innerFrom)(t(i,e(t)(r))),s?(s.unsubscribe(),s=null,a.subscribe(o)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(o))}))};var n=e("../observable/innerFrom"),i=e("./OperatorSubscriber"),o=e("../util/lift")},{"../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3","../util/lift":"gwDu"}],oeFh:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.scanInternals=function(e,t,r,i,o){return function(a,s){var u=r,l=t,c=0;a.subscribe((0,n.createOperatorSubscriber)(s,(function(t){var r=c++;l=u?e(l,t,r):(u=!0,t),i&&s.next(l)}),o&&function(){u&&s.next(l),s.complete()}))}};var n=e("./OperatorSubscriber")},{"./OperatorSubscriber":"qno3"}],gTgQ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.reduce=function(e,t){return(0,i.operate)((0,n.scanInternals)(e,t,arguments.length>=2,!1,!0))};var n=e("./scanInternals"),i=e("../util/lift")},{"./scanInternals":"oeFh","../util/lift":"gwDu"}],Dse9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.toArray=function(){return(0,i.operate)((function(e,t){(0,n.reduce)(o,[])(e).subscribe(t)}))};var n=e("./reduce"),i=e("../util/lift"),o=function(e,t){return e.push(t),e}},{"./reduce":"gTgQ","../util/lift":"gwDu"}],oubL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.joinAllInternals=function(e,t){return(0,o.pipe)((0,s.toArray)(),(0,a.mergeMap)((function(t){return e(t)})),t?(0,i.mapOneOrManyArgs)(t):n.identity)};var n=e("../util/identity"),i=e("../util/mapOneOrManyArgs"),o=e("../util/pipe"),a=e("./mergeMap"),s=e("./toArray")},{"../util/identity":"FeLp","../util/mapOneOrManyArgs":"An60","../util/pipe":"eq9W","./mergeMap":"mGWE","./toArray":"Dse9"}],KhWj:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.combineLatestAll=function(e){return(0,i.joinAllInternals)(n.combineLatest,e)};var n=e("../observable/combineLatest"),i=e("./joinAllInternals")},{"../observable/combineLatest":"kXaL","./joinAllInternals":"oubL"}],bYSN:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.combineAll=void 0;var n=e("./combineLatestAll").combineLatestAll;r.combineAll=n},{"./combineLatestAll":"KhWj"}],xTmU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.combineLatest=function e(){for(var t=[],r=0;r=2;return function(u){return u.pipe((0,i.filter)((function(t,r){return r===e})),(0,s.take)(1),r?(0,a.defaultIfEmpty)(t):(0,o.throwIfEmpty)((function(){return new n.ArgumentOutOfRangeError})))}};var n=e("../util/ArgumentOutOfRangeError"),i=e("./filter"),o=e("./throwIfEmpty"),a=e("./defaultIfEmpty"),s=e("./take")},{"../util/ArgumentOutOfRangeError":"wL5X","./filter":"IFp1","./throwIfEmpty":"hR0o","./defaultIfEmpty":"Fah0","./take":"mmu8"}],w35o:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.endWith=function(){for(var e=[],t=0;t=2;return function(l){return l.pipe(e?(0,i.filter)((function(t,r){return e(t,r,l)})):u.identity,(0,o.take)(1),r?(0,a.defaultIfEmpty)(t):(0,s.throwIfEmpty)((function(){return new n.EmptyError})))}};var n=e("../util/EmptyError"),i=e("./filter"),o=e("./take"),a=e("./defaultIfEmpty"),s=e("./throwIfEmpty"),u=e("../util/identity")},{"../util/EmptyError":"wRNN","./filter":"IFp1","./take":"mmu8","./defaultIfEmpty":"Fah0","./throwIfEmpty":"hR0o","../util/identity":"FeLp"}],JSNM:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.groupBy=function(e,t,r,u){return(0,a.operate)((function(a,l){var c;t&&"function"!=typeof t?(r=t.duration,c=t.element,u=t.connector):c=t;var d=new Map,h=function(e){d.forEach(e),e(l)},f=function(e){return h((function(t){return t.error(e)}))},p=0,m=!1,y=new s.OperatorSubscriber(l,(function(t){try{var a=e(t),h=d.get(a);if(!h){d.set(a,h=u?u():new o.Subject);var g=(b=a,_=h,(w=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&m&&y.unsubscribe()}}))).key=b,w);if(l.next(g),r){var v=(0,s.createOperatorSubscriber)(h,(function(){h.complete(),null==v||v.unsubscribe()}),void 0,void 0,(function(){return d.delete(a)}));y.add((0,i.innerFrom)(r(g)).subscribe(v))}}h.next(c?c(t):t)}catch(x){f(x)}var b,_,w}),(function(){return h((function(e){return e.complete()}))}),f,(function(){return d.clear()}),(function(){return m=!0,0===p}));a.subscribe(y)}))};var n=e("../Observable"),i=e("../observable/innerFrom"),o=e("../Subject"),a=e("../util/lift"),s=e("./OperatorSubscriber")},{"../Observable":"EkNV","../observable/innerFrom":"pOze","../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],G3o6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isEmpty=function(){return(0,n.operate)((function(e,t){e.subscribe((0,i.createOperatorSubscriber)(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))};var n=e("../util/lift"),i=e("./OperatorSubscriber")},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],BkG9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.takeLast=function(e){return e<=0?function(){return i.EMPTY}:(0,o.operate)((function(t,r){var i=[];t.subscribe((0,a.createOperatorSubscriber)(r,(function(t){i.push(t),e=2;return function(l){return l.pipe(e?(0,i.filter)((function(t,r){return e(t,r,l)})):u.identity,(0,o.takeLast)(1),r?(0,s.defaultIfEmpty)(t):(0,a.throwIfEmpty)((function(){return new n.EmptyError})))}};var n=e("../util/EmptyError"),i=e("./filter"),o=e("./takeLast"),a=e("./throwIfEmpty"),s=e("./defaultIfEmpty"),u=e("../util/identity")},{"../util/EmptyError":"wRNN","./filter":"IFp1","./takeLast":"BkG9","./throwIfEmpty":"hR0o","./defaultIfEmpty":"Fah0","../util/identity":"FeLp"}],LGra:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.materialize=function(){return(0,i.operate)((function(e,t){e.subscribe((0,o.createOperatorSubscriber)(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))};var n=e("../Notification"),i=e("../util/lift"),o=e("./OperatorSubscriber")},{"../Notification":"swlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],wP5t:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.max=function(e){return(0,n.reduce)((0,i.isFunction)(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})};var n=e("./reduce"),i=e("../util/isFunction")},{"./reduce":"gTgQ","../util/isFunction":"IMGL"}],zBzv:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.flatMap=void 0;var n=e("./mergeMap").mergeMap;r.flatMap=n},{"./mergeMap":"mGWE"}],AZnr:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),(0,i.isFunction)(t)?(0,n.mergeMap)((function(){return e}),t,r):("number"==typeof t&&(r=t),(0,n.mergeMap)((function(){return e}),r))};var n=e("./mergeMap"),i=e("../util/isFunction")},{"./mergeMap":"mGWE","../util/isFunction":"IMGL"}],L3Pv:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),(0,n.operate)((function(n,o){var a=t;return(0,i.mergeInternals)(n,o,(function(t,r){return e(a,t,r)}),r,(function(e){a=e}),!1,void 0,(function(){return a=null}))}))};var n=e("../util/lift"),i=e("./mergeInternals")},{"../util/lift":"gwDu","./mergeInternals":"EAff"}],Jh4T:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.merge=function(){for(var e=[],t=0;t=2,!0))};var n=e("../util/lift"),i=e("./scanInternals")},{"../util/lift":"gwDu","./scanInternals":"oeFh"}],iZ1A:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),(0,n.operate)((function(r,n){var o={buffer:[],complete:!1},a={buffer:[],complete:!1},s=function(e){n.next(e),n.complete()},u=function(e,r){var o=(0,i.createOperatorSubscriber)(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?s(!1):e.buffer.push(n):!t(n,i.shift())&&s(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&s(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(u(o,a)),e.subscribe(u(a,o))}))};var n=e("../util/lift"),i=e("./OperatorSubscriber")},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],wd7X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new o.Subject}:t,n=e.resetOnError,l=void 0===n||n,c=e.resetOnComplete,d=void 0===c||c,h=e.resetOnRefCountZero,f=void 0===h||h;return function(e){var t,n,o,c=0,h=!1,p=!1,m=function(){null==n||n.unsubscribe(),n=void 0},y=function(){m(),t=o=void 0,h=p=!1},g=function(){var e=t;y(),null==e||e.unsubscribe()};return(0,s.operate)((function(e,s){c++,p||h||m();var v=o=null!=o?o:r();s.add((function(){0!==--c||p||h||(n=u(g,f))})),v.subscribe(s),!t&&c>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){p=!0,m(),n=u(y,l,e),v.error(e)},complete:function(){h=!0,m(),n=u(y,d),v.complete()}}),(0,i.innerFrom)(e).subscribe(t))}))(e)}};var n=e("tslib"),i=e("../observable/innerFrom"),o=e("../Subject"),a=e("../Subscriber"),s=e("../util/lift");function u(e,t){for(var r=[],i=2;i0?t:e;return(0,o.operate)((function(t,o){var s=[new i.Subject],u=0;o.next(s[0].asObservable()),t.subscribe((0,a.createOperatorSubscriber)(o,(function(t){var a,l;try{for(var c=(0,n.__values)(s),d=c.next();!d.done;d=c.next())d.value.next(t)}catch(p){a={error:p}}finally{try{d&&!d.done&&(l=c.return)&&l.call(c)}finally{if(a)throw a.error}}var h=u-e+1;if(h>=0&&h%r==0&&s.shift().complete(),++u%r==0){var f=new i.Subject;s.push(f),o.next(f.asObservable())}}),(function(){for(;s.length>0;)s.shift().complete();o.complete()}),(function(e){for(;s.length>0;)s.shift().error(e);o.error(e)}),(function(){s=null})))}))};var n=e("tslib"),i=e("../Subject"),o=e("../util/lift"),a=e("./OperatorSubscriber")},{tslib:"vCxL","../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],fQsK:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.windowTime=function(e){for(var t,r,d=[],h=1;h=0?(0,c.executeSchedule)(r,f,d,p,!0):a=!0,d();var h=function(e){return i.slice().forEach(e)},y=function(e){h((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe((0,s.createOperatorSubscriber)(r,(function(e){h((function(t){t.window.next(e),m<=++t.seen&&l(t)}))}),(function(){return y((function(e){return e.complete()}))}),(function(e){return y((function(t){return t.error(e)}))}))),function(){i=null}}))};var n=e("../Subject"),i=e("../scheduler/async"),o=e("../Subscription"),a=e("../util/lift"),s=e("./OperatorSubscriber"),u=e("../util/arrRemove"),l=e("../util/args"),c=e("../util/executeSchedule")},{"../Subject":"BDW7","../scheduler/async":"WQPT","../Subscription":"Atlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/arrRemove":"h9cX","../util/args":"cFBb","../util/executeSchedule":"WVgR"}],vmsA:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.windowToggle=function(e,t){return(0,a.operate)((function(r,a){var d=[],h=function(e){for(;01||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof u?Promise.resolve(r.value.v).then(l,c):d(o[0][2],r)}catch(n){d(o[0][3],n)}var r}function l(e){s("next",e)}function c(e){s("throw",e)}function d(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}},r.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=a(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}},r.__await=u,r.__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},r.__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},r.__classPrivateFieldIn=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)},r.__classPrivateFieldSet=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},r.__createBinding=void 0,r.__decorate=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},r.__esDecorate=function(e,t,r,n,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=n.kind,l="getter"===u?"get":"setter"===u?"set":"value",c=!t&&e?n.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),h=!1,f=r.length-1;f>=0;f--){var p={};for(var m in n)p[m]="access"===m?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var y=(0,r[f])("accessor"===u?{get:d.get,set:d.set}:d[l],p);if("accessor"===u){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(d.get=s),(s=a(y.set))&&(d.set=s),(s=a(y.init))&&i.push(s)}else(s=a(y))&&("field"===u?i.push(s):d[l]=s)}c&&Object.defineProperty(c,n.name,d),h=!0},r.__exportStar=function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)},r.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r.__generator=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]2,i=0;i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function u(e){return this instanceof u?(this.v=e,this):new u(e)}r.__createBinding=o;var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}},{}],KxmD:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,"__esModule",{value:!0}),r.Sha1=r.RANDOM_FACTOR=r.MAX_VALUE_MILLIS=r.FirebaseError=r.ErrorFactory=r.Deferred=r.CONSTANTS=void 0,r.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},r.assertionError=r.assert=void 0,r.async=function(e,t){return function(){for(var r=[],n=0;n0?r:void 0)},r.getGlobal=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("Unable to locate global object.")},r.getModularInstance=function(e){return e&&e._delegate?e._delegate:e},r.getUA=y,r.isAdmin=void 0,r.isBrowser=function(){return"object"==typeof self&&self.self===self},r.isBrowserExtension=function(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id},r.isElectron=function(){return y().indexOf("Electron/")>=0},r.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},r.isIE=function(){var e=y();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},r.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!=indexedDB},r.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(y())},r.isNode=g,r.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},r.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},r.isSafari=function(){return!g()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},r.isUWP=function(){return y().indexOf("MSAppHost/")>=0},r.issuedAtTime=r.isValidTimestamp=r.isValidFormat=void 0,r.jsonEval=w,r.map=function(e,t,r){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=t.call(r,e[i],i,e));return n},r.ordinal=function(e){return Number.isFinite(e)?e+function(e){var t=(e=Math.abs(e))%100;if(t>=10&&t<=20)return"th";var r=e%10;return 1===r?"st":2===r?"nd":3===r?"rd":"th"}(e):""+e},r.querystring=function(e){for(var t=[],r=function(e,r){Array.isArray(r)?r.forEach((function(r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))})):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))},n=0,i=Object.entries(e);n>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return t},l={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 r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[],i=0;i>2,d=(3&o)<<4|s>>4,h=(15&s)<<2|l>>6,f=63&l;u||(f=64,a||(h=64)),n.push(r[c],r[d],r[h],r[f])}return n.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(u(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],r=0,n=0;r191&&i<224){var o=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[r++]))<<12|(63&(s=e[r++]))<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(a>>10)),t[n++]=String.fromCharCode(56320+(1023&a))}else{o=e[r++];var s=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[],i=0;i>4;if(n.push(l),64!==s){var c=a<<4&240|s>>2;if(n.push(c),64!==u){var d=s<<6&192|u;n.push(d)}}}return n},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};r.base64=l;var c=function(e){var t=u(e);return l.encodeByteArray(t,!0)};r.base64Encode=c;var d=function(e){return c(e).replace(/\./g,"")};r.base64urlEncodeWithoutPadding=d;var h=function(e){try{return l.decodeString(e,!0)}catch(i){console.error("base64Decode failed: ",i)}return null};function f(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r in t)t.hasOwnProperty(r)&&p(r)&&(e[r]=f(e[r],t[r]));return e}function p(e){return"__proto__"!==e}r.base64Decode=h;var m=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,r){e.resolve=t,e.reject=r}))}return e.prototype.wrapCallback=function(e){var t=this;return function(r,n){r?t.reject(r):t.resolve(n),"function"==typeof e&&(t.promise.catch((function(){})),1===e.length?e(r):e(r,n))}},e}();function y(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function g(){try{return"[object process]"===Object.prototype.toString.call(n.process)}catch(i){return!1}}r.Deferred=m;var v=function(e){function t(r,n,i){var o=e.call(this,n)||this;return o.code=r,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,b.prototype.create),o}return(0,i.__extends)(t,e),t}(Error);r.FirebaseError=v;var b=function(){function e(e,t,r){this.service=e,this.serviceName=t,this.errors=r}return e.prototype.create=function(e){for(var t=[],r=1;r"}))}(o,n):"Error",s=this.serviceName+": "+a+" ("+i+").";return new v(i,s,n)},e}();r.ErrorFactory=b;var _=/\{\$([^}]+)}/g;function w(e){return JSON.parse(e)}var x=function(e){var t={},r={},n={},i="";try{var o=e.split(".");t=w(h(o[0])||""),r=w(h(o[1])||""),i=o[2],n=r.d||{},delete r.d}catch(a){}return{header:t,claims:r,data:n,signature:i}};r.decode=x;r.isValidTimestamp=function(e){var t=x(e).claims,r=Math.floor((new Date).getTime()/1e3),n=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),i=t.hasOwnProperty("exp")?t.exp:n+86400),!!r&&!!n&&!!i&&r>=n&&r<=i};r.issuedAtTime=function(e){var t=x(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null};r.isValidFormat=function(e){var t=x(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")};function S(e){return null!==e&&"object"==typeof e}r.isAdmin=function(e){var t=x(e).claims;return"object"==typeof t&&!0===t.admin};var E=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],l=this.chain_[2],c=this.chain_[3],d=this.chain_[4];for(n=0;n<80;n++)n<40?n<20?(o=c^u&(l^c),a=1518500249):(o=u^l^c,a=1859775393):n<60?(o=u&l|c&(u|l),a=2400959708):(o=u^l^c,a=3395469782),i=(s<<5|s>>>27)+o+d+a+r[n]&4294967295,d=c,c=l,l=4294967295&(u<<30|u>>>2),u=s,s=i;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+l&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+d&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var r=t-this.blockSize,n=0,i=this.buf_,o=this.inbuf_;n=56;r--)this.buf_[r]=255&t,t/=256;this.compress_(this.buf_);var n=0;for(r=0;r<5;r++)for(var i=24;i>=0;i-=8)e[n]=this.chain_[r]>>i&255,++n;return e},e}();r.Sha1=E;var T=function(){function e(e,t){var r=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(r)})).catch((function(e){r.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,r){var n,i=this;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");void 0===(n=function(e,t){if("object"!=typeof e||null===e)return!1;for(var r=0,n=t;rr&&(i=0===r?"none":"no more than "+r),i)throw new Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+i+".")};r.stringToByteArray=function(e){for(var t=[],r=0,n=0;n=55296&&i<=56319){var o=i-55296;a(++n>6|192,t[r++]=63&i|128):i<65536?(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return t};r.stringLength=function(e){for(var t=0,r=0;r=55296&&n<=56319?(t+=4,r++):t+=3}return t};var C=1e3,j=2,O=144e5;r.MAX_VALUE_MILLIS=O;var A=.5;r.RANDOM_FACTOR=A},{tslib:"f2sD"}],sLOu:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Provider=r.ComponentContainer=r.Component=void 0;var n=e("tslib"),i=e("@firebase/util"),o=function(){function e(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},e}();r.Component=o;var a="[DEFAULT]",s=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return e.prototype.get=function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var r=new i.Deferred;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{var n=this.getOrInitializeService({instanceIdentifier:t});n&&r.resolve(n)}catch(u){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t,r=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(r)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(n)return null;throw s}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,r;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:a})}catch(h){}try{for(var i=(0,n.__values)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=(0,n.__read)(o.value,2),u=s[0],l=s[1],c=this.normalizeInstanceIdentifier(u);try{var d=this.getOrInitializeService({instanceIdentifier:c});l.resolve(d)}catch(h){}}}catch(f){t={error:f}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}},e.prototype.clearInstance=function(e){void 0===e&&(e=a),this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return(0,n.__awaiter)(this,void 0,void 0,(function(){var e;return(0,n.__generator)(this,(function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all((0,n.__spreadArray)((0,n.__spreadArray)([],(0,n.__read)(e.filter((function(e){return"INTERNAL"in e})).map((function(e){return e.INTERNAL.delete()})))),(0,n.__read)(e.filter((function(e){return"_delete"in e})).map((function(e){return e._delete()})))))];case 1:return t.sent(),[2]}}))}))},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.isInitialized=function(e){return void 0===e&&(e=a),this.instances.has(e)},e.prototype.getOptions=function(e){return void 0===e&&(e=a),this.instancesOptions.get(e)||{}},e.prototype.initialize=function(e){var t,r;void 0===e&&(e={});var i=e.options,o=void 0===i?{}:i,a=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(a))throw Error(this.name+"("+a+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var s=this.getOrInitializeService({instanceIdentifier:a,options:o});try{for(var u=(0,n.__values)(this.instancesDeferred.entries()),l=u.next();!l.done;l=u.next()){var c=(0,n.__read)(l.value,2),d=c[0],h=c[1];a===this.normalizeInstanceIdentifier(d)&&h.resolve(s)}}catch(f){t={error:f}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return s},e.prototype.onInit=function(e,t){var r,n=this.normalizeInstanceIdentifier(t),i=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;i.add(e),this.onInitCallbacks.set(n,i);var o=this.instances.get(n);return o&&e(o,n),function(){i.delete(e)}},e.prototype.invokeOnInitCallbacks=function(e,t){var r,i,o=this.onInitCallbacks.get(t);if(o)try{for(var a=(0,n.__values)(o),s=a.next();!s.done;s=a.next()){var u=s.value;try{u(e,t)}catch(l){}}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.getOrInitializeService=function(e){var t=e.instanceIdentifier,r=e.options,n=void 0===r?{}:r,i=this.instances.get(t);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:u(t),options:n}),this.instances.set(t,i),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(i,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,i)}catch(o){}return i||null},e.prototype.normalizeInstanceIdentifier=function(e){return void 0===e&&(e=a),this.component?this.component.multipleInstances?e:a:e},e.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},e}();function u(e){return e===a?void 0:e}r.Provider=s;var l=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new s(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();r.ComponentContainer=l},{tslib:"f2sD","@firebase/util":"KxmD"}],TUpU:[function(e,t,r){"use strict";function n(){for(var e=0,t=0,r=arguments.length;t=(null!=n?n:t.logLevel)&&e({level:o[r].toLowerCase(),message:s,args:i,type:t.name})}},n=0,i=a;n=0&&p.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var _=g.initializeApp;g.initializeApp=function(){for(var e=[],t=0;tr?n.push(e.substring(i,r)):n.push(e.substring(i,i+t));return n};function F(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])}var U=function(e){var t,r,n,i,o;(0,a.assert)(!O(e),"Invalid JSON number"),0===e?(r=0,n=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(r=(i=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,n=Math.round(e*Math.pow(2,52-i)-Math.pow(2,52))):(r=0,n=Math.round(e/Math.pow(2,-1074))));var s=[];for(o=52;o;o-=1)s.push(n%2?1:0),n=Math.floor(n/2);for(o=11;o;o-=1)s.push(r%2?1:0),r=Math.floor(r/2);s.push(t?1:0),s.reverse();var u=s.join(""),l="";for(o=0;o<64;o+=8){var c=parseInt(u.substr(o,8),2).toString(16);1===c.length&&(c="0"+c),l+=c}return l.toLowerCase()};var B=new RegExp("^-?(0*)\\d{1,10}$"),z=-2147483648,V=2147483647,G=function(e){if(B.test(e)){var t=Number(e);if(t>=z&&t<=V)return t}return null},W=function(e){try{e()}catch(i){setTimeout((function(){var t=i.stack||"";throw j("Exception was thrown by user callback.",t),i}),Math.floor(0))}},H=function(e,t){var r=setTimeout(e,t);return"object"==typeof r&&r.unref&&r.unref(),r},q=function(){function e(e,t){var r=this;this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then((function(e){return r.appCheck=e}))}return e.prototype.getToken=function(e){var t=this;return this.appCheck?this.appCheck.getToken(e):new Promise((function(r,n){setTimeout((function(){t.appCheck?t.getToken(e).then(r,n):r(null)}),0)}))},e.prototype.addTokenChangeListener=function(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then((function(t){return t.addTokenListener(e)}))},e.prototype.notifyForInvalidToken=function(){j('Provided AppCheck credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly.')},e}(),Y=function(){function e(e,t,r){var n=this;this.appName_=e,this.firebaseOptions_=t,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit((function(e){return n.auth_=e}))}return e.prototype.getToken=function(e){var t=this;return this.auth_?this.auth_.getToken(e).catch((function(e){return e&&"auth/token-not-initialized"===e.code?(T("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})):new Promise((function(r,n){setTimeout((function(){t.auth_?t.getToken(e).then(r,n):r(null)}),0)}))},e.prototype.addTokenChangeListener=function(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then((function(t){return t.addAuthTokenListener(e)}))},e.prototype.removeTokenChangeListener=function(e){this.authProvider_.get().then((function(t){return t.removeAuthTokenListener(e)}))},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',j(e)},e}(),X=function(){function e(e){this.accessToken=e}return e.prototype.getToken=function(e){return Promise.resolve({accessToken:this.accessToken})},e.prototype.addTokenChangeListener=function(e){e(this.accessToken)},e.prototype.removeTokenChangeListener=function(e){},e.prototype.notifyForInvalidToken=function(){},e.OWNER="owner",e}(),K="5",$=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Q="ac",J="websocket",Z="long_polling",ee=function(){function e(e,t,r,n,i,o,a){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===a&&(a=!1),this.secure=t,this.namespace=r,this.webSocketOnly=n,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=y.get("host:"+e)||this._host}return e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain},Object.defineProperty(e.prototype,"host",{get:function(){return this._host},set:function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&y.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){var e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+e+this.host+"/"+t},e}();function te(e,t,r){var n;if((0,a.assert)("string"==typeof t,"typeof type must == string"),(0,a.assert)("object"==typeof r,"typeof params must == object"),t===J)n=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==Z)throw new Error("Unknown connection type: "+t);n=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(r.ns=e.namespace);var i=[];return F(r,(function(e,t){i.push(e+"="+t)})),n+i.join("&")}var re=function(){function e(){this.counters_={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),(0,a.contains)(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t},e.prototype.get=function(){return(0,a.deepCopy)(this.counters_)},e}(),ne={},ie={};function oe(e){var t=e.toString();return ne[t]||(ne[t]=new re),ne[t]}var ae=function(){function e(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponsedocument.domain="'+document.domain+'";<\/script>');var s=""+o+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(c){T("frame writing exception"),c.stack&&T(c.stack),T(c)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||T("No IE domain setting required")}catch(o){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var e=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)}),Math.floor(0)));var t=this.onDisconnect;t&&(this.onDisconnect=null,t())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;for(var t=this.urlFn(e),r="",n=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+r.length<=1870;){var i=this.pendingSegs.shift();r=r+"&seg"+n+"="+i.seg+"&ts"+n+"="+i.ts+"&d"+n+"="+i.d,n++}return t+=r,this.addLongPollTag_(t,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,r){this.pendingSegs.push({seg:e,ts:t,d:r}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var r=this;this.outstandingRequests.add(t);var n=function(){r.outstandingRequests.delete(t),r.newRequest_()},i=setTimeout(n,Math.floor(25e3));this.addTag(e,(function(){clearTimeout(i),n()}))},e.prototype.addTag=function(e,t){var r=this;(0,a.isNodeSdk)()?this.doNodeLongPoll(e,t):setTimeout((function(){try{if(!r.sendNewPolls)return;var n=r.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){var e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=function(){T("Long-poll script failed to load: "+e),r.sendNewPolls=!1,r.close()},r.myIFrame.doc.body.appendChild(n)}catch(s){}}),Math.floor(1))},e}(),ce=null;"undefined"!=typeof MozWebSocket?ce=MozWebSocket:"undefined"!=typeof WebSocket&&(ce=WebSocket);var de=function(){function e(t,r,n,i,o,a,s){this.connId=t,this.applicationId=n,this.appCheckToken=i,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=M(this.connId),this.stats_=oe(r),this.connURL=e.connectionURL_(r,a,s,i),this.nodeAdmin=r.nodeAdmin}return e.connectionURL_=function(e,t,r,n){var i={};return i.v=K,!(0,a.isNodeSdk)()&&"undefined"!=typeof location&&location.hostname&&$.test(location.hostname)&&(i.r="f"),t&&(i.s=t),r&&(i.ls=r),n&&(i[Q]=n),te(e,J,i)},e.prototype.open=function(e,t){var r=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,y.set("previous_websocket_failure",!0);try{if((0,a.isNodeSdk)()){var i=this.nodeAdmin?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+d+"/"+n.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}};this.authToken&&(o.headers.Authorization="Bearer "+this.authToken),this.appCheckToken&&(o.headers["X-Firebase-AppCheck"]=this.appCheckToken);var s=n.env,u=0===this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;u&&(o.proxy={origin:u}),this.mySock=new ce(this.connURL,[],o)}else o={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}},this.mySock=new ce(this.connURL,[],o)}catch(f){this.log_("Error instantiating WebSocket.");var l=f.message||f.data;return l&&this.log_(l),void this.onClosed_()}this.mySock.onopen=function(){r.log_("Websocket connected."),r.everConnected_=!0},this.mySock.onclose=function(){r.log_("Websocket connection was disconnected."),r.mySock=null,r.onClosed_()},this.mySock.onmessage=function(e){r.handleIncomingFrame(e)},this.mySock.onerror=function(e){r.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&r.log_(t),r.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var r=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);r&&r.length>1&&parseFloat(r[1])<4.4&&(t=!0)}return!t&&null!==ce&&!e.forceDisallow_},e.previouslyFailed=function(){return y.isInMemoryStorage||!0===y.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){y.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var t=this.frames.join("");this.frames=null;var r=(0,a.jsonEval)(t);this.onMessage(r)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if((0,a.assert)(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var r=this.extractFrameCount_(t);null!==r&&this.appendFrame_(r)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=(0,a.stringify)(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var r=N(t,16384);r.length>1&&this.sendString_(String(r.length));for(var n=0;n0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),fe=function(){function e(e,t,r,n,i,o,a,s,u,l){this.id=e,this.repoInfo_=t,this.applicationId_=r,this.appCheckToken_=n,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=u,this.lastSessionId=l,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=M("c:"+this.id+":"),this.transportManager_=new he(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var r=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){e.conn_&&e.conn_.open(r,n)}),Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=H((function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))}),Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(r){e===t.conn_?t.onConnectionLost_(r):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(r){2!==t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(r):e===t.secondaryConn_?t.onSecondaryMessageReceived_(r):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=D("t",e),r=D("d",e);if("c"===t)this.onSecondaryControl_(r);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(r)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=D("t",e),r=D("d",e);"c"===t?this.onControl_(r):"d"===t&&this.onDataMessage_(r)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=D("t",e);if("d"in e){var r=e.d;if("h"===t)this.onHandshake_(r);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var n=0;n0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],r=1;r0&&(this.pieces_[r]=this.pieces_[n],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function xe(e){return e.pieces_.length-e.pieceNum_}function Se(e){var t=e.pieceNum_;return t=e.pieces_.length)return null;for(var t=[],r=e.pieceNum_;r0&&r.push(i[n])}return new be(r,0)}function Ce(e){return e.pieceNum_>=e.pieces_.length}function je(e,t){var r=we(e),n=we(t);if(null===r)return t;if(r===n)return je(Se(e),Se(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function Oe(e,t){for(var r=Te(e,0),n=Te(t,0),i=0;ixe(t))return!1;for(;rve)throw new Error(e.errorPrefix_+"has a key path longer than "+ve+" bytes ("+e.byteLength_+").");if(e.parts_.length>ge)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+ge+") or object contains a cycle "+De(e))}function De(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}var Le,Ne,Fe=function(e){function t(){var t,r,n=e.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(r="visibilitychange",t="hidden"):void 0!==document.mozHidden?(r="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(r="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(r="webkitvisibilitychange",t="webkitHidden")),n.visible_=!0,r&&document.addEventListener(r,(function(){var e=!document[t];e!==n.visible_&&(n.visible_=e,n.trigger("visible",e))}),!1),n}return(0,s.__extends)(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return(0,a.assert)("visible"===e,"Unknown event type: "+e),[this.visible_]},t}(me),Ue=1e3,Be=function(e){function t(r,n,i,o,s,u,l,c){var d=e.call(this)||this;if(d.repoInfo_=r,d.applicationId_=n,d.onDataUpdate_=i,d.onConnectStatus_=o,d.onServerInfoUpdate_=s,d.authTokenProvider_=u,d.appCheckTokenProvider_=l,d.authOverride_=c,d.id=t.nextPersistentConnectionId_++,d.log_=M("p:"+d.id+":"),d.interruptReasons_={},d.listens=new Map,d.outstandingPuts_=[],d.outstandingGets_=[],d.outstandingPutCount_=0,d.outstandingGetCount_=0,d.onDisconnectRequestQueue_=[],d.connected_=!1,d.reconnectDelay_=Ue,d.maxReconnectDelay_=3e5,d.securityDebugCallback_=null,d.lastSessionId=null,d.establishConnectionTimer_=null,d.visible_=!1,d.requestCBHash_={},d.requestNumber_=0,d.realtime_=null,d.authToken_=null,d.appCheckToken_=null,d.forceTokenRefresh_=!1,d.invalidAuthTokenCount_=0,d.invalidAppCheckTokenCount_=0,d.firstConnection_=!0,d.lastConnectionAttemptTime_=null,d.lastConnectionEstablishedTime_=null,c&&!(0,a.isNodeSdk)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return Fe.getInstance().on("visible",d.onVisible_,d),-1===r.host.indexOf("fblocal")&&ye.getInstance().on("online",d.onOnline_,d),d}return(0,s.__extends)(t,e),t.prototype.sendRequest=function(e,t,r){var n=++this.requestNumber_,i={r:n,a:e,b:t};this.log_((0,a.stringify)(i)),(0,a.assert)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),r&&(this.requestCBHash_[n]=r)},t.prototype.get=function(e){var t=this;this.initConnection_();var r=new a.Deferred,n={p:e._path.toString(),q:e._queryObject},i={action:"g",request:n,onComplete:function(e){var i=e.d;"ok"===e.s?(t.onDataUpdate_(n.p,i,!1,null),r.resolve(i)):r.reject(i)}};this.outstandingGets_.push(i),this.outstandingGetCount_++;var o=this.outstandingGets_.length-1;return this.connected_||setTimeout((function(){var e=t.outstandingGets_[o];void 0!==e&&i===e&&(delete t.outstandingGets_[o],t.outstandingGetCount_--,0===t.outstandingGetCount_&&(t.outstandingGets_=[]),t.log_("get "+o+" timed out on connection"),r.reject(new Error("Client is offline.")))}),3e3),this.connected_&&this.sendGet_(o),r.promise},t.prototype.listen=function(e,t,r,n){this.initConnection_();var i=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),(0,a.assert)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),(0,a.assert)(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");var s={onComplete:n,hashFn:t,query:e,tag:r};this.listens.get(o).set(i,s),this.connected_&&this.sendListen_(s)},t.prototype.sendGet_=function(e){var t=this,r=this.outstandingGets_[e];this.sendRequest("g",r.request,(function(n){delete t.outstandingGets_[e],t.outstandingGetCount_--,0===t.outstandingGetCount_&&(t.outstandingGets_=[]),r.onComplete&&r.onComplete(n)}))},t.prototype.sendListen_=function(e){var r=this,n=e.query,i=n._path.toString(),o=n._queryIdentifier;this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=n._queryObject,a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,u=a.s;t.warnOnListenWarnings_(s,n),(r.listens.get(i)&&r.listens.get(i).get(o))===e&&(r.log_("listen response",a),"ok"!==u&&r.removeListen_(i,o),e.onComplete&&e.onComplete(u,s))}))},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&(0,a.contains)(e,"w")){var r=(0,a.safeGet)(e,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){var n='".indexOn": "'+t._queryParams.getIndex().toString()+'"',i=t._path.toString();j("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+n+" at "+i+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||(0,a.isAdmin)(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.refreshAppCheckToken=function(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(function(){}))},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,r=(0,a.isValidFormat)(t)?"auth":"gauth",n={cred:t};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(r,n,(function(r){var n=r.s,i=r.d||"error";e.authToken_===t&&("ok"===n?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(n,i))}))}},t.prototype.tryAppCheck=function(){var e=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(function(t){var r=t.s,n=t.d||"error";"ok"===r?e.invalidAppCheckTokenCount_=0:e.onAppCheckRevoked_(r,n)}))},t.prototype.unlisten=function(e,t){var r=e._path.toString(),n=e._queryIdentifier;this.log_("Unlisten called for "+r+" "+n),(0,a.assert)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(r,n)&&this.connected_&&this.sendUnlisten_(r,n,e._queryObject,t)},t.prototype.sendUnlisten_=function(e,t,r,n){this.log_("Unlisten on "+e+" for "+t);var i={p:e};n&&(i.q=r,i.t=n),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:r})},t.prototype.onDisconnectMerge=function(e,t,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:r})},t.prototype.onDisconnectCancel=function(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,r,n){var i={p:t,d:r};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,(function(e){n&&setTimeout((function(){n(e.s,e.d)}),Math.floor(0))}))},t.prototype.put=function(e,t,r,n){this.putInternal("p",e,t,r,n)},t.prototype.merge=function(e,t,r,n){this.putInternal("m",e,t,r,n)},t.prototype.putInternal=function(e,t,r,n,i){this.initConnection_();var o={p:t,d:r};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:n}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,r=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(r,n,(function(n){t.log_(r+" response",n),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(n.s,n.d)}))},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var r={c:e};this.log_("reportStats",r),this.sendRequest("s",r,(function(e){if("ok"!==e.s){var r=e.d;t.log_("reportStats","Error sending stats: "+r)}}))}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+(0,a.stringify)(e));var t=e.r,r=this.requestCBHash_[t];r&&(delete this.requestCBHash_[t],r(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):k("Unrecognized action received from server: "+(0,a.stringify)(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;(0,a.assert)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){t.establishConnectionTimer_=null,t.establishConnection_()}),Math.floor(e))},t.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Ue,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Ue,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&((new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=Ue),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime());var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){return(0,s.__awaiter)(this,void 0,void 0,(function(){var e,r,n,i,o,u,l,c,d,h,f,p,m,y,g=this;return(0,s.__generator)(this,(function(v){switch(v.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null,e=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this.lastSessionId,u=!1,l=null,c=function(){l?l.close():(u=!0,n())},d=function(e){(0,a.assert)(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)},this.realtime_={close:c,sendRequest:d},h=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(h),this.appCheckTokenProvider_.getToken(h)])];case 2:return f=s.__read.apply(void 0,[v.sent(),2]),p=f[0],m=f[1],u?T("getToken() completed but was canceled"):(T("getToken() completed. Creating connection."),this.authToken_=p&&p.accessToken,this.appCheckToken_=m&&m.token,l=new fe(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,r,n,(function(e){j(e+" ("+g.repoInfo_.toString()+")"),g.interrupt("server_kill")}),o)),[3,4];case 3:return y=v.sent(),this.log_("Failed to get token: "+y),u||(this.repoInfo_.nodeAdmin&&j(y),c()),[3,4];case 4:return[2]}}))}))},t.prototype.interrupt=function(e){T("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){T("Resuming connection for reason: "+e),delete this.interruptReasons_[e],(0,a.isEmpty)(this.interruptReasons_)&&(this.reconnectDelay_=Ue,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onAppCheckRevoked_=function(e,t){T("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,r,n;this.tryAuth(),this.tryAppCheck();try{for(var i=(0,s.__values)(this.listens.values()),o=i.next();!o.done;o=i.next()){var a=o.value;try{for(var u=(r=void 0,(0,s.__values)(a.values())),l=u.next();!l.done;l=u.next()){var c=l.value;this.sendListen_(c)}}catch(m){r={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}}catch(y){e={error:y}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}for(var d=0;d0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),qe=function(){function e(t,r,n,i,o){this.key=t,this.value=r,this.color=null!=n?n:e.RED,this.left=null!=i?i:Xe.EMPTY_NODE,this.right=null!=o?o:Xe.EMPTY_NODE}return e.prototype.copy=function(t,r,n,i,o){return new e(null!=t?t:this.key,null!=r?r:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,r){var n=this,i=r(e,n.key);return(n=i<0?n.copy(null,null,null,n.left.insert(e,t,r),null):0===i?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,r))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return Xe.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var r,n;if(t(e,(r=this).key)<0)r.left.isEmpty()||r.left.isRed_()||r.left.left.isRed_()||(r=r.moveRedLeft_()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed_()&&(r=r.rotateRight_()),r.right.isEmpty()||r.right.isRed_()||r.right.left.isRed_()||(r=r.moveRedRight_()),0===t(e,r.key)){if(r.right.isEmpty())return Xe.EMPTY_NODE;n=r.right.min_(),r=r.copy(n.key,n.value,null,null,r.right.removeMin_())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=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},e.prototype.moveRedLeft_=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},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=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)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Ye=function(){function e(){}return e.prototype.copy=function(e,t,r,n,i){return this},e.prototype.insert=function(e,t,r){return new qe(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),Xe=function(){function e(t,r){void 0===r&&(r=e.EMPTY_NODE),this.comparator_=t,this.root_=r}return e.prototype.insert=function(t,r){return new e(this.comparator_,this.root_.insert(t,r,this.comparator_).copy(null,null,qe.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,qe.BLACK,null,null))},e.prototype.get=function(e){for(var t,r=this.root_;!r.isEmpty();){if(0===(t=this.comparator_(e,r.key)))return r.value;t<0?r=r.left:t>0&&(r=r.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,r=this.root_,n=null;!r.isEmpty();){if(0===(t=this.comparator_(e,r.key))){if(r.left.isEmpty())return n?n.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}t<0?r=r.left:t>0&&(n=r,r=r.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new He(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new He(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new He(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new He(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Ye,e}();function Ke(e,t){return I(e.name,t.name)}function $e(e,t){return I(e,t)}var Qe,Je,Ze,et=function(e){return"number"==typeof e?"number:"+U(e):"string:"+e},tt=function(e){if(e.isLeafNode()){var t=e.val();(0,a.assert)("string"==typeof t||"number"==typeof t||"object"==typeof t&&(0,a.contains)(t,".sv"),"Priority must be a string or number.")}else(0,a.assert)(e===Ne||e.isEmpty(),"priority of unexpected type.");(0,a.assert)(e===Ne||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},rt=function(){function e(t,r){void 0===r&&(r=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=r,this.lazyHash_=null,(0,a.assert)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),tt(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return Qe},set:function(e){Qe=e},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return Ce(t)?this:".priority"===we(t)?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,r){return".priority"===t?this.updatePriority(r):r.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,r).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,r){var n=we(t);return null===n?r:r.isEmpty()&&".priority"!==n?this:((0,a.assert)(".priority"!==n||1===xe(t),".priority must be the last token in a path"),this.updateImmediateChild(n,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(Se(t),r)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+et(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?U(this.value_):this.value_,this.lazyHash_=_(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:((0,a.assert)(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var r=typeof t.value_,n=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(r),o=e.VALUE_TYPE_ORDER.indexOf(n);return(0,a.assert)(i>=0,"Unknown leaf type: "+r),(0,a.assert)(o>=0,"Unknown leaf type: "+n),i===o?"object"===n?0:this.value_0;)n.getNext(),i=n.peek();return n},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===pt?-1:0},e.prototype.withIndex=function(t){if(t===We||this.indexMap_.hasIndex(t))return this;var r=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,r)},e.prototype.isIndexed=function(e){return e===We||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var r=this.getIterator(at),n=t.getIterator(at),i=r.getNext(),o=n.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=r.getNext(),o=n.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===We?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),ft=function(e){function t(){return e.call(this,new Xe($e),ht.EMPTY_NODE,dt.Default)||this}return(0,s.__extends)(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return ht.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(ht),pt=new ft;Object.defineProperties(ze,{MIN:{value:new ze(A,ht.EMPTY_NODE)},MAX:{value:new ze(P,pt)}}),Ge.__EMPTY_NODE=ht.EMPTY_NODE,rt.__childrenNodeConstructor=ht,function(e){Ne=e}(pt),function(e){Ze=e}(pt);var mt=!0;function yt(e,t){if(void 0===t&&(t=null),null===e)return ht.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),(0,a.assert)(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new rt(e,yt(t));if(e instanceof Array||!mt){var r=ht.EMPTY_NODE;return F(e,(function(t,n){if((0,a.contains)(e,t)&&"."!==t.substring(0,1)){var i=yt(n);!i.isLeafNode()&&i.isEmpty()||(r=r.updateImmediateChild(t,i))}})),r.updatePriority(yt(t))}var n=[],i=!1;if(F(e,(function(e,t){if("."!==e.substring(0,1)){var r=yt(t);r.isEmpty()||(i=i||!r.getPriority().isEmpty(),n.push(new ze(e,r)))}})),0===n.length)return ht.EMPTY_NODE;var o=lt(n,Ke,(function(e){return e.name}),$e);if(i){var s=lt(n,at.getCompare());return new ht(o,yt(t),new dt({".priority":s},{".priority":at}))}return new ht(o,yt(t),dt.Default)}!function(e){Je=e}(yt);var gt=function(e){function t(t){var r=e.call(this)||this;return r.indexPath_=t,(0,a.assert)(!Ce(t)&&".priority"!==we(t),"Can't create PathIndex with empty path or .priority key"),r}return(0,s.__extends)(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var r=this.extractChild(e.node),n=this.extractChild(t.node),i=r.compareTo(n);return 0===i?I(e.name,t.name):i},t.prototype.makePost=function(e,t){var r=yt(e),n=ht.EMPTY_NODE.updateChild(this.indexPath_,r);return new ze(t,n)},t.prototype.maxPost=function(){var e=ht.EMPTY_NODE.updateChild(this.indexPath_,pt);return new ze(P,e)},t.prototype.toString=function(){return Te(this.indexPath_,0).join("/")},t}(Ve),vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,s.__extends)(t,e),t.prototype.compare=function(e,t){var r=e.node.compareTo(t.node);return 0===r?I(e.name,t.name):r},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return ze.MIN},t.prototype.maxPost=function(){return ze.MAX},t.prototype.makePost=function(e,t){var r=yt(e);return new ze(t,r)},t.prototype.toString=function(){return".value"},t}(Ve),bt=new vt,_t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",wt=function(){var e=0,t=[];return function(r){var n,i=r===e;e=r;var o=new Array(8);for(n=7;n>=0;n--)o[n]=_t.charAt(r%64),r=Math.floor(r/64);(0,a.assert)(0===r,"Cannot push at time == 0");var s=o.join("");if(i){for(n=11;n>=0&&63===t[n];n--)t[n]=0;t[n]++}else for(n=0;n<12;n++)t[n]=Math.floor(64*Math.random());for(n=0;n<12;n++)s+=_t.charAt(t[n]);return(0,a.assert)(20===s.length,"nextPushId: Length should be 20."),s}}(),xt=function(e){if(e===""+V)return"-";var t=G(e);if(null!=t)return""+(t+1);for(var r=new Array(e.length),n=0;n=0&&"z"===r[i];)i--;if(-1===i)return P;var o=r[i],a=_t.charAt(_t.indexOf(o)+1);return r[i]=a,r.slice(0,i+1).join("")},St=function(e){if(e===""+z)return A;var t=G(e);if(null!=t)return""+(t-1);for(var r=new Array(e.length),n=0;n=0)return null!=i&&i.trackChildChange(kt(t,r,h)),u.updateImmediateChild(t,r);null!=i&&i.trackChildChange(Mt(t,h));var m=u.updateImmediateChild(t,ht.EMPTY_NODE);return null!=f&&this.rangedFilter_.matches(f)?(null!=i&&i.trackChildChange(Tt(f.name,f.node)),m.updateImmediateChild(f.name,f.node)):m}return r.isEmpty()?e:d&&o(c,l)>=0?(null!=i&&(i.trackChildChange(Mt(c.name,c.node)),i.trackChildChange(Tt(t,r))),u.updateImmediateChild(t,r).updateImmediateChild(c.name,ht.EMPTY_NODE)):e},e}(),At=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=at}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.hasStartAfter=function(){return this.startAfterSet_},e.prototype.hasEndBefore=function(){return this.endBeforeSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_},e.prototype.getIndexStartValue=function(){return(0,a.assert)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return(0,a.assert)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:A},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return(0,a.assert)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return(0,a.assert)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:P},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return(0,a.assert)(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===at},e.prototype.copy=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e}();function Pt(e,t,r){var n=e.copy();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=r?(n.startNameSet_=!0,n.indexStartName_=r):(n.startNameSet_=!1,n.indexStartName_=""),n}function It(e,t,r){var n=e.copy();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==r?(n.endNameSet_=!0,n.indexEndName_=r):(n.endNameSet_=!1,n.indexEndName_=""),n}function Rt(e,t){var r=e.copy();return r.index_=t,r}function Dt(e){var t,r={};return e.isDefault()||(e.index_===at?t="$priority":e.index_===bt?t="$value":e.index_===We?t="$key":((0,a.assert)(e.index_ instanceof gt,"Unrecognized index type!"),t=e.index_.toString()),r.orderBy=(0,a.stringify)(t),e.startSet_&&(r.startAt=(0,a.stringify)(e.indexStartValue_),e.startNameSet_&&(r.startAt+=","+(0,a.stringify)(e.indexStartName_))),e.endSet_&&(r.endAt=(0,a.stringify)(e.indexEndValue_),e.endNameSet_&&(r.endAt+=","+(0,a.stringify)(e.indexEndName_))),e.limitSet_&&(e.isViewFromLeft()?r.limitToFirst=e.limit_:r.limitToLast=e.limit_)),r}function Lt(e){var t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_)),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_)),e.limitSet_){t.l=e.limit_;var r=e.viewFrom_;""===r&&(r=e.isViewFromLeft()?"l":"r"),t.vf=r}return e.index_!==at&&(t.i=e.index_.toString()),t}var Nt=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.repoInfo_=t,o.onDataUpdate_=r,o.authTokenProvider_=n,o.appCheckTokenProvider_=i,o.log_=M("p:rest:"),o.listens_={},o}return(0,s.__extends)(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:((0,a.assert)(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())},t.prototype.listen=function(e,r,n,i){var o=this,s=e._path.toString();this.log_("Listen called for "+s+" "+e._queryIdentifier);var u=t.getListenId_(e,n),l={};this.listens_[u]=l;var c=Dt(e._queryParams);this.restRequest_(s+".json",c,(function(e,t){var r=t;404===e&&(r=null,e=null),null===e&&o.onDataUpdate_(s,r,!1,n),(0,a.safeGet)(o.listens_,u)===l&&i(e?401===e?"permission_denied":"rest_error:"+e:"ok",null)}))},t.prototype.unlisten=function(e,r){var n=t.getListenId_(e,r);delete this.listens_[n]},t.prototype.get=function(e){var t=this,r=Dt(e._queryParams),n=e._path.toString(),i=new a.Deferred;return this.restRequest_(n+".json",r,(function(e,r){var o=r;404===e&&(o=null,e=null),null===e?(t.onDataUpdate_(n,o,!1,null),i.resolve(o)):i.reject(new Error(o))})),i.promise},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,r){var n=this;return void 0===t&&(t={}),t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((function(i){var o=(0,s.__read)(i,2),u=o[0],l=o[1];u&&u.accessToken&&(t.auth=u.accessToken),l&&l.token&&(t.ac=l.token);var c=(n.repoInfo_.secure?"https://":"http://")+n.repoInfo_.host+e+"?ns="+n.repoInfo_.namespace+(0,a.querystring)(t);n.log_("Sending REST request for "+c);var d=new XMLHttpRequest;d.onreadystatechange=function(){if(r&&4===d.readyState){n.log_("REST Response for "+c+" received. status:",d.status,"response:",d.responseText);var e=null;if(d.status>=200&&d.status<300){try{e=(0,a.jsonEval)(d.responseText)}catch(t){j("Failed to parse JSON response for "+c+": "+d.responseText)}r(null,e)}else 401!==d.status&&404!==d.status&&j("Got unsuccessful REST response for "+c+" Status: "+d.status),r(d.status);r=null}},d.open("GET",c,!0),d.send()}))},t}(pe),Ft=function(){function e(){this.rootNode_=ht.EMPTY_NODE}return e.prototype.getNode=function(e){return this.rootNode_.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)},e}();function Ut(){return{value:null,children:new Map}}function Bt(e,t,r){if(Ce(t))e.value=r,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,r);else{var n=we(t);e.children.has(n)||e.children.set(n,Ut()),Bt(e.children.get(n),t=Se(t),r)}}function zt(e,t){if(Ce(t))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;var r=e.value;return e.value=null,r.forEachChild(at,(function(t,r){Bt(e,new be(t),r)})),zt(e,t)}if(e.children.size>0){var n=we(t);return t=Se(t),e.children.has(n)&&zt(e.children.get(n),t)&&e.children.delete(n),0===e.children.size}return!0}function Vt(e,t,r){null!==e.value?r(t,e.value):function(e,t){e.children.forEach((function(e,r){t(r,e)}))}(e,(function(e,n){Vt(n,new be(t.toString()+"/"+e),r)}))}var Gt,Wt=function(){function e(e){this.collection_=e,this.last_=null}return e.prototype.get=function(){var e=this.collection_.get(),t=(0,s.__assign)({},e);return this.last_&&F(this.last_,(function(e,r){t[e]=t[e]-r})),this.last_=e,t},e}(),Ht=function(){function e(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new Wt(e);var r=1e4+2e4*Math.random();H(this.reportStats_.bind(this),Math.floor(r))}return e.prototype.reportStats_=function(){var e=this,t=this.statsListener_.get(),r={},n=!1;F(t,(function(t,i){i>0&&(0,a.contains)(e.statsToReport_,t)&&(r[t]=i,n=!0)})),n&&this.server_.reportStats(r),H(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},e}();function qt(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(Gt||(Gt={}));var Yt,Xt=function(){function e(e,t,r){this.path=e,this.affectedTree=t,this.revert=r,this.type=Gt.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}return e.prototype.operationForChild=function(t){if(Ce(this.path)){if(null!=this.affectedTree.value)return(0,a.assert)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var r=this.affectedTree.subtree(new be(t));return new e(_e(),r,this.revert)}return(0,a.assert)(we(this.path)===t,"operationForChild called for unrelated child."),new e(Se(this.path),this.affectedTree,this.revert)},e}(),Kt=function(){function e(e,t){this.source=e,this.path=t,this.type=Gt.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return Ce(this.path)?new e(this.source,_e()):new e(this.source,Se(this.path))},e}(),$t=function(){function e(e,t,r){this.source=e,this.path=t,this.snap=r,this.type=Gt.OVERWRITE}return e.prototype.operationForChild=function(t){return Ce(this.path)?new e(this.source,_e(),this.snap.getImmediateChild(t)):new e(this.source,Se(this.path),this.snap)},e}(),Qt=function(){function e(e,t,r){this.source=e,this.path=t,this.children=r,this.type=Gt.MERGE}return e.prototype.operationForChild=function(t){if(Ce(this.path)){var r=this.children.subtree(new be(t));return r.isEmpty()?null:r.value?new $t(this.source,_e(),r.value):new e(this.source,_e(),r)}return(0,a.assert)(we(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,Se(this.path),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}(),Jt=function(){function e(e,t,r){this.node_=e,this.fullyInitialized_=t,this.filtered_=r}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(Ce(e))return this.isFullyInitialized()&&!this.filtered_;var t=we(e);return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}(),Zt=function(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()};function er(e,t,r,n,i,o){var a=n.filter((function(e){return e.type===r}));a.sort((function(t,r){return tr(e,t,r)})),a.forEach((function(r){var n=function(e,t,r){return"value"===t.type||"child_removed"===t.type||(t.prevName=r.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,r,o);i.forEach((function(i){i.respondsTo(r.type)&&t.push(i.createEvent(n,e.query_))}))}))}function tr(e,t,r){if(null==t.childName||null==r.childName)throw(0,a.assertionError)("Should only compare child_ events.");var n=new ze(t.childName,t.snapshotNode),i=new ze(r.childName,r.snapshotNode);return e.index_.compare(n,i)}function rr(e,t){return{eventCache:e,serverCache:t}}function nr(e,t,r,n){return rr(new Jt(t,r,n),e.serverCache)}function ir(e,t,r,n){return rr(e.eventCache,new Jt(t,r,n))}function or(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function ar(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}var sr=function(){function e(e,t){void 0===t&&(Yt||(Yt=new Xe(R)),t=Yt),this.value=e,this.children=t}return e.fromObject=function(t){var r=new e(null);return F(t,(function(e,t){r=r.set(new be(e),t)})),r},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:_e(),value:this.value};if(Ce(e))return null;var r=we(e),n=this.children.get(r);if(null!==n){var i=n.findRootMostMatchingPathAndValue(Se(e),t);return null!=i?{path:ke(new be(r),i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,(function(){return!0}))},e.prototype.subtree=function(t){if(Ce(t))return this;var r=we(t),n=this.children.get(r);return null!==n?n.subtree(Se(t)):new e(null)},e.prototype.set=function(t,r){if(Ce(t))return new e(r,this.children);var n=we(t),i=(this.children.get(n)||new e(null)).set(Se(t),r),o=this.children.insert(n,i);return new e(this.value,o)},e.prototype.remove=function(t){if(Ce(t))return this.children.isEmpty()?new e(null):new e(null,this.children);var r=we(t),n=this.children.get(r);if(n){var i=n.remove(Se(t)),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),null===this.value&&o.isEmpty()?new e(null):new e(this.value,o)}return this},e.prototype.get=function(e){if(Ce(e))return this.value;var t=we(e),r=this.children.get(t);return r?r.get(Se(e)):null},e.prototype.setTree=function(t,r){if(Ce(t))return r;var n,i=we(t),o=(this.children.get(i)||new e(null)).setTree(Se(t),r);return n=o.isEmpty()?this.children.remove(i):this.children.insert(i,o),new e(this.value,n)},e.prototype.fold=function(e){return this.fold_(_e(),e)},e.prototype.fold_=function(e,t){var r={};return this.children.inorderTraversal((function(n,i){r[n]=i.fold_(ke(e,n),t)})),t(e,this.value,r)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,_e(),t)},e.prototype.findOnPath_=function(e,t,r){var n=!!this.value&&r(t,this.value);if(n)return n;if(Ce(e))return null;var i=we(e),o=this.children.get(i);return o?o.findOnPath_(Se(e),ke(t,i),r):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,_e(),t)},e.prototype.foreachOnPath_=function(t,r,n){if(Ce(t))return this;this.value&&n(r,this.value);var i=we(t),o=this.children.get(i);return o?o.foreachOnPath_(Se(t),ke(r,i),n):new e(null)},e.prototype.foreach=function(e){this.foreach_(_e(),e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal((function(r,n){n.foreach_(ke(e,r),t)})),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal((function(t,r){r.value&&e(t,r.value)}))},e}(),ur=function(){function e(e){this.writeTree_=e}return e.empty=function(){return new e(new sr(null))},e}();function lr(e,t,r){if(Ce(t))return new ur(new sr(r));var n=e.writeTree_.findRootMostValueAndPath(t);if(null!=n){var i=n.path,o=n.value,a=je(i,t);return o=o.updateChild(a,r),new ur(e.writeTree_.set(i,o))}var s=new sr(r),u=e.writeTree_.setTree(t,s);return new ur(u)}function cr(e,t,r){var n=e;return F(r,(function(e,r){n=lr(n,ke(t,e),r)})),n}function dr(e,t){if(Ce(t))return ur.empty();var r=e.writeTree_.setTree(t,new sr(null));return new ur(r)}function hr(e,t){return null!=fr(e,t)}function fr(e,t){var r=e.writeTree_.findRootMostValueAndPath(t);return null!=r?e.writeTree_.get(r.path).getChild(je(r.path,t)):null}function pr(e){var t=[],r=e.writeTree_.value;return null!=r?r.isLeafNode()||r.forEachChild(at,(function(e,r){t.push(new ze(e,r))})):e.writeTree_.children.inorderTraversal((function(e,r){null!=r.value&&t.push(new ze(e,r.value))})),t}function mr(e,t){if(Ce(t))return e;var r=fr(e,t);return new ur(null!=r?new sr(r):e.writeTree_.subtree(t))}function yr(e){return e.writeTree_.isEmpty()}function gr(e,t){return vr(_e(),e.writeTree_,t)}function vr(e,t,r){if(null!=t.value)return r.updateChild(e,t.value);var n=null;return t.children.inorderTraversal((function(t,i){".priority"===t?((0,a.assert)(null!==i.value,"Priority writes must always be leaf nodes"),n=i.value):r=vr(ke(e,t),i,r)})),r.getChild(e).isEmpty()||null===n||(r=r.updateChild(ke(e,".priority"),n)),r}function br(e,t){return Dr(t,e)}function _r(e,t,r,n,i){(0,a.assert)(n>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),e.allWrites.push({path:t,snap:r,writeId:n,visible:i}),i&&(e.visibleWrites=lr(e.visibleWrites,t,r)),e.lastWriteId=n}function wr(e,t,r,n){(0,a.assert)(n>e.lastWriteId,"Stacking an older merge on top of newer ones"),e.allWrites.push({path:t,children:r,writeId:n,visible:!0}),e.visibleWrites=cr(e.visibleWrites,t,r),e.lastWriteId=n}function xr(e,t){var r=e.allWrites.findIndex((function(e){return e.writeId===t}));(0,a.assert)(r>=0,"removeWrite called with nonexistent writeId.");var n=e.allWrites[r];e.allWrites.splice(r,1);for(var i=n.visible,o=!1,s=e.allWrites.length-1;i&&s>=0;){var u=e.allWrites[s];u.visible&&(s>=r&&Sr(u,n.path)?i=!1:Pe(n.path,u.path)&&(o=!0)),s--}return!!i&&(o?(function(e){e.visibleWrites=Tr(e.allWrites,Er,_e()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0):(n.snap?e.visibleWrites=dr(e.visibleWrites,n.path):F(n.children,(function(t){e.visibleWrites=dr(e.visibleWrites,ke(n.path,t))})),!0))}function Sr(e,t){if(e.snap)return Pe(e.path,t);for(var r in e.children)if(e.children.hasOwnProperty(r)&&Pe(ke(e.path,r),t))return!0;return!1}function Er(e){return e.visible}function Tr(e,t,r){for(var n=ur.empty(),i=0;i0||!e.eventCache.isFullyInitialized()||i&&!n.getNode().equals(o)||!n.getNode().getPriority().equals(o.getPriority()))&&r.push(Et(or(t)))}}(t,o,h),{viewCache:o,changes:h}}function zr(e,t,r,n,i,o){var s=t.eventCache;if(null!=Ar(n,r))return t;var u=void 0,l=void 0;if(Ce(r))if((0,a.assert)(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){var c=ar(t),d=jr(n,c instanceof ht?c:ht.EMPTY_NODE);u=e.filter.updateFullNode(t.eventCache.getNode(),d,o)}else{var h=Cr(n,ar(t));u=e.filter.updateFullNode(t.eventCache.getNode(),h,o)}else{var f=we(r);if(".priority"===f){(0,a.assert)(1===xe(r),"Can't have a priority with additional path components");var p=s.getNode(),m=Or(n,r,p,l=t.serverCache.getNode());u=null!=m?e.filter.updatePriority(p,m):s.getNode()}else{var y=Se(r),g=void 0;if(s.isCompleteForChild(f)){l=t.serverCache.getNode();var v=Or(n,r,s.getNode(),l);g=null!=v?s.getNode().getImmediateChild(f).updateChild(y,v):s.getNode().getImmediateChild(f)}else g=Ir(n,f,t.serverCache);u=null!=g?e.filter.updateChild(s.getNode(),f,g,y,i,o):s.getNode()}}return nr(t,u,s.isFullyInitialized()||Ce(r),e.filter.filtersNodes())}function Vr(e,t,r,n,i,o,a,s){var u,l=t.serverCache,c=a?e.filter:e.filter.getIndexedFilter();if(Ce(r))u=c.updateFullNode(l.getNode(),n,null);else if(c.filtersNodes()&&!l.isFiltered()){var d=l.getNode().updateChild(r,n);u=c.updateFullNode(l.getNode(),d,null)}else{var h=we(r);if(!l.isCompleteForPath(r)&&xe(r)>1)return t;var f=Se(r),p=l.getNode().getImmediateChild(h).updateChild(f,n);u=".priority"===h?c.updatePriority(l.getNode(),p):c.updateChild(l.getNode(),h,p,f,Fr,null)}var m=ir(t,u,l.isFullyInitialized()||Ce(r),c.filtersNodes());return zr(e,m,r,i,new Ur(i,m,o),s)}function Gr(e,t,r,n,i,o,a){var s,u,l=t.eventCache,c=new Ur(i,t,o);if(Ce(r))u=e.filter.updateFullNode(t.eventCache.getNode(),n,a),s=nr(t,u,!0,e.filter.filtersNodes());else{var d=we(r);if(".priority"===d)u=e.filter.updatePriority(t.eventCache.getNode(),n),s=nr(t,u,l.isFullyInitialized(),l.isFiltered());else{var h=Se(r),f=l.getNode().getImmediateChild(d),p=void 0;if(Ce(h))p=n;else{var m=c.getCompleteChild(d);p=null!=m?".priority"===Ee(h)&&m.getChild(Me(h)).isEmpty()?m:m.updateChild(h,n):ht.EMPTY_NODE}s=f.equals(p)?t:nr(t,e.filter.updateChild(l.getNode(),d,p,h,c,a),l.isFullyInitialized(),e.filter.filtersNodes())}}return s}function Wr(e,t){return e.eventCache.isCompleteForChild(t)}function Hr(e,t,r){return r.foreach((function(e,r){t=t.updateChild(e,r)})),t}function qr(e,t,r,n,i,o,a,s){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;var u,l=t;u=Ce(r)?n:new sr(null).setTree(r,n);var c=t.serverCache.getNode();return u.children.inorderTraversal((function(r,n){if(c.hasChild(r)){var u=Hr(0,t.serverCache.getNode().getImmediateChild(r),n);l=Vr(e,l,new be(r),u,i,o,a,s)}})),u.children.inorderTraversal((function(r,n){var u=!t.serverCache.isCompleteForChild(r)&&void 0===n.value;if(!c.hasChild(r)&&!u){var d=Hr(0,t.serverCache.getNode().getImmediateChild(r),n);l=Vr(e,l,new be(r),d,i,o,a,s)}})),l}var Yr,Xr=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var r=this.query_._queryParams,n=new Ct(r.getIndex()),i=function(e){return e.loadsAllData()?new Ct(e.getIndex()):e.hasLimit()?new Ot(e):new jt(e)}(r);this.processor_=function(e){return{filter:e}}(i);var o=t.serverCache,a=t.eventCache,s=n.updateFullNode(ht.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(ht.EMPTY_NODE,a.getNode(),null),l=new Jt(s,o.isFullyInitialized(),n.filtersNodes()),c=new Jt(u,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=rr(c,l),this.eventGenerator_=new Zt(this.query_)}return Object.defineProperty(e.prototype,"query",{get:function(){return this.query_},enumerable:!1,configurable:!0}),e}();function Kr(e,t){var r=ar(e.viewCache_);return r&&(e.query._queryParams.loadsAllData()||!Ce(t)&&!r.getImmediateChild(we(t)).isEmpty())?r.getChild(t):null}function $r(e){return 0===e.eventRegistrations_.length}function Qr(e,t,r){var n=[];if(r){(0,a.assert)(null==t,"A cancel should cancel all event registrations.");var i=e.query._path;e.eventRegistrations_.forEach((function(e){var t=e.createCancelEvent(r,i);t&&n.push(t)}))}if(t){for(var o=[],s=0;s0&&!n&&(l?e.listenProvider_.stopListening(Pn(t),null):u.forEach((function(t){var r=e.queryToTagMap.get(Cn(t));e.listenProvider_.stopListening(Pn(t),r)}))),function(e,t){for(var r=0;r0}function Yn(e,t){F(e.node.children,(function(r,n){t(new Vn(r,e,n))}))}function Xn(e,t,r,n){r&&!n&&t(e),Yn(e,(function(e){Xn(e,t,!0,n)})),r&&n&&t(e)}function Kn(e){return new be(null===e.parent?e.name:Kn(e.parent)+"/"+e.name)}function $n(e){null!==e.parent&&function(e,t,r){var n=function(e){return void 0===Wn(e)&&!qn(e)}(r),i=(0,a.contains)(e.node.children,t);n&&i?(delete e.node.children[t],e.node.childCount--,$n(e)):n||i||(e.node.children[t]=r.node,e.node.childCount++,$n(e))}(e.parent,e.name,e)}var Qn=/[\[\].#$\/\u0000-\u001F\u007F]/,Jn=/[\[\].#$\u0000-\u001F\u007F]/,Zn=10485760,ei=function(e){return"string"==typeof e&&0!==e.length&&!Qn.test(e)},ti=function(e){return"string"==typeof e&&0!==e.length&&!Jn.test(e)},ri=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!O(e)||e&&"object"==typeof e&&(0,a.contains)(e,".sv")},ni=function(e,t,r,n){n&&void 0===t||ii((0,a.errorPrefix)(e,"value"),t,r)},ii=function(e,t,r){var n=r instanceof be?new Ie(r,e):r;if(void 0===t)throw new Error(e+"contains undefined "+De(n));if("function"==typeof t)throw new Error(e+"contains a function "+De(n)+" with contents = "+t.toString());if(O(t))throw new Error(e+"contains "+t.toString()+" "+De(n));if("string"==typeof t&&t.length>Zn/3&&(0,a.stringLength)(t)>Zn)throw new Error(e+"contains a string greater than "+Zn+" utf8 bytes "+De(n)+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var i=!1,o=!1;if(F(t,(function(t,r){if(".value"===t)i=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!ei(t)))throw new Error(e+" contains an invalid key ("+t+") "+De(n)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');(function(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=(0,a.stringLength)(t),Re(e)})(n,t),ii(e,r,n),function(e){var t=e.parts_.pop();e.byteLength_-=(0,a.stringLength)(t),e.parts_.length>0&&(e.byteLength_-=1)}(n)})),i&&o)throw new Error(e+' contains ".value" child '+De(n)+" in addition to actual children.")}},oi=function(e,t,r,n){if(!n||void 0!==t){var i=(0,a.errorPrefix)(e,"values");if(!t||"object"!=typeof t||Array.isArray(t))throw new Error(i+" must be an object containing the children to replace.");var o=[];F(t,(function(e,t){var n=new be(e);if(ii(i,t,ke(r,n)),".priority"===Ee(n)&&!ri(t))throw new Error(i+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(n)})),function(e,t){var r,n;for(r=0;r=0)e.server_=new Nt(e.repoInfo_,(function(t,r,n,i){Ei(e,t,r,n,i)}),e.authTokenProvider_,e.appCheckProvider_),setTimeout((function(){return Ti(e,!0)}),0);else{if(null!=r){if("object"!=typeof r)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{(0,a.stringify)(r)}catch(s){throw new Error("Invalid authOverride provided: "+s)}}e.persistentConnection_=new Be(e.repoInfo_,t,(function(t,r,n,i){Ei(e,t,r,n,i)}),(function(t){Ti(e,t)}),(function(t){!function(e,t){F(t,(function(t,r){Mi(e,t,r)}))}(e,t)}),e.authTokenProvider_,e.appCheckProvider_,r),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener((function(t){e.server_.refreshAuthToken(t)})),e.appCheckProvider_.addTokenChangeListener((function(t){e.server_.refreshAppCheckToken(t.token)})),e.statsReporter_=function(e,t){var r=e.toString();return ie[r]||(ie[r]=t()),ie[r]}(e.repoInfo_,(function(){return new Ht(e.stats_,e.server_)})),e.infoData_=new Ft,e.infoSyncTree_=new mn({startListening:function(t,r,n,i){var o=[],a=e.infoData_.getNode(t._path);return a.isEmpty()||(o=vn(e.infoSyncTree_,t._path,a),setTimeout((function(){i("ok")}),0)),o},stopListening:function(){}}),Mi(e,"connected",!1),e.serverSyncTree_=new mn({startListening:function(t,r,n,i){return e.server_.listen(t,n,r,(function(r,n){var o=i(r,n);mi(e.eventQueue_,t._path,o)})),[]},stopListening:function(t,r){e.server_.unlisten(t,r)}})}function xi(e){var t=e.infoData_.getNode(new be(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function Si(e){return Dn({timestamp:xi(e)})}function Ei(e,t,r,n,i){e.dataUpdateCount++;var o=new be(t);r=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,r):r;var s=[];if(i)if(n){var u=(0,a.map)(r,(function(e){return yt(e)}));s=function(e,t,r,n){var i=jn(e,n);if(i){var o=On(i),a=o.path,s=o.queryId,u=je(a,t),l=sr.fromObject(r);return An(e,a,new Qt(qt(s),u,l))}return[]}(e.serverSyncTree_,o,u,i)}else{var l=yt(r);s=function(e,t,r,n){var i=jn(e,n);if(null!=i){var o=On(i),a=o.path,s=o.queryId,u=je(a,t);return An(e,a,new $t(qt(s),u,r))}return[]}(e.serverSyncTree_,o,l,i)}else if(n){var c=(0,a.map)(r,(function(e){return yt(e)}));s=function(e,t,r){var n=sr.fromObject(r);return Sn(e,new Qt({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}(e.serverSyncTree_,o,c)}else{var d=yt(r);s=vn(e.serverSyncTree_,o,d)}var h=o;s.length>0&&(h=Fi(e,o)),mi(e.eventQueue_,h,s)}function Ti(e,t){Mi(e,"connected",t),!1===t&&function(e){Ri(e,"onDisconnectEvents");var t=Si(e),r=Ut();Vt(e.onDisconnect_,_e(),(function(n,i){var o=Un(n,i,e.serverSyncTree_,t);Bt(r,n,o)}));var n=[];Vt(r,_e(),(function(t,r){n=n.concat(vn(e.serverSyncTree_,t,r));var i=Wi(e,t);Fi(e,i)})),e.onDisconnect_=Ut(),mi(e.eventQueue_,_e(),n)}(e)}function Mi(e,t,r){var n=new be("/.info/"+t),i=yt(r);e.infoData_.updateSnapshot(n,i);var o=vn(e.infoSyncTree_,n,i);mi(e.eventQueue_,n,o)}function ki(e){return e.nextWriteId_++}function Ci(e,t,r,n,i){Ri(e,"set",{path:t.toString(),value:r,priority:n});var o=Si(e),a=yt(r,n),s=wn(e.serverSyncTree_,t),u=Bn(a,s,o),l=ki(e),c=yn(e.serverSyncTree_,t,u,l,!0);fi(e.eventQueue_,c),e.server_.put(t.toString(),a.val(!0),(function(r,n){var o="ok"===r;o||j("set at "+t+" failed: "+r);var a=gn(e.serverSyncTree_,l,!o);mi(e.eventQueue_,t,a),Di(e,i,r,n)}));var d=Wi(e,t);Fi(e,d),mi(e.eventQueue_,d,[])}function ji(e,t,r,n){Ri(e,"update",{path:t.toString(),value:r});var i=!0,o=Si(e),a={};if(F(r,(function(r,n){i=!1,a[r]=Un(ke(t,r),yt(n),e.serverSyncTree_,o)})),i)T("update() called with empty data. Don't do anything."),Di(e,n,"ok",void 0);else{var s=ki(e),u=function(e,t,r,n){wr(e.pendingWriteTree_,t,r,n);var i=sr.fromObject(r);return Sn(e,new Qt({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,i))}(e.serverSyncTree_,t,a,s);fi(e.eventQueue_,u),e.server_.merge(t.toString(),r,(function(r,i){var o="ok"===r;o||j("update at "+t+" failed: "+r);var a=gn(e.serverSyncTree_,s,!o),u=a.length>0?Fi(e,t):t;mi(e.eventQueue_,u,a),Di(e,n,r,i)})),F(r,(function(r){var n=Wi(e,ke(t,r));Fi(e,n)})),mi(e.eventQueue_,t,[])}}function Oi(e,t,r){e.server_.onDisconnectCancel(t.toString(),(function(n,i){"ok"===n&&zt(e.onDisconnect_,t),Di(e,r,n,i)}))}function Ai(e,t,r,n){var i=yt(r);e.server_.onDisconnectPut(t.toString(),i.val(!0),(function(r,o){"ok"===r&&Bt(e.onDisconnect_,t,i),Di(e,n,r,o)}))}function Pi(e,t,r){var n;n=".info"===we(t._path)?bn(e.infoSyncTree_,t,r):bn(e.serverSyncTree_,t,r),pi(e.eventQueue_,t._path,n)}function Ii(e){e.persistentConnection_&&e.persistentConnection_.interrupt(vi)}function Ri(e){for(var t=[],r=1;r0,"Sending zero length transaction queue"),r.every((function(e){return 0===e.status}))&&function(e,t,r){for(var n=r.map((function(e){return e.currentWriteId})),i=Li(e,t,n),o=i,s=i.hash(),u=0;u=bi)h=!0,u="maxretry",i=i.concat(gn(e.serverSyncTree_,c.currentWriteId,!0));else{var f=Li(e,c.path,o);c.currentInputSnapshot=f;var p=t[s].update(f.val());if(void 0!==p){ii("transaction failed: Data returned ",p,c.path);var m=yt(p);"object"==typeof p&&null!=p&&(0,a.contains)(p,".priority")||(m=m.updatePriority(f.getPriority()));var y=c.currentWriteId,g=Si(e),v=Bn(m,f,g);c.currentOutputSnapshotRaw=m,c.currentOutputSnapshotResolved=v,c.currentWriteId=ki(e),o.splice(o.indexOf(y),1),i=(i=i.concat(yn(e.serverSyncTree_,c.path,v,c.currentWriteId,c.applyLocally))).concat(gn(e.serverSyncTree_,y,!0))}else h=!0,u="nodata",i=i.concat(gn(e.serverSyncTree_,c.currentWriteId,!0))}mi(e.eventQueue_,r,i),i=[],h&&(t[s].status=2,l=t[s].unwatcher,setTimeout(l,Math.floor(0)),t[s].onComplete&&("nodata"===u?n.push((function(){return t[s].onComplete(null,!1,t[s].currentInputSnapshot)})):n.push((function(){return t[s].onComplete(new Error(u),!1,null)}))))},u=0;u0?r:void 0)}Yn(t,(function(t){Gi(e,t)}))}function Wi(e,t){var r=Kn(Bi(e,t)),n=Gn(e.transactionQueueTree_,t);return function(e,t,r){for(var n=r?e:e.parent;null!==n;){if(t(n))return!0;n=n.parent}}(n,(function(t){Hi(e,t)})),Hi(e,n),Xn(n,(function(t){Hi(e,t)})),r}function Hi(e,t){var r=Wn(t);if(r){for(var n=[],i=[],o=-1,s=0;s.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===r.domain||C("Cannot parse Firebase url. Please use https://.firebaseio.com"),r.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&j("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var i="ws"===r.scheme||"wss"===r.scheme;return{repoInfo:new ee(r.host,r.secure,n,t,i,"",n!==r.subdomain),path:new be(r.pathString)}},Xi=function(e){var t="",r="",n="",i="",o="",a=!0,s="https",u=443;if("string"==typeof e){var l=e.indexOf("//");l>=0&&(s=e.substring(0,l-1),e=e.substring(l+2));var c=e.indexOf("/");-1===c&&(c=e.length);var d=e.indexOf("?");-1===d&&(d=e.length),t=e.substring(0,Math.min(c,d)),c0){var i=r[n];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}t+="/"+i}return t}(e.substring(c,d)));var h=qi(e.substring(Math.min(e.length,d)));(l=t.indexOf(":"))>=0?(a="https"===s||"wss"===s,u=parseInt(t.substring(l+1),10)):l=t.length;var f=t.slice(0,l);if("localhost"===f.toLowerCase())r="localhost";else if(f.split(".").length<=2)r=f;else{var p=t.indexOf(".");n=t.substring(0,p).toLowerCase(),r=t.substring(p+1),o=n}"ns"in h&&(o=h.ns)}return{host:t,port:u,domain:r,subdomain:n,secure:a,scheme:s,pathString:i,namespace:o}},Ki=function(){function e(e,t,r,n){this.eventType=e,this.eventRegistration=t,this.snapshot=r,this.prevName=n}return e.prototype.getPath=function(){var e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+(0,a.stringify)(this.snapshot.exportVal())},e}(),$i=function(){function e(e,t,r){this.eventRegistration=e,this.error=t,this.path=r}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),Qi=function(){function e(e,t){this.snapshotCallback=e,this.cancelCallback=t}return e.prototype.onValue=function(e,t){this.snapshotCallback.call(null,e,t)},e.prototype.onCancel=function(e){return(0,a.assert)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)},Object.defineProperty(e.prototype,"hasCancelCallback",{get:function(){return!!this.cancelCallback},enumerable:!1,configurable:!0}),e.prototype.matches=function(e){return this.snapshotCallback===e.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context},e}(),Ji=function(){function e(e,t){this._repo=e,this._path=t}return e.prototype.cancel=function(){var e=new a.Deferred;return Oi(this._repo,this._path,e.wrapCallback((function(){}))),e.promise},e.prototype.remove=function(){ci("OnDisconnect.remove",this._path);var e=new a.Deferred;return Ai(this._repo,this._path,null,e.wrapCallback((function(){}))),e.promise},e.prototype.set=function(e){ci("OnDisconnect.set",this._path),ni("OnDisconnect.set",e,this._path,!1);var t=new a.Deferred;return Ai(this._repo,this._path,e,t.wrapCallback((function(){}))),t.promise},e.prototype.setWithPriority=function(e,t){ci("OnDisconnect.setWithPriority",this._path),ni("OnDisconnect.setWithPriority",e,this._path,!1),ai("OnDisconnect.setWithPriority",t,!1);var r=new a.Deferred;return function(e,t,r,n,i){var o=yt(r,n);e.server_.onDisconnectPut(t.toString(),o.val(!0),(function(r,n){"ok"===r&&Bt(e.onDisconnect_,t,o),Di(0,i,r,n)}))}(this._repo,this._path,e,t,r.wrapCallback((function(){}))),r.promise},e.prototype.update=function(e){ci("OnDisconnect.update",this._path),oi("OnDisconnect.update",e,this._path,!1);var t=new a.Deferred;return function(e,t,r,n){if((0,a.isEmpty)(r))return T("onDisconnect().update() called with empty data. Don't do anything."),void Di(0,n,"ok",void 0);e.server_.onDisconnectMerge(t.toString(),r,(function(i,o){"ok"===i&&F(r,(function(r,n){var i=yt(n);Bt(e.onDisconnect_,ke(t,r),i)})),Di(0,n,i,o)}))}(this._repo,this._path,e,t.wrapCallback((function(){}))),t.promise},e}(),Zi=function(){function e(e,t,r,n){this._repo=e,this._path=t,this._queryParams=r,this._orderByCalled=n}return Object.defineProperty(e.prototype,"key",{get:function(){return Ce(this._path)?null:Ee(this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new no(this._repo,this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_queryIdentifier",{get:function(){var e=Lt(this._queryParams),t=L(e);return"{}"===t?"default":t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_queryObject",{get:function(){return Lt(this._queryParams)},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!((t=(0,a.getModularInstance)(t))instanceof e))return!1;var r=this._repo===t._repo,n=Ae(this._path,t._path),i=this._queryIdentifier===t._queryIdentifier;return r&&n&&i},e.prototype.toJSON=function(){return this.toString()},e.prototype.toString=function(){return this._repo.toString()+function(e){for(var t="",r=e.pieceNum_;r>>0),b=0;function _(e,t,r){return e.call.apply(e.bind,arguments)}function w(e,t,r){if(!e)throw Error();if(2e.b&&(e.b++,t.next=e.a,e.a=t)}function B(){this.b=this.a=null}j=I("__EID__")?"__EID__":void 0,T(D,Error),D.prototype.name="CustomError",T(L,D),L.prototype.name="AssertionError",F.prototype.get=function(){if(0/g,oe=/"/g,ae=/'/g,se=/\x00/g,ue=/[\x00&<>"']/;function le(e,t){return-1!=e.indexOf(t)}function ce(e,t){return et?1:0}e:{var de=u.navigator;if(de){var he=de.userAgent;if(he){ee=he;break e}}ee=""}function fe(e){return le(ee,e)}function pe(e,t){for(var r in e)t.call(void 0,e[r],r,e)}function me(e){for(var t in e)return!1;return!0}function ye(e){var t,r={};for(t in e)r[t]=e[t];return r}var ge="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ve(e,t){for(var r,n,i=1;i"}else o=void 0===e?"undefined":null===e?"null":typeof e;N("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,o)}}function _e(e,t){this.a=e===Ee&&t||"",this.b=Se}function we(e){return e instanceof _e&&e.constructor===_e&&e.b===Se?e.a:(N("expected object of type Const, got '"+e+"'"),"type_error:Const")}_e.prototype.ta=!0,_e.prototype.sa=function(){return this.a},_e.prototype.toString=function(){return"Const{"+this.a+"}"};var xe,Se={},Ee={};function Te(){if(void 0===xe){var t=null,r=u.trustedTypes;if(r&&r.createPolicy){try{t=r.createPolicy("goog#html",{createHTML:M,createScript:M,createScriptURL:M})}catch(e){u.console&&u.console.error(e.message)}xe=t}else xe=t}return xe}function Me(e,t){this.a=t===Ae?e:""}function ke(e){return e instanceof Me&&e.constructor===Me?e.a:(N("expected object of type TrustedResourceUrl, got '"+e+"' of type "+f(e)),"type_error:TrustedResourceUrl")}function Ce(e,t){var r=we(e);if(!Oe.test(r))throw Error("Invalid TrustedResourceUrl format: "+r);return function(e){var t=Te();return new Me(e=t?t.createScriptURL(e):e,Ae)}(e=r.replace(je,(function(e,n){if(!Object.prototype.hasOwnProperty.call(t,n))throw Error('Found marker, "'+n+'", in format string, "'+r+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[n])instanceof _e?we(e):encodeURIComponent(String(e))})))}Me.prototype.ta=!0,Me.prototype.sa=function(){return this.a.toString()},Me.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var je=/%{(\w+)}/g,Oe=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Ae={};function Pe(e,t){this.a=t===Ue?e:""}function Ie(e){return e instanceof Pe&&e.constructor===Pe?e.a:(N("expected object of type SafeUrl, got '"+e+"' of type "+f(e)),"type_error:SafeUrl")}Pe.prototype.ta=!0,Pe.prototype.sa=function(){return this.a.toString()},Pe.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Re=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,De=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Le=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Ne(e){if(e instanceof Pe)return e;if(e="object"==typeof e&&e.ta?e.sa():String(e),Le.test(e))e=new Pe(e,Ue);else{var t=(e=(e=String(e)).replace(/(%0A|%0D)/g,"")).match(De);e=t&&Re.test(t[1])?new Pe(e,Ue):null}return e}function Fe(e){return e instanceof Pe?e:(e="object"==typeof e&&e.ta?e.sa():String(e),Le.test(e)||(e="about:invalid#zClosurez"),new Pe(e,Ue))}var Ue={},Be=new Pe("about:invalid#zClosurez",Ue);function ze(e,t,r){this.a=r===Ve?e:""}ze.prototype.ta=!0,ze.prototype.sa=function(){return this.a.toString()},ze.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Ve={};function Ge(e,t,r,n){return e=e instanceof Pe?e:Fe(e),t=t||u,r=r instanceof _e?we(r):r||"",t.open(Ie(e),r,n,void 0)}function We(e,t){for(var r=e.split("%s"),n="",i=Array.prototype.slice.call(arguments,1);i.length&&1")&&(e=e.replace(ie,">")),-1!=e.indexOf('"')&&(e=e.replace(oe,""")),-1!=e.indexOf("'")&&(e=e.replace(ae,"'")),-1!=e.indexOf("\0")&&(e=e.replace(se,"�"))),e}function qe(e){return qe[" "](e),e}qe[" "]=h;var Ye,Xe,Ke=fe("Opera"),$e=fe("Trident")||fe("MSIE"),Qe=fe("Edge"),Je=Qe||$e,Ze=fe("Gecko")&&!(le(ee.toLowerCase(),"webkit")&&!fe("Edge"))&&!(fe("Trident")||fe("MSIE"))&&!fe("Edge"),et=le(ee.toLowerCase(),"webkit")&&!fe("Edge");function tt(){var e=u.document;return e?e.documentMode:void 0}e:{var rt="",nt=(Xe=ee,Ze?/rv:([^\);]+)(\)|;)/.exec(Xe):Qe?/Edge\/([\d\.]+)/.exec(Xe):$e?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Xe):et?/WebKit\/(\S+)/.exec(Xe):Ke?/(?:Version)[ \/]?(\S+)/.exec(Xe):void 0);if(nt&&(rt=nt?nt[1]:""),$e){var it=tt();if(null!=it&&it>parseFloat(rt)){Ye=String(it);break e}}Ye=rt}var ot,at={};function st(e){return function(e,t){var r=at;return Object.prototype.hasOwnProperty.call(r,e)?r[e]:r[e]=t()}(e,(function(){for(var t=0,r=te(String(Ye)).split("."),n=te(String(e)).split("."),i=Math.max(r.length,n.length),o=0;0==t&&o=e.keyCode)&&(e.keyCode=-1)}catch(i){}},Qt.prototype.g=function(){return this.a};var Zt="closure_listenable_"+(1e6*Math.random()|0),er=0;function tr(e,t,r,n,i){this.listener=e,this.proxy=null,this.src=t,this.type=r,this.capture=!!n,this.Wa=i,this.key=++er,this.wa=this.Qa=!1}function rr(e){e.wa=!0,e.listener=null,e.proxy=null,e.src=null,e.Wa=null}function nr(e){this.src=e,this.a={},this.b=0}function ir(e,t){var r=t.type;r in e.a&&$(e.a[r],t)&&(rr(t),0==e.a[r].length&&(delete e.a[r],e.b--))}function or(e,t,r,n){for(var i=0;in.keyCode||null!=n.returnValue)){e:{var i=!1;if(0==n.keyCode)try{n.keyCode=-1;break e}catch(a){i=!0}(i||null==n.returnValue)&&(n.returnValue=!0)}for(n=[],i=t.b;i;i=i.parentNode)n.push(i);for(e=e.type,i=n.length-1;0<=i;i--){t.b=n[i];var o=pr(n[i],e,!0,t);r=r&&o}for(i=0;i>>0);function br(e){return m(e)?e:(e[vr]||(e[vr]=function(t){return e.handleEvent(t)}),e[vr])}function _r(){Vt.call(this),this.v=new nr(this),this.bc=this,this.hb=null}function wr(e,t,r,n,i){e.v.add(String(t),r,!1,n,i)}function xr(e,t,r,n,i){e.v.add(String(t),r,!0,n,i)}function Sr(e,t,r,n){if(!(t=e.v.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;ot)throw Error("Bad port number "+t);e.g=t}else e.g=null}function Dr(e,t,r){t instanceof Xr?(e.b=t,function(e,t){t&&!e.f&&(Kr(e),e.c=null,e.a.forEach((function(e,t){var r=t.toLowerCase();t!=r&&(Qr(this,t),Zr(this,r,e))}),e)),e.f=t}(e.b,e.i)):(r||(t=zr(t,qr)),e.b=new Xr(t,e.i))}function Lr(e,t,r){e.b.set(t,r)}function Nr(e,t){return e.b.get(t)}function Fr(e){return e instanceof Pr?new Pr(e):new Pr(e,void 0)}function Ur(e,t,r,n){var i=new Pr(null,void 0);return e&&Ir(i,e),t&&(i.a=t),r&&Rr(i,r),n&&(i.f=n),i}function Br(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function zr(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,Vr),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Vr(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pr.prototype.toString=function(){var e=[],t=this.c;t&&e.push(zr(t,Gr,!0),":");var r=this.a;return(r||"file"==t)&&(e.push("//"),(t=this.l)&&e.push(zr(t,Gr,!0),"@"),e.push(encodeURIComponent(String(r)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(r=this.g)&&e.push(":",String(r))),(r=this.f)&&(this.a&&"/"!=r.charAt(0)&&e.push("/"),e.push(zr(r,"/"==r.charAt(0)?Hr:Wr,!0))),(r=this.b.toString())&&e.push("?",r),(r=this.h)&&e.push("#",zr(r,Yr)),e.join("")},Pr.prototype.resolve=function(e){var t=new Pr(this),r=!!e.c;r?Ir(t,e.c):r=!!e.l,r?t.l=e.l:r=!!e.a,r?t.a=e.a:r=null!=e.g;var n=e.f;if(r)Rr(t,e.g);else if(r=!!e.f){if("/"!=n.charAt(0))if(this.a&&!this.f)n="/"+n;else{var i=t.f.lastIndexOf("/");-1!=i&&(n=t.f.substr(0,i+1)+n)}if(".."==(i=n)||"."==i)n="";else if(le(i,"./")||le(i,"/.")){n=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a2*e.c&&jr(e)))}function Jr(e,t){return Kr(e),t=tn(e,t),Or(e.a.b,t)}function Zr(e,t,r){Qr(e,t),0',e=new ze(e=(n=Te())?n.createHTML(e):e,null,Ve),n=a.document)&&(n.write(function(e){return e instanceof ze&&e.constructor===ze?e.a:(N("expected object of type SafeHtml, got '"+e+"' of type "+f(e)),"type_error:SafeHtml")}(e)),n.close())):(a=Ge(t,n,r,a))&&e.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}var pn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,mn=/^[^@]+@[^@]+$/;function yn(){var e=null;return new wt((function(t){"complete"==u.document.readyState?t():(e=function(){t()},cr(window,"load",e))})).o((function(t){throw dr(window,"load",e),t}))}function gn(e){return e=e||kn(),!("file:"!==Pn()&&"ionic:"!==Pn()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function vn(){var e=u.window;try{return!(!e||e==e.top)}catch(i){return!1}}function bn(){return void 0!==u.WorkerGlobalScope&&"function"==typeof u.importScripts}function _n(){return i.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":i.default.INTERNAL.hasOwnProperty("node")?"Node":bn()?"Worker":"Browser"}function wn(){var e=_n();return"ReactNative"===e||"Node"===e}var xn="Firefox",Sn="Chrome";function En(e){var t=e.toLowerCase();return le(t,"opera/")||le(t,"opr/")||le(t,"opios/")?"Opera":le(t,"iemobile")?"IEMobile":le(t,"msie")||le(t,"trident/")?"IE":le(t,"edge/")?"Edge":le(t,"firefox/")?xn:le(t,"silk/")?"Silk":le(t,"blackberry")?"Blackberry":le(t,"webos")?"Webos":!le(t,"safari/")||le(t,"chrome/")||le(t,"crios/")||le(t,"android")?!le(t,"chrome/")&&!le(t,"crios/")||le(t,"edge/")?le(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":Sn:"Safari"}var Tn={md:"FirebaseCore-web",od:"FirebaseUI-web"};function Mn(e,t){t=t||[];var r,n=[],i={};for(r in Tn)i[Tn[r]]=!0;for(r=0;rt)throw Error("Short delay should be less than long delay!");this.a=e,this.c=t,e=kn(),t=_n(),this.b=dn(e)||"ReactNative"===t}function zn(){var e=u.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function Vn(t){try{var r=new Date(parseInt(t,10));if(!isNaN(r.getTime())&&!/[^0-9]/.test(t))return r.toUTCString()}catch(e){}return null}function Gn(){return!(!Cn("fireauth.oauthhelper",u)&&!Cn("fireauth.iframe",u))}Bn.prototype.get=function(){var e=u.navigator;return!e||"boolean"!=typeof e.onLine||!An()&&"chrome-extension:"!==Pn()&&void 0===e.connection||e.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Wn,Hn={};function qn(e){Hn[e]||(Hn[e]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e))}try{var Yn={};Object.defineProperty(Yn,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Yn,"abcd",{configurable:!0,enumerable:!0,value:2}),Wn=2==Yn.abcd}catch(Xe){Wn=!1}function Xn(e,t,r){Wn?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r}):e[t]=r}function Kn(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&Xn(e,r,t[r])}function $n(e){var t={};return Kn(t,e),t}function Qn(e){var t=e;if("object"==typeof e&&null!=e)for(var r in t="length"in e?[]:{},e)Xn(t,r,Qn(e[r]));return t}function Jn(e){var t=e&&(e[ni]?"phone":null);if(!(t&&e&&e[ri]))throw new k("internal-error","Internal assert: invalid MultiFactorInfo object");Xn(this,"uid",e[ri]),Xn(this,"displayName",e[ei]||null);var r=null;e[ti]&&(r=new Date(e[ti]).toUTCString()),Xn(this,"enrollmentTime",r),Xn(this,"factorId",t)}function Zn(t){try{var r=new ii(t)}catch(e){r=null}return r}Jn.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var ei="displayName",ti="enrolledAt",ri="mfaEnrollmentId",ni="phoneInfo";function ii(e){Jn.call(this,e),Xn(this,"phoneNumber",e[ni])}function oi(e){var t={},r=e[li],n=e[di],i=e[hi];if(e=Zn(e[ci]),!i||i!=si&&i!=ui&&!r||i==ui&&!n||i==ai&&!e)throw Error("Invalid checkActionCode response!");i==ui?(t[pi]=r||null,t[yi]=r||null,t[fi]=n):(t[pi]=n||null,t[yi]=n||null,t[fi]=r||null),t[mi]=e||null,Xn(this,vi,i),Xn(this,gi,Qn(t))}T(ii,Jn),ii.prototype.w=function(){var e=ii.bb.w.call(this);return e.phoneNumber=this.phoneNumber,e};var ai="REVERT_SECOND_FACTOR_ADDITION",si="EMAIL_SIGNIN",ui="VERIFY_AND_CHANGE_EMAIL",li="email",ci="mfaInfo",di="newEmail",hi="requestType",fi="email",pi="fromEmail",mi="multiFactorInfo",yi="previousEmail",gi="data",vi="operation";function bi(e){var t=Nr(e=Fr(e),_i)||null,r=Nr(e,wi)||null,n=Nr(e,Ei)||null;if(n=n&&Mi[n]||null,!t||!r||!n)throw new k("argument-error",_i+", "+wi+"and "+Ei+" are required in a valid action code URL.");Kn(this,{apiKey:t,operation:n,code:r,continueUrl:Nr(e,xi)||null,languageCode:Nr(e,Si)||null,tenantId:Nr(e,Ti)||null})}var _i="apiKey",wi="oobCode",xi="continueUrl",Si="languageCode",Ei="mode",Ti="tenantId",Mi={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:ai,signIn:si,verifyAndChangeEmail:ui,verifyEmail:"VERIFY_EMAIL"};function ki(e){try{return new bi(e)}catch(i){return null}}function Ci(e){var t=e[Ii];if(void 0===t)throw new k("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new k("invalid-continue-uri");this.h=t,this.b=this.a=null,this.g=!1;var r=e[ji];if(r&&"object"==typeof r){t=r[Li];var n=r[Ri];if(r=r[Di],"string"==typeof t&&t.length){if(this.a=t,void 0!==n&&"boolean"!=typeof n)throw new k("argument-error",Ri+" property must be a boolean when specified.");if(this.g=!!n,void 0!==r&&("string"!=typeof r||"string"==typeof r&&!r.length))throw new k("argument-error",Di+" property must be a non empty string when specified.");this.b=r||null}else{if(void 0!==t)throw new k("argument-error",Li+" property must be a non empty string when specified.");if(void 0!==n||void 0!==r)throw new k("missing-android-pkg-name")}}else if(void 0!==r)throw new k("argument-error",ji+" property must be a non null object when specified.");if(this.f=null,(t=e[Pi])&&"object"==typeof t){if("string"==typeof(t=t[Ni])&&t.length)this.f=t;else if(void 0!==t)throw new k("argument-error",Ni+" property must be a non empty string when specified.")}else if(void 0!==t)throw new k("argument-error",Pi+" property must be a non null object when specified.");if(void 0!==(t=e[Ai])&&"boolean"!=typeof t)throw new k("argument-error",Ai+" property must be a boolean when specified.");if(this.c=!!t,void 0!==(e=e[Oi])&&("string"!=typeof e||"string"==typeof e&&!e.length))throw new k("argument-error",Oi+" property must be a non empty string when specified.");this.i=e||null}var ji="android",Oi="dynamicLinkDomain",Ai="handleCodeInApp",Pi="iOS",Ii="url",Ri="installApp",Di="minimumVersion",Li="packageName",Ni="bundleId";function Fi(e){var t={};for(var r in t.continueUrl=e.h,t.canHandleCodeInApp=e.c,(t.androidPackageName=e.a)&&(t.androidMinimumVersion=e.b,t.androidInstallApp=e.g),t.iOSBundleId=e.f,t.dynamicLinkDomain=e.i,t)null===t[r]&&delete t[r];return t}var Ui=null;function Bi(e){var t=Vi(e);if(!(t&&t.sub&&t.iss&&t.aud&&t.exp))throw Error("Invalid JWT");this.h=e,this.a=t.exp,this.i=t.sub,e=Date.now()/1e3,this.g=t.iat||(e>this.a?this.a:e),this.b=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null,this.f=t.firebase&&t.firebase.tenant||null,this.c=!!t.is_anonymous||"anonymous"==this.b}function zi(e){try{return new Bi(e)}catch(i){return null}}function Vi(e){if(!e)return null;if(3!=(e=e.split(".")).length)return null;for(var t=(4-(e=e[1]).length%4)%4,r=0;rr;r++)for(var n=e.concat(t[r].split("")),i=0;i>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){t.push(e)})),t}(e);for(e=[],r=t=0;ti)e[r++]=String.fromCharCode(i);else if(191i){var o=n[t++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(239i){o=n[t++];var a=n[t++],s=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&n[t++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else o=n[t++],a=n[t++],e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}return JSON.parse(e.join(""))}catch(u){}return null}Bi.prototype.T=function(){return this.f},Bi.prototype.l=function(){return this.c},Bi.prototype.toString=function(){return this.h};var Gi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Wi=["client_id","response_type","scope","redirect_uri","state"],Hi={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:Wi},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:Wi},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:Wi},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:Gi},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function qi(e){for(var t in Hi)if(Hi[t].fa==e)return Hi[t];return null}function Yi(e){var r={};r["facebook.com"]=Ji,r["google.com"]=eo,r["github.com"]=Zi,r["twitter.com"]=to;var n=e&&e[Ki];try{if(n)return r[n]?new r[n](e):new Qi(e);if(void 0!==e[Xi])return new $i(e)}catch(t){}return null}var Xi="idToken",Ki="providerId";function $i(e){var t=e[Ki];if(!t&&e[Xi]){var r=zi(e[Xi]);r&&r.b&&(t=r.b)}if(!t)throw Error("Invalid additional user info!");"anonymous"!=t&&"custom"!=t||(t=null),r=!1,void 0!==e.isNewUser?r=!!e.isNewUser:"identitytoolkit#SignupNewUserResponse"===e.kind&&(r=!0),Xn(this,"providerId",t),Xn(this,"isNewUser",r)}function Qi(e){$i.call(this,e),Xn(this,"profile",Qn((e=Ln(e.rawUserInfo||"{}"))||{}))}function Ji(e){if(Qi.call(this,e),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Zi(e){if(Qi.call(this,e),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Xn(this,"username",this.profile&&this.profile.login||null)}function eo(e){if(Qi.call(this,e),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function to(e){if(Qi.call(this,e),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Xn(this,"username",e.screenName||null)}function ro(e){var t=Fr(e),r=Nr(t,"link"),n=Nr(Fr(r),"link");return t=Nr(t,"deep_link_id"),Nr(Fr(t),"link")||t||n||r||e}function no(e,t){if(!e&&!t)throw new k("internal-error","Internal assert: no raw session string available");if(e&&t)throw new k("internal-error","Internal assert: unable to determine the session type");this.a=e||null,this.b=t||null,this.type=this.a?io:oo}T(Qi,$i),T(Ji,Qi),T(Zi,Qi),T(eo,Qi),T(to,Qi);var io="enroll",oo="signin";function ao(){}function so(e,t){return e.then((function(e){if(e[Xa]){var r=zi(e[Xa]);if(!r||t!=r.i)throw new k("user-mismatch");return e}throw new k("user-mismatch")})).o((function(e){throw e&&e.code&&e.code==O+"user-not-found"?new k("user-mismatch"):e}))}function uo(e,t){if(!t)throw new k("internal-error","failed to construct a credential");this.a=t,Xn(this,"providerId",e),Xn(this,"signInMethod",e)}function lo(e){return{pendingToken:e.a,requestUri:"http://localhost"}}function co(e){if(e&&e.providerId&&e.signInMethod&&0==e.providerId.indexOf("saml.")&&e.pendingToken)try{return new uo(e.providerId,e.pendingToken)}catch(i){}return null}function ho(e,t,r){if(this.a=null,t.idToken||t.accessToken)t.idToken&&Xn(this,"idToken",t.idToken),t.accessToken&&Xn(this,"accessToken",t.accessToken),t.nonce&&!t.pendingToken&&Xn(this,"nonce",t.nonce),t.pendingToken&&(this.a=t.pendingToken);else{if(!t.oauthToken||!t.oauthTokenSecret)throw new k("internal-error","failed to construct a credential");Xn(this,"accessToken",t.oauthToken),Xn(this,"secret",t.oauthTokenSecret)}Xn(this,"providerId",e),Xn(this,"signInMethod",r)}function fo(e){var t={};return e.idToken&&(t.id_token=e.idToken),e.accessToken&&(t.access_token=e.accessToken),e.secret&&(t.oauth_token_secret=e.secret),t.providerId=e.providerId,e.nonce&&!e.a&&(t.nonce=e.nonce),t={postBody:$r(t).toString(),requestUri:"http://localhost"},e.a&&(delete t.postBody,t.pendingToken=e.a),t}function po(t){if(t&&t.providerId&&t.signInMethod){var r={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new ho(t.providerId,r,t.signInMethod)}catch(e){}}return null}function mo(e,t){this.Qc=t||[],Kn(this,{providerId:e,isOAuthProvider:!0}),this.Jb={},this.qb=(qi(e)||{}).Ja||null,this.pb=null}function yo(e){if("string"!=typeof e||0!=e.indexOf("saml."))throw new k("argument-error",'SAML provider IDs must be prefixed with "saml."');mo.call(this,e,[])}function go(e){mo.call(this,e,Wi),this.a=[]}function vo(){go.call(this,"facebook.com")}function bo(e){if(!e)throw new k("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return y(e)&&(t=e.accessToken),(new vo).credential({accessToken:t})}function _o(){go.call(this,"github.com")}function wo(e){if(!e)throw new k("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return y(e)&&(t=e.accessToken),(new _o).credential({accessToken:t})}function xo(){go.call(this,"google.com"),this.Ca("profile")}function So(e,t){var r=e;return y(e)&&(r=e.idToken,t=e.accessToken),(new xo).credential({idToken:r,accessToken:t})}function Eo(){mo.call(this,"twitter.com",Gi)}function To(e,t){var r=e;if(y(r)||(r={oauthToken:e,oauthTokenSecret:t}),!r.oauthToken||!r.oauthTokenSecret)throw new k("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new ho("twitter.com",r,"twitter.com")}function Mo(e,t,r){this.a=e,this.f=t,Xn(this,"providerId","password"),Xn(this,"signInMethod",r===Co.EMAIL_LINK_SIGN_IN_METHOD?Co.EMAIL_LINK_SIGN_IN_METHOD:Co.EMAIL_PASSWORD_SIGN_IN_METHOD)}function ko(e){return e&&e.email&&e.password?new Mo(e.email,e.password,e.signInMethod):null}function Co(){Kn(this,{providerId:"password",isOAuthProvider:!1})}function jo(e,t){if(!(t=Oo(t)))throw new k("argument-error","Invalid email link!");return new Mo(e,t.code,Co.EMAIL_LINK_SIGN_IN_METHOD)}function Oo(e){return(e=ki(e=ro(e)))&&e.operation===si?e:null}function Ao(e){if(!(e.fb&&e.eb||e.La&&e.ea))throw new k("internal-error");this.a=e,Xn(this,"providerId","phone"),this.fa="phone",Xn(this,"signInMethod","phone")}function Po(e){if(e&&"phone"===e.providerId&&(e.verificationId&&e.verificationCode||e.temporaryProof&&e.phoneNumber)){var t={};return H(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(r){e[r]&&(t[r]=e[r])})),new Ao(t)}return null}function Io(e){return e.a.La&&e.a.ea?{temporaryProof:e.a.La,phoneNumber:e.a.ea}:{sessionInfo:e.a.fb,code:e.a.eb}}function Ro(t){try{this.a=t||i.default.auth()}catch(e){throw new k("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Kn(this,{providerId:"phone",isOAuthProvider:!1})}function Do(e,t){if(!e)throw new k("missing-verification-id");if(!t)throw new k("missing-verification-code");return new Ao({fb:e,eb:t})}function Lo(e){if(e.temporaryProof&&e.phoneNumber)return new Ao({La:e.temporaryProof,ea:e.phoneNumber});var t=e&&e.providerId;if(!t||"password"===t)return null;var r=e&&e.oauthAccessToken,n=e&&e.oauthTokenSecret,i=e&&e.nonce,o=e&&e.oauthIdToken,a=e&&e.pendingToken;try{switch(t){case"google.com":return So(o,r);case"facebook.com":return bo(r);case"github.com":return wo(r);case"twitter.com":return To(r,n);default:return r||n||o||a?a?0==t.indexOf("saml.")?new uo(t,a):new ho(t,{pendingToken:a,idToken:e.oauthIdToken,accessToken:e.oauthAccessToken},t):new go(t).credential({idToken:o,accessToken:r,rawNonce:i}):null}}catch(s){return null}}function No(e){if(!e.isOAuthProvider)throw new k("invalid-oauth-provider")}function Fo(e,t,r,n,i,o,a){if(this.c=e,this.b=t||null,this.g=r||null,this.f=n||null,this.i=o||null,this.h=a||null,this.a=i||null,!this.g&&!this.a)throw new k("invalid-auth-event");if(this.g&&this.a)throw new k("invalid-auth-event");if(this.g&&!this.f)throw new k("invalid-auth-event")}function Uo(e){return(e=e||{}).type?new Fo(e.type,e.eventId,e.urlResponse,e.sessionId,e.error&&C(e.error),e.postBody,e.tenantId):null}function Bo(){this.b=null,this.a=[]}no.prototype.Ha=function(){return this.a?Ct(this.a):Ct(this.b)},no.prototype.w=function(){return this.type==io?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},ao.prototype.ka=function(){},ao.prototype.b=function(){},ao.prototype.c=function(){},ao.prototype.w=function(){},uo.prototype.ka=function(e){return ms(e,lo(this))},uo.prototype.b=function(e,t){var r=lo(this);return r.idToken=t,ys(e,r)},uo.prototype.c=function(e,t){return so(gs(e,lo(this)),t)},uo.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},ho.prototype.ka=function(e){return ms(e,fo(this))},ho.prototype.b=function(e,t){var r=fo(this);return r.idToken=t,ys(e,r)},ho.prototype.c=function(e,t){return so(gs(e,fo(this)),t)},ho.prototype.w=function(){var e={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(e.oauthIdToken=this.idToken),this.accessToken&&(e.oauthAccessToken=this.accessToken),this.secret&&(e.oauthTokenSecret=this.secret),this.nonce&&(e.nonce=this.nonce),this.a&&(e.pendingToken=this.a),e},mo.prototype.Ka=function(e){return this.Jb=ye(e),this},T(yo,mo),T(go,mo),go.prototype.Ca=function(e){return K(this.a,e)||this.a.push(e),this},go.prototype.Rb=function(){return Z(this.a)},go.prototype.credential=function(e,t){var r;if(!(r=y(e)?{idToken:e.idToken||null,accessToken:e.accessToken||null,nonce:e.rawNonce||null}:{idToken:e||null,accessToken:t||null}).idToken&&!r.accessToken)throw new k("argument-error","credential failed: must provide the ID token and/or the access token.");return new ho(this.providerId,r,this.providerId)},T(vo,go),Xn(vo,"PROVIDER_ID","facebook.com"),Xn(vo,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),T(_o,go),Xn(_o,"PROVIDER_ID","github.com"),Xn(_o,"GITHUB_SIGN_IN_METHOD","github.com"),T(xo,go),Xn(xo,"PROVIDER_ID","google.com"),Xn(xo,"GOOGLE_SIGN_IN_METHOD","google.com"),T(Eo,mo),Xn(Eo,"PROVIDER_ID","twitter.com"),Xn(Eo,"TWITTER_SIGN_IN_METHOD","twitter.com"),Mo.prototype.ka=function(e){return this.signInMethod==Co.EMAIL_LINK_SIGN_IN_METHOD?Js(e,Ts,{email:this.a,oobCode:this.f}):Js(e,Ys,{email:this.a,password:this.f})},Mo.prototype.b=function(e,t){return this.signInMethod==Co.EMAIL_LINK_SIGN_IN_METHOD?Js(e,Ms,{idToken:t,email:this.a,oobCode:this.f}):Js(e,Us,{idToken:t,email:this.a,password:this.f})},Mo.prototype.c=function(e,t){return so(this.ka(e),t)},Mo.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},Kn(Co,{PROVIDER_ID:"password"}),Kn(Co,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Kn(Co,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Ao.prototype.ka=function(e){return e.gb(Io(this))},Ao.prototype.b=function(e,t){var r=Io(this);return r.idToken=t,Js(e,Ks,r)},Ao.prototype.c=function(e,t){var r=Io(this);return r.operation="REAUTH",so(e=Js(e,$s,r),t)},Ao.prototype.w=function(){var e={providerId:"phone"};return this.a.fb&&(e.verificationId=this.a.fb),this.a.eb&&(e.verificationCode=this.a.eb),this.a.La&&(e.temporaryProof=this.a.La),this.a.ea&&(e.phoneNumber=this.a.ea),e},Ro.prototype.gb=function(e,t){var r=this.a.a;return Ct(t.verify()).then((function(n){if("string"!=typeof n)throw new k("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");if("recaptcha"===t.type){var i=y(e)?e.session:null,o=y(e)?e.phoneNumber:e;return(i&&i.type==io?i.Ha().then((function(e){return Js(r,zs,{idToken:e,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:n}}).then((function(e){return e.phoneSessionInfo.sessionInfo}))})):i&&i.type==oo?i.Ha().then((function(t){return function(e,t){return Js(e,Vs,t).then((function(e){return e.phoneResponseInfo.sessionInfo}))}(r,{mfaPendingCredential:t,mfaEnrollmentId:e.multiFactorHint&&e.multiFactorHint.uid||e.multiFactorUid,phoneSignInInfo:{recaptchaToken:n}})})):function(e,t){return Js(e,Ns,t)}(r,{phoneNumber:o,recaptchaToken:n})).then((function(e){return"function"==typeof t.reset&&t.reset(),e}),(function(e){throw"function"==typeof t.reset&&t.reset(),e}))}throw new k("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}))},Kn(Ro,{PROVIDER_ID:"phone"}),Kn(Ro,{PHONE_SIGN_IN_METHOD:"phone"}),Fo.prototype.getUid=function(){var e=[];return e.push(this.c),this.b&&e.push(this.b),this.f&&e.push(this.f),this.h&&e.push(this.h),e.join("-")},Fo.prototype.T=function(){return this.h},Fo.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};var zo,Vo=null;function Go(e){var t="unauthorized-domain",r=void 0,n=Fr(e);e=n.a,"chrome-extension"==(n=n.c)?r=We("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):"http"==n||"https"==n?r=We("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",k.call(this,t,r)}function Wo(e,t,r){k.call(this,e,r),(e=t||{}).Kb&&Xn(this,"email",e.Kb),e.ea&&Xn(this,"phoneNumber",e.ea),e.credential&&Xn(this,"credential",e.credential),e.$b&&Xn(this,"tenantId",e.$b)}function Ho(e){if(e.code){var t=e.code||"";0==t.indexOf(O)&&(t=t.substring(O.length));var r={credential:Lo(e),$b:e.tenantId};if(e.email)r.Kb=e.email;else if(e.phoneNumber)r.ea=e.phoneNumber;else if(!r.credential)return new k(t,e.message||void 0);return new Wo(t,r,e.message)}return null}function qo(){}function Yo(e){return e.c||(e.c=e.b())}function Xo(){}function Ko(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n=function e(t){return t.c?t.c:t.a?e(t.a):(N("Root logger has no level set."),null)}(this).value)for(m(t)&&(t=t()),e=new Zo(e,String(t),this.f),r&&(e.a=r),r=this;r;)r=r.a};var aa={},sa=null;function ua(e){var t;if(sa||(sa=new ea(""),aa[""]=sa,sa.c=ia),!(t=aa[e])){t=new ea(e);var r=e.lastIndexOf("."),n=e.substr(r+1);(r=ua(e.substr(0,r))).b||(r.b={}),r.b[n]=t,t.a=r,aa[e]=t}return t}function la(e,t){e&&e.log(oa,t,void 0)}function ca(e){this.f=e}function da(e){_r.call(this),this.u=e,this.h=void 0,this.readyState=ha,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=ua("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}T(ca,qo),ca.prototype.a=function(){return new da(this.f)},ca.prototype.b=function(e){return function(){return e}}({}),T(da,_r);var ha=0;function fa(e){e.c.read().then(e.pc.bind(e)).catch(e.Va.bind(e))}function pa(e){e.readyState=4,e.g=null,e.c=null,e.m=null,ma(e)}function ma(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function ya(e){_r.call(this),this.headers=new Cr,this.D=e||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=ga,this.u=this.S=!1}(e=da.prototype).open=function(e,t){if(this.readyState!=ha)throw this.abort(),Error("Error reopening a connection");this.s=e,this.f=t,this.readyState=1,ma(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.l,method:this.s,credentials:this.h,cache:void 0};e&&(t.body=e),this.u.fetch(new Request(this.f,t)).then(this.uc.bind(this),this.Va.bind(this))},e.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,pa(this)),this.readyState=ha},e.uc=function(e){this.a&&(this.g=e,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=e.headers,this.readyState=2,ma(this)),this.a&&(this.readyState=3,ma(this),this.a&&("arraybuffer"===this.responseType?e.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):void 0!==u.ReadableStream&&"body"in e?(this.response=this.responseText="",this.c=e.body.getReader(),this.m=new TextDecoder,fa(this)):e.text().then(this.tc.bind(this),this.Va.bind(this)))))},e.pc=function(e){if(this.a){var t=this.m.decode(e.value?e.value:new Uint8Array(0),{stream:!e.done});t&&(this.response=this.responseText+=t),e.done?pa(this):ma(this),3==this.readyState&&fa(this)}},e.tc=function(e){this.a&&(this.response=this.responseText=e,pa(this))},e.sc=function(e){this.a&&(this.response=e,pa(this))},e.Va=function(e){var t=this.i;t&&t.log(na,"Failed to fetch url "+this.f,e instanceof Error?e:Error(e)),this.a&&pa(this)},e.setRequestHeader=function(e,t){this.l.append(e,t)},e.getResponseHeader=function(e){return this.b?this.b.get(e.toLowerCase())||"":((e=this.i)&&e.log(na,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var e=this.i;return e&&e.log(na,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}e=[];for(var t=this.b.entries(),r=t.next();!r.done;)r=r.value,e.push(r[0]+": "+r[1]),r=t.next();return e.join("\r\n")},Object.defineProperty(da.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(e){this.h=e?"include":"same-origin"}}),T(ya,_r);var ga="";ya.prototype.b=ua("goog.net.XhrIo");var va=/^https?$/i,ba=["POST","PUT"];function _a(e){return"content-type"==e.toLowerCase()}function wa(e,t){e.c=!1,e.a&&(e.f=!0,e.a.abort(),e.f=!1),e.h=t,xa(e),Ea(e)}function xa(e){e.J||(e.J=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function Sa(e){if(e.c&&void 0!==s)if(e.C[1]&&4==Ma(e)&&2==ka(e))la(e.b,Ca(e,"Local request error detected and ignored"));else if(e.i&&4==Ma(e))Er(e.Wb,0,e);else if(e.dispatchEvent("readystatechange"),4==Ma(e)){la(e.b,Ca(e,"Request complete")),e.c=!1;try{var t,r=ka(e);e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var n=!0;break e;default:n=!1}if(!(t=n)){var i;if(i=0===r){var o=String(e.l).match(Ar)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!va.test(o?o.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{try{var l=2=t.l&&t.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(e=new La(this),Aa(this),Oa(this,!1,e))}},ja.prototype.m=function(e,t){this.i=!1,Oa(this,e,t)},ja.prototype.then=function(e,t,r){var n,i,o=new wt((function(e,t){n=e,i=t}));return Pa(this,n,(function(e){e instanceof La?o.cancel():i(e)})),o.then(e,t,r)},ja.prototype.$goog_Thenable=!0,T(Da,D),Da.prototype.message="Deferred has already fired",Da.prototype.name="AlreadyCalledError",T(La,D),La.prototype.message="Deferred was canceled",La.prototype.name="CanceledError",Na.prototype.c=function(){throw delete Fa[this.a],this.b};var Fa={};function Ua(e){var t={},r=t.document||document,n=ke(e).toString(),i=mt(document,"SCRIPT"),o={Xb:i,Ma:void 0},a=new ja(o),s=null,l=null!=t.timeout?t.timeout:5e3;return 0e||$e&&ut&&!(9t?null:"string"==typeof e?e.charAt(t):e[t]}(o.Y()),n=u.FormData&&t instanceof u.FormData,!K(ba,r)||i||n||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(e,t){this.a.setRequestHeader(t,e)}),e),e.m&&(e.a.responseType=e.m),"withCredentials"in e.a&&e.a.withCredentials!==e.S&&(e.a.withCredentials=e.S);try{Ta(e),0t;t++){i=0|r[t-15],n=0|r[t-2];var o=(0|r[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|r[t-7])+((n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10)|0;r[t]=o+a|0}n=0|e.a[0],i=0|e.a[1];var s=0|e.a[2],u=0|e.a[3],l=0|e.a[4],c=0|e.a[5],d=0|e.a[6];for(o=0|e.a[7],t=0;64>t;t++){var h=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&s^i&s)|0;a=(o=o+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))|0)+((a=(a=l&c^~l&d)+(0|rl[t])|0)+(0|r[t])|0)|0,o=d,d=c,c=l,l=u+a|0,u=s,s=i,i=n,n=a+h|0}e.a[0]=e.a[0]+n|0,e.a[1]=e.a[1]+i|0,e.a[2]=e.a[2]+s|0,e.a[3]=e.a[3]+u|0,e.a[4]=e.a[4]+l|0,e.a[5]=e.a[5]+c|0,e.a[6]=e.a[6]+d|0,e.a[7]=e.a[7]+o|0}function hl(e,t,r){void 0===r&&(r=t.length);var n=0,i=e.c;if("string"==typeof t)for(;n=o&&o==(0|o)))throw Error("message must be a byte array");e.f[i++]=o,i==e.b&&(dl(e),i=0)}}e.c=i,e.g+=r}ol.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):Z(this.h)};var fl=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function pl(){ol.call(this,8,ml)}T(pl,ol);var ml=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function yl(e,t,r,n,i,o){this.v=e,this.i=t,this.l=r,this.m=n||null,this.u=i||null,this.s=o,this.h=t+":"+r,this.C=new il,this.g=new tl(this.h),this.f=null,this.b=[],this.a=this.c=null}function gl(e){return new k("invalid-cordova-configuration",e)}function vl(e,r){for(var n=0;nt.c?hl(t,cl,56-t.c):hl(t,cl,t.b-(t.c-56));for(var n=63;56<=n;n--)t.f[n]=255&r,r/=256;for(dl(t),n=r=0;n>i&255;return function(e){return Y(e,(function(e){return 1<(e=e.toString(16)).length?e:"0"+e})).join("")}(e)}(o),c.sessionId=o;var d=fu(e.v,e.i,e.l,t,r,null,n,e.m,c,e.u,i,e.s);return e.ma().then((function(){var t=e.h;return e.C.a.set(nl,a.w(),t)})).then((function(){var t=Cn("cordova.plugins.browsertab.isAvailable",u);if("function"!=typeof t)throw new k("invalid-cordova-configuration");var r=null;t((function(t){if(t){if("function"!=typeof(r=Cn("cordova.plugins.browsertab.openUrl",u)))throw new k("invalid-cordova-configuration");r(d)}else{if("function"!=typeof(r=Cn("cordova.InAppBrowser.open",u)))throw new k("invalid-cordova-configuration");t=kn(),e.a=r(d,t.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||t.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}(i,e,t,r,n)})).then((function(){return new wt((function(e,t){s=function(){var t=Cn("cordova.plugins.browsertab.close",u);return e(),"function"==typeof t&&t(),i.a&&"function"==typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(s),l=function(){a||(a=Tr(2e3).then((function(){t(new k("redirect-cancelled-by-user"))})))},c=function(){zn()&&l()},o.addEventListener("resume",l,!1),kn().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)})).o((function(e){return _l(i).then((function(){throw e}))}))})).oa((function(){l&&o.removeEventListener("resume",l,!1),c&&o.removeEventListener("visibilitychange",c,!1),a&&a.cancel(),s&&i.Ta(s),i.c=null}))},e.Ea=function(e){this.b.push(e),bl(this).o((function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new Fo("unknown",null,null,null,new k("no-auth-event")),e(t))}))},e.Ta=function(e){Q(this.b,(function(t){return t==e}))};var xl={name:"pendingRedirect",F:"session"};function Sl(e){return Zu(e.b,xl,e.a)}function El(e,t,r,n){this.i={},this.u=0,this.D=e,this.v=t,this.m=r,this.J=n,this.h=[],this.f=!1,this.l=x(this.s,this),this.b=new Ul,this.C=new Wl,this.g=new wl(Nl(this.v,this.m)),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.C,this.c.linkViaPopup=this.C,this.c.reauthViaPopup=this.C,this.a=Tl(this.D,this.v,this.m,j,this.J)}function Tl(e,t,r,n,o){var a=i.default.SDK_VERSION||null;return gn()?new yl(e,t,r,a,n,o):new lu(e,t,r,a,n,o)}function Ml(e){e.f||(e.f=!0,e.a.Ea(e.l));var t=e.a;return e.a.ma().o((function(r){throw e.a==t&&e.reset(),r}))}function kl(e){e.a.Yb()&&Ml(e).o((function(t){var r=new Fo("unknown",null,null,null,new k("operation-not-supported-in-this-environment"));Il(t)&&e.s(r)})),e.a.Ub()||Bl(e.b)}function Cl(e,t){K(e.h,t)||e.h.push(t),e.f||function(e){return e.b.get(xl,e.a).then((function(e){return"pending"==e}))}(e.g).then((function(t){t?Sl(e.g).then((function(){Ml(e).o((function(t){var r=new Fo("unknown",null,null,null,new k("operation-not-supported-in-this-environment"));Il(t)&&e.s(r)}))})):kl(e)})).o((function(){kl(e)}))}function jl(e,t){Q(e.h,(function(e){return e==t}))}El.prototype.reset=function(){this.f=!1,this.a.Ta(this.l),this.a=Tl(this.D,this.v,this.m,null,this.J),this.i={}},El.prototype.s=function(e){if(!e)throw new k("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),e&&e.getUid()&&this.i.hasOwnProperty(e.getUid()))return!1;for(var t=!1,r=0;re.f&&(e.a=e.f),t)}(t,r)).then((function(){return e=u.document,t=null,zn()||!e?Ct():new wt((function(r){t=function(){zn()&&(e.removeEventListener("visibilitychange",t,!1),r())},e.addEventListener("visibilitychange",t,!1)})).o((function(r){throw e.removeEventListener("visibilitychange",t,!1),r}));var e,t})).then((function(){return t.h()})).then((function(){e(t,!0)})).o((function(r){t.i(r)&&e(t,!1)}))}(this,!0)},ac.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},sc.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},sc.prototype.getToken=function(e){return e=!!e,this.b&&!this.a?jt(new k("user-token-expired")):e||!this.b||Date.now()>this.c-3e4?this.a?function(e,t){return function(e,t){return new wt((function(r,n){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?ns(e,e.l+"?key="+encodeURIComponent(e.c),(function(e){e?e.error?n(eu(e)):e.access_token&&e.refresh_token?r(e):n(new k("internal-error")):n(new k("network-request-failed"))}),"POST",$r(t).toString(),e.g,e.m.get()):n(new k("internal-error"))}))}(e.f,t).then((function(t){return e.b=zi(t.access_token),e.a=t.refresh_token,uc(e,t.expires_in),{accessToken:e.b.toString(),refreshToken:e.a}})).o((function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t}))}(this,{grant_type:"refresh_token",refresh_token:this.a}):Ct(null):Ct({accessToken:this.b.toString(),refreshToken:this.a})},cc.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},T(hc,_r),hc.prototype.xa=function(e){this.za=e,Za(this.a,e)},hc.prototype.la=function(){return this.za},hc.prototype.Ga=function(){return Z(this.aa)},hc.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())},Xn(hc.prototype,"providerId","firebase"),(e=hc.prototype).reload=function(){var e=this;return Bc(this,Mc(this).then((function(){return Pc(e).then((function(){return xc(e)})).then(Tc)})))},e.oc=function(e){return this.I(e).then((function(e){return new Xl(e)}))},e.I=function(e){var t=this;return Bc(this,Mc(this).then((function(){return t.h.getToken(e)})).then((function(e){if(!e)throw new k("internal-error");return e.accessToken!=t.Aa&&(wc(t,e.accessToken),t.dispatchEvent(new nc("tokenChanged"))),Oc(t,"refreshToken",e.refreshToken),e.accessToken})))},e.Kc=function(e){if(!(e=e.users)||!e.length)throw new k("internal-error");Ec(this,{uid:(e=e[0]).localId,displayName:e.displayName,photoURL:e.photoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt,tenantId:e.tenantId});for(var t=function(e){return(e=e.providerUserInfo)&&e.length?Y(e,(function(e){return new dc(e.rawId,e.providerId,e.email,e.displayName,e.photoUrl,e.phoneNumber)})):[]}(e),r=0;rthis.u&&(this.u=0),0==this.u&&ud(this)&&_c(ud(this)),this.removeAuthTokenListener(e)},e.addAuthTokenListener=function(e){var t=this;this.s.push(e),dd(this,this.h.then((function(){t.l||K(t.s,e)&&e(ld(t))})))},e.removeAuthTokenListener=function(e){Q(this.s,(function(t){return t==e}))},e.delete=function(){this.l=!0;for(var e=0;ei||i>=Ld.length)throw new k("internal-error","Argument validator received an unsupported number of arguments.");r=Ld[i],n=(n?"":r+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.K+".";break e}n=null}}if(n)throw new k("argument-error",e+" failed: "+n)}(e=Md.prototype).Ia=function(){var e=this;return this.f?this.f:this.f=Pd(this,Ct().then((function(){if(An()&&!bn())return yn();throw new k("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return e.m.g(e.u())})).then((function(t){return e.g=t,Js(e.s,Ds,{})})).then((function(t){e.a[jd]=t.recaptchaSiteKey})).o((function(t){throw e.f=null,t})))},e.render=function(){Id(this);var e=this;return Pd(this,this.Ia().then((function(){if(null===e.c){var t=e.v;if(!e.i){var r=ct(t);t=function(e,t,r){var n=arguments,i=document,o=String(n[0]),a=n[1];if(!lt&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',He(a.name),'"'),a.type){o.push(' type="',He(a.type),'"');var s={};ve(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=mt(i,o),a&&("string"==typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):dt(o,a)),2=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),i=n,o=void 0;try{var u=t&&t.error;if(u){var l=u.status;if("string"==typeof l){if(!a[l])return new s("internal","internal");n=a[l],i=l}var c=u.message;"string"==typeof c&&(i=c),void 0!==(o=u.details)&&(o=r.decode(o))}}catch(d){}return"ok"===n?null:new s(n,i,o)}var l=function(){function e(e,t){var r=this;this.auth=null,this.messaging=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then((function(e){return r.auth=e}),(function(){})),this.messaging||t.get().then((function(e){return r.messaging=e}),(function(){}))}return e.prototype.getAuthToken=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:if(!this.auth)return[2,void 0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return(e=t.sent())?[2,e.accessToken]:[2,void 0];case 3:return t.sent(),[2,void 0];case 4:return[2]}}))}))},e.prototype.getInstanceIdToken=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:if(!this.messaging||!("Notification"in self)||"granted"!==Notification.permission)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.messaging.getToken()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,void 0];case 4:return[2]}}))}))},e.prototype.getContext=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e,t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return[4,this.getAuthToken()];case 1:return e=r.sent(),[4,this.getInstanceIdToken()];case 2:return t=r.sent(),[2,{authToken:e,instanceIdToken:t}]}}))}))},e}();function c(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n]));return r}var d=function(){function e(){}return e.prototype.encode=function(e){var t=this;if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map((function(e){return t.encode(e)}));if("function"==typeof e||"object"==typeof e)return c(e,(function(e){return t.encode(e)}));throw new Error("Data cannot be encoded in JSON: "+e)},e.prototype.decode=function(e){var t=this;if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":var r=Number(e.value);if(isNaN(r))throw new Error("Data cannot be decoded from JSON: "+e);return r;default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map((function(e){return t.decode(e)})):"function"==typeof e||"object"==typeof e?c(e,(function(e){return t.decode(e)})):e},e}();var h=function(){function e(e,t,r,n,i,o){var a=this;void 0===i&&(i="us-central1"),this.app_=e,this.appCheckProvider=n,this.fetchImpl=o,this.serializer=new d,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(a.deleteService())}},this.contextProvider=new l(t,r),this.cancelAllRequests=new Promise((function(e){a.deleteService=function(){return e()}}));try{var s=new URL(i);this.customDomain=s.origin,this.region="us-central1"}catch(u){this.customDomain=null,this.region=i}}return Object.defineProperty(e.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),e.prototype._url=function(e){var t=this.app_.options.projectId;return null!==this.emulatorOrigin?this.emulatorOrigin+"/"+t+"/"+this.region+"/"+e:null!==this.customDomain?this.customDomain+"/"+e:"https://"+this.region+"-"+t+".cloudfunctions.net/"+e},e.prototype.useEmulator=function(e,t){this.emulatorOrigin="http://"+e+":"+t},e.prototype.useFunctionsEmulator=function(e){this.emulatorOrigin=e},e.prototype.httpsCallable=function(e,t){var r=this;return function(n){return r.call(e,n,t||{})}},e.prototype.postJSON=function(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r["Content-Type"]="application/json",[4,this.getAppCheckToken()];case 1:null!==(n=i.sent())&&(r["X-Firebase-AppCheck"]=n),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.fetchImpl(e,{method:"POST",body:JSON.stringify(t),headers:r})];case 3:return o=i.sent(),[3,5];case 4:return i.sent(),[2,{status:0,json:null}];case 5:a=null,i.label=6;case 6:return i.trys.push([6,8,,9]),[4,o.json()];case 7:return a=i.sent(),[3,9];case 8:return i.sent(),[3,9];case 9:return[2,{status:o.status,json:a}]}}))}))},e.prototype.getAppCheckToken=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return(e=this.appCheckProvider.getImmediate({optional:!0}))?[4,e.getToken()]:[3,2];case 1:return[2,t.sent().token];case 2:return[2,null]}}))}))},e.prototype.call=function(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,a,l,c,d,h,p,m,y,g;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return n=this._url(e),t=this.serializer.encode(t),o={data:t},a={},[4,this.contextProvider.getContext()];case 1:return(l=i.sent()).authToken&&(a.Authorization="Bearer "+l.authToken),l.instanceIdToken&&(a["Firebase-Instance-ID-Token"]=l.instanceIdToken),c=r.timeout||7e4,d=function(e){var t,r=new Promise((function(r,n){t=setTimeout((function(){n(new s("deadline-exceeded","deadline-exceeded"))}),e)}));return{timer:t,promise:r}}(c),h=d.timer,p=d.promise,[4,Promise.race([f(h,this.postJSON(n,o,a)),p,f(h,this.cancelAllRequests)])];case 2:if(!(m=i.sent()))throw new s("cancelled","Firebase Functions instance was deleted.");if(y=u(m.status,m.json,this.serializer))throw y;if(!m.json)throw new s("internal","Response is not valid JSON object.");if(void 0===(g=m.json.data)&&(g=m.json.result),void 0===g)throw new s("internal","Response is missing data field.");return[2,{data:this.serializer.decode(g)}]}}))}))},e}();function f(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return r=n.sent(),clearTimeout(e),[2,r]}}))}))}(function(e,t){var r={Functions:h};e.INTERNAL.registerComponent(new o.Component("functions",(function(e,r){var n=r.instanceIdentifier,i=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal"),s=e.getProvider("messaging");return new h(i,o,s,a,n,t)}),"PUBLIC").setServiceProps(r).setMultipleInstances(!0))})(n.default,fetch.bind(self)),n.default.registerVersion("@firebase/functions","0.6.16")},{"@firebase/app":"VxYX",tslib:"vCxL","@firebase/component":"sLOu"}],a7Bh:[function(e,t,r){"use strict";e("@firebase/functions")},{"@firebase/functions":"SScM"}],ueHA:[function(e,t,r){var n=arguments[3];Object.defineProperty(r,"__esModule",{value:!0}),r.getStatEventTarget=r.default=r.createWebChannelTransport=r.XhrIo=r.WebChannel=r.Stat=r.FetchXmlHttpFactory=r.EventType=r.Event=r.ErrorCode=void 0;var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var s,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:{},l=l||{},c=u||self;function d(){}function h(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 f(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),m=0;function y(e,t,r){return e.call.apply(e.bind,arguments)}function g(e,t,r){if(!e)throw Error();if(2t?1:0}e:{var P=c.navigator;if(P){var I=P.userAgent;if(I){C=I;break e}}C=""}function R(e,t,r){for(var n in e)t.call(r,e[n],n,e)}function D(e){var t={};for(var r in e)t[r]=e[r];return t}var L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function N(e,t){for(var r,n,i=1;iparseFloat(Y)){U=String(K);break e}}U=Y}var $,Q={};function J(){return function(e){var t=Q;return Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=e(9)}((function(){for(var e=0,t=j(String(U)).split("."),r=j("9").split("."),n=Math.max(t.length,r.length),i=0;0==e&&i>>0);function xe(e){return"function"==typeof e?e:(e[we]||(e[we]=function(t){return e.handleEvent(t)}),e[we])}function Se(){w.call(this),this.i=new ue(this),this.P=this,this.I=null}function Ee(e,t){var r,n=e.I;if(n)for(r=[];n;n=n.I)r.push(n);if(e=e.P,n=t.type||t,"string"==typeof t)t=new te(t,e);else if(t instanceof te)t.target=t.target||e;else{var i=t;N(t=new te(n,e),i)}if(i=!0,r)for(var o=r.length-1;0<=o;o--){var a=t.g=r[o];i=Te(a,n,!0,t)&&i}if(i=Te(a=t.g=e,n,!0,t)&&i,i=Te(a,n,!1,t)&&i,r)for(o=0;ot.h&&(t.h++,e.next=t.g,t.g=e)}Re=!1}function Ne(e,t){Se.call(this),this.h=e||1,this.g=t||c,this.j=v(this.kb,this),this.l=Date.now()}function Fe(e){e.da=!1,e.S&&(e.g.clearTimeout(e.S),e.S=null)}function Ue(e,t,r){if("function"==typeof e)r&&(e=v(e,r));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=v(e.handleEvent,e)}return 2147483647n.length)){var i=n[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;at.length?gt:(t=t.substr(n,r),e.C=n+r,t))}function St(e){e.Y=Date.now()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=rt(v(e.eb,e),t)}function Tt(e){e.B&&(c.clearTimeout(e.B),e.B=null)}function Mt(e){0==e.l.G||e.I||$r(e.l,e)}function kt(e){Tt(e);var t=e.L;t&&"function"==typeof t.na&&t.na(),e.L=null,Fe(e.W),He(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.na())}function Ct(e,t){try{var r=e.l;if(0!=r.G&&(r.g==e||sr(r.i,e)))if(r.I=e.N,!e.J&&sr(r.i,e)&&3==r.G){try{var n=r.Ca.g.parse(t)}catch(o){n=null}if(Array.isArray(n)&&3==n.length){var i=n;if(0==i[0]){e:if(!r.u){if(r.g){if(!(r.g.F+3e3i[2]&&r.N&&0==r.A&&!r.v&&(r.v=rt(v(r.ab,r),6e3));if(1>=ar(r.i)&&r.ka){try{r.ka()}catch(o){}r.ka=void 0}}else Jr(r,11)}else if((e.J||r.g==e)&&Kr(r),!k(t))for(i=r.Ca.g.parse(t),t=0;tt)&&(3!=t||G||this.g&&(this.h.h||this.g.ga()||Ir(this.g)))){this.I||4!=t||7==r||Je(8==r||0>=n?3:2),Tt(this);var i=this.g.ba();this.N=i;t:if(_t(this)){var o=Ir(this.g);e="";var a=o.length,s=4==Pr(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){kt(this),Mt(this);var u="";break t}this.h.i=new c.TextDecoder}for(r=0;rt)throw Error("Bad port number "+t);e.m=t}else e.m=null}function Ut(e,t,r){t instanceof $t?(e.h=t,function(e,t){t&&!e.j&&(Qt(e),e.i=null,e.g.forEach((function(e,t){var r=t.toLowerCase();t!=r&&(Jt(this,t),er(this,r,e))}),e)),e.j=t}(e.h,e.g)):(r||(t=Gt(t,Xt)),e.h=new $t(t,e.g))}function Bt(e,t,r){e.h.set(t,r)}function zt(e){return Bt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function Vt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Gt(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,Wt),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Wt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Rt.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Gt(t,Ht,!0),":");var r=this.i;return(r||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Gt(t,Ht,!0),"@"),e.push(encodeURIComponent(String(r)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(r=this.m)&&e.push(":",String(r))),(r=this.l)&&(this.i&&"/"!=r.charAt(0)&&e.push("/"),e.push(Gt(r,"/"==r.charAt(0)?Yt:qt,!0))),(r=this.h.toString())&&e.push("?",r),(r=this.o)&&e.push("#",Gt(r,Kt)),e.join("")};var Ht=/[#\/\?@]/g,qt=/[#\?:]/g,Yt=/[#\?]/g,Xt=/[#\?@]/g,Kt=/#/g;function $t(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Qt(e){e.g||(e.g=new Ot,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var r=0;r2*e.i&&At(e)))}function Zt(e,t){return Qt(e),t=tr(e,t),Pt(e.g.h,t)}function er(e,t,r){Jt(e,t),0=e.j}function ar(e){return e.h?1:e.g?e.g.size:0}function sr(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function ur(e,t){e.g?e.g.add(t):e.h=t}function lr(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function cr(e){var t,r;if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){var n=e.i;try{for(var i=a(e.g.values()),o=i.next();!o.done;o=i.next()){var s=o.value;n=n.concat(s.D)}}catch(d){t={error:d}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}return M(e.i)}function dr(){}function hr(){this.g=new dr}function fr(e,t,r){var n=r||"";try{jt(e,(function(e,r){var i=e;f(e)&&(i=Me(e)),t.push(n+r+"="+encodeURIComponent(i))}))}catch(s){throw t.push(n+"type="+encodeURIComponent("_badmap")),s}}function pr(e,t,r,n,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(n)}catch(u){}}function mr(e){this.l=e.$b||null,this.j=e.ib||!1}function yr(e,t){Se.call(this),this.D=e,this.u=t,this.m=void 0,this.readyState=gr,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}nr.prototype.cancel=function(){var e,t;if(this.i=cr(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var r=a(this.g.values()),n=r.next();!n.done;n=r.next())n.value.cancel()}catch(u){e={error:u}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.g.clear()}},dr.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},dr.prototype.parse=function(e){return c.JSON.parse(e,void 0)},_(mr,ot),mr.prototype.g=function(){return new yr(this.l,this.j)},mr.prototype.i=function(e){return function(){return e}}({}),_(yr,Se);var gr=0;function vr(e){e.j.read().then(e.Sa.bind(e)).catch(e.ha.bind(e))}function br(e){e.readyState=4,e.l=null,e.j=null,e.A=null,_r(e)}function _r(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(s=yr.prototype).open=function(e,t){if(this.readyState!=gr)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,_r(this)},s.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||c).fetch(new Request(this.B,t)).then(this.Va.bind(this),this.ha.bind(this))},s.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,br(this)),this.readyState=gr},s.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,_r(this)),this.g&&(this.readyState=3,_r(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==c.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;vr(this)}else e.text().then(this.Ua.bind(this),this.ha.bind(this))},s.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?br(this):_r(this),3==this.readyState&&vr(this)}},s.Ua=function(e){this.g&&(this.response=this.responseText=e,br(this))},s.Ta=function(e){this.g&&(this.response=e,br(this))},s.ha=function(){this.g&&br(this)},s.setRequestHeader=function(e,t){this.v.append(e,t)},s.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},s.getAllResponseHeaders=function(){if(!this.h)return"";for(var e=[],t=this.h.entries(),r=t.next();!r.done;)r=r.value,e.push(r[0]+": "+r[1]),r=t.next();return e.join("\r\n")},Object.defineProperty(yr.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var wr=c.JSON.parse;function xr(e){Se.call(this),this.headers=new Ot,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=Sr,this.K=this.L=!1}_(xr,Se);var Sr="",Er=/^https?$/i,Tr=["POST","PUT"];function Mr(e){return"content-type"==e.toLowerCase()}function kr(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,Cr(e),Or(e)}function Cr(e){e.D||(e.D=!0,Ee(e,"complete"),Ee(e,"error"))}function jr(e){if(e.h&&void 0!==l&&(!e.C[1]||4!=Pr(e)||2!=e.ba()))if(e.v&&4==Pr(e))Ue(e.Fa,0,e);else if(Ee(e,"readystatechange"),4==Pr(e)){e.h=!1;try{var t,r=e.ba();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var n=!0;break e;default:n=!1}if(!(t=n)){var i;if(i=0===r){var o=String(e.H).match(It)[1]||null;if(!o&&c.self&&c.self.location){var a=c.self.location.protocol;o=a.substr(0,a.length-1)}i=!Er.test(o?o.toLowerCase():"")}t=i}if(t)Ee(e,"complete"),Ee(e,"success");else{e.m=6;try{var s=2(l-=o))o=Math.max(0,i[u].h-100),s=!1;else try{fr(c,a,"req"+l+"_")}catch(d){n&&n(c)}}if(s){n=a.join("&");break e}}return e=e.l.splice(0,r),t.D=e,n}function Hr(e){e.g||e.u||(e.Y=1,Ie(e.Ga,e),e.A=0)}function qr(e){return!(e.g||e.u||3<=e.A)&&(e.Y++,e.u=rt(v(e.Ga,e),Qr(e,e.A)),e.A++,!0)}function Yr(e){null!=e.B&&(c.clearTimeout(e.B),e.B=null)}function Xr(e){e.g=new ft(e,e.h,"rpc",e.Y),null===e.o&&(e.g.H=e.s),e.g.O=0;var t=Dt(e.oa);Bt(t,"RID","rpc"),Bt(t,"SID",e.J),Bt(t,"CI",e.N?"0":"1"),Bt(t,"AID",e.U),Gr(e,t),Bt(t,"TYPE","xmlhttp"),e.o&&e.s&&Rr(t,e.o,e.s),e.K&&e.g.setTimeout(e.K);var r=e.g;e=e.la,r.K=1,r.v=zt(Dt(t)),r.s=null,r.U=!0,bt(r,e)}function Kr(e){null!=e.v&&(c.clearTimeout(e.v),e.v=null)}function $r(e,t){var r=null;if(e.g==t){Kr(e),Yr(e),e.g=null;var n=2}else{if(!sr(e.i,t))return;r=t.D,lr(e.i,t),n=1}if(e.I=t.N,0!=e.G)if(t.i)if(1==n){r=t.s?t.s.length:0,t=Date.now()-t.F;var i=e.C;Ee(n=$e(),new tt(n,r,t,i)),zr(e)}else Hr(e);else if(3==(i=t.o)||0==i&&0=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=rt(v(e.Ha,e,t),Qr(e,e.C)),e.C++,!0))}(e,t)||2==n&&qr(e)))switch(r&&0t?null:"string"==typeof e?e.charAt(t):e[t]}(i.T()),r=c.FormData&&e instanceof c.FormData,!(0<=S(Tr,t))||n||r||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{Ar(this),0=this.O)){var e=2*this.O;this.h.info("BP detection timer enabled: "+e),this.B=rt(v(this.bb,this),e)}},s.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,et(10),Fr(this),Xr(this))},s.ab=function(){null!=this.v&&(this.v=null,Fr(this),qr(this),et(19))},s.jb=function(e){e?(this.h.info("Successfully pinged google.com"),et(2)):(this.h.info("Failed to ping google.com"),et(1))},(s=rn.prototype).xa=function(){},s.wa=function(){},s.va=function(){},s.ua=function(){},s.Oa=function(){},nn.prototype.g=function(e,t){return new on(e,t)},_(on,Se),on.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var e=this.g,t=this.l,r=this.h||void 0;e.Wa&&(e.h.info("Origin Trials enabled."),Ie(v(e.hb,e,t))),et(0),e.W=t,e.aa=r||{},e.N=e.X,e.F=en(e,null,e.W),zr(e)},on.prototype.close=function(){Nr(this.g)},on.prototype.u=function(e){if("string"==typeof e){var t={};t.__data__=e,Br(this.g,t)}else this.v?((t={}).__data__=Me(e),Br(this.g,t)):Br(this.g,e)},on.prototype.M=function(){this.g.j=null,delete this.j,Nr(this.g),delete this.g,on.Z.M.call(this)},_(an,ct),_(sn,dt),_(un,rn),un.prototype.xa=function(){Ee(this.g,"a")},un.prototype.wa=function(e){Ee(this.g,new an(e))},un.prototype.va=function(e){Ee(this.g,new sn(e))},un.prototype.ua=function(){Ee(this.g,"b")},nn.prototype.createWebChannel=nn.prototype.g,on.prototype.send=on.prototype.u,on.prototype.open=on.prototype.m,on.prototype.close=on.prototype.close,nt.NO_ERROR=0,nt.TIMEOUT=8,nt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.N,xr.prototype.listenOnce=xr.prototype.O,xr.prototype.getLastError=xr.prototype.La,xr.prototype.getLastErrorCode=xr.prototype.Da,xr.prototype.getStatus=xr.prototype.ba,xr.prototype.getResponseJson=xr.prototype.Qa,xr.prototype.getResponseText=xr.prototype.ga,xr.prototype.send=xr.prototype.ea;var ln=function(){return new nn};r.createWebChannelTransport=ln;var cn=function(){return $e()};r.getStatEventTarget=cn;var dn=nt;r.ErrorCode=dn;var hn=it;r.EventType=hn;var fn=Xe;r.Event=fn;var pn={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};r.Stat=pn;var mn=mr;r.FetchXmlHttpFactory=mn;var yn=st;r.WebChannel=yn;var gn=xr;r.XhrIo=gn;var vn={createWebChannelTransport:ln,getStatEventTarget:cn,ErrorCode:dn,EventType:hn,Event:fn,Stat:pn,FetchXmlHttpFactory:mn,WebChannel:yn,XhrIo:gn};r.default=vn},{}],pbUl:[function(e,t,r){e("process");var n=e("process");Object.defineProperty(r,"__esModule",{value:!0}),r.Z=r.W=r.U=r.T=r.M=r.L=r.K=r.H=r.G=r.E=r.C=void 0,r.a=function(e){var t,r,n=this;return(t=this._delegate,r=e,function(e,t){var r=this;return e.asyncQueue.enqueue((function(){return(0,i.__awaiter)(r,void 0,void 0,(function(){var r;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return r=function(e,t){var r=_(e);return r.persistence.runTransaction("Get named query","readonly",(function(e){return r.Ke.getNamedQuery(e,t)}))},[4,ls(e)];case 1:return[2,r.apply(void 0,[n.sent(),t])]}}))}))}))}(Hs(t=Os(t,Ws)),r).then((function(e){return e?new Ds(t,null,e.query):null}))).then((function(e){return e?new bl(n,e):null}))},r.i=r.e=r.c=void 0,r.j=function(e){var t;t=e,h.setLogLevel(t)},r.t=r.s=r.o=void 0,r.u=function(e){return function(e,t){var r=Hs(e=Os(e,Ws)),n=new Gs;return function(e,t,r,n){var o=this,a=function(e,t){return function(e,t){return new es(e,t)}(function(e,t){if(e instanceof Uint8Array)return Ja(e,t);if(e instanceof ArrayBuffer)return Ja(new Uint8Array(e),t);if(e instanceof ReadableStream)return e.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}("string"==typeof e?(new TextEncoder).encode(e):e),t)}(r,po(t));e.asyncQueue.enqueueAndForget((function(){return(0,i.__awaiter)(o,void 0,void 0,(function(){var t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return t=Ya,[4,ds(e)];case 1:return t.apply(void 0,[r.sent(),a,n]),[2]}}))}))}))}(r,e._databaseId,t,n),n}(this._delegate,e)};var i=e("tslib"),o=e("@firebase/util"),a=e("@firebase/logger"),s=e("@firebase/webchannel-wrapper");function u(e){return(u="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})(e)}var l=function(){function e(e,t){var r=this;this.previousValue=e,t&&(t.sequenceNumberHandler=function(e){return r.t(e)},this.i=function(e){return t.writeSequenceNumber(e)})}return e.prototype.t=function(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue},e.prototype.next=function(){var e=++this.previousValue;return this.i&&this.i(e),e},e}();l.o=-1;var c={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"},d=function(e){function t(t,r){var n=this;return(n=e.call(this,r)||this).code=t,n.message=r,n.name="FirebaseError",n.toString=function(){return n.name+": [code="+n.code+"]: "+n.message},n}return(0,i.__extends)(t,e),t}(Error),h=new a.Logger("@firebase/firestore");function f(){return h.logLevel}function p(e){for(var t=[],r=1;rt?1:0}function E(e,t,r){return e.length===t.length&&e.every((function(e,n){return r(e,t[n])}))}function T(e){return e+"\0"}var M=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new d(c.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new d(c.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new d(c.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new d(c.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var r=Math.floor(t/1e3);return new e(r,Math.floor(1e6*(t-1e3*r)))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?S(this.nanoseconds,e.nanoseconds):S(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},e.prototype.valueOf=function(){var e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},e}(),k=function(){function e(e){this.timestamp=e}return e.fromTimestamp=function(t){return new e(t)},e.min=function(){return new e(new M(0,0))},e.prototype.compareTo=function(e){return this.timestamp._compareTo(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e}();function C(e){var t=0;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function j(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function O(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}r.M=M;var A=function(){function e(e,t,r){void 0===t?t=0:t>e.length&&v(),void 0===r?r=e.length-t:r>e.length-t&&v(),this.segments=e,this.offset=t,this.len=r}return Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var r=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(e){r.push(e)})):r.push(t),this.construct(r)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return this.segments[this.offset]},e.prototype.lastSegment=function(){return this.get(this.length-1)},e.prototype.get=function(e){return this.segments[this.offset+e]},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.isPrefixOf=function(e){if(e.lengtho)return 1}return e.lengtht.length?1:0},e}(),P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.construct=function(e,r,n){return new t(e,r,n)},t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(){for(var e=[],r=0;r=0)throw new d(c.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");n.push.apply(n,a.split("/").filter((function(e){return e.length>0})))}return new t(n)},t.emptyPath=function(){return new t([])},t}(A),I=/^[_a-zA-Z][_a-zA-Z0-9]*$/,R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.construct=function(e,r,n){return new t(e,r,n)},t.isValidIdentifier=function(e){return I.test(e)},t.prototype.canonicalString=function(){return this.toArray().map((function(e){return e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e})).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},t.keyField=function(){return new t(["__name__"])},t.fromServerFormat=function(e){for(var r=[],n="",i=0,o=function(){if(0===n.length)throw new d(c.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");r.push(n),n=""},a=!1;i=Number.MIN_SAFE_INTEGER}var Y=function(){function e(e){this.path=e}return e.fromPath=function(t){return new e(P.fromString(t))},e.fromName=function(t){return new e(P.fromString(t).popFirst(5))},e.prototype.hasCollectionId=function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e},e.prototype.isEqual=function(e){return null!==e&&0===P.comparator(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(e,t){return P.comparator(e.path,t.path)},e.isDocumentKey=function(e){return e.length%2==0},e.fromSegments=function(t){return new e(new P(t.slice()))},e}();function X(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?z(e)?4:10:v()}function K(e,t){var r=X(e);if(r!==X(t))return!1;switch(r){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return G(e).isEqual(G(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 r=F(e.timestampValue),n=F(t.timestampValue);return r.seconds===n.seconds&&r.nanos===n.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return B(e.bytesValue).isEqual(B(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return U(e.geoPointValue.latitude)===U(t.geoPointValue.latitude)&&U(e.geoPointValue.longitude)===U(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return U(e.integerValue)===U(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){var r=U(e.doubleValue),n=U(t.doubleValue);return r===n?H(r)===H(n):isNaN(r)&&isNaN(n)}return!1}(e,t);case 9:return E(e.arrayValue.values||[],t.arrayValue.values||[],K);case 10:return function(e,t){var r=e.mapValue.fields||{},n=t.mapValue.fields||{};if(C(r)!==C(n))return!1;for(var i in r)if(r.hasOwnProperty(i)&&(void 0===n[i]||!K(r[i],n[i])))return!1;return!0}(e,t);default:return v()}}function $(e,t){return void 0!==(e.values||[]).find((function(e){return K(e,t)}))}function Q(e,t){var r=X(e),n=X(t);if(r!==n)return S(r,n);switch(r){case 0:return 0;case 1:return S(e.booleanValue,t.booleanValue);case 2:return function(e,t){var r=U(e.integerValue||e.doubleValue),n=U(t.integerValue||t.doubleValue);return rn?1:r===n?0:isNaN(r)?isNaN(n)?0:-1:1}(e,t);case 3:return J(e.timestampValue,t.timestampValue);case 4:return J(G(e),G(t));case 5:return S(e.stringValue,t.stringValue);case 6:return function(e,t){var r=B(e),n=B(t);return r.compareTo(n)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){for(var r=e.split("/"),n=t.split("/"),i=0;i":return e>0;case">=":return e>=0;default:return v()}},t.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},t}((function(){})),ge=function(e){function t(t,r,n){var i=this;return(i=e.call(this,t,r,n)||this).key=Y.fromName(n.referenceValue),i}return(0,i.__extends)(t,e),t.prototype.matches=function(e){var t=Y.comparator(e.key,this.key);return this.m(t)},t}(ye),ve=function(e){function t(t,r){var n=this;return(n=e.call(this,t,"in",r)||this).keys=_e("in",r),n}return(0,i.__extends)(t,e),t.prototype.matches=function(e){return this.keys.some((function(t){return t.isEqual(e.key)}))},t}(ye),be=function(e){function t(t,r){var n=this;return(n=e.call(this,t,"not-in",r)||this).keys=_e("not-in",r),n}return(0,i.__extends)(t,e),t.prototype.matches=function(e){return!this.keys.some((function(t){return t.isEqual(e.key)}))},t}(ye);function _e(e,t){var r;return((null===(r=t.arrayValue)||void 0===r?void 0:r.values)||[]).map((function(e){return Y.fromName(e.referenceValue)}))}var we=function(e){function t(t,r){return e.call(this,t,"array-contains",r)||this}return(0,i.__extends)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return ne(t)&&$(t.arrayValue,this.value)},t}(ye),xe=function(e){function t(t,r){return e.call(this,t,"in",r)||this}return(0,i.__extends)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return null!==t&&$(this.value.arrayValue,t)},t}(ye),Se=function(e){function t(t,r){return e.call(this,t,"not-in",r)||this}return(0,i.__extends)(t,e),t.prototype.matches=function(e){if($(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var t=e.data.field(this.field);return null!==t&&!$(this.value.arrayValue,t)},t}(ye),Ee=function(e){function t(t,r){return e.call(this,t,"array-contains-any",r)||this}return(0,i.__extends)(t,e),t.prototype.matches=function(e){var t=this,r=e.data.field(this.field);return!(!ne(r)||!r.arrayValue.values)&&r.arrayValue.values.some((function(e){return $(t.value.arrayValue,e)}))},t}(ye),Te=function(e,t){this.position=e,this.before=t};function Me(e){return(e.before?"b":"a")+":"+e.position.map((function(e){return Z(e)})).join(",")}var ke=function(e,t){void 0===t&&(t="asc"),this.field=e,this.dir=t};function Ce(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function je(e,t,r){for(var n=0,i=0;i0?e.explicitOrderBy[0].field:null}function Ne(e){for(var t=0,r=e.filters;t0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.p.push(new ke(R.keyField(),u))}}}return t.p}function Be(e){var t=_(e);if(!t.T)if("F"===t.limitType)t.T=he(t.path,t.collectionGroup,Ue(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var r=[],n=0,i=Ue(t);n0&&(t+=", orderBy: ["+e.orderBy.map((function(e){return function(e){return e.field.canonicalString()+" ("+e.dir+")"}(e)})).join(", ")+"]"),e.startAt&&(t+=", startAt: "+Me(e.startAt)),e.endAt&&(t+=", endAt: "+Me(e.endAt)),"Target("+t+")"}(Be(e))+"; limitType="+e.limitType+")"}function He(e,t){return t.isFoundDocument()&&function(e,t){var r=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(r):Y.isDocumentKey(e.path)?e.path.isEqual(r):e.path.isImmediateParentOf(r)}(e,t)&&function(e,t){for(var r=0,n=e.explicitOrderBy;r0&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,r=this.root;!r.isEmpty();){var n=this.comparator(e,r.key);if(0===n)return t+r.left.size;n<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal((function(t,r){return e(t,r),!1}))},e.prototype.toString=function(){var e=[];return this.inorderTraversal((function(t,r){return e.push(t+":"+r),!1})),"{"+e.join(", ")+"}"},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Pt(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Pt(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Pt(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(e){return new Pt(this.root,e,this.comparator,!0)},e}(),Pt=function(){function e(e,t,r,n){this.isReverse=n,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=t?r(e.key,t):1,n&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return e.prototype.getNext=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},e.prototype.hasNext=function(){return this.nodeStack.length>0},e.prototype.peek=function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},e}(),It=function(){function e(t,r,n,i,o){this.key=t,this.value=r,this.color=null!=n?n:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=o?o:e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,r,n,i,o){return new e(null!=t?t:this.key,null!=r?r:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,r){var n=this,i=r(e,n.key);return(n=i<0?n.copy(null,null,null,n.left.insert(e,t,r),null):0===i?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,r))).fixUp()},e.prototype.removeMin=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()},e.prototype.remove=function(t,r){var n,i=this;if(r(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,r),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===r(t,i.key)){if(i.right.isEmpty())return e.EMPTY;n=i.right.min(),i=i.copy(n.key,n.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(t,r))}return i.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=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},e.prototype.moveRedLeft=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},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=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)},e.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw v();if(this.right.isRed())throw v();var e=this.left.check();if(e!==this.right.check())throw v();return e+(this.isRed()?0:1)},e}();It.EMPTY=null,It.RED=!0,It.BLACK=!1,It.EMPTY=new(function(){function e(){this.size=0}return Object.defineProperty(e.prototype,"key",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){throw v()},enumerable:!1,configurable:!0}),e.prototype.copy=function(e,t,r,n,i){return this},e.prototype.insert=function(e,t,r){return new It(e,t)},e.prototype.remove=function(e,t){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}());var Rt=function(){function e(e){this.comparator=e,this.data=new At(this.comparator)}return e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.inorderTraversal((function(t,r){return e(t),!1}))},e.prototype.forEachInRange=function(e,t){for(var r=this.data.getIteratorFrom(e[0]);r.hasNext();){var n=r.getNext();if(this.comparator(n.key,e[1])>=0)return;t(n.key)}},e.prototype.forEachWhile=function(e,t){var r;for(r=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return},e.prototype.firstAfterOrEqual=function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null},e.prototype.getIterator=function(){return new Dt(this.data.getIterator())},e.prototype.getIteratorFrom=function(e){return new Dt(this.data.getIteratorFrom(e))},e.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(e){var t=this;return t.size0&&(this.k=!0,this.C=e)},e.prototype.M=function(){var e=Gt(),t=Gt(),r=Gt();return this.D.forEach((function(n,i){switch(i){case 0:e=e.add(n);break;case 2:t=t.add(n);break;case 1:r=r.add(n);break;default:v()}})),new Yt(this.C,this.N,e,t,r)},e.prototype.L=function(){this.k=!1,this.D=er()},e.prototype.B=function(e,t){this.k=!0,this.D=this.D.insert(e,t)},e.prototype.q=function(e){this.k=!0,this.D=this.D.remove(e)},e.prototype.U=function(){this.S+=1},e.prototype.K=function(){this.S-=1},e.prototype.j=function(){this.k=!0,this.N=!0},e}(),Jt=function(){function e(e){this.W=e,this.G=new Map,this.H=Nt(),this.J=Zt(),this.Y=new Rt(S)}return e.prototype.X=function(e){for(var t=0,r=e.v;t0?e.targetIds.forEach(t):this.G.forEach((function(e,n){r.st(n)&&t(n)}))},e.prototype.rt=function(e){var t=e.targetId,r=e.V.count,n=this.ot(t);if(n){var i=n.target;if(me(i))if(0===r){var o=new Y(i.path);this.tt(t,o,ce.newNoDocument(o,k.min()))}else b(1===r);else this.ct(t)!==r&&(this.it(t),this.Y=this.Y.add(t))}},e.prototype.ut=function(e){var t=this,r=new Map;this.G.forEach((function(n,i){var o=t.ot(i);if(o){if(n.current&&me(o.target)){var a=new Y(o.target.path);null!==t.H.get(a)||t.at(i,a)||t.tt(i,a,ce.newNoDocument(a,e))}n.$&&(r.set(i,n.M()),n.L())}}));var n=Gt();this.J.forEach((function(e,r){var i=!0;r.forEachWhile((function(e){var r=t.ot(e);return!r||2===r.purpose||(i=!1,!1)})),i&&(n=n.add(e))}));var i=new qt(e,r,this.Y,this.H,n);return this.H=Nt(),this.J=Zt(),this.Y=new Rt(S),i},e.prototype.Z=function(e,t){if(this.st(e)){var r=this.at(e,t.key)?2:0;this.nt(e).B(t.key,r),this.H=this.H.insert(t.key,t),this.J=this.J.insert(t.key,this.ht(t.key).add(e))}},e.prototype.tt=function(e,t,r){if(this.st(e)){var n=this.nt(e);this.at(e,t)?n.B(t,1):n.q(t),this.J=this.J.insert(t,this.ht(t).delete(e)),r&&(this.H=this.H.insert(t,r))}},e.prototype.removeTarget=function(e){this.G.delete(e)},e.prototype.ct=function(e){var t=this.nt(e).M();return this.W.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size},e.prototype.U=function(e){this.nt(e).U()},e.prototype.nt=function(e){var t=this.G.get(e);return t||(t=new Qt,this.G.set(e,t)),t},e.prototype.ht=function(e){var t=this.J.get(e);return t||(t=new Rt(S),this.J=this.J.insert(e,t)),t},e.prototype.st=function(e){var t=null!==this.ot(e);return t||p("WatchChangeAggregator","Detected inactive target",e),t},e.prototype.ot=function(e){var t=this.G.get(e);return t&&t.F?null:this.W.lt(e)},e.prototype.it=function(e){var t=this;this.G.set(e,new Qt),this.W.getRemoteKeysForTarget(e).forEach((function(r){t.tt(e,r,null)}))},e.prototype.at=function(e,t){return this.W.getRemoteKeysForTarget(e).has(t)},e}();function Zt(){return new At(Y.comparator)}function er(){return new At(Y.comparator)}var tr={asc:"ASCENDING",desc:"DESCENDING"},rr={"<":"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"},nr=function(e,t){this.databaseId=e,this.I=t};function ir(e,t){return e.I?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function or(e,t){return e.I?t.toBase64():t.toUint8Array()}function ar(e,t){return ir(e,t.toTimestamp())}function sr(e){return b(!!e),k.fromTimestamp(function(e){var t=F(e);return new M(t.seconds,t.nanos)}(e))}function ur(e,t){return function(e){return new P(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function lr(e){var t=P.fromString(e);return b(Ir(t)),t}function cr(e,t){return ur(e.databaseId,t.path)}function dr(e,t){var r=lr(t);if(r.get(1)!==e.databaseId.projectId)throw new d(c.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+e.databaseId.projectId);if(r.get(3)!==e.databaseId.database)throw new d(c.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+e.databaseId.database);return new Y(mr(r))}function hr(e,t){return ur(e.databaseId,t)}function fr(e){var t=lr(e);return 4===t.length?P.emptyPath():mr(t)}function pr(e){return new P(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function mr(e){return b(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function yr(e,t,r){return{name:cr(e,t),fields:r.value.mapValue.fields}}function gr(e,t,r){var n=dr(e,t.name),i=sr(t.updateTime),o=new ue({mapValue:{fields:t.fields}}),a=ce.newFoundDocument(n,i,o);return r&&a.setHasCommittedMutations(),r?a.setHasCommittedMutations():a}function vr(e,t){var r;if(t instanceof bt)r={update:yr(e,t.key,t.value)};else if(t instanceof Mt)r={delete:cr(e,t.key)};else if(t instanceof _t)r={update:yr(e,t.key,t.data),updateMask:Pr(t.fieldMask)};else{if(!(t instanceof kt))return v();r={verify:cr(e,t.key)}}return t.fieldTransforms.length>0&&(r.updateTransforms=t.fieldTransforms.map((function(e){return function(e,t){var r=t.transform;if(r instanceof tt)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(r instanceof rt)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:r.elements}};if(r instanceof it)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:r.elements}};if(r instanceof at)return{fieldPath:t.field.canonicalString(),increment:r.A};throw v()}(0,e)}))),t.precondition.isNone||(r.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:ar(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:v()}(e,t.precondition)),r}function br(e,t){var r=t.currentDocument?function(e){return void 0!==e.updateTime?dt.updateTime(sr(e.updateTime)):void 0!==e.exists?dt.exists(e.exists):dt.none()}(t.currentDocument):dt.none(),n=t.updateTransforms?t.updateTransforms.map((function(t){return function(e,t){var r=null;if("setToServerValue"in t)b("REQUEST_TIME"===t.setToServerValue),r=new tt;else if("appendMissingElements"in t){var n=t.appendMissingElements.values||[];r=new rt(n)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];r=new it(i)}else"increment"in t?r=new at(e,t.increment):v();var o=R.fromServerFormat(t.fieldPath);return new lt(o,r)}(e,t)})):[];if(t.update){t.update.name;var i=dr(e,t.update.name),o=new ue({mapValue:{fields:t.update.fields}});if(t.updateMask){var a=function(e){var t=e.fieldPaths||[];return new D(t.map((function(e){return R.fromServerFormat(e)})))}(t.updateMask);return new _t(i,o,a,r,n)}return new bt(i,o,r,n)}if(t.delete){var s=dr(e,t.delete);return new Mt(s,r)}if(t.verify){var u=dr(e,t.verify);return new kt(u,r)}return v()}function _r(e,t){return{documents:[hr(e,t.path)]}}function wr(e,t){var r={structuredQuery:{}},n=t.path;null!==t.collectionGroup?(r.parent=hr(e,n),r.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(r.parent=hr(e,n.popLast()),r.structuredQuery.from=[{collectionId:n.lastSegment()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(oe(e.value))return{unaryFilter:{field:Cr(e.field),op:"IS_NAN"}};if(ie(e.value))return{unaryFilter:{field:Cr(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(oe(e.value))return{unaryFilter:{field:Cr(e.field),op:"IS_NOT_NAN"}};if(ie(e.value))return{unaryFilter:{field:Cr(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Cr(e.field),op:kr(e.op),value:e.value}}}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(r.structuredQuery.where=i);var o=function(e){if(0!==e.length)return e.map((function(e){return function(e){return{field:Cr(e.field),direction:Mr(e.dir)}}(e)}))}(t.orderBy);o&&(r.structuredQuery.orderBy=o);var a=function(e,t){return e.I||W(t)?t:{value:t}}(e,t.limit);return null!==a&&(r.structuredQuery.limit=a),t.startAt&&(r.structuredQuery.startAt=Er(t.startAt)),t.endAt&&(r.structuredQuery.endAt=Er(t.endAt)),r}function xr(e){var t=fr(e.parent),r=e.structuredQuery,n=r.from?r.from.length:0,i=null;if(n>0){b(1===n);var o=r.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var a=[];r.where&&(a=Sr(r.where));var s=[];r.orderBy&&(s=r.orderBy.map((function(e){return function(e){return new ke(jr(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)})));var l=null;r.limit&&(l=function(e){var t;return W(t="object"==u(e)?e.value:e)?null:t}(r.limit));var c=null;r.startAt&&(c=Tr(r.startAt));var d=null;return r.endAt&&(d=Tr(r.endAt)),Pe(t,i,s,a,l,"F",c,d)}function Sr(e){return e?void 0!==e.unaryFilter?[Ar(e)]:void 0!==e.fieldFilter?[Or(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((function(e){return Sr(e)})).reduce((function(e,t){return e.concat(t)})):v():[]}function Er(e){return{before:e.before,values:e.position}}function Tr(e){var t=!!e.before,r=e.values||[];return new Te(r,t)}function Mr(e){return tr[e]}function kr(e){return rr[e]}function Cr(e){return{fieldPath:e.canonicalString()}}function jr(e){return R.fromServerFormat(e.fieldPath)}function Or(e){return ye.create(jr(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 v()}}(e.fieldFilter.op),e.fieldFilter.value)}function Ar(e){switch(e.unaryFilter.op){case"IS_NAN":var t=jr(e.unaryFilter.field);return ye.create(t,"==",{doubleValue:NaN});case"IS_NULL":var r=jr(e.unaryFilter.field);return ye.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var n=jr(e.unaryFilter.field);return ye.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=jr(e.unaryFilter.field);return ye.create(i,"!=",{nullValue:"NULL_VALUE"});default:return v()}}function Pr(e){var t=[];return e.fields.forEach((function(e){return t.push(e.canonicalString())})),{fieldPaths:t}}function Ir(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function Rr(e){for(var t="",r=0;r0&&(t=Lr(t)),t=Dr(e.get(r),t);return Lr(t)}function Dr(e,t){for(var r=t,n=e.length,i=0;i=2),2===t)return b("\x01"===e.charAt(0)&&"\x01"===e.charAt(1)),P.emptyPath();for(var r=t-2,n=[],i="",o=0;or)&&v(),e.charAt(a+1)){case"\x01":var s=e.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),n.push(u);break;case"\x10":i+=e.substring(o,a),i+="\0";break;case"\x11":i+=e.substring(o,a+1);break;default:v()}o=a+2}return new P(n)}var Fr=function(e,t){this.seconds=e,this.nanoseconds=t},Ur=function(e,t,r){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=r};Ur.store="owner",Ur.key="owner";var Br=function(e,t,r){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=r};Br.store="mutationQueues",Br.keyPath="userId";var zr=function(e,t,r,n,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=r,this.baseMutations=n,this.mutations=i};zr.store="mutations",zr.keyPath="batchId",zr.userMutationsIndex="userMutationsIndex",zr.userMutationsKeyPath=["userId","batchId"];var Vr=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,Rr(t)]},e.key=function(e,t,r){return[e,Rr(t),r]},e}();Vr.store="documentMutations",Vr.PLACEHOLDER=new Vr;var Gr=function(e,t){this.path=e,this.readTime=t},Wr=function(e,t){this.path=e,this.version=t},Hr=function(e,t,r,n,i,o){this.unknownDocument=e,this.noDocument=t,this.document=r,this.hasCommittedMutations=n,this.readTime=i,this.parentPath=o};Hr.store="remoteDocuments",Hr.readTimeIndex="readTimeIndex",Hr.readTimeIndexPath="readTime",Hr.collectionReadTimeIndex="collectionReadTimeIndex",Hr.collectionReadTimeIndexPath=["parentPath","readTime"];var qr=function(e){this.byteSize=e};qr.store="remoteDocumentGlobal",qr.key="remoteDocumentGlobalKey";var Yr=function(e,t,r,n,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=r,this.resumeToken=n,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Yr.store="targets",Yr.keyPath="targetId",Yr.queryTargetsIndexName="queryTargetsIndex",Yr.queryTargetsKeyPath=["canonicalId","targetId"];var Xr=function(e,t,r){this.targetId=e,this.path=t,this.sequenceNumber=r};Xr.store="targetDocuments",Xr.keyPath=["targetId","path"],Xr.documentTargetsIndex="documentTargetsIndex",Xr.documentTargetsKeyPath=["path","targetId"];var Kr=function(e,t,r,n){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=r,this.targetCount=n};Kr.key="targetGlobalKey",Kr.store="targetGlobal";var $r=function(e,t){this.collectionId=e,this.parent=t};$r.store="collectionParents",$r.keyPath=["collectionId","parent"];var Qr=function(e,t,r,n){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=r,this.inForeground=n};Qr.store="clientMetadata",Qr.keyPath="clientId";var Jr=function(e,t,r){this.bundleId=e,this.createTime=t,this.version=r};Jr.store="bundles",Jr.keyPath="bundleId";var Zr=function(e,t,r){this.name=e,this.readTime=t,this.bundledQuery=r};Zr.store="namedQueries",Zr.keyPath="name";var en=(0,i.__spreadArray)((0,i.__spreadArray)([],(0,i.__spreadArray)((0,i.__spreadArray)([],(0,i.__spreadArray)((0,i.__spreadArray)([],(0,i.__spreadArray)((0,i.__spreadArray)([],[Br.store,zr.store,Vr.store,Hr.store,Yr.store,Ur.store,Kr.store,Xr.store]),[Qr.store])),[qr.store])),[$r.store])),[Jr.store,Zr.store]),tn="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",rn=function(){function e(){this.onCommittedListeners=[]}return e.prototype.addOnCommittedListener=function(e){this.onCommittedListeners.push(e)},e.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach((function(e){return e()}))},e}(),nn=function(){var e=this;this.promise=new Promise((function(t,r){e.resolve=t,e.reject=r}))},on=function(){function e(e){var t=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((function(e){t.isDone=!0,t.result=e,t.nextCallback&&t.nextCallback(e)}),(function(e){t.isDone=!0,t.error=e,t.catchCallback&&t.catchCallback(e)}))}return e.prototype.catch=function(e){return this.next(void 0,e)},e.prototype.next=function(t,r){var n=this;return this.callbackAttached&&v(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(t,this.result):new e((function(e,i){n.nextCallback=function(r){n.wrapSuccess(t,r).next(e,i)},n.catchCallback=function(t){n.wrapFailure(r,t).next(e,i)}}))},e.prototype.toPromise=function(){var e=this;return new Promise((function(t,r){e.next(t,r)}))},e.prototype.wrapUserFunction=function(t){try{var r=t();return r instanceof e?r:e.resolve(r)}catch(t){return e.reject(t)}},e.prototype.wrapSuccess=function(t,r){return t?this.wrapUserFunction((function(){return t(r)})):e.resolve(r)},e.prototype.wrapFailure=function(t,r){return t?this.wrapUserFunction((function(){return t(r)})):e.reject(r)},e.resolve=function(t){return new e((function(e,r){e(t)}))},e.reject=function(t){return new e((function(e,r){r(t)}))},e.waitFor=function(t){return new e((function(e,r){var n=0,i=0,o=!1;t.forEach((function(t){++n,t.next((function(){++i,o&&i===n&&e()}),(function(e){return r(e)}))})),o=!0,i===n&&e()}))},e.or=function(t){for(var r=e.resolve(!1),n=function(t){r=r.next((function(r){return r?e.resolve(r):t()}))},i=0,o=t;i0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||n||a)},e.gt=function(){var e;return void 0!==n&&"YES"===(null===(e=n.env)||void 0===e?void 0:e.Tt)},e.It=function(e,t){return e.store(t)},e._t=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(r)},e.Et=function(e){var t=e.match(/Android ([\d.]+)/i),r=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(r)},e.prototype.At=function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r=this;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return this.db?[3,2]:(p("SimpleDb","Opening database:",this.name),t=this,[4,new Promise((function(t,n){var i=indexedDB.open(r.name,r.version);i.onsuccess=function(e){var r=e.target.result;t(r)},i.onblocked=function(){n(new ln(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(t){var r=t.target.error;"VersionError"===r.name?n(new d(c.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):n(new ln(e,r))},i.onupgradeneeded=function(e){p("SimpleDb",'Database "'+r.name+'" requires upgrade from version:',e.oldVersion);var t=e.target.result;r.wt.Rt(t,i.transaction,e.oldVersion,r.version).next((function(){p("SimpleDb","Database upgrade to version "+r.version+" complete")}))}}))]);case 1:t.db=n.sent(),n.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(e){return r.bt(e)}),this.db)]}}))}))},e.prototype.vt=function(e){this.bt=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},e.prototype.runTransaction=function(e,t,r,n){return(0,i.__awaiter)(this,void 0,void 0,(function(){var o,a,s,l,c;return(0,i.__generator)(this,(function(d){switch(d.label){case 0:o="readonly"===t,a=0,s=function(){var t,s,u,c,d;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:++a,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,l.At(e)];case 2:return l.db=i.sent(),t=an.open(l.db,e,o?"readonly":"readwrite",r),s=n(t).catch((function(e){return t.abort(e),on.reject(e)})).toPromise(),u={},s.catch((function(){})),[4,t.dt];case 3:return[2,(u.value=(i.sent(),s),u)];case 4:return c=i.sent(),d="FirebaseError"!==c.name&&a<3,p("SimpleDb","Transaction failed with error:",c.message,"Retrying:",d),l.close(),d?[3,5]:[2,{value:Promise.reject(c)}];case 5:return[2]}}))},l=this,d.label=1;case 1:return[5,s()];case 2:if("object"==u(c=d.sent()))return[2,c.value];d.label=3;case 3:return[3,1];case 4:return[2]}}))}))},e.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},e}(),un=function(){function e(e){this.Pt=e,this.Vt=!1,this.St=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Pt=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Vt=!0},e.prototype.Ct=function(e){this.St=e},e.prototype.delete=function(){return hn(this.Pt.delete())},e}(),ln=function(e){function t(t,r){var n=this;return(n=e.call(this,c.UNAVAILABLE,"IndexedDB transaction '"+t+"' failed: "+r)||this).name="IndexedDbTransactionError",n}return(0,i.__extends)(t,e),t}(d);function cn(e){return"IndexedDbTransactionError"===e.name}var dn=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var r;return void 0!==t?(p("SimpleDb","PUT",this.store.name,e,t),r=this.store.put(t,e)):(p("SimpleDb","PUT",this.store.name,"",e),r=this.store.put(e)),hn(r)},e.prototype.add=function(e){return p("SimpleDb","ADD",this.store.name,e,e),hn(this.store.add(e))},e.prototype.get=function(e){var t=this;return hn(this.store.get(e)).next((function(r){return void 0===r&&(r=null),p("SimpleDb","GET",t.store.name,e,r),r}))},e.prototype.delete=function(e){return p("SimpleDb","DELETE",this.store.name,e),hn(this.store.delete(e))},e.prototype.count=function(){return p("SimpleDb","COUNT",this.store.name),hn(this.store.count())},e.prototype.Nt=function(e,t){var r=this.cursor(this.options(e,t)),n=[];return this.xt(r,(function(e,t){n.push(t)})).next((function(){return n}))},e.prototype.kt=function(e,t){p("SimpleDb","DELETE ALL",this.store.name);var r=this.options(e,t);r.Ft=!1;var n=this.cursor(r);return this.xt(n,(function(e,t,r){return r.delete()}))},e.prototype.$t=function(e,t){var r;t?r=e:(r={},t=e);var n=this.cursor(r);return this.xt(n,t)},e.prototype.Ot=function(e){var t=this.cursor({});return new on((function(r,n){t.onerror=function(e){var t=pn(e.target.error);n(t)},t.onsuccess=function(t){var n=t.target.result;n?e(n.primaryKey,n.value).next((function(e){e?n.continue():r()})):r()}}))},e.prototype.xt=function(e,t){var r=[];return new on((function(n,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new un(i),a=t(i.primaryKey,i.value,o);if(a instanceof on){var s=a.catch((function(e){return o.done(),on.reject(e)}));r.push(s)}o.isDone?n():null===o.Dt?i.continue():i.continue(o.Dt)}else n()}})).next((function(){return on.waitFor(r)}))},e.prototype.options=function(e,t){var r;return void 0!==e&&("string"==typeof e?r=e:t=e),{index:r,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var r=this.store.index(e.index);return e.Ft?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function hn(e){return new on((function(t,r){e.onsuccess=function(e){var r=e.target.result;t(r)},e.onerror=function(e){var t=pn(e.target.error);r(t)}}))}var fn=!1;function pn(e){var t=sn._t((0,o.getUA)());if(t>=12.2&&t<13){var r="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(r)>=0){var n=new d("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+r+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return fn||(fn=!0,setTimeout((function(){throw n}),0)),n}}return e}var mn=function(e){function t(t,r){var n=this;return(n=e.call(this)||this).Mt=t,n.currentSequenceNumber=r,n}return(0,i.__extends)(t,e),t}(rn);function yn(e,t){var r=_(e);return sn.It(r.Mt,t)}var gn=function(){function e(e,t,r,n){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=n}return e.prototype.applyToRemoteDocument=function(e,t){for(var r=t.mutationResults,n=0;n=n),o=kn(r.R,t)),i.done()})).next((function(){return o}))},e.prototype.getHighestUnacknowledgedBatchId=function(e){var t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=-1;return Wn(e).$t({index:zr.userMutationsIndex,range:t,reverse:!0},(function(e,t,n){r=t.batchId,n.done()})).next((function(){return r}))},e.prototype.getAllMutationBatches=function(e){var t=this,r=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Wn(e).Nt(zr.userMutationsIndex,r).next((function(e){return e.map((function(e){return kn(t.R,e)}))}))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var r=this,n=Vr.prefixForPath(this.userId,t.path),i=IDBKeyRange.lowerBound(n),o=[];return Hn(e).$t({range:i},(function(n,i,a){var s=n[0],u=n[1],l=n[2],c=Nr(u);if(s===r.userId&&t.path.isEqual(c))return Wn(e).get(l).next((function(e){if(!e)throw v();b(e.userId===r.userId),o.push(kn(r.R,e))}));a.done()})).next((function(){return o}))},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var r=this,n=new Rt(S),i=[];return t.forEach((function(t){var o=Vr.prefixForPath(r.userId,t.path),a=IDBKeyRange.lowerBound(o),s=Hn(e).$t({range:a},(function(e,i,o){var a=e[0],s=e[1],u=e[2],l=Nr(s);a===r.userId&&t.path.isEqual(l)?n=n.add(u):o.done()}));i.push(s)})),on.waitFor(i).next((function(){return r.Wt(e,n)}))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var r=this,n=t.path,i=n.length+1,o=Vr.prefixForPath(this.userId,n),a=IDBKeyRange.lowerBound(o),s=new Rt(S);return Hn(e).$t({range:a},(function(e,t,o){var a=e[0],u=e[1],l=e[2],c=Nr(u);a===r.userId&&n.isPrefixOf(c)?c.length===i&&(s=s.add(l)):o.done()})).next((function(){return r.Wt(e,s)}))},e.prototype.Wt=function(e,t){var r=this,n=[],i=[];return t.forEach((function(t){i.push(Wn(e).get(t).next((function(e){if(null===e)throw v();b(e.userId===r.userId),n.push(kn(r.R,e))})))})),on.waitFor(i).next((function(){return n}))},e.prototype.removeMutationBatch=function(e,t){var r=this;return Bn(e.Mt,this.userId,t).next((function(n){return e.addOnCommittedListener((function(){r.Gt(t.batchId)})),on.forEach(n,(function(t){return r.referenceDelegate.markPotentiallyOrphaned(e,t)}))}))},e.prototype.Gt=function(e){delete this.Kt[e]},e.prototype.performConsistencyCheck=function(e){var t=this;return this.checkEmpty(e).next((function(r){if(!r)return on.resolve();var n=IDBKeyRange.lowerBound(Vr.prefixForUser(t.userId)),i=[];return Hn(e).$t({range:n},(function(e,r,n){if(e[0]===t.userId){var o=Nr(e[1]);i.push(o)}else n.done()})).next((function(){b(0===i.length)}))}))},e.prototype.containsKey=function(e,t){return Gn(e,this.userId,t)},e.prototype.zt=function(e){var t=this;return qn(e).get(this.userId).next((function(e){return e||new Br(t.userId,-1,"")}))},e}();function Gn(e,t,r){var n=Vr.prefixForPath(t,r.path),i=n[1],o=IDBKeyRange.lowerBound(n),a=!1;return Hn(e).$t({range:o,Ft:!0},(function(e,r,n){var o=e[0],s=e[1];e[2],o===t&&s===i&&(a=!0),n.done()})).next((function(){return a}))}function Wn(e){return yn(e,zr.store)}function Hn(e){return yn(e,Vr.store)}function qn(e){return yn(e,Br.store)}var Yn=function(){function e(e){this.Ht=e}return e.prototype.next=function(){return this.Ht+=2,this.Ht},e.Jt=function(){return new e(0)},e.Yt=function(){return new e(-1)},e}(),Xn=function(){function e(e,t){this.referenceDelegate=e,this.R=t}return e.prototype.allocateTargetId=function(e){var t=this;return this.Xt(e).next((function(r){var n=new Yn(r.highestTargetId);return r.highestTargetId=n.next(),t.Zt(e,r).next((function(){return r.highestTargetId}))}))},e.prototype.getLastRemoteSnapshotVersion=function(e){return this.Xt(e).next((function(e){return k.fromTimestamp(new M(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))}))},e.prototype.getHighestSequenceNumber=function(e){return this.Xt(e).next((function(e){return e.highestListenSequenceNumber}))},e.prototype.setTargetsMetadata=function(e,t,r){var n=this;return this.Xt(e).next((function(i){return i.highestListenSequenceNumber=t,r&&(i.lastRemoteSnapshotVersion=r.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),n.Zt(e,i)}))},e.prototype.addTargetData=function(e,t){var r=this;return this.te(e,t).next((function(){return r.Xt(e).next((function(n){return n.targetCount+=1,r.ee(t,n),r.Zt(e,n)}))}))},e.prototype.updateTargetData=function(e,t){return this.te(e,t)},e.prototype.removeTargetData=function(e,t){var r=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next((function(){return Kn(e).delete(t.targetId)})).next((function(){return r.Xt(e)})).next((function(t){return b(t.targetCount>0),t.targetCount-=1,r.Zt(e,t)}))},e.prototype.removeTargets=function(e,t,r){var n=this,i=0,o=[];return Kn(e).$t((function(a,s){var u=Cn(s);u.sequenceNumber<=t&&null===r.get(u.targetId)&&(i++,o.push(n.removeTargetData(e,u)))})).next((function(){return on.waitFor(o)})).next((function(){return i}))},e.prototype.forEachTarget=function(e,t){return Kn(e).$t((function(e,r){var n=Cn(r);t(n)}))},e.prototype.Xt=function(e){return $n(e).get(Kr.key).next((function(e){return b(null!==e),e}))},e.prototype.Zt=function(e,t){return $n(e).put(Kr.key,t)},e.prototype.te=function(e,t){return Kn(e).put(jn(this.R,t))},e.prototype.ee=function(e,t){var r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r},e.prototype.getTargetCount=function(e){return this.Xt(e).next((function(e){return e.targetCount}))},e.prototype.getTargetData=function(e,t){var r=fe(t),n=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),i=null;return Kn(e).$t({range:n,index:Yr.queryTargetsIndexName},(function(e,r,n){var o=Cn(r);pe(t,o.target)&&(i=o,n.done())})).next((function(){return i}))},e.prototype.addMatchingKeys=function(e,t,r){var n=this,i=[],o=Qn(e);return t.forEach((function(t){var a=Rr(t.path);i.push(o.put(new Xr(r,a))),i.push(n.referenceDelegate.addReference(e,r,t))})),on.waitFor(i)},e.prototype.removeMatchingKeys=function(e,t,r){var n=this,i=Qn(e);return on.forEach(t,(function(t){var o=Rr(t.path);return on.waitFor([i.delete([r,o]),n.referenceDelegate.removeReference(e,r,t)])}))},e.prototype.removeMatchingKeysForTargetId=function(e,t){var r=Qn(e),n=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(n)},e.prototype.getMatchingKeysForTargetId=function(e,t){var r=IDBKeyRange.bound([t],[t+1],!1,!0),n=Qn(e),i=Gt();return n.$t({range:r,Ft:!0},(function(e,t,r){var n=Nr(e[1]),o=new Y(n);i=i.add(o)})).next((function(){return i}))},e.prototype.containsKey=function(e,t){var r=Rr(t.path),n=IDBKeyRange.bound([r],[T(r)],!1,!0),i=0;return Qn(e).$t({index:Xr.documentTargetsIndex,Ft:!0,range:n},(function(e,t,r){var n=e[0];e[1],0!==n&&(i++,r.done())})).next((function(){return i>0}))},e.prototype.lt=function(e,t){return Kn(e).get(t).next((function(e){return e?Cn(e):null}))},e}();function Kn(e){return yn(e,Yr.store)}function $n(e){return yn(e,Kr.store)}function Qn(e){return yn(e,Xr.store)}function Jn(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){if(e.code!==c.FAILED_PRECONDITION||e.message!==tn)throw e;return p("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function Zn(e,t){var r=e[0],n=e[1],i=t[0],o=t[1],a=S(r,i);return 0===a?S(n,o):a}var ei=function(){function e(e){this.ne=e,this.buffer=new Rt(Zn),this.se=0}return e.prototype.ie=function(){return++this.se},e.prototype.re=function(e){var t=[e,this.ie()];if(this.buffer.sizec.params.maximumSequenceNumbersToCollect?(p("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+c.params.maximumSequenceNumbersToCollect+" from "+t),n=c.params.maximumSequenceNumbersToCollect):n=t,o=Date.now(),c.nthSequenceNumber(e,n)})).next((function(n){return r=n,s=Date.now(),c.removeTargets(e,r,t)})).next((function(t){return i=t,u=Date.now(),c.removeOrphanedDocuments(e,r)})).next((function(e){return l=Date.now(),f()<=a.LogLevel.DEBUG&&p("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-d)+"ms\n\tDetermined least recently used "+n+" in "+(s-o)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+e+" documents in "+(l-u)+"ms\nTotal Duration: "+(l-d)+"ms"),on.resolve({didRun:!0,sequenceNumbersCollected:n,targetsRemoved:i,documentsRemoved:e})}))},e}(),ni=function(){function e(e,t){this.db=e,this.garbageCollector=function(e,t){return new ri(e,t)}(this,t)}return e.prototype.he=function(e){var t=this.de(e);return this.db.getTargetCache().getTargetCount(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype.de=function(e){var t=0;return this.le(e,(function(e){t++})).next((function(){return t}))},e.prototype.forEachTarget=function(e,t){return this.db.getTargetCache().forEachTarget(e,t)},e.prototype.le=function(e,t){return this.we(e,(function(e,r){return t(r)}))},e.prototype.addReference=function(e,t,r){return ii(e,r)},e.prototype.removeReference=function(e,t,r){return ii(e,r)},e.prototype.removeTargets=function(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)},e.prototype.markPotentiallyOrphaned=function(e,t){return ii(e,t)},e.prototype._e=function(e,t){return function(e,t){var r=!1;return qn(e).Ot((function(n){return Gn(e,n,t).next((function(e){return e&&(r=!0),on.resolve(!e)}))})).next((function(){return r}))}(e,t)},e.prototype.removeOrphanedDocuments=function(e,t){var r=this,n=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(e,(function(a,s){if(s<=t){var u=r._e(e,a).next((function(t){if(!t)return o++,n.getEntry(e,a).next((function(){return n.removeEntry(a),Qn(e).delete([0,Rr(a.path)])}))}));i.push(u)}})).next((function(){return on.waitFor(i)})).next((function(){return n.apply(e)})).next((function(){return o}))},e.prototype.removeTarget=function(e,t){var r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)},e.prototype.updateLimboDocument=function(e,t){return ii(e,t)},e.prototype.we=function(e,t){var r,n=Qn(e),i=l.o;return n.$t({index:Xr.documentTargetsIndex},(function(e,n){var o=e[0];e[1];var a=n.path,s=n.sequenceNumber;0===o?(i!==l.o&&t(new Y(Nr(r)),i),i=s,r=a):i=l.o})).next((function(){i!==l.o&&t(new Y(Nr(r)),i)}))},e.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},e}();function ii(e,t){return Qn(e).put(function(e,t){return new Xr(0,Rr(e.path),t)}(t,e.currentSequenceNumber))}var oi=function(){function e(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={}}return e.prototype.get=function(e){var t=this.mapKeyFn(e),r=this.inner[t];if(void 0!==r)for(var n=0,i=r;n=0&&n<=11);var o=new an("createOrUpgrade",t);r<1&&n>=1&&(function(e){e.createObjectStore(Ur.store)}(e),function(e){e.createObjectStore(Br.store,{keyPath:Br.keyPath}),e.createObjectStore(zr.store,{keyPath:zr.keyPath,autoIncrement:!0}).createIndex(zr.userMutationsIndex,zr.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Vr.store)}(e),fi(e),function(e){e.createObjectStore(Hr.store)}(e));var a=on.resolve();return r<3&&n>=3&&(0!==r&&(function(e){e.deleteObjectStore(Xr.store),e.deleteObjectStore(Yr.store),e.deleteObjectStore(Kr.store)}(e),fi(e)),a=a.next((function(){return e=o.store(Kr.store),t=new Kr(0,0,k.min().toTimestamp(),0),e.put(Kr.key,t);var e,t}))),r<4&&n>=4&&(0!==r&&(a=a.next((function(){return function(e,t){return t.store(zr.store).Nt().next((function(r){e.deleteObjectStore(zr.store),e.createObjectStore(zr.store,{keyPath:zr.keyPath,autoIncrement:!0}).createIndex(zr.userMutationsIndex,zr.userMutationsKeyPath,{unique:!0});var n=t.store(zr.store),i=r.map((function(e){return n.put(e)}));return on.waitFor(i)}))}(e,o)}))),a=a.next((function(){!function(e){e.createObjectStore(Qr.store,{keyPath:Qr.keyPath})}(e)}))),r<5&&n>=5&&(a=a.next((function(){return i.Re(o)}))),r<6&&n>=6&&(a=a.next((function(){return function(e){e.createObjectStore(qr.store)}(e),i.be(o)}))),r<7&&n>=7&&(a=a.next((function(){return i.ve(o)}))),r<8&&n>=8&&(a=a.next((function(){return i.Pe(e,o)}))),r<9&&n>=9&&(a=a.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(Hr.store);t.createIndex(Hr.readTimeIndex,Hr.readTimeIndexPath,{unique:!1}),t.createIndex(Hr.collectionReadTimeIndex,Hr.collectionReadTimeIndexPath,{unique:!1})}(t)}))),r<10&&n>=10&&(a=a.next((function(){return i.Ve(o)}))),r<11&&n>=11&&(a=a.next((function(){!function(e){e.createObjectStore(Jr.store,{keyPath:Jr.keyPath})}(e),function(e){e.createObjectStore(Zr.store,{keyPath:Zr.keyPath})}(e)}))),a},e.prototype.be=function(e){var t=0;return e.store(Hr.store).$t((function(e,r){t+=zn(r)})).next((function(){var r=new qr(t);return e.store(qr.store).put(qr.key,r)}))},e.prototype.Re=function(e){var t=this,r=e.store(Br.store),n=e.store(zr.store);return r.Nt().next((function(r){return on.forEach(r,(function(r){var i=IDBKeyRange.bound([r.userId,-1],[r.userId,r.lastAcknowledgedBatchId]);return n.Nt(zr.userMutationsIndex,i).next((function(n){return on.forEach(n,(function(n){b(n.userId===r.userId);var i=kn(t.R,n);return Bn(e,r.userId,i).next((function(){}))}))}))}))}))},e.prototype.ve=function(e){var t=e.store(Xr.store),r=e.store(Hr.store);return e.store(Kr.store).get(Kr.key).next((function(e){var n=[];return r.$t((function(r,i){var o=new P(r),a=[0,Rr(o)];n.push(t.get(a).next((function(r){return r?on.resolve():function(r){return t.put(new Xr(0,Rr(r),e.highestListenSequenceNumber))}(o)})))})).next((function(){return on.waitFor(n)}))}))},e.prototype.Pe=function(e,t){e.createObjectStore($r.store,{keyPath:$r.keyPath});var r=t.store($r.store),n=new Dn,i=function(e){if(n.add(e)){var t=e.lastSegment(),i=e.popLast();return r.put({collectionId:t,parent:Rr(i)})}};return t.store(Hr.store).$t({Ft:!0},(function(e,t){var r=new P(e);return i(r.popLast())})).next((function(){return t.store(Vr.store).$t({Ft:!0},(function(e,t){e[0];var r=e[1];e[2];var n=Nr(r);return i(n.popLast())}))}))},e.prototype.Ve=function(e){var t=this,r=e.store(Yr.store);return r.$t((function(e,n){var i=Cn(n),o=jn(t.R,i);return r.put(o)}))},e}();function fi(e){e.createObjectStore(Xr.store,{keyPath:Xr.keyPath}).createIndex(Xr.documentTargetsIndex,Xr.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Yr.store,{keyPath:Yr.keyPath}).createIndex(Yr.queryTargetsIndexName,Yr.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Kr.store)}var pi="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",mi=function(){function e(t,r,n,i,o,a,s,u,l,h){if(this.allowTabSynchronization=t,this.persistenceKey=r,this.clientId=n,this.Se=o,this.window=a,this.document=s,this.De=l,this.Ce=h,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(e){return Promise.resolve()},!e.yt())throw new d(c.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new ni(this,i),this.Le=r+"main",this.R=new _n(u),this.Be=new sn(this.Le,11,new hi(this.R)),this.qe=new Xn(this.referenceDelegate,this.R),this.Ut=new Ln,this.Ue=function(e,t){return new si(e,t)}(this.R,this.Ut),this.Ke=new An,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===h&&m("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.prototype.start=function(){var e=this;return this.je().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new d(c.FAILED_PRECONDITION,pi);return e.We(),e.Ge(),e.ze(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.qe.getHighestSequenceNumber(t)}))})).then((function(t){e.Ne=new l(t,e.De)})).then((function(){e.xe=!0})).catch((function(t){return e.Be&&e.Be.close(),Promise.reject(t)}))},e.prototype.He=function(e){var t=this;return this.Me=function(r){return(0,i.__awaiter)(t,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){return this.started?[2,e(r)]:[2]}))}))},e(this.isPrimary)},e.prototype.setDatabaseDeletedListener=function(e){var t=this;this.Be.vt((function(r){return(0,i.__awaiter)(t,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return null===r.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.setNetworkEnabled=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget((function(){return(0,i.__awaiter)(t,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.je=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return gi(t).put(new Qr(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Je(t).next((function(t){t||(e.isPrimary=!1,e.Se.enqueueRetryable((function(){return e.Me(!1)})))}))})).next((function(){return e.Ye(t)})).next((function(r){return e.isPrimary&&!r?e.Xe(t).next((function(){return!1})):!!r&&e.Ze(t).next((function(){return!0}))}))})).catch((function(t){if(cn(t))return p("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return p("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.Se.enqueueRetryable((function(){return e.Me(t)})),e.isPrimary=t}))},e.prototype.Je=function(e){var t=this;return yi(e).get(Ur.key).next((function(e){return on.resolve(t.tn(e))}))},e.prototype.en=function(e){return gi(e).delete(this.clientId)},e.prototype.nn=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e,t,r,n,o=this;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var t=yn(e,Qr.store);return t.Nt().next((function(e){var r=o.rn(e,18e5),n=e.filter((function(e){return-1===r.indexOf(e)}));return on.forEach(n,(function(e){return t.delete(e.clientId)})).next((function(){return n}))}))})).catch((function(){return[]}))]);case 1:if(e=i.sent(),this.Qe)for(t=0,r=e;tr&&(m("Detected an update time that is in the future: "+e+" > "+r),1))},e.prototype.We=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fe=function(){e.Se.enqueueAndForget((function(){return e.inForeground="visible"===e.document.visibilityState,e.je()}))},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground="visible"===this.document.visibilityState)},e.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},e.prototype.Ge=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ke=function(){t.un(),(0,o.isSafari)()&&navigator.appVersion.match("Version/14")&&t.Se.enterRestrictedMode(!0),t.Se.enqueueAndForget((function(){return t.shutdown()}))},this.window.addEventListener("pagehide",this.ke))},e.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},e.prototype.cn=function(e){var t;try{var r=null!==(null===(t=this.Qe)||void 0===t?void 0:t.getItem(this.on(e)));return p("IndexedDbPersistence","Client '"+e+"' "+(r?"is":"is not")+" zombied in LocalStorage"),r}catch(e){return m("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(e){m("Failed to set zombie client id.",e)}},e.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(e){}},e.prototype.on=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function yi(e){return yn(e,Ur.store)}function gi(e){return yn(e,Qr.store)}function vi(e,t){var r=e.projectId;return e.isDefaultDatabase||(r+="."+e.database),"firestore/"+t+"/"+r+"/"}var bi=function(e,t){this.progress=e,this.wn=t},_i=function(){function e(e,t,r){this.Ue=e,this._n=t,this.Ut=r}return e.prototype.mn=function(e,t){var r=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,t).next((function(n){return r.yn(e,t,n)}))},e.prototype.yn=function(e,t,r){return this.Ue.getEntry(e,t).next((function(e){for(var t=0,n=r;t0)},e.prototype.Dn=function(e,t){return f()<=a.LogLevel.DEBUG&&p("QueryEngine","Using full collection scan to execute query:",We(t)),this.Sn.getDocumentsMatchingQuery(e,t,k.min())},e}(),Si=function(){function e(e,t,r,n){this.persistence=e,this.xn=t,this.R=n,this.kn=new At(S),this.Fn=new oi((function(e){return fe(e)}),pe),this.$n=k.min(),this._n=e.getMutationQueue(r),this.On=e.getRemoteDocumentCache(),this.qe=e.getTargetCache(),this.Mn=new _i(this.On,this._n,this.persistence.getIndexManager()),this.Ke=e.getBundleCache(),this.xn.Vn(this.Mn)}return e.prototype.collectGarbage=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(r){return e.collect(r,t.kn)}))},e}();function Ei(e,t,r,n){return new Si(e,t,r,n)}function Ti(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=_(e),n=r._n,o=r.Mn,[4,r.persistence.runTransaction("Handle user change","readonly",(function(e){var i;return r._n.getAllMutationBatches(e).next((function(a){return i=a,n=r.persistence.getMutationQueue(t),o=new _i(r.On,n,r.persistence.getIndexManager()),n.getAllMutationBatches(e)})).next((function(t){for(var r=[],n=[],a=Gt(),s=0,u=i;s0){var l=s.withResumeToken(u,n).withSequenceNumber(e.currentSequenceNumber);i=i.insert(o,l),function(e,t,r){return b(t.resumeToken.approximateByteSize()>0),0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||r.addedDocuments.size+r.modifiedDocuments.size+r.removedDocuments.size>0}(s,l,t)&&a.push(r.qe.updateTargetData(e,l))}}}));var s=Nt();if(t.documentUpdates.forEach((function(n,i){t.resolvedLimboDocuments.has(n)&&a.push(r.persistence.referenceDelegate.updateLimboDocument(e,n))})),a.push(ji(e,o,t.documentUpdates,n,void 0).next((function(e){s=e}))),!n.isEqual(k.min())){var u=r.qe.getLastRemoteSnapshotVersion(e).next((function(t){return r.qe.setTargetsMetadata(e,e.currentSequenceNumber,n)}));a.push(u)}return on.waitFor(a).next((function(){return o.apply(e)})).next((function(){return r.Mn.En(e,s)})).next((function(){return s}))})).then((function(e){return r.kn=i,e}))}function ji(e,t,r,n,i){var o=Gt();return r.forEach((function(e){return o=o.add(e)})),t.getEntries(e,o).next((function(e){var o=Nt();return r.forEach((function(r,a){var s=e.get(r),u=(null==i?void 0:i.get(r))||n;a.isNoDocument()&&a.version.isEqual(k.min())?(t.removeEntry(r,u),o=o.insert(r,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(a,u),o=o.insert(r,a)):p("LocalStore","Ignoring outdated watch update for ",r,". Current version:",s.version," Watch version:",a.version)})),o}))}function Oi(e,t){var r=_(e);return r.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),r._n.getNextMutationBatchAfterBatchId(e,t)}))}function Ai(e,t){var r=_(e);return r.persistence.runTransaction("Allocate target","readwrite",(function(e){var n;return r.qe.getTargetData(e,t).next((function(i){return i?(n=i,on.resolve(n)):r.qe.allocateTargetId(e).next((function(i){return n=new bn(t,i,0,e.currentSequenceNumber),r.qe.addTargetData(e,n).next((function(){return n}))}))}))})).then((function(e){var n=r.kn.get(e.targetId);return(null===n||e.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(r.kn=r.kn.insert(e.targetId,e),r.Fn.set(t,e.targetId)),e}))}function Pi(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,a,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:n=_(e),o=n.kn.get(t),a=r?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),r?[3,3]:[4,n.persistence.runTransaction("Release target",a,(function(e){return n.persistence.referenceDelegate.removeTarget(e,o)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!cn(s=i.sent()))throw s;return p("LocalStore","Failed to update sequence numbers for target "+t+": "+s),[3,5];case 5:return n.kn=n.kn.remove(t),n.Fn.delete(o.target),[2]}}))}))}function Ii(e,t,r){var n=_(e),i=k.min(),o=Gt();return n.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,r){var n=_(e),i=n.Fn.get(r);return void 0!==i?on.resolve(n.kn.get(i)):n.qe.getTargetData(t,r)}(n,e,Be(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,n.qe.getMatchingKeysForTargetId(e,t.targetId).next((function(e){o=e}))})).next((function(){return n.xn.getDocumentsMatchingQuery(e,t,r?i:k.min(),r?o:Gt())})).next((function(e){return{documents:e,Bn:o}}))}))}function Ri(e,t){var r=_(e),n=_(r.qe),i=r.kn.get(t);return i?Promise.resolve(i.target):r.persistence.runTransaction("Get target data","readonly",(function(e){return n.lt(e,t).next((function(e){return e?e.target:null}))}))}function Di(e){var t=_(e);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return function(e,t,r){var n=_(e),i=Nt(),o=Sn(r),a=ci(t),s=IDBKeyRange.lowerBound(o,!0);return a.$t({index:Hr.readTimeIndex,range:s},(function(e,t){var r=wn(n.R,t);i=i.insert(r.key,r),o=t.readTime})).next((function(){return{wn:i,readTime:En(o)}}))}(t.On,e,t.$n)})).then((function(e){var r=e.wn,n=e.readTime;return t.$n=n,r}))}function Li(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t;return(0,i.__generator)(this,(function(r){return[2,(t=_(e)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return function(e){var t=ci(e),r=k.min();return t.$t({index:Hr.readTimeIndex,reverse:!0},(function(e,t,n){t.readTime&&(r=En(t.readTime)),n.done()})).next((function(){return r}))}(e)})).then((function(e){t.$n=e}))]}))}))}function Ni(e,t,r,n){return(0,i.__awaiter)(this,void 0,void 0,(function(){var o,a,s,u,l,c,d,h,f,p;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:for(o=_(e),a=Gt(),s=Nt(),u=zt(),l=0,c=r;l=0)return o.Ke.saveNamedQuery(e,t);var a=n.withResumeToken(L.EMPTY_BYTE_STRING,i);return o.kn=o.kn.insert(a.targetId,a),o.qe.updateTargetData(e,a).next((function(){return o.qe.removeMatchingKeysForTargetId(e,n.targetId)})).next((function(){return o.qe.addMatchingKeys(e,r,n.targetId)})).next((function(){return o.Ke.saveNamedQuery(e,t)}))}))]}}))}))}var Ui=function(){function e(e){this.R=e,this.Qn=new Map,this.jn=new Map}return e.prototype.getBundleMetadata=function(e,t){return on.resolve(this.Qn.get(t))},e.prototype.saveBundleMetadata=function(e,t){var r;return this.Qn.set(t.id,{id:(r=t).id,version:r.version,createTime:sr(r.createTime)}),on.resolve()},e.prototype.getNamedQuery=function(e,t){return on.resolve(this.jn.get(t))},e.prototype.saveNamedQuery=function(e,t){return this.jn.set(t.name,function(e){return{name:e.name,query:On(e.bundledQuery),readTime:sr(e.readTime)}}(t)),on.resolve()},e}(),Bi=function(){function e(){this.Wn=new Rt(zi.Gn),this.zn=new Rt(zi.Hn)}return e.prototype.isEmpty=function(){return this.Wn.isEmpty()},e.prototype.addReference=function(e,t){var r=new zi(e,t);this.Wn=this.Wn.add(r),this.zn=this.zn.add(r)},e.prototype.Jn=function(e,t){var r=this;e.forEach((function(e){return r.addReference(e,t)}))},e.prototype.removeReference=function(e,t){this.Yn(new zi(e,t))},e.prototype.Xn=function(e,t){var r=this;e.forEach((function(e){return r.removeReference(e,t)}))},e.prototype.Zn=function(e){var t=this,r=new Y(new P([])),n=new zi(r,e),i=new zi(r,e+1),o=[];return this.zn.forEachInRange([n,i],(function(e){t.Yn(e),o.push(e.key)})),o},e.prototype.ts=function(){var e=this;this.Wn.forEach((function(t){return e.Yn(t)}))},e.prototype.Yn=function(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)},e.prototype.es=function(e){var t=new Y(new P([])),r=new zi(t,e),n=new zi(t,e+1),i=Gt();return this.zn.forEachInRange([r,n],(function(e){i=i.add(e.key)})),i},e.prototype.containsKey=function(e){var t=new zi(e,0),r=this.Wn.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)},e}(),zi=function(){function e(e,t){this.key=e,this.ns=t}return e.Gn=function(e,t){return Y.comparator(e.key,t.key)||S(e.ns,t.ns)},e.Hn=function(e,t){return S(e.ns,t.ns)||Y.comparator(e.key,t.key)},e}(),Vi=function(){function e(e,t){this.Ut=e,this.referenceDelegate=t,this._n=[],this.ss=1,this.rs=new Rt(zi.Gn)}return e.prototype.checkEmpty=function(e){return on.resolve(0===this._n.length)},e.prototype.addMutationBatch=function(e,t,r,n){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new gn(i,t,r,n);this._n.push(o);for(var a=0,s=n;ai?this._n[i]:null)},e.prototype.getHighestUnacknowledgedBatchId=function(){return on.resolve(0===this._n.length?-1:this.ss-1)},e.prototype.getAllMutationBatches=function(e){return on.resolve(this._n.slice())},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var r=this,n=new zi(t,0),i=new zi(t,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([n,i],(function(e){var t=r.os(e.ns);o.push(t)})),on.resolve(o)},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var r=this,n=new Rt(S);return t.forEach((function(e){var t=new zi(e,0),i=new zi(e,Number.POSITIVE_INFINITY);r.rs.forEachInRange([t,i],(function(e){n=n.add(e.ns)}))})),on.resolve(this.us(n))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var r=t.path,n=r.length+1,i=r;Y.isDocumentKey(i)||(i=i.child(""));var o=new zi(new Y(i),0),a=new Rt(S);return this.rs.forEachWhile((function(e){var t=e.key.path;return!!r.isPrefixOf(t)&&(t.length===n&&(a=a.add(e.ns)),!0)}),o),on.resolve(this.us(a))},e.prototype.us=function(e){var t=this,r=[];return e.forEach((function(e){var n=t.os(e);null!==n&&r.push(n)})),r},e.prototype.removeMutationBatch=function(e,t){var r=this;b(0===this.hs(t.batchId,"removed")),this._n.shift();var n=this.rs;return on.forEach(t.mutations,(function(i){var o=new zi(i.key,t.batchId);return n=n.delete(o),r.referenceDelegate.markPotentiallyOrphaned(e,i.key)})).next((function(){r.rs=n}))},e.prototype.Gt=function(e){},e.prototype.containsKey=function(e,t){var r=new zi(t,0),n=this.rs.firstAfterOrEqual(r);return on.resolve(t.isEqual(n&&n.key))},e.prototype.performConsistencyCheck=function(e){return this._n.length,on.resolve()},e.prototype.hs=function(e,t){return this.cs(e)},e.prototype.cs=function(e){return 0===this._n.length?0:e-this._n[0].batchId},e.prototype.os=function(e){var t=this.cs(e);return t<0||t>=this._n.length?null:this._n[t]},e}(),Gi=function(){function e(e,t){this.Ut=e,this.ls=t,this.docs=new At(Y.comparator),this.size=0}return e.prototype.addEntry=function(e,t,r){var n=t.key,i=this.docs.get(n),o=i?i.size:0,a=this.ls(t);return this.docs=this.docs.insert(n,{document:t.clone(),size:a,readTime:r}),this.size+=a-o,this.Ut.addToCollectionParentIndex(e,n.path.popLast())},e.prototype.removeEntry=function(e){var t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)},e.prototype.getEntry=function(e,t){var r=this.docs.get(t);return on.resolve(r?r.document.clone():ce.newInvalidDocument(t))},e.prototype.getEntries=function(e,t){var r=this,n=Nt();return t.forEach((function(e){var t=r.docs.get(e);n=n.insert(e,t?t.document.clone():ce.newInvalidDocument(e))})),on.resolve(n)},e.prototype.getDocumentsMatchingQuery=function(e,t,r){for(var n=Nt(),i=new Y(t.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),s=a.key,u=a.value,l=u.document,c=u.readTime;if(!t.path.isPrefixOf(s.path))break;c.compareTo(r)<=0||He(t,l)&&(n=n.insert(l.key,l.clone()))}return on.resolve(n)},e.prototype.fs=function(e,t){return on.forEach(this.docs,(function(e){return t(e)}))},e.prototype.newChangeBuffer=function(e){return new Wi(this)},e.prototype.getSize=function(e){return on.resolve(this.size)},e}(),Wi=function(e){function t(t){var r=this;return(r=e.call(this)||this).Ie=t,r}return(0,i.__extends)(t,e),t.prototype.applyChanges=function(e){var t=this,r=[];return this.changes.forEach((function(n,i){i.document.isValidDocument()?r.push(t.Ie.addEntry(e,i.document,t.getReadTime(n))):t.Ie.removeEntry(n)})),on.waitFor(r)},t.prototype.getFromCache=function(e,t){return this.Ie.getEntry(e,t)},t.prototype.getAllFromCache=function(e,t){return this.Ie.getEntries(e,t)},t}(ai),Hi=function(){function e(e){this.persistence=e,this.ds=new oi((function(e){return fe(e)}),pe),this.lastRemoteSnapshotVersion=k.min(),this.highestTargetId=0,this.ws=0,this._s=new Bi,this.targetCount=0,this.ys=Yn.Jt()}return e.prototype.forEachTarget=function(e,t){return this.ds.forEach((function(e,r){return t(r)})),on.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(e){return on.resolve(this.lastRemoteSnapshotVersion)},e.prototype.getHighestSequenceNumber=function(e){return on.resolve(this.ws)},e.prototype.allocateTargetId=function(e){return this.highestTargetId=this.ys.next(),on.resolve(this.highestTargetId)},e.prototype.setTargetsMetadata=function(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.ws&&(this.ws=t),on.resolve()},e.prototype.te=function(e){this.ds.set(e.target,e);var t=e.targetId;t>this.highestTargetId&&(this.ys=new Yn(t),this.highestTargetId=t),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)},e.prototype.addTargetData=function(e,t){return this.te(t),this.targetCount+=1,on.resolve()},e.prototype.updateTargetData=function(e,t){return this.te(t),on.resolve()},e.prototype.removeTargetData=function(e,t){return this.ds.delete(t.target),this._s.Zn(t.targetId),this.targetCount-=1,on.resolve()},e.prototype.removeTargets=function(e,t,r){var n=this,i=0,o=[];return this.ds.forEach((function(a,s){s.sequenceNumber<=t&&null===r.get(s.targetId)&&(n.ds.delete(a),o.push(n.removeMatchingKeysForTargetId(e,s.targetId)),i++)})),on.waitFor(o).next((function(){return i}))},e.prototype.getTargetCount=function(e){return on.resolve(this.targetCount)},e.prototype.getTargetData=function(e,t){var r=this.ds.get(t)||null;return on.resolve(r)},e.prototype.addMatchingKeys=function(e,t,r){return this._s.Jn(t,r),on.resolve()},e.prototype.removeMatchingKeys=function(e,t,r){this._s.Xn(t,r);var n=this.persistence.referenceDelegate,i=[];return n&&t.forEach((function(t){i.push(n.markPotentiallyOrphaned(e,t))})),on.waitFor(i)},e.prototype.removeMatchingKeysForTargetId=function(e,t){return this._s.Zn(t),on.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var r=this._s.es(t);return on.resolve(r)},e.prototype.containsKey=function(e,t){return on.resolve(this._s.containsKey(t))},e}(),qi=function(){function e(e,t){var r=this;this.gs={},this.Ne=new l(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.qe=new Hi(this),this.Ut=new Rn,this.Ue=function(e,t){return new Gi(e,(function(e){return r.referenceDelegate.ps(e)}))}(this.Ut),this.R=new _n(t),this.Ke=new Ui(this.R)}return e.prototype.start=function(){return Promise.resolve()},e.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(e.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),e.prototype.setDatabaseDeletedListener=function(){},e.prototype.setNetworkEnabled=function(){},e.prototype.getIndexManager=function(){return this.Ut},e.prototype.getMutationQueue=function(e){var t=this.gs[e.toKey()];return t||(t=new Vi(this.Ut,this.referenceDelegate),this.gs[e.toKey()]=t),t},e.prototype.getTargetCache=function(){return this.qe},e.prototype.getRemoteDocumentCache=function(){return this.Ue},e.prototype.getBundleCache=function(){return this.Ke},e.prototype.runTransaction=function(e,t,r){var n=this;p("MemoryPersistence","Starting transaction:",e);var i=new Yi(this.Ne.next());return this.referenceDelegate.Es(),r(i).next((function(e){return n.referenceDelegate.Ts(i).next((function(){return e}))})).toPromise().then((function(e){return i.raiseOnCommittedEvent(),e}))},e.prototype.Is=function(e,t){return on.or(Object.values(this.gs).map((function(r){return function(){return r.containsKey(e,t)}})))},e}(),Yi=function(e){function t(t){var r=this;return(r=e.call(this)||this).currentSequenceNumber=t,r}return(0,i.__extends)(t,e),t}(rn),Xi=function(){function e(e){this.persistence=e,this.As=new Bi,this.Rs=null}return e.bs=function(t){return new e(t)},Object.defineProperty(e.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw v()},enumerable:!1,configurable:!0}),e.prototype.addReference=function(e,t,r){return this.As.addReference(r,t),this.vs.delete(r.toString()),on.resolve()},e.prototype.removeReference=function(e,t,r){return this.As.removeReference(r,t),this.vs.add(r.toString()),on.resolve()},e.prototype.markPotentiallyOrphaned=function(e,t){return this.vs.add(t.toString()),on.resolve()},e.prototype.removeTarget=function(e,t){var r=this;this.As.Zn(t.targetId).forEach((function(e){return r.vs.add(e.toString())}));var n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next((function(e){e.forEach((function(e){return r.vs.add(e.toString())}))})).next((function(){return n.removeTargetData(e,t)}))},e.prototype.Es=function(){this.Rs=new Set},e.prototype.Ts=function(e){var t=this,r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return on.forEach(this.vs,(function(n){var i=Y.fromPath(n);return t.Ps(e,i).next((function(e){e||r.removeEntry(i)}))})).next((function(){return t.Rs=null,r.apply(e)}))},e.prototype.updateLimboDocument=function(e,t){var r=this;return this.Ps(e,t).next((function(e){e?r.vs.delete(t.toString()):r.vs.add(t.toString())}))},e.prototype.ps=function(e){return 0},e.prototype.Ps=function(e,t){var r=this;return on.or([function(){return on.resolve(r.As.containsKey(t))},function(){return r.persistence.getTargetCache().containsKey(e,t)},function(){return r.persistence.Is(e,t)}])},e}(),Ki=function(){function e(e){this.uid=e}return e.prototype.isAuthenticated=function(){return null!=this.uid},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e}();function $i(e,t){return"firestore_clients_"+e+"_"+t}function Qi(e,t,r){var n="firestore_mutations_"+e+"_"+r;return t.isAuthenticated()&&(n+="_"+t.uid),n}function Ji(e,t){return"firestore_targets_"+e+"_"+t}Ki.UNAUTHENTICATED=new Ki(null),Ki.GOOGLE_CREDENTIALS=new Ki("google-credentials-uid"),Ki.FIRST_PARTY=new Ki("first-party-uid"),Ki.MOCK_USER=new Ki("mock-user");var Zi=function(){function e(e,t,r,n){this.user=e,this.batchId=t,this.state=r,this.error=n}return e.Vs=function(t,r,n){var i,o=JSON.parse(n),a="object"==u(o)&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==u(o.error));return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new d(o.error.code,o.error.message)),a?new e(t,r,o.state,i):(m("SharedClientState","Failed to parse mutation state for ID '"+r+"': "+n),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),eo=function(){function e(e,t,r){this.targetId=e,this.state=t,this.error=r}return e.Vs=function(t,r){var n,i=JSON.parse(r),o="object"==u(i)&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==u(i.error));return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(n=new d(i.error.code,i.error.message)),o?new e(t,i.state,n):(m("SharedClientState","Failed to parse target state for ID '"+t+"': "+r),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),to=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Vs=function(t,r){for(var n=JSON.parse(r),i="object"==u(n)&&n.activeTargetIds instanceof Array,o=Ht(),a=0;i&&a0){var n=a.getResponseJson().error;if(n&&n.status&&n.message){var u=function(e){var t=n.status.toLowerCase().replace(/_/g,"-");return Object.values(c).indexOf(t)>=0?t:c.UNKNOWN}();o(new d(u,n.message))}else o(new d(c.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new d(c.UNAVAILABLE,"Connection failed."));break;default:v()}}finally{p("Connection",'RPC "'+e+'" completed.')}}));var u=JSON.stringify(n);a.send(t,"POST",u,r,15)}))},t.prototype.Oi=function(e,t){var r=[this.Di,"/","google.firestore.v1.Firestore","/",e,"/channel"],n=(0,s.createWebChannelTransport)(),i=(0,s.getStatEventTarget)(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(a.xmlHttpFactory=new s.FetchXmlHttpFactory({})),this.ki(a.initMessageHeaders,t),(0,o.isMobileCordova)()||(0,o.isReactNative)()||(0,o.isElectron)()||(0,o.isIE)()||(0,o.isUWP)()||(0,o.isBrowserExtension)()||(a.httpHeadersOverwriteParam="$httpHeaders");var u=r.join("");p("Connection","Creating WebChannel: "+u,a);var l=n.createWebChannel(u,a),h=!1,f=!1,m=new lo({Ei:function(e){f?p("Connection","Not sending because WebChannel is closed:",e):(h||(p("Connection","Opening WebChannel transport."),l.open(),h=!0),p("Connection","WebChannel sending:",e),l.send(e))},Ti:function(){return l.close()}}),g=function(e,t,r){e.listen(t,(function(e){try{r(e)}catch(e){setTimeout((function(){throw e}),0)}}))};return g(l,s.WebChannel.EventType.OPEN,(function(){f||p("Connection","WebChannel transport opened.")})),g(l,s.WebChannel.EventType.CLOSE,(function(){f||(f=!0,p("Connection","WebChannel transport closed"),m.Vi())})),g(l,s.WebChannel.EventType.ERROR,(function(e){f||(f=!0,y("Connection","WebChannel transport errored:",e),m.Vi(new d(c.UNAVAILABLE,"The operation could not be completed")))})),g(l,s.WebChannel.EventType.MESSAGE,(function(e){var t;if(!f){var r=e.data[0];b(!!r);var n=r,i=n.error||(null===(t=n[0])||void 0===t?void 0:t.error);if(i){p("Connection","WebChannel received error:",i);var o=i.status,a=function(e){var t=Et[o];if(void 0!==t)return Ot(t)}(),s=i.message;void 0===a&&(a=c.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),f=!0,m.Vi(new d(a,s)),l.close()}else p("Connection","WebChannel received:",r),m.Si(r)}})),g(i,s.Event.STAT_EVENT,(function(e){e.stat===s.Stat.PROXY?p("Connection","Detected buffering proxy"):e.stat===s.Stat.NOPROXY&&p("Connection","Detected no buffering proxy")})),setTimeout((function(){m.Pi()}),0),m},t}(function(){function e(e){this.databaseInfo=e,this.databaseId=e.databaseId;var t=e.ssl?"https":"http";this.Di=t+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return e.prototype.Ni=function(e,t,r,n){var i=this.xi(e,t);p("RestConnection","Sending: ",i,r);var o={};return this.ki(o,n),this.Fi(e,i,o,r).then((function(e){return p("RestConnection","Received: ",e),e}),(function(t){throw y("RestConnection",e+" failed with error: ",t,"url: ",i,"request:",r),t}))},e.prototype.$i=function(e,t,r,n){return this.Ni(e,t,r,n)},e.prototype.ki=function(e,t){if(e["X-Goog-Api-Client"]="gl-js/ fire/8.10.1",e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t)for(var r in t.authHeaders)t.authHeaders.hasOwnProperty(r)&&(e[r]=t.authHeaders[r])},e.prototype.xi=function(e,t){var r=uo[e];return this.Di+"/v1/"+t+":"+r},e}());function ho(){return"undefined"!=typeof window?window:null}function fo(){return"undefined"!=typeof document?document:null}function po(e){return new nr(e,!0)}var mo=function(){function e(e,t,r,n,i){void 0===r&&(r=1e3),void 0===n&&(n=1.5),void 0===i&&(i=6e4),this.Se=e,this.timerId=t,this.Mi=r,this.Li=n,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return e.prototype.reset=function(){this.qi=0},e.prototype.Qi=function(){this.qi=this.Bi},e.prototype.ji=function(e){var t=this;this.cancel();var r=Math.floor(this.qi+this.Wi()),n=Math.max(0,Date.now()-this.Ki),i=Math.max(0,r-n);i>0&&p("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+r+" ms, last attempt: "+n+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,(function(){return t.Ki=Date.now(),e()})),this.qi*=this.Li,this.qithis.Bi&&(this.qi=this.Bi)},e.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},e.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},e.prototype.Wi=function(){return(Math.random()-.5)*this.qi},e}(),yo=function(){function e(e,t,r,n,i,o){this.Se=e,this.zi=r,this.Hi=n,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new mo(e,t)}return e.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.er=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.nr()},e.prototype.stop=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.sr=function(){this.state=0,this.Zi.reset()},e.prototype.ir=function(){var e=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return e.rr()})))},e.prototype.cr=function(e){this.ur(),this.stream.send(e)},e.prototype.rr=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return this.er()?[2,this.close(0)]:[2]}))}))},e.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},e.prototype.close=function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():t&&t.code===c.RESOURCE_EXHAUSTED?(m(t.toString()),m("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):t&&t.code===c.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.ar=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.hr(this.Yi),r=this.Yi;this.Ji.getToken().then((function(t){e.Yi===r&&e.lr(t)}),(function(r){t((function(){var t=new d(c.UNKNOWN,"Fetching auth token failed: "+r.message);return e.dr(t)}))}))},e.prototype.lr=function(e){var t=this,r=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii((function(){r((function(){return t.state=2,t.listener.Ii()}))})),this.stream.Ri((function(e){r((function(){return t.dr(e)}))})),this.stream.onMessage((function(e){r((function(){return t.onMessage(e)}))}))},e.prototype.nr=function(){var e=this;this.state=4,this.Zi.ji((function(){return(0,i.__awaiter)(e,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.dr=function(e){return p("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.hr=function(e){var t=this;return function(r){t.Se.enqueueAndForget((function(){return t.Yi===e?r():(p("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),go=function(e){function t(t,r,n,i,o){var a=this;return(a=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",r,n,o)||this).R=i,a}return(0,i.__extends)(t,e),t.prototype.wr=function(e){return this.Hi.Oi("Listen",e)},t.prototype.onMessage=function(e){this.Zi.reset();var t=function(e,t){var r;if("targetChange"in t){t.targetChange;var n=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:v()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.I?(b(void 0===t||"string"==typeof t),L.fromBase64String(t||"")):(b(void 0===t||t instanceof Uint8Array),L.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=(s=t.targetChange.cause)&&function(e){var t=void 0===e.code?c.UNKNOWN:Ot(e.code);return new d(t,e.message||"")}(s);r=new $t(n,i,o,a||null)}else if("documentChange"in t){t.documentChange,(n=t.documentChange).document,n.document.name,n.document.updateTime,i=dr(e,n.document.name),o=sr(n.document.updateTime);var s=new ue({mapValue:{fields:n.document.fields}}),u=(a=ce.newFoundDocument(i,o,s),n.targetIds||[]),l=n.removedTargetIds||[];r=new Xt(u,l,a.key,a)}else if("documentDelete"in t)t.documentDelete,(n=t.documentDelete).document,i=dr(e,n.document),o=n.readTime?sr(n.readTime):k.min(),s=ce.newNoDocument(i,o),a=n.removedTargetIds||[],r=new Xt([],a,s.key,s);else if("documentRemove"in t)t.documentRemove,(n=t.documentRemove).document,i=dr(e,n.document),o=n.removedTargetIds||[],r=new Xt([],o,i,null);else{if(!("filter"in t))return v();t.filter;var h=t.filter;h.targetId,n=h.count||0,i=new Ct(n),o=h.targetId,r=new Kt(o,i)}return r}(this.R,e),r=function(e){if(!("targetChange"in e))return k.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?k.min():t.readTime?sr(t.readTime):k.min()}(e);return this.listener._r(t,r)},t.prototype.mr=function(e){var t={};t.database=pr(this.R),t.addTarget=function(e,t){var r,n=t.target;return(r=me(n)?{documents:_r(e,n)}:{query:wr(e,n)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0?r.resumeToken=or(e,t.resumeToken):t.snapshotVersion.compareTo(k.min())>0&&(r.readTime=ir(e,t.snapshotVersion.toTimestamp())),r}(this.R,e);var r=function(e,t){var r=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return v()}}(0,t.purpose);return null==r?null:{"goog-listen-tags":r}}(this.R,e);r&&(t.labels=r),this.cr(t)},t.prototype.yr=function(e){var t={};t.database=pr(this.R),t.removeTarget=e,this.cr(t)},t}(yo),vo=function(e){function t(t,r,n,i,o){var a=this;return(a=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",r,n,o)||this).R=i,a.gr=!1,a}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ar=function(){this.gr&&this.Er([])},t.prototype.wr=function(e){return this.Hi.Oi("Write",e)},t.prototype.onMessage=function(e){if(b(!!e.streamToken),this.lastStreamToken=e.streamToken,this.gr){this.Zi.reset();var t=function(e,t){return e&&e.length>0?(b(void 0!==t),e.map((function(e){return function(e,t){var r=e.updateTime?sr(e.updateTime):sr(t);return r.isEqual(k.min())&&(r=sr(t)),new ct(r,e.transformResults||[])}(e,t)}))):[]}(e.writeResults,e.commitTime),r=sr(e.commitTime);return this.listener.Tr(r,t)}return b(!e.writeResults||0===e.writeResults.length),this.gr=!0,this.listener.Ir()},t.prototype.Ar=function(){var e={};e.database=pr(this.R),this.cr(e)},t.prototype.Er=function(e){var t=this,r={streamToken:this.lastStreamToken,writes:e.map((function(e){return vr(t.R,e)}))};this.cr(r)},t}(yo),bo=function(e){function t(t,r,n){var i=this;return(i=e.call(this)||this).credentials=t,i.Hi=r,i.R=n,i.Rr=!1,i}return(0,i.__extends)(t,e),t.prototype.br=function(){if(this.Rr)throw new d(c.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.Ni=function(e,t,r){var n=this;return this.br(),this.credentials.getToken().then((function(i){return n.Hi.Ni(e,t,r,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===c.UNAUTHENTICATED&&n.credentials.invalidateToken(),e):new d(c.UNKNOWN,e.toString())}))},t.prototype.$i=function(e,t,r){var n=this;return this.br(),this.credentials.getToken().then((function(i){return n.Hi.$i(e,t,r,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===c.UNAUTHENTICATED&&n.credentials.invalidateToken(),e):new d(c.UNKNOWN,e.toString())}))},t.prototype.terminate=function(){this.Rr=!0},t}((function(){})),_o=function(){function e(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return e.prototype.Sr=function(){var e=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return e.Pr=null,e.Cr("Backend didn't respond within 10 seconds."),e.Dr("Offline"),Promise.resolve()})))},e.prototype.Nr=function(e){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+e.toString()),this.Dr("Offline")))},e.prototype.set=function(e){this.kr(),this.vr=0,"Online"===e&&(this.Vr=!1),this.Dr(e)},e.prototype.Dr=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.Cr=function(e){var t="Could not reach Cloud Firestore backend. "+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.Vr?(m(t),this.Vr=!1):p("OnlineStateTracker",t)},e.prototype.kr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},e}(),wo=function(e,t,r,n,o){var a=this;this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=o,this.Lr.di((function(e){r.enqueueAndForget((function(){return(0,i.__awaiter)(a,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return Oo(this)?(p("RemoteStore","Restarting streams for network reachability change."),[4,function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return(t=_(e)).Or.add(4),[4,So(t)];case 1:return r.sent(),t.Br.set("Unknown"),t.Or.delete(4),[4,xo(t)];case 2:return r.sent(),[2]}}))}))}(this)]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Br=new _o(r,n)};function xo(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:if(!Oo(e))return[3,4];t=0,r=e.Mr,n.label=1;case 1:return t0}function Oo(e){return 0===_(e).Or.size}function Ao(e){e.qr=void 0}function Po(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){return e.$r.forEach((function(t,r){Mo(e,t)})),[2]}))}))}function Io(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(r){return Ao(e),jo(e)?(e.Br.Nr(t),Co(e)):e.Br.set("Unknown"),[2]}))}))}function Ro(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,a;return(0,i.__generator)(this,(function(s){switch(s.label){case 0:if(e.Br.set("Online"),!(t instanceof $t&&2===t.state&&t.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:r=t.cause,n=0,o=t.targetIds,i.label=1;case 1:return n=0?[4,function(e,t){var r=e.qr.ut(t);return r.targetChanges.forEach((function(r,n){if(r.resumeToken.approximateByteSize()>0){var i=e.$r.get(n);i&&e.$r.set(n,i.withResumeToken(r.resumeToken,t))}})),r.targetMismatches.forEach((function(t){var r=e.$r.get(t);if(r){e.$r.set(t,r.withResumeToken(L.EMPTY_BYTE_STRING,r.snapshotVersion)),ko(e,t);var n=new bn(r.target,t,1,r.sequenceNumber);Mo(e,n)}})),e.remoteSyncer.applyRemoteEvent(r)}(e,r)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return p("RemoteStore","Failed to raise snapshot:",a=s.sent()),[4,Do(e,a)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function Do(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n=this;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:if(!cn(t))throw t;return e.Or.add(1),[4,So(e)];case 1:return o.sent(),e.Br.set("Offline"),r||(r=function(){return ki(e.localStore)}),e.asyncQueue.enqueueRetryable((function(){return(0,i.__awaiter)(n,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return p("RemoteStore","Retrying IndexedDB access"),[4,r()];case 1:return t.sent(),e.Or.delete(1),[4,xo(e)];case 2:return t.sent(),[2]}}))}))})),[2]}}))}))}function Lo(e,t){return t().catch((function(r){return Do(e,r,t)}))}function No(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r,n,o,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:t=_(e),r=qo(t),n=t.Fr.length>0?t.Fr[t.Fr.length-1].batchId:-1,i.label=1;case 1:if(!function(e){return Oo(e)&&e.Fr.length<10}(t))return[3,7];i.label=2;case 2:return i.trys.push([2,4,,6]),[4,Oi(t.localStore,n)];case 3:return null===(o=i.sent())?(0===t.Fr.length&&r.ir(),[3,7]):(n=o.batchId,function(e,t){e.Fr.push(t);var r=qo(e);r.er()&&r.pr&&r.Er(t.mutations)}(t,o),[3,6]);case 4:return a=i.sent(),[4,Do(t,a)];case 5:return i.sent(),[3,6];case 6:return[3,1];case 7:return Fo(t)&&Uo(t),[2]}}))}))}function Fo(e){return Oo(e)&&!qo(e).tr()&&e.Fr.length>0}function Uo(e){qo(e).start()}function Bo(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){return qo(e).Ar(),[2]}))}))}function zo(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r,n,o;return(0,i.__generator)(this,(function(i){for(t=qo(e),r=0,n=e.Fr;r0&&(p("RemoteStore","Stopping write stream with "+e.Fr.length+" pending writes"),e.Fr=[]),t.label=4;case 4:return[2]}}))}))}))),e.Kr}var Yo=function(){function e(e,t,r,n,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=n,this.removalCallback=i,this.deferred=new nn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(e){}))}return e.createAndSchedule=function(t,r,n,i,o){var a=new e(t,r,Date.now()+n,i,o);return a.start(n),a},e.prototype.start=function(e){var t=this;this.timerHandle=setTimeout((function(){return t.handleDelayElapsed()}),e)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new d(c.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.handleDelayElapsed=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()}))},e.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e}();function Xo(e,t){if(m("AsyncQueue",t+": "+e),cn(e))return new d(c.UNAVAILABLE,t+": "+e);throw e}var Ko=function(){function e(e){this.comparator=e?function(t,r){return e(t,r)||Y.comparator(t.key,r.key)}:function(e,t){return Y.comparator(e.key,t.key)},this.keyedMap=Ut(),this.sortedSet=new At(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(e){return null!=this.keyedMap.get(e)},e.prototype.get=function(e){return this.keyedMap.get(e)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.sortedSet.inorderTraversal((function(t,r){return e(t),!1}))},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var r=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();r.hasNext();){var i=r.getNext().key,o=n.getNext().key;if(!i.isEqual(o))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach((function(t){e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"},e.prototype.copy=function(t,r){var n=new e;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=r,n},e}(),$o=function(){function e(){this.Qr=new At(Y.comparator)}return e.prototype.track=function(e){var t=e.doc.key,r=this.Qr.get(t);r?0!==e.type&&3===r.type?this.Qr=this.Qr.insert(t,e):3===e.type&&1!==r.type?this.Qr=this.Qr.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.Qr=this.Qr.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.Qr=this.Qr.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.Qr=this.Qr.remove(t):1===e.type&&2===r.type?this.Qr=this.Qr.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.Qr=this.Qr.insert(t,{type:2,doc:e.doc}):v():this.Qr=this.Qr.insert(t,e)},e.prototype.jr=function(){var e=[];return this.Qr.inorderTraversal((function(t,r){e.push(r)})),e},e}(),Qo=function(){function e(e,t,r,n,i,o,a,s){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=n,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return e.fromInitialDocuments=function(t,r,n,i){var o=[];return r.forEach((function(e){o.push({type:0,doc:e})})),new e(t,r,Ko.emptySet(r),o,n,i,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ve(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(var n=0;n=0&&(a.listeners.splice(s,1),o=0===a.listeners.length),o?[2,(r.queries.delete(n),r.onUnlisten(n))]:[2]}))}))}function ra(e,t){for(var r=_(e),n=!1,i=0,o=t;i0)return!0;var t=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges},e.prototype.no=function(e){e=Qo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)},e}(),aa=function(){function e(e,t){this.payload=e,this.byteLength=t}return e.prototype.io=function(){return"metadata"in this.payload},e}(),sa=function(){function e(e){this.R=e}return e.prototype.qn=function(e){return dr(this.R,e)},e.prototype.Un=function(e){return e.metadata.exists?gr(this.R,e.document,!1):ce.newNoDocument(this.qn(e.metadata.name),this.Kn(e.metadata.readTime))},e.prototype.Kn=function(e){return sr(e)},e}(),ua=function(){function e(e,t,r){this.ro=e,this.localStore=t,this.R=r,this.queries=[],this.documents=[],this.progress=la(e)}return e.prototype.oo=function(e){this.progress.bytesLoaded+=e.byteLength;var t=this.progress.documentsLoaded;return e.payload.namedQuery?this.queries.push(e.payload.namedQuery):e.payload.documentMetadata?(this.documents.push({metadata:e.payload.documentMetadata}),e.payload.documentMetadata.exists||++t):e.payload.document&&(this.documents[this.documents.length-1].document=e.payload.document,++t),t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null},e.prototype.co=function(e){for(var t=new Map,r=new sa(this.R),n=0,i=e;n0||l&&r.lo(d,l)<0)&&(s=!0)):!c&&d?(n.track({type:0,doc:d}),p=!0):c&&!d&&(n.track({type:1,doc:c}),p=!0,(u||l)&&(s=!0)),p&&(d?(a=a.add(d),o=f?o.add(e):o.delete(e)):(a=a.delete(e),o=o.delete(e)))})),Re(this.query)||De(this.query))for(;a.size>this.query.limit;){var c=Re(this.query)?a.last():a.first();a=a.delete(c.key),o=o.delete(c.key),n.track({type:1,doc:c})}return{fo:a,mo:n,Nn:s,mutatedKeys:o}},e.prototype.yo=function(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations},e.prototype.applyChanges=function(e,t,r){var n=this,i=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;var o=e.mo.jr();o.sort((function(e,t){return function(e,t){var r=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return v()}};return r(e)-r(t)}(e.type,t.type)||n.lo(e.doc,t.doc)})),this.po(r);var a=t?this.Eo():[],s=0===this.ho.size&&this.current?1:0,u=s!==this.ao;return this.ao=s,0!==o.length||u?{snapshot:new Qo(this.query,e.fo,i,o,e.mutatedKeys,0===s,u,!1),To:a}:{To:a}},e.prototype.zr=function(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({fo:this.fo,mo:new $o,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},e.prototype.Io=function(e){return!this.uo.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations},e.prototype.po=function(e){var t=this;e&&(e.addedDocuments.forEach((function(e){return t.uo=t.uo.add(e)})),e.modifiedDocuments.forEach((function(e){})),e.removedDocuments.forEach((function(e){return t.uo=t.uo.delete(e)})),this.current=e.current)},e.prototype.Eo=function(){var e=this;if(!this.current)return[];var t=this.ho;this.ho=Gt(),this.fo.forEach((function(t){e.Io(t.key)&&(e.ho=e.ho.add(t.key))}));var r=[];return t.forEach((function(t){e.ho.has(t)||r.push(new da(t))})),this.ho.forEach((function(e){t.has(e)||r.push(new ca(e))})),r},e.prototype.Ao=function(e){this.uo=e.Bn,this.ho=Gt();var t=this._o(e.documents);return this.applyChanges(t,!0)},e.prototype.Ro=function(){return Qo.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},e}(),fa=function(e,t,r){this.query=e,this.targetId=t,this.view=r},pa=function(e){this.key=e,this.bo=!1},ma=function(){function e(e,t,r,n,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=n,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new oi((function(e){return Ge(e)}),Ve),this.Vo=new Map,this.So=new Set,this.Do=new At(Y.comparator),this.Co=new Map,this.No=new Bi,this.xo={},this.ko=new Map,this.Fo=Yn.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(e.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),e}();function ya(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o,a,s,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=Ha(e),(a=r.Po.get(t))?(n=a.targetId,r.sharedClientState.addLocalQueryTarget(n),o=a.view.Ro(),[3,4]):[3,1];case 1:return[4,Ai(r.localStore,Be(t))];case 2:return s=i.sent(),u=r.sharedClientState.addLocalQueryTarget(s.targetId),n=s.targetId,[4,ga(r,t,n,"current"===u)];case 3:o=i.sent(),r.isPrimaryClient&&Eo(r.remoteStore,s),i.label=4;case 4:return[2,o]}}))}))}function ga(e,t,r,n){return(0,i.__awaiter)(this,void 0,void 0,(function(){var o,a,s,u,l,c;return(0,i.__generator)(this,(function(d){switch(d.label){case 0:return e.Oo=function(t,r,n){return function(e,t,r,n){return(0,i.__awaiter)(this,void 0,void 0,(function(){var o,a,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return(o=t.view._o(r)).Nn?[4,Ii(e.localStore,t.query,!1).then((function(e){var r=e.documents;return t.view._o(r,o)}))]:[3,2];case 1:o=i.sent(),i.label=2;case 2:return a=n&&n.targetChanges.get(t.targetId),s=t.view.applyChanges(o,e.isPrimaryClient,a),[2,(Oa(e,t.targetId,s.To),s.snapshot)]}}))}))}(e,t,r,n)},[4,Ii(e.localStore,t,!0)];case 1:return o=d.sent(),a=new ha(t,o.Bn),s=a._o(o.documents),u=Yt.createSynthesizedTargetChangeForCurrentChange(r,n&&"Offline"!==e.onlineState),l=a.applyChanges(s,e.isPrimaryClient,u),Oa(e,r,l.To),c=new fa(t,r,a),[2,(e.Po.set(t,c),e.Vo.has(r)?e.Vo.get(r).push(t):e.Vo.set(r,[t]),l.snapshot)]}}))}))}function va(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=_(e),n=r.Po.get(t),(o=r.Vo.get(n.targetId)).length>1?[2,(r.Vo.set(n.targetId,o.filter((function(e){return!Ve(e,t)}))),void r.Po.delete(t))]:r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(n.targetId),r.sharedClientState.isActiveQueryTarget(n.targetId)?[3,2]:[4,Pi(r.localStore,n.targetId,!1).then((function(){r.sharedClientState.clearQueryState(n.targetId),To(r.remoteStore,n.targetId),Ca(r,n.targetId)})).catch(Jn)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return Ca(r,n.targetId),[4,Pi(r.localStore,n.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))}function ba(e,t,r){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n,o,a,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:n=qa(e),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(e,t){var r,n=_(e),i=M.now(),o=t.reduce((function(e,t){return e.add(t.key)}),Gt());return n.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return n.Mn.pn(e,o).next((function(o){r=o;for(var a=[],s=0,u=t;s0?n.bo=!0:e.modifiedDocuments.size>0?b(n.bo):e.removedDocuments.size>0&&(b(n.bo),n.bo=!1))})),[4,Ia(r,n,t)];case 3:return i.sent(),[3,6];case 4:return[4,Jn(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function wa(e,t,r){var n=_(e);if(n.isPrimaryClient&&0===r||!n.isPrimaryClient&&1===r){var i=[];n.Po.forEach((function(e,r){var n=r.view.zr(t);n.snapshot&&i.push(n.snapshot)})),function(e,t){var r=_(e);r.onlineState=t;var n=!1;r.queries.forEach((function(e,r){for(var i=0,o=r.listeners;i0&&e.Do.size=0}))}(e.localStore,n)];case 2:return i.sent()?[4,t.close()]:[3,4];case 3:return[2,(i.sent(),void r._completeWith(function(e){return{taskState:"Success",documentsLoaded:e.totalDocuments,bytesLoaded:e.totalBytes,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}(n)))];case 4:return r._updateProgress(la(n)),o=new ua(n,e.localStore,t.R),[4,t.Lo()];case 5:a=i.sent(),i.label=6;case 6:return a?[4,o.oo(a)]:[3,10];case 7:return(s=i.sent())&&r._updateProgress(s),[4,t.Lo()];case 8:a=i.sent(),i.label=9;case 9:return[3,6];case 10:return[4,o.complete()];case 11:return u=i.sent(),[4,Ia(e,u.wn,void 0)];case 12:return i.sent(),[4,function(e,t){var r=_(e);return r.persistence.runTransaction("Save bundle","readwrite",(function(e){return r.Ke.saveBundleMetadata(e,t)}))}(e.localStore,n)];case 13:return i.sent(),r._completeWith(u.progress),[3,15];case 14:return y("SyncEngine","Loading bundle failed with "+(l=i.sent())),r._failWith(l),[3,15];case 15:return[2]}}))}))})(n,t,r).then((function(){n.sharedClientState.notifyBundleLoaded()}))}var Xa=function(){function e(){this.synchronizeTabs=!1}return e.prototype.initialize=function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return this.R=po(e.databaseInfo.databaseId),this.sharedClientState=this.Bo(e),this.persistence=this.qo(e),[4,this.persistence.start()];case 1:return t.sent(),this.gcScheduler=this.Uo(e),this.localStore=this.Ko(e),[2]}}))}))},e.prototype.Uo=function(e){return null},e.prototype.Ko=function(e){return Ei(this.persistence,new xi,e.initialUser,this.R)},e.prototype.qo=function(e){return new qi(Xi.bs,this.R)},e.prototype.Bo=function(e){return new oo},e.prototype.terminate=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return e.sent(),[4,this.persistence.shutdown()];case 2:return e.sent(),[2]}}))}))},e}(),Ka=function(e){function t(t,r,n){var i=this;return(i=e.call(this)||this).Qo=t,i.cacheSizeBytes=r,i.forceOwnership=n,i.synchronizeTabs=!1,i}return(0,i.__extends)(t,e),t.prototype.initialize=function(t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r=this;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return n.sent(),[4,Li(this.localStore)];case 2:return n.sent(),[4,this.Qo.initialize(this,t)];case 3:return n.sent(),[4,qa(this.Qo.syncEngine)];case 4:return n.sent(),[4,No(this.Qo.remoteStore)];case 5:return n.sent(),[4,this.persistence.He((function(){return r.gcScheduler&&!r.gcScheduler.started&&r.gcScheduler.start(r.localStore),Promise.resolve()}))];case 6:return n.sent(),[2]}}))}))},t.prototype.Ko=function(e){return Ei(this.persistence,new xi,e.initialUser,this.R)},t.prototype.Uo=function(e){var t=this.persistence.referenceDelegate.garbageCollector;return new ti(t,e.asyncQueue)},t.prototype.qo=function(e){var t=vi(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=void 0!==this.cacheSizeBytes?Un.withCacheSize(this.cacheSizeBytes):Un.DEFAULT;return new mi(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,ho(),fo(),this.R,this.sharedClientState,!!this.forceOwnership)},t.prototype.Bo=function(e){return new oo},t}(Xa),$a=function(e){function t(t,r){var n=this;return(n=e.call(this,t,r,!1)||this).Qo=t,n.cacheSizeBytes=r,n.synchronizeTabs=!0,n}return(0,i.__extends)(t,e),t.prototype.initialize=function(t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n=this;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return o.sent(),r=this.Qo.syncEngine,this.sharedClientState instanceof io?(this.sharedClientState.syncEngine={ui:Fa.bind(null,r),ai:Ga.bind(null,r),hi:Wa.bind(null,r),fn:Va.bind(null,r),ci:Na.bind(null,r)},[4,this.sharedClientState.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.He((function(e){return(0,i.__awaiter)(n,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,Ua(this.Qo.syncEngine,e)];case 1:return t.sent(),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):e||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return o.sent(),[2]}}))}))},t.prototype.Bo=function(e){var t=ho();if(!io.yt(t))throw new d(c.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var r=vi(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new io(t,e.asyncQueue,r,e.clientId,e.initialUser)},t}(Ka),Qa=function(){function e(){}return e.prototype.initialize=function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r=this;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return this.localStore?[3,2]:(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(e){return wa(r.syncEngine,e,1)},this.remoteStore.remoteSyncer.handleCredentialChange=Ra.bind(null,this.syncEngine),[4,Wo(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.createEventManager=function(e){return new Zo},e.prototype.createDatastore=function(e){var t,r=po(e.databaseInfo.databaseId),n=(t=e.databaseInfo,new co(t));return function(e,t,r){return new bo(e,n,r)}(e.credentials,0,r)},e.prototype.createRemoteStore=function(e){var t,r,n,i,o,a=this;return t=this.localStore,r=this.datastore,n=e.asyncQueue,i=function(e){return wa(a.syncEngine,e,0)},o=so.yt()?new so:new ao,new wo(t,r,n,i,o)},e.prototype.createSyncEngine=function(e,t){return function(e,t,r,n,i,o,a){var s=new ma(e,t,r,n,i,o);return a&&(s.$o=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)},e.prototype.terminate=function(){return function(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return t=_(e),p("RemoteStore","RemoteStore shutting down."),t.Or.add(5),[4,So(t)];case 1:return r.sent(),t.Lr.shutdown(),t.Br.set("Unknown"),[2]}}))}))}(this.remoteStore)},e}();function Ja(e,t){void 0===t&&(t=10240);var r=0;return{read:function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var n;return(0,i.__generator)(this,(function(i){return r0)throw new d(c.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o,a,s,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=_(e),n=pr(r.R)+"/documents",o={documents:t.map((function(e){return cr(r.R,e)}))},[4,r.$i("BatchGetDocuments",n,o)];case 1:return a=i.sent(),s=new Map,a.forEach((function(e){var t=function(e,t){return"found"in t?function(e,t){b(!!t.found),t.found.name,t.found.updateTime;var r=dr(e,t.found.name),n=sr(t.found.updateTime),i=new ue({mapValue:{fields:t.found.fields}});return ce.newFoundDocument(r,n,i)}(e,t):"missing"in t?function(e,t){b(!!t.missing),b(!!t.readTime);var r=dr(e,t.missing),n=sr(t.readTime);return ce.newNoDocument(r,n)}(e,t):v()}(r.R,e);s.set(t.key.toString(),t)})),u=[],[2,(t.forEach((function(e){var t=s.get(e.toString());b(!!t),u.push(t)})),u)]}}))}))}(this.datastore,e)];case 1:return[2,((t=n.sent()).forEach((function(e){return r.recordVersion(e)})),t)]}}))}))},e.prototype.set=function(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.update=function(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastWriteError=e}this.writtenDocs.add(e.toString())},e.prototype.delete=function(e){this.write(new Mt(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.commit=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e,t=this;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return e=this.readVersions,this.mutations.forEach((function(t){e.delete(t.key.toString())})),e.forEach((function(e,r){var n=Y.fromPath(r);t.mutations.push(new kt(n,t.precondition(n)))})),[4,function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r=_(e),n=pr(r.R)+"/documents",o={writes:t.map((function(e){return vr(r.R,e)}))},[4,r.Ni("Commit",n,o)];case 1:return i.sent(),[2]}}))}))}(this.datastore,this.mutations)];case 1:return r.sent(),this.committed=!0,[2]}}))}))},e.prototype.recordVersion=function(e){var t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw v();t=k.min()}var r=this.readVersions.get(e.key.toString());if(r){if(!t.isEqual(r))throw new d(c.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)},e.prototype.precondition=function(e){var t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?dt.updateTime(t):dt.none()},e.prototype.preconditionForUpdate=function(e){var t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(k.min()))throw new d(c.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return dt.updateTime(t)}return dt.exists(!0)},e.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations.push(e)},e.prototype.ensureCommitNotCalled=function(){},e}(),rs=function(){function e(e,t,r,n){this.asyncQueue=e,this.datastore=t,this.updateFunction=r,this.deferred=n,this.ec=5,this.Zi=new mo(this.asyncQueue,"transaction_retry")}return e.prototype.run=function(){this.ec-=1,this.nc()},e.prototype.nc=function(){var e=this;this.Zi.ji((function(){return(0,i.__awaiter)(e,void 0,void 0,(function(){var e,t,r=this;return(0,i.__generator)(this,(function(n){return e=new ts(this.datastore),(t=this.sc(e))&&t.then((function(t){r.asyncQueue.enqueueAndForget((function(){return e.commit().then((function(){r.deferred.resolve(t)})).catch((function(e){r.ic(e)}))}))})).catch((function(e){r.ic(e)})),[2]}))}))}))},e.prototype.sc=function(e){try{var t=this.updateFunction(e);return!W(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}},e.prototype.ic=function(e){var t=this;this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return t.nc(),Promise.resolve()}))):this.deferred.reject(e)},e.prototype.rc=function(e){if("FirebaseError"===e.name){var t=e.code;return"aborted"===t||"failed-precondition"===t||!jt(t)}return!1},e}(),ns=function(){function e(e,t,r){var n=this;this.credentials=e,this.asyncQueue=t,this.databaseInfo=r,this.user=Ki.UNAUTHENTICATED,this.clientId=x.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(t,(function(e){return(0,i.__awaiter)(n,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return p("FirestoreClient","Received user=",e.uid),[4,this.credentialListener(e)];case 1:return t.sent(),this.user=e,[2]}}))}))}))}return e.prototype.getConfiguration=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]}))}))},e.prototype.setCredentialChangeListener=function(e){this.credentialListener=e},e.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new d(c.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.terminate=function(){var e=this;this.asyncQueue.enterRestrictedMode();var t=new nn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return(0,i.__awaiter)(e,void 0,void 0,(function(){var e,r;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:n.sent(),n.label=4;case 4:return this.credentials.removeChangeListener(),t.resolve(),[3,6];case 5:return e=n.sent(),r=Xo(e,"Failed to shutdown persistence"),t.reject(r),[3,6];case 6:return[2]}}))}))})),t.promise},e}();function is(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n,o=this;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:return e.asyncQueue.verifyOperationInProgress(),p("FirestoreClient","Initializing OfflineComponentProvider"),[4,e.getConfiguration()];case 1:return r=a.sent(),[4,t.initialize(r)];case 2:return a.sent(),n=r.initialUser,e.setCredentialChangeListener((function(e){return(0,i.__awaiter)(o,void 0,void 0,(function(){return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return n.isEqual(e)?[3,2]:[4,Ti(t.localStore,e)];case 1:r.sent(),n=e,r.label=2;case 2:return[2]}}))}))})),t.persistence.setDatabaseDeletedListener((function(){return e.terminate()})),e.offlineComponents=t,[2]}}))}))}function os(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n;return(0,i.__generator)(this,(function(o){switch(o.label){case 0:return e.asyncQueue.verifyOperationInProgress(),[4,as(e)];case 1:return r=o.sent(),p("FirestoreClient","Initializing OnlineComponentProvider"),[4,e.getConfiguration()];case 2:return n=o.sent(),[4,t.initialize(r,n)];case 3:return o.sent(),e.setCredentialChangeListener((function(e){return function(e,t){return(0,i.__awaiter)(this,void 0,void 0,(function(){var r,n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return(r=_(e)).asyncQueue.verifyOperationInProgress(),p("RemoteStore","RemoteStore received new credentials"),n=Oo(r),r.Or.add(3),[4,So(r)];case 1:return i.sent(),n&&r.Br.set("Unknown"),[4,r.remoteSyncer.handleCredentialChange(t)];case 2:return i.sent(),r.Or.delete(3),[4,xo(r)];case 3:return i.sent(),[2]}}))}))}(t.remoteStore,e)})),e.onlineComponents=t,[2]}}))}))}function as(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return e.offlineComponents?[3,2]:(p("FirestoreClient","Using default OfflineComponentProvider"),[4,is(e,new Xa)]);case 1:t.sent(),t.label=2;case 2:return[2,e.offlineComponents]}}))}))}function ss(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return e.onlineComponents?[3,2]:(p("FirestoreClient","Using default OnlineComponentProvider"),[4,os(e,new Qa)]);case 1:t.sent(),t.label=2;case 2:return[2,e.onlineComponents]}}))}))}function us(e){return as(e).then((function(e){return e.persistence}))}function ls(e){return as(e).then((function(e){return e.localStore}))}function cs(e){return ss(e).then((function(e){return e.remoteStore}))}function ds(e){return ss(e).then((function(e){return e.syncEngine}))}function hs(e){return(0,i.__awaiter)(this,void 0,void 0,(function(){var t,r;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,ss(e)];case 1:return t=n.sent(),[2,((r=t.eventManager).onListen=ya.bind(null,t.syncEngine),r.onUnlisten=va.bind(null,t.syncEngine),r)]}}))}))}function fs(e,t,r){var n=this;void 0===r&&(r={});var o=new nn;return e.asyncQueue.enqueueAndForget((function(){return(0,i.__awaiter)(n,void 0,void 0,(function(){var n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return n=function(e,t,r,n,i){var o=new Za({next:function(o){t.enqueueAndForget((function(){return ta(e,a)}));var s=o.docs.has(r);!s&&o.fromCache?i.reject(new d(c.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&n&&"server"===n.source?i.reject(new d(c.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:function(e){return i.reject(e)}}),a=new oa(Ie(r.path),o,{includeMetadataChanges:!0,so:!0});return ea(e,a)},[4,hs(e)];case 1:return[2,n.apply(void 0,[i.sent(),e.asyncQueue,t,r,o])]}}))}))})),o.promise}function ps(e,t,r){var n=this;void 0===r&&(r={});var o=new nn;return e.asyncQueue.enqueueAndForget((function(){return(0,i.__awaiter)(n,void 0,void 0,(function(){var n;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return n=function(e,t,r,n,i){var o=new Za({next:function(r){t.enqueueAndForget((function(){return ta(e,a)})),r.fromCache&&"server"===n.source?i.reject(new d(c.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(r)},error:function(e){return i.reject(e)}}),a=new oa(r,o,{includeMetadataChanges:!0,so:!0});return ea(e,a)},[4,hs(e)];case 1:return[2,n.apply(void 0,[i.sent(),e.asyncQueue,t,r,o])]}}))}))})),o.promise}var ms=function(e,t,r,n,i,o,a,s){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=n,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.useFetchStreams=s},ys=function(){function e(e,t){this.projectId=e,this.database=t||"(default)"}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e}(),gs=new Map,vs=function(e,t){this.user=t,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+e},bs=function(){function e(){this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e,t){this.changeListener=t,e.enqueueRetryable((function(){return t(Ki.UNAUTHENTICATED)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),_s=function(){function e(e){this.token=e,this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(this.token)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e,t){var r=this;this.changeListener=t,e.enqueueRetryable((function(){return t(r.token.user)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),ws=function(){function e(e){var t=this;this.currentUser=Ki.UNAUTHENTICATED,this.oc=new nn,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){t.cc++,t.currentUser=t.ac(),t.oc.resolve(),t.changeListener&&t.asyncQueue.enqueueRetryable((function(){return t.changeListener(t.currentUser)}))};var r=function(e){p("FirebaseCredentialsProvider","Auth detected"),t.auth=e,t.auth.addAuthTokenListener(t.uc)};e.onInit((function(e){return r(e)})),setTimeout((function(){if(!t.auth){var n=e.getImmediate({optional:!0});n?r(n):(p("FirebaseCredentialsProvider","Auth not yet detected"),t.oc.resolve())}}),0)}return e.prototype.getToken=function(){var e=this,t=this.cc,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then((function(r){return e.cc!==t?(p("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):r?(b("string"==typeof r.accessToken),new vs(r.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.invalidateToken=function(){this.forceRefresh=!0},e.prototype.setChangeListener=function(e,t){var r=this;this.asyncQueue=e,this.asyncQueue.enqueueRetryable((function(){return(0,i.__awaiter)(r,void 0,void 0,(function(){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.oc.promise];case 1:return e.sent(),[4,t(this.currentUser)];case 2:return e.sent(),this.changeListener=t,[2]}}))}))}))},e.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},e.prototype.ac=function(){var e=this.auth&&this.auth.getUid();return b(null===e||"string"==typeof e),new Ki(e)},e}(),xs=function(){function e(e,t,r){this.hc=e,this.lc=t,this.fc=r,this.type="FirstParty",this.user=Ki.FIRST_PARTY}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.lc},t=this.hc.auth.getAuthHeaderValueForFirstParty([]);return t&&(e.Authorization=t),this.fc&&(e["X-Goog-Iam-Authorization-Token"]=this.fc),e},enumerable:!1,configurable:!0}),e}(),Ss=function(){function e(e,t,r){this.hc=e,this.lc=t,this.fc=r}return e.prototype.getToken=function(){return Promise.resolve(new xs(this.hc,this.lc,this.fc))},e.prototype.setChangeListener=function(e,t){e.enqueueRetryable((function(){return t(Ki.FIRST_PARTY)}))},e.prototype.removeChangeListener=function(){},e.prototype.invalidateToken=function(){},e}();function Es(e,t,r){if(!r)throw new d(c.INVALID_ARGUMENT,"Function "+e+"() cannot be called with an empty "+t+".")}function Ts(e,t){if(void 0===t)return{merge:!1};if(void 0!==t.mergeFields&&void 0!==t.merge)throw new d(c.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function Ms(e,t,r,n){if(!0===t&&!0===n)throw new d(c.INVALID_ARGUMENT,e+" and "+r+" cannot be used together.")}function ks(e){if(!Y.isDocumentKey(e))throw new d(c.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e+" has "+e.length+".")}function Cs(e){if(Y.isDocumentKey(e))throw new d(c.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e+" has "+e.length+".")}function js(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==u(e)){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":v()}function Os(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new d(c.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var r=js(e);throw new d(c.INVALID_ARGUMENT,"Expected type '"+t.name+"', but it was: "+r)}return e}function As(e,t){if(t<=0)throw new d(c.INVALID_ARGUMENT,"Function "+e+"() requires a positive number, but it was: "+t+".")}var Ps=function(){function e(e){var t;if(void 0===e.host){if(void 0!==e.ssl)throw new d(c.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new d(c.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,Ms("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}return e.prototype.isEqual=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}(),Is=function(){function e(e,t){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Ps({}),this._settingsFrozen=!1,e instanceof ys?(this._databaseId=e,this._credentials=new bs):(this._app=e,this._databaseId=function(e){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new d(c.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new ys(e.options.projectId)}(e),this._credentials=new ws(t))}return Object.defineProperty(e.prototype,"app",{get:function(){if(!this._app)throw new d(c.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),e.prototype._setSettings=function(e){if(this._settingsFrozen)throw new d(c.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 Ps(e),void 0!==e.credentials&&(this._credentials=function(e){if(!e)return new bs;switch(e.type){case"gapi":var t=e.client;return b(!("object"!=u(t)||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new Ss(t,e.sessionIndex||"0",e.iamToken||null);case"provider":return e.client;default:throw new d(c.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},e.prototype._getSettings=function(){return this._settings},e.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},e.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},e.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},e.prototype._terminate=function(){return(e=gs.get(this))&&(p("ComponentProvider","Removing Datastore"),gs.delete(this),e.terminate()),Promise.resolve();var e},e}(),Rs=function(){function e(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}return Object.defineProperty(e.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Ls(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._key)},e}(),Ds=function(){function e(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}return e.prototype.withConverter=function(t){return new e(this.firestore,t,this._query)},e}(),Ls=function(e){function t(t,r,n){var i=this;return(i=e.call(this,t,r,Ie(n))||this)._path=n,i.type="collection",i}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._path.popLast();return e.isEmpty()?null:new Rs(this.firestore,null,new Y(e))},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._path)},t}(Ds);function Ns(e,t){for(var r,n=[],a=2;a0&&this.Zi.ji((function(){return t.bc()})),r.label=5;case 5:return[2]}}))}))},e.prototype.Rc=function(e){var t=this,r=this.dc.then((function(){return t.gc=!0,e().catch((function(e){throw t.yc=e,t.gc=!1,m("INTERNAL UNHANDLED ERROR: ",function(e){var t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e})).then((function(e){return t.gc=!1,e}))}));return this.dc=r,r},e.prototype.enqueueAfterDelay=function(e,t,r){var n=this;this.Ac(),this.Tc.indexOf(e)>-1&&(t=0);var i=Yo.createAndSchedule(this,e,t,r,(function(e){return n.vc(e)}));return this.mc.push(i),i},e.prototype.Ac=function(){this.yc&&v()},e.prototype.verifyOperationInProgress=function(){},e.prototype.Pc=function(){return(0,i.__awaiter)(this,void 0,void 0,(function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,e=this.dc];case 1:t.sent(),t.label=2;case 2:if(e!==this.dc)return[3,0];t.label=3;case 3:return[2]}}))}))},e.prototype.Vc=function(e){for(var t=0,r=this.mc;t90)throw new d(c.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new d(c.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},e.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},e.prototype._compareTo=function(e){return S(this._lat,e._lat)||S(this._long,e._long)},e}(),Zs=/^__.*__$/,eu=function(){function e(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}return e.prototype.toMutation=function(e,t){return null!==this.fieldMask?new _t(e,this.data,this.fieldMask,t,this.fieldTransforms):new bt(e,this.data,t,this.fieldTransforms)},e}(),tu=function(){function e(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}return e.prototype.toMutation=function(e,t){return new _t(e,this.data,this.fieldMask,t,this.fieldTransforms)},e}();function ru(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw v()}}r.C=Js;var nu=function(){function e(e,t,r,n,i,o){this.settings=e,this.databaseId=t,this.R=r,this.ignoreUndefinedProperties=n,void 0===i&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),e.prototype.xc=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},e.prototype.kc=function(e){var t,r=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.xc({path:r,Fc:!1});return n.$c(e),n},e.prototype.Oc=function(e){var t,r=null===(t=this.path)||void 0===t?void 0:t.child(e),n=this.xc({path:r,Fc:!1});return n.Cc(),n},e.prototype.Mc=function(e){return this.xc({path:void 0,Fc:!0})},e.prototype.Lc=function(e){return Su(e,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},e.prototype.contains=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)}))},e.prototype.Cc=function(){if(this.path)for(var e=0;e=0;--m)if(!Eu(f,u[m])){var y=u[m],g=l[m];g=(0,o.getModularInstance)(g);var v=s.Oc(y);if(g instanceof su)f.push(y);else{var b=yu(g,v);null!=b&&(f.push(y),p.set(y,b))}}var _=new D(f);return new tu(p,_,s.fieldTransforms)}function mu(e,t,r,n){return void 0===n&&(n=!1),yu(r,e.Uc(n?4:3,t))}function yu(e,t){if(vu(e=(0,o.getModularInstance)(e)))return bu("Unsupported field value:",t,e),gu(e,t);if(e instanceof Qs)return function(e,t){if(!ru(t.Nc))throw t.Lc(e._methodName+"() can only be used with update() and set()");if(!t.path)throw t.Lc(e._methodName+"() is not currently supported inside arrays");var r=e._toFieldTransform(t);r&&t.fieldTransforms.push(r)}(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.Fc&&4!==t.Nc)throw t.Lc("Nested arrays are not supported");return function(e,t){for(var r=[],n=0,i=0,o=e;i0&&t.fieldMask.push(t.path):j(e,(function(e,n){var i=yu(n,t.kc(e));null!=i&&(r[e]=i)})),{mapValue:{fields:r}}}function vu(e){return!("object"!=u(e)||null===e||e instanceof Array||e instanceof Date||e instanceof M||e instanceof Js||e instanceof $s||e instanceof Rs||e instanceof Qs)}function bu(e,t,r){if(!vu(r)||!function(e){return"object"==u(e)&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(r)){var n=js(r);throw"an object"===n?t.Lc(e+" a custom object"):t.Lc(e+" "+n)}}function _u(e,t,r){if((t=(0,o.getModularInstance)(t))instanceof Ks)return t._internalPath;if("string"==typeof t)return xu(e,t);throw Su("Field path arguments must be of type string or FieldPath.",e,!1,void 0,r)}var wu=new RegExp("[~\\*/\\[\\]]");function xu(e,t,r){if(t.search(wu)>=0)throw Su("Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'",e,!1,void 0,r);try{return(new(Ks.bind.apply(Ks,(0,i.__spreadArray)([void 0],t.split(".")))))._internalPath}catch(s){throw Su("Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",e,!1,void 0,r)}}function Su(e,t,r,n,i){var o=n&&!n.isEmpty(),a=void 0!==i,s="Function "+t+"() called with invalid data";r&&(s+=" (via `toFirestore()`)");var u="";return(o||a)&&(u+=" (found",o&&(u+=" in field "+n),a&&(u+=" in document "+i),u+=")"),new d(c.INVALID_ARGUMENT,(s+=". ")+e+u)}function Eu(e,t){return e.some((function(e){return e.isEqual(t)}))}var Tu=function(){function e(e,t,r,n,i){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=n,this._converter=i}return Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new Rs(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),e.prototype.exists=function(){return null!==this._document},e.prototype.data=function(){if(this._document){if(this._converter){var e=new Mu(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}},e.prototype.get=function(e){if(this._document){var t=this._document.data.field(ku("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}},e}(),Mu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.data=function(){return e.prototype.data.call(this)},t}(Tu);function ku(e,t){return"string"==typeof t?xu(e,t):t instanceof Ks?t._internalPath:t._delegate._internalPath}var Cu=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),ju=function(e){function t(t,r,n,i,o,a){var s=this;return(s=e.call(this,t,r,n,i,a)||this)._firestore=t,s._firestoreImpl=t,s.metadata=o,s}return(0,i.__extends)(t,e),t.prototype.exists=function(){return e.prototype.exists.call(this)},t.prototype.data=function(e){if(void 0===e&&(e={}),this._document){if(this._converter){var t=new Ou(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)}},t.prototype.get=function(e,t){if(void 0===t&&(t={}),this._document){var r=this._document.data.field(ku("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}},t}(Tu),Ou=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.data=function(t){return void 0===t&&(t={}),e.prototype.data.call(this,t)},t}(ju),Au=function(){function e(e,t,r,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new Cu(n.hasPendingWrites,n.fromCache),this.query=r}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var r=this;this._snapshot.docs.forEach((function(n){e.call(t,new Ou(r._firestore,r._userDataWriter,n.key,n,new Cu(r._snapshot.mutatedKeys.has(n.key),r._snapshot.fromCache),r.query.converter))}))},e.prototype.docChanges=function(e){void 0===e&&(e={});var t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new d(c.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 r=0;return e._snapshot.docChanges.map((function(t){return{type:"added",doc:new Ou(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Cu(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),oldIndex:-1,newIndex:r++}}))}var n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var r=new Ou(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Cu(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,o=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(o=(n=n.add(t.doc)).indexOf(t.doc.key)),{type:Pu(t.type),doc:r,oldIndex:i,newIndex:o}}))}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e}();function Pu(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return v()}}function Iu(e,t){return e instanceof ju&&t instanceof ju?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Au&&t instanceof Au&&e._firestore===t._firestore&&Bs(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Ru(e){if(De(e)&&0===e.explicitOrderBy.length)throw new d(c.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Du=function(){};function Lu(e){for(var t=[],r=1;r, or >=) must be on the same field. But you have inequality filters on '"+r.toString()+"' and '"+t.field.toString()+"'");var n=Le(e);null!==n&&Hu(e,t.field,n)}var i=function(e,t){for(var r=0,n=e.filters;r=0)return i.op}return null}(e,function(e){switch(t.op){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[]}}());if(null!==i)throw i===t.op?new d(c.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new d(c.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,p),p}(e._query,0,t,e.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Ds(e.firestore,e.converter,function(e,t){var r=e.filters.concat([t]);return new Ae(e.path,e.collectionGroup,e.explicitOrderBy.slice(),r,e.limit,e.limitType,e.startAt,e.endAt)}(e._query,r))},t}(Du),Fu=function(e){function t(t,r){var n=this;return(n=e.call(this)||this).jc=t,n.zc=r,n.type="orderBy",n}return(0,i.__extends)(t,e),t.prototype._apply=function(e){var t=function(e,t,r){if(null!==e.startAt)throw new d(c.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new d(c.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var n=new ke(t,r);return function(e,t){if(null===Le(e)){var r=Ne(e);null!==r&&Hu(e,r,t.field)}}(e,n),n}(e._query,this.jc,this.zc);return new Ds(e.firestore,e.converter,function(e,t){var r=e.explicitOrderBy.concat([t]);return new Ae(e.path,e.collectionGroup,r,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))},t}(Du),Uu=function(e){function t(t,r,n){var i=this;return(i=e.call(this)||this).type=t,i.Hc=r,i.Jc=n,i}return(0,i.__extends)(t,e),t.prototype._apply=function(e){return new Ds(e.firestore,e.converter,ze(e._query,this.Hc,this.Jc))},t}(Du),Bu=function(e){function t(t,r,n){var i=this;return(i=e.call(this)||this).type=t,i.Yc=r,i.Xc=n,i}return(0,i.__extends)(t,e),t.prototype._apply=function(e){var t=Vu(e,this.type,this.Yc,this.Xc);return new Ds(e.firestore,e.converter,function(e,t){return new Ae(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))},t}(Du),zu=function(e){function t(t,r,n){var i=this;return(i=e.call(this)||this).type=t,i.Yc=r,i.Xc=n,i}return(0,i.__extends)(t,e),t.prototype._apply=function(e){var t=Vu(e,this.type,this.Yc,this.Xc);return new Ds(e.firestore,e.converter,function(e,t){return new Ae(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))},t}(Du);function Vu(e,t,r,n){if(r[0]=(0,o.getModularInstance)(r[0]),r[0]instanceof Tu)return function(e,t,r,n,i){if(!n)throw new d(c.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+r+"().");for(var o=[],a=0,s=Ue(e);aa.length)throw new d(c.INVALID_ARGUMENT,"Too many arguments provided to "+n+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],l=0;l10)throw new d(c.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.")}function Hu(e,t,r){if(!r.isEqual(t))throw new d(c.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+r.toString()+"' instead.")}var qu=function(){function e(){}return e.prototype.convertValue=function(e,t){switch(void 0===t&&(t="none"),X(e)){case 0:return null;case 1:return e.booleanValue;case 2:return U(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(B(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 v()}},e.prototype.convertObject=function(e,t){var r=this,n={};return j(e.fields,(function(e,i){n[e]=r.convertValue(i,t)})),n},e.prototype.convertGeoPoint=function(e){return new Js(U(e.latitude),U(e.longitude))},e.prototype.convertArray=function(e,t){var r=this;return(e.values||[]).map((function(e){return r.convertValue(e,t)}))},e.prototype.convertServerTimestamp=function(e,t){switch(t){case"previous":var r=V(e);return null==r?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(G(e));default:return null}},e.prototype.convertTimestamp=function(e){var t=F(e);return new M(t.seconds,t.nanos)},e.prototype.convertDocumentKey=function(e,t){var r=P.fromString(e);b(Ir(r));var n=new ys(r.get(1),r.get(3)),i=new Y(r.popFirst(5));return n.isEqual(t)||m("Document "+i+" contains a document reference within a different database ("+n.projectId+"/"+n.database+") which is not supported. It will be treated as a reference in the current database ("+t.projectId+"/"+t.database+") instead."),i},e}();function Yu(e,t,r){return e?r&&(r.merge||r.mergeFields)?e.toFirestore(t,r):e.toFirestore(t):t}var Xu=function(e){function t(t){var r=this;return(r=e.call(this)||this).firestore=t,r}return(0,i.__extends)(t,e),t.prototype.convertBytes=function(e){return new $s(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new Rs(this.firestore,null,t)},t}(qu),Ku=function(){function e(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=ou(e)}return e.prototype.set=function(e,t,r){this._verifyNotCommitted();var n=$u(e,this._firestore),i=Yu(n.converter,t,r),o=au(this._dataReader,"WriteBatch.set",n._key,i,null!==n.converter,r);return this._mutations.push(o.toMutation(n._key,dt.none())),this},e.prototype.update=function(e,t,r){for(var n=[],i=3;i0?this._commitHandler(this._mutations):Promise.resolve()},e.prototype._verifyNotCommitted=function(){if(this._committed)throw new d(c.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}();function $u(e,t){if((e=(0,o.getModularInstance)(e)).firestore!==t)throw new d(c.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}var Qu=function(e){function t(t){var r=this;return(r=e.call(this)||this).firestore=t,r}return(0,i.__extends)(t,e),t.prototype.convertBytes=function(e){return new $s(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new Rs(this.firestore,null,t)},t}(qu);function Ju(e,t,r){e=Os(e,Rs);var n=Os(e.firestore,Ws),i=Yu(e.converter,t,r);return tl(n,[au(ou(n),"setDoc",e._key,i,null!==e.converter,r).toMutation(e._key,dt.none())])}function Zu(e,t,r){for(var n=[],i=3;i=0)throw new d(c.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Ds(e,null,function(e){return new Ae(P.emptyPath(),e)}(t))}(this._delegate,e))}catch(e){throw pl(e,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(e){var t=this;return function(e,t){return function(e,t){var r=this,n=new nn;return e.asyncQueue.enqueueAndForget((function(){return(0,i.__awaiter)(r,void 0,void 0,(function(){var r;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return[4,function(e){return ss(e).then((function(e){return e.datastore}))}(e)];case 1:return r=i.sent(),new rs(e.asyncQueue,r,t,n).run(),[2]}}))}))})),n.promise}(Hs(e),(function(r){return t(new nl(e,r))}))}(this._delegate,(function(r){return e(new cl(t,r))}))},e.prototype.batch=function(){var e=this;return Hs(this._delegate),new dl(new Ku(this._delegate,(function(t){return tl(e._delegate,t)})))},e.prototype.loadBundle=function(e){throw new d(c.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},e.prototype.namedQuery=function(e){throw new d(c.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},e}(),ll=function(e){function t(t){var r=this;return(r=e.call(this)||this).firestore=t,r}return(0,i.__extends)(t,e),t.prototype.convertBytes=function(e){return new al(new $s(e))},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return fl.eu(t,this.firestore,null)},t}(qu);r.K=ul,r.U=sl,r.L=al;var cl=function(){function e(e,t){this._firestore=e,this._delegate=t,this._userDataWriter=new ll(e)}return e.prototype.get=function(e){var t=this,r=Sl(e);return this._delegate.get(r).then((function(e){return new gl(t._firestore,new ju(t._firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,r.converter))}))},e.prototype.set=function(e,t,r){var n=Sl(e);return r?(Ts("Transaction.set",r),this._delegate.set(n,t,r)):this._delegate.set(n,t),this},e.prototype.update=function(e,t,r){for(var n,o=[],a=3;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]&&arguments[0];return h(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null===(e=this.app.auth())||void 0===e?void 0:e.currentUser){r.next=3;break}return r.abrupt("return",Promise.reject("getUserIdToken: unable to get currentUser"));case 3:return r.next=5,n.getIdToken(t).catch((function(e){console.error(e)}));case 5:case"end":return r.stop()}}),r,this)})))}},{key:"getClaims",value:function(){var e,t=null===(e=this.app.auth())||void 0===e?void 0:e.currentUser;return t?t.getIdTokenResult().then((function(e){return e.claims})).catch((function(e){return console.error(e),null})):Promise.reject("getUserClaims: unable to get currentUser")}},{key:"userDevicesToDeviceInfoList",value:function(e){return h(this,void 0,void 0,o().mark((function t(){var r,n,i,a=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(null!=e?e:{}).map((function(e){return a.app.database().ref(a.getDeviceInfoPath(e)).once("value")})),t.next=3,Promise.all(r).then((function(e){return e.map((function(e){return e.val()}))}));case 3:return n=t.sent,(i=n.filter((function(e){return!!e}))).sort((function(t,r){return e[t.deviceId].claimedOn-e[r.deviceId].claimedOn})),t.abrupt("return",i);case 7:case"end":return t.stop()}}),t)})))}},{key:"hasDevicePermission",value:function(e){return h(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getDeviceInfoPath(e),t.next=3,this.app.database().ref(r).once("value").then((function(){return!0})).catch((function(){return!1}));case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getDeviceClaimedByPath",value:function(e){return"devices/".concat(e,"/status/claimedBy")}},{key:"getUserClaimedDevicePath",value:function(e){var t=this.user.uid;return"users/".concat(t,"/devices/").concat(e)}},{key:"getUserDevicesPath",value:function(){var e=this.user.uid;return"users/".concat(e,"/devices")}},{key:"getUserClaimsUpdatedOnPath",value:function(){var e=this.user.uid;return"users/".concat(e,"/claimsUpdatedOn")}},{key:"getDeviceInfoPath",value:function(e){return"devices/".concat(e,"/info")}},{key:"onUserExperiments",value:function(){var e=this;return this.onAuthStateChanged().pipe((0,m.switchMap)((function(t){if(!t)return p.EMPTY;var r=e.user.uid,n=e.app.database().ref("experiments").orderByChild("userId").equalTo(r).limitToFirst(100);return(0,p.fromEventPattern)((function(e){return n.on("value",e)}),(function(e){return n.off("value",e)})).pipe((0,m.map)((function(e){return a(e,1)[0].val()})),(0,m.map)((function(e){return Object.entries(null!=e?e:{}).map((function(e){var t,r=a(e,2),n=r[0],i=r[1];return Object.assign({id:null!==(t=null==i?void 0:i.id)&&void 0!==t?t:n},i)})).sort((function(e,t){return new Date(null==t?void 0:t.timestamp).getTime()-new Date(null==e?void 0:e.timestamp).getTime()}))})))})))}},{key:"deleteUserExperiment",value:function(e){return h(this,void 0,void 0,o().mark((function t(){var r,n,i=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",Promise.reject("deleteUserExperiment: please provide an experiment id"));case 2:return r=function(e){return i.app.database().ref("experiments").child(e).remove()},n=function(e){return i.app.functions().httpsCallable("removeRelations")({experimentId:e})},t.next=6,Promise.all([r(e),n(e)]).catch((function(){}));case 6:case"end":return t.stop()}}),t)})))}}]),e}();r.FirebaseUser=v},{rxjs:"Zr8e","rxjs/operators":"v3iE","firebase/app":"OJEJ"}],mSvX:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createDeviceStore=void 0;var l=u(e("firebase/app")).default.database.ServerValue.TIMESTAMP;r.createDeviceStore=function(e,t,r){var n=e.database().ref("devices/".concat(t)),o=n.child("subscriptions").push().key,u=n.child("clients/".concat(o)),c=[],d=function(e,t){return n.child(e).set(t)},h=function(e,t){return n.child(e).update(t)},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"value",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=n.child(t).on(e,(function(e){r(e.val(),e)}));return c.push((function(){n.child(t).off(e,i)})),i},p=function(e,t,r){r?n.child(e).off(t,r):n.child(e).off(t)},m=e.database().ref(".info/connected").on("value",(function(e){e.val()&&u.onDisconnect().remove().then((function(){u.set(l),h("subscriptions",r.get()).then((function(){r.toList().forEach((function(e){var t="subscriptions/".concat(e.id);n.child(t).onDisconnect().remove()}))}))}))}));return c.push((function(){e.database().ref(".info/connected").off("value",m)})),{set:d,once:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";return s(void 0,void 0,void 0,a().mark((function r(){var i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.child(e).once(t);case 2:return i=r.sent,r.abrupt("return",i.val());case 4:case"end":return r.stop()}}),r)})))},update:h,lastOfChildValue:function(e,t,r){return s(void 0,void 0,void 0,a().mark((function o(){var s,u,l,c,d;return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.child(e).orderByChild(t).equalTo(r).limitToLast(1).once("value");case 2:return s=o.sent,u=s.val(),l=Object.values(u||{}),c=i(l,1),d=c[0],o.abrupt("return",d||null);case 6:case"end":return o.stop()}}),o)})))},onNamespace:function(e,t){return f("value",e,(function(e){t(e)}))},offNamespace:function(e,t){p(e,"value",t)},dispatchAction:function(e){return s(void 0,void 0,void 0,a().mark((function t(){var r,i,o,s,u,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,"actions",a=e,n.child("actions").push(a);case 2:if(r=t.sent,i=r.key,o="actions/".concat(i),r.onDisconnect().remove(),!e.responseRequired){t.next=11;break}return s=e.responseTimeout||6e5,u=new Promise((function(e,t){var n=setTimeout((function(){clearTimeout(n),r.remove(),t("Action response timed out in ".concat(s,"ms."))}),s)})),l=new Promise((function(e){var t,r,n;t="value",r="".concat(o,"/response"),n=e,f(t,r,(function(e){null!==e&&(p(r,t),n(e))}))})),t.abrupt("return",Promise.race([l,u]));case 11:return t.abrupt("return",i);case 12:case"end":return t.stop()}var a}),t)})))},nextMetric:function(e,t){return s(void 0,void 0,void 0,a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:d("metrics/".concat(e),t);case 1:case"end":return r.stop()}}),r)})))},onMetric:function(e,t){var r=e.atomic,n=e.metric,i=e.labels,o=r?"metrics/".concat(n):"metrics/".concat(n,"/").concat(i[0]);return f("value",o,(function(e){null!==e&&t(e)}))},subscribeToMetric:function(e){var t=n.child("subscriptions").push().key,r="subscriptions/".concat(t),i=Object.assign({id:t,clientId:o},e);return d(r,i),n.child(r).onDisconnect().remove(),i},unsubscribeFromMetric:function(e){var t;t="subscriptions/".concat(e.id),n.child(t).remove()},removeMetricListener:function(e,t){var r=e.atomic,n=e.metric,i=e.labels,o=r?"metrics/".concat(n):"metrics/".concat(n,"/").concat(i[0]);p(o,"value",t)},disconnect:function(){u.remove(),c.forEach((function(e){e()})),r.toList().filter((function(e){return e.clientId===o})).forEach((function(e){var t="subscriptions/".concat(e.id);n.child(t).remove()}))}}}},{"firebase/app":"OJEJ"}],KzOJ:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function s(e,t){for(var r=0;ri&&a.push(e[s]);return a}function o(e){var t=e.length,r=~~(t/2);return t%2?e[r]:(e[r-1]+e[r])/2}t.exports=function(e){if(n(e))return i(e);var t=null,r="string"==typeof e&&e;return function(e,n,o){return t||(t=i(o,r)),e=r?e[r]:e,!~t.indexOf(e)}}},{}],s7Vt:[function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||i(e,t)||function(){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 i(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rh||!!(Date.now()-e.lastHeartbeat>f))}r.heartbeatAwareStatus=function(e){var t=e.pipe((0,u.map)((function(e){return e.lastHeartbeat})),(0,l.distinctUntilChanged)(),(0,u.map)((function(){return Date.now()}))),r=t.pipe((0,u.switchMap)((function(){return(0,s.timer)(h)})),(0,u.map)((function(){return null})),(0,u.startWith)(null));return(0,s.combineLatest)({status:e,lostHeartbeat:r}).pipe((0,l.withLatestFrom)(t),(0,u.map)((function(e){var t=n(e,2),r=t[0].status,i=t[1];return i&&p(r,i)?Object.assign(Object.assign({},r),{state:d.STATUS.OFFLINE}):r})),(0,l.distinctUntilChanged)((function(e,t){return(0,c.default)(e,t)})))},r.deviceHasLostHeartbeat=p},{rxjs:"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","../types/status":"Ttuy"}],qny3:[function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||i(e,t)||function(){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 i(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function s(e,t){for(var r=0;rt=>{const r=o.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),u=e=>(e=e.toLowerCase(),t=>s(t)===e),l=e=>t=>typeof t===e,{isArray:c}=Array,d=l("undefined");const h=u("ArrayBuffer");const f=l("string"),p=l("function"),m=l("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=u("Date"),b=u("File"),_=u("Blob"),w=u("FileList"),x=u("URLSearchParams");function S(e,t){let r,n,{allOwnKeys:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(r=0,n=e.length;r0;)if(t===(n=r[i]).toLowerCase())return n;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n,M=e=>!d(e)&&e!==T;const k=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&a(Uint8Array)),C=u("HTMLFormElement"),j=(e=>{let{hasOwnProperty:t}=e;return(e,r)=>t.call(e,r)})(Object.prototype),O=u("RegExp"),A=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};S(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},P="abcdefghijklmnopqrstuvwxyz",I="0123456789",R={DIGIT:I,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+I};const D=u("AsyncFunction");var L={isArray:c,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer)},isString:f,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:d,isDate:v,isFile:b,isBlob:_,isRegExp:O,isFunction:p,isStream:e=>y(e)&&p(e.pipe),isURLSearchParams:x,isTypedArray:k,isFileList:w,forEach:S,merge:function e(){const{caseless:t}=M(this)&&this||{},r={},n=(n,i)=>{const o=t&&E(r,i)||i;g(r[o])&&g(n)?r[o]=e(r[o],n):g(n)?r[o]=e({},n):c(n)?r[o]=n.slice():r[o]=n};for(let i=0,o=arguments.length;i3&&void 0!==arguments[3]?arguments[3]:{};return S(t,((t,n)=>{r&&p(t)?e[n]=(0,i.default)(t,r):e[n]=t}),{allOwnKeys:n}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,s;const u={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)s=i[o],n&&!n(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!m(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:C,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:A,freezeMethods:e=>{A(e,((t,r)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];p(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return c(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:T,isContextDefined:M,ALPHABET:R,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R.ALPHA_DIGIT,r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=c(e)?[]:{};return S(e,((e,t)=>{const o=r(e,n+1);!d(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:D,isThenable:e=>e&&(y(e)||p(e))&&p(e.then)&&p(e.catch)};r.default=L},{"./helpers/bind.js":"EDTP"}],rRKx:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../utils.js"));function i(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.default.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n.default.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=(e,t,r,a,s,u)=>{const l=Object.create(o);return n.default.toFlatObject(e,l,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),i.call(l,e.message,t,r,a,s),l.cause=e,l.name=e.name,u&&Object.assign(l,u),l};var s=i;r.default=s},{"../utils.js":"S1cf"}],jiNE:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=null},{}],yh9p:[function(e,t,r){"use strict";r.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,d=s>0?a-4:a;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o>1,c=-7,d=r?i-1:0,h=r?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[r+f]=255&a,f+=p,a/=256,l-=8);e[r+f-p]|=128*m}},{}],wvRa:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],peL6:[function(e,t,r){var n=arguments[3],i=e("base64-js"),o=e("ieee754"),a=e("isarray");function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function y(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+d<=r)switch(d){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}return function(e){var t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);for(var r="",n=0;n0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,n,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),d=0;di)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var j=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function F(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,i){return i||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,i){return i||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"wvRa",buffer:"peL6"}],BFle:[function(e,t,r){e("buffer").Buffer;var n=e("buffer").Buffer;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=s(e("../utils.js")),o=s(e("../core/AxiosError.js")),a=s(e("../platform/node/classes/FormData.js"));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return i.default.isPlainObject(e)||i.default.isArray(e)}function l(e){return i.default.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,r){return e?e.concat(t).map((function(e,t){return e=l(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const d=i.default.toFlatObject(i.default,{},null,(function(e){return/^is[A-Z]/.test(e)}));var h=function(e,t,r){if(!i.default.isObject(e))throw new TypeError("target must be an object");t=t||new(a.default||FormData);const s=(r=i.default.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!i.default.isUndefined(t[e])}))).metaTokens,h=r.visitor||g,f=r.dots,p=r.indexes,m=(r.Blob||"undefined"!=typeof Blob&&Blob)&&i.default.isSpecCompliantForm(t);if(!i.default.isFunction(h))throw new TypeError("visitor must be a function");function y(e){if(null===e)return"";if(i.default.isDate(e))return e.toISOString();if(!m&&i.default.isBlob(e))throw new o.default("Blob is not supported. Use a Buffer instead.");return i.default.isArrayBuffer(e)||i.default.isTypedArray(e)?m&&"function"==typeof Blob?new Blob([e]):n.from(e):e}function g(e,r,n){let o=e;if(e&&!n&&"object"==typeof e)if(i.default.endsWith(r,"{}"))r=s?r:r.slice(0,-2),e=JSON.stringify(e);else if(i.default.isArray(e)&&function(e){return i.default.isArray(e)&&!e.some(u)}(e)||(i.default.isFileList(e)||i.default.endsWith(r,"[]"))&&(o=i.default.toArray(e)))return r=l(r),o.forEach((function(e,n){!i.default.isUndefined(e)&&null!==e&&t.append(!0===p?c([r],n,f):null===p?r:r+"[]",y(e))})),!1;return!!u(e)||(t.append(c(n,r,f),y(e)),!1)}const v=[],b=Object.assign(d,{defaultVisitor:g,convertValue:y,isVisitable:u});if(!i.default.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!i.default.isUndefined(r)){if(-1!==v.indexOf(r))throw Error("Circular reference detected in "+n.join("."));v.push(r),i.default.forEach(r,(function(r,o){!0===(!(i.default.isUndefined(r)||null===r)&&h.call(t,r,i.default.isString(o)?o.trim():o,n,b))&&e(r,n?n.concat(o):[o])})),v.pop()}}(e),t};r.default=h},{"../utils.js":"S1cf","../core/AxiosError.js":"rRKx","../platform/node/classes/FormData.js":"jiNE",buffer:"peL6"}],lSwM:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./toFormData.js"));function i(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function o(e,t){this._pairs=[],e&&(0,n.default)(e,this,t)}const a=o.prototype;a.append=function(e,t){this._pairs.push([e,t])},a.toString=function(e){const t=e?function(t){return e.call(this,t,i)}:i;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var s=o;r.default=s},{"./toFormData.js":"BFle"}],H6Qo:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){if(!t)return e;const o=r&&r.encode||a,s=r&&r.serialize;let u;if(u=s?s(t,r):n.default.isURLSearchParams(t)?t.toString():new i.default(t,r).toString(o)){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+u}return e};var n=o(e("../utils.js")),i=o(e("../helpers/AxiosURLSearchParams.js"));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}},{"../utils.js":"S1cf","../helpers/AxiosURLSearchParams.js":"lSwM"}],rj2i:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./../utils.js"));var i=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){n.default.forEach(this.handlers,(function(t){null!==t&&e(t)}))}};r.default=i},{"./../utils.js":"S1cf"}],LrSb:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},{}],gNhC:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../../../helpers/AxiosURLSearchParams.js"));var i="undefined"!=typeof URLSearchParams?URLSearchParams:n.default;r.default=i},{"../../../helpers/AxiosURLSearchParams.js":"lSwM"}],BCMH:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n="undefined"!=typeof FormData?FormData:null;r.default=n},{}],jSAH:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n="undefined"!=typeof Blob?Blob:null;r.default=n},{}],KFqX:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./classes/URLSearchParams.js")),i=a(e("./classes/FormData.js")),o=a(e("./classes/Blob.js"));function a(e){return e&&e.__esModule?e:{default:e}}var s={isBrowser:!0,classes:{URLSearchParams:n.default,FormData:i.default,Blob:o.default},protocols:["http","https","file","blob","url","data"]};r.default=s},{"./classes/URLSearchParams.js":"gNhC","./classes/FormData.js":"BCMH","./classes/Blob.js":"jSAH"}],umJP:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.hasStandardBrowserWebWorkerEnv=r.hasStandardBrowserEnv=r.hasBrowserEnv=void 0;const n="undefined"!=typeof window&&"undefined"!=typeof document;r.hasBrowserEnv=n;const i=(e=>n&&["ReactNative","NativeScript","NS"].indexOf(e)<0)("undefined"!=typeof navigator&&navigator.product);r.hasStandardBrowserEnv=i;const o="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;r.hasStandardBrowserWebWorkerEnv=o},{}],dN6h:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./node/index.js")),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}(e("./common/utils.js"));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}var a={...i,...n.default};r.default=a},{"./node/index.js":"KFqX","./common/utils.js":"umJP"}],R27V:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return(0,i.default)(e,new o.default.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,i){return o.default.isNode&&n.default.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))};var n=a(e("../utils.js")),i=a(e("./toFormData.js")),o=a(e("../platform/index.js"));function a(e){return e&&e.__esModule?e:{default:e}}},{"../utils.js":"S1cf","./toFormData.js":"BFle","../platform/index.js":"dN6h"}],zEQI:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../utils.js"));var i=function(e){if(n.default.isFormData(e)&&n.default.isFunction(e.entries)){const t={};return n.default.forEachEntry(e,((e,r)=>{!function e(t,r,i,o){let a=t[o++];const s=Number.isFinite(+a),u=o>=t.length;return a=!a&&n.default.isArray(i)?i.length:a,u?(n.default.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!s):(i[a]&&n.default.isObject(i[a])||(i[a]=[]),e(t,r,i[a],o)&&n.default.isArray(i[a])&&(i[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n"[]"===e[0]?"":e[1]||e[0]))}(e),r,t,0)})),t}return null};r.default=i},{"../utils.js":"S1cf"}],VQpg:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=c(e("../utils.js")),i=c(e("../core/AxiosError.js")),o=c(e("./transitional.js")),a=c(e("../helpers/toFormData.js")),s=c(e("../helpers/toURLEncodedForm.js")),u=c(e("../platform/index.js")),l=c(e("../helpers/formDataToJSON.js"));function c(e){return e&&e.__esModule?e:{default:e}}const d={transitional:o.default,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,o=n.default.isObject(e);if(o&&n.default.isHTMLForm(e)&&(e=new FormData(e)),n.default.isFormData(e))return i&&i?JSON.stringify((0,l.default)(e)):e;if(n.default.isArrayBuffer(e)||n.default.isBuffer(e)||n.default.isStream(e)||n.default.isFile(e)||n.default.isBlob(e))return e;if(n.default.isArrayBufferView(e))return e.buffer;if(n.default.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return(0,s.default)(e,this.formSerializer).toString();if((u=n.default.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return(0,a.default)(u?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||i?(t.setContentType("application/json",!1),function(e,t,r){if(n.default.isString(e))try{return(t||JSON.parse)(e),n.default.trim(e)}catch(s){if("SyntaxError"!==s.name)throw s}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||d.transitional,r=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&n.default.isString(e)&&(r&&!this.responseType||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(r){if("SyntaxError"===l.name)throw i.default.from(l,i.default.ERR_BAD_RESPONSE,this,null,this.response);throw l}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u.default.classes.FormData,Blob:u.default.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};n.default.forEach(["delete","get","head","post","put","patch"],(e=>{d.headers[e]={}}));var h=d;r.default=h},{"../utils.js":"S1cf","../core/AxiosError.js":"rRKx","./transitional.js":"LrSb","../helpers/toFormData.js":"BFle","../helpers/toURLEncodedForm.js":"R27V","../platform/index.js":"dN6h","../helpers/formDataToJSON.js":"zEQI"}],ZeD7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;const n=function(e){return e&&e.__esModule?e:{default:e}}(e("./../utils.js")).default.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);r.default=e=>{const t={};let r,i,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),i=e.substring(o+1).trim(),!r||t[r]&&n[r]||("set-cookie"===r?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)})),t}},{"./../utils.js":"S1cf"}],aueS:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("../utils.js")),i=o(e("../helpers/parseHeaders.js"));function o(e){return e&&e.__esModule?e:{default:e}}const a=Symbol("internals");function s(e){return e&&String(e).trim().toLowerCase()}function u(e){return!1===e||null==e?e:n.default.isArray(e)?e.map(u):String(e)}function l(e,t,r,i,o){return n.default.isFunction(i)?i.call(this,t,r):(o&&(t=r),n.default.isString(t)?n.default.isString(i)?-1!==t.indexOf(i):n.default.isRegExp(i)?i.test(t):void 0:void 0)}function c(e,t){const r=n.default.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}class d{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function a(e,t,r){const i=s(t);if(!i)throw new Error("header name must be a non-empty string");const a=n.default.findKey(o,i);(!a||void 0===o[a]||!0===r||void 0===r&&!1!==o[a])&&(o[a||t]=u(e))}const l=(e,t)=>n.default.forEach(e,((e,r)=>a(e,r,t)));return n.default.isPlainObject(e)||e instanceof this.constructor?l(e,t):n.default.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e)?l((0,i.default)(e),t):null!=e&&a(t,e,r),this}get(e,t){if(e=s(e)){const r=n.default.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(n.default.isFunction(t))return t.call(this,e,r);if(n.default.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=s(e)){const r=n.default.findKey(this,e);return!(!r||void 0===this[r]||t&&!l(0,this[r],r,t))}return!1}delete(e,t){const r=this;let i=!1;function o(e){if(e=s(e)){const o=n.default.findKey(r,e);!o||t&&!l(0,r[o],o,t)||(delete r[o],i=!0)}}return n.default.isArray(e)?e.forEach(o):o(e),i}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!l(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return n.default.forEach(this,((i,o)=>{const a=n.default.findKey(r,o);if(a)return t[a]=u(i),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete t[o],t[s]=u(i),r[s]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),r=0;r{null!=r&&!1!==r&&(t[i]=e&&n.default.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,r]=e;return t+": "+r})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;it.set(e))),t}static accessor(e){const t=(this[a]=this[a]={accessors:{}}).accessors,r=this.prototype;function i(e){const n=s(e);t[n]||(c(r,e),t[n]=!0)}return n.default.isArray(e)?e.forEach(i):i(e),this}}d.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),n.default.reduceDescriptors(d.prototype,((e,t)=>{let{value:r}=e,n=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(e){this[n]=e}}})),n.default.freezeMethods(d);var h=d;r.default=h},{"../utils.js":"S1cf","../helpers/parseHeaders.js":"ZeD7"}],woEt:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){const r=this||i.default,a=t||r,s=o.default.from(a.headers);let u=a.data;return n.default.forEach(e,(function(e){u=e.call(r,u,s.normalize(),t?t.status:void 0)})),s.normalize(),u};var n=a(e("./../utils.js")),i=a(e("../defaults/index.js")),o=a(e("../core/AxiosHeaders.js"));function a(e){return e&&e.__esModule?e:{default:e}}},{"./../utils.js":"S1cf","../defaults/index.js":"VQpg","../core/AxiosHeaders.js":"aueS"}],V30M:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return!(!e||!e.__CANCEL__)}},{}],E1lI:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(e("../core/AxiosError.js"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){n.default.call(this,null==e?"canceled":e,n.default.ERR_CANCELED,t,r),this.name="CanceledError"}i(e("../utils.js")).default.inherits(o,n.default,{__CANCEL__:!0});var a=o;r.default=a},{"../core/AxiosError.js":"rRKx","../utils.js":"S1cf"}],aS8y:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){const i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n.default("Request failed with status code "+r.status,[n.default.ERR_BAD_REQUEST,n.default.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./AxiosError.js"))},{"./AxiosError.js":"rRKx"}],dn2M:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(e("./../utils.js"));function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e("../platform/index.js")).default.hasStandardBrowserEnv?{write(e,t,r,i,o,a){const s=[e+"="+encodeURIComponent(t)];n.default.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.default.isString(i)&&s.push("path="+i),n.default.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};r.default=o},{"./../utils.js":"S1cf","../platform/index.js":"dN6h"}],YZjV:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},{}],a2Uu:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},{}],KxkP:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return e&&!(0,n.default)(t)?(0,i.default)(e,t):t};var n=o(e("../helpers/isAbsoluteURL.js")),i=o(e("../helpers/combineURLs.js"));function o(e){return e&&e.__esModule?e:{default:e}}},{"../helpers/isAbsoluteURL.js":"YZjV","../helpers/combineURLs.js":"a2Uu"}],w7LF:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(e("./../utils.js"));function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e("../platform/index.js")).default.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function i(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=i(window.location.href),function(e){const t=n.default.isString(e)?i(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};r.default=o},{"./../utils.js":"S1cf","../platform/index.js":"dN6h"}],NS8l:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},{}],keMf:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),l=n[a];i||(i=u),r[o]=s,n[o]=u;let c=a,d=0;for(;c!==o;)d+=r[c++],c%=e;if((o=(o+1)%e)===a&&(a=(a+1)%e),u-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-r,u=n(s);r=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:i};l[t?"download":"upload"]=!0,e(l)}}var v="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let m=e.data;const y=p.default.from(e.headers).normalize();let v,b,{responseType:_,withXSRFToken:w}=e;function x(){e.cancelToken&&e.cancelToken.unsubscribe(v),e.signal&&e.signal.removeEventListener("abort",v)}if(n.default.isFormData(m))if(f.default.hasStandardBrowserEnv||f.default.hasStandardBrowserWebWorkerEnv)y.setContentType(!1);else if(!1!==(b=y.getContentType())){const[e,...t]=b?b.split(";").map((e=>e.trim())).filter(Boolean):[];y.setContentType([e||"multipart/form-data",...t].join("; "))}let S=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.set("Authorization","Basic "+btoa(t+":"+r))}const E=(0,s.default)(e.baseURL,e.url);function T(){if(!S)return;const n=p.default.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),o={data:_&&"text"!==_&&"json"!==_?S.response:S.responseText,status:S.status,statusText:S.statusText,headers:n,config:e,request:S};(0,i.default)((function(e){t(e),x()}),(function(e){r(e),x()}),o),S=null}if(S.open(e.method.toUpperCase(),(0,a.default)(E,e.params,e.paramsSerializer),!0),S.timeout=e.timeout,"onloadend"in S?S.onloadend=T:S.onreadystatechange=function(){S&&4===S.readyState&&(0!==S.status||S.responseURL&&0===S.responseURL.indexOf("file:"))&&setTimeout(T)},S.onabort=function(){S&&(r(new c.default("Request aborted",c.default.ECONNABORTED,e,S)),S=null)},S.onerror=function(){r(new c.default("Network Error",c.default.ERR_NETWORK,e,S)),S=null},S.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||l.default;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new c.default(t,n.clarifyTimeoutError?c.default.ETIMEDOUT:c.default.ECONNABORTED,e,S)),S=null},f.default.hasStandardBrowserEnv&&(w&&n.default.isFunction(w)&&(w=w(e)),w||!1!==w&&(0,u.default)(E))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&o.default.read(e.xsrfCookieName);t&&y.set(e.xsrfHeaderName,t)}void 0===m&&y.setContentType(null),"setRequestHeader"in S&&n.default.forEach(y.toJSON(),(function(e,t){S.setRequestHeader(t,e)})),n.default.isUndefined(e.withCredentials)||(S.withCredentials=!!e.withCredentials),_&&"json"!==_&&(S.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&S.addEventListener("progress",g(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&S.upload&&S.upload.addEventListener("progress",g(e.onUploadProgress)),(e.cancelToken||e.signal)&&(v=t=>{S&&(r(!t||t.type?new d.default(null,e,S):t),S.abort(),S=null)},e.cancelToken&&e.cancelToken.subscribe(v),e.signal&&(e.signal.aborted?v():e.signal.addEventListener("abort",v)));const M=(0,h.default)(E);M&&-1===f.default.protocols.indexOf(M)?r(new c.default("Unsupported protocol "+M+":",c.default.ERR_BAD_REQUEST,e)):S.send(m||null)}))};r.default=v},{"./../utils.js":"S1cf","./../core/settle.js":"aS8y","./../helpers/cookies.js":"dn2M","./../helpers/buildURL.js":"H6Qo","../core/buildFullPath.js":"KxkP","./../helpers/isURLSameOrigin.js":"w7LF","../defaults/transitional.js":"LrSb","../core/AxiosError.js":"rRKx","../cancel/CanceledError.js":"E1lI","../helpers/parseProtocol.js":"NS8l","../platform/index.js":"dN6h","../core/AxiosHeaders.js":"aueS","../helpers/speedometer.js":"keMf"}],MSoV:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(e("../utils.js")),i=s(e("./http.js")),o=s(e("./xhr.js")),a=s(e("../core/AxiosError.js"));function s(e){return e&&e.__esModule?e:{default:e}}const u={http:i.default,xhr:o.default};n.default.forEach(u,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(o){}Object.defineProperty(e,"adapterName",{value:t})}}));const l=e=>"- ".concat(e),c=e=>n.default.isFunction(e)||null===e||!1===e;var d={getAdapter:e=>{e=n.default.isArray(e)?e:[e];const{length:t}=e;let r,i;const o={};for(let n=0;n{let[t,r]=e;return"adapter ".concat(t," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));let r=t?e.length>1?"since :\n"+e.map(l).join("\n"):" "+l(e[0]):"as no adapter specified";throw new a.default("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:u};r.default=d},{"../utils.js":"S1cf","./http.js":"jiNE","./xhr.js":"KRuG","../core/AxiosError.js":"rRKx"}],uz6X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return c(e),e.headers=s.default.from(e.headers),e.data=n.default.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),u.default.getAdapter(e.adapter||o.default.adapter)(e).then((function(t){return c(e),t.data=n.default.call(e,e.transformResponse,t),t.headers=s.default.from(t.headers),t}),(function(t){return(0,i.default)(t)||(c(e),t&&t.response&&(t.response.data=n.default.call(e,e.transformResponse,t.response),t.response.headers=s.default.from(t.response.headers))),Promise.reject(t)}))};var n=l(e("./transformData.js")),i=l(e("../cancel/isCancel.js")),o=l(e("../defaults/index.js")),a=l(e("../cancel/CanceledError.js")),s=l(e("../core/AxiosHeaders.js")),u=l(e("../adapters/adapters.js"));function l(e){return e&&e.__esModule?e:{default:e}}function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a.default(null,e)}},{"./transformData.js":"woEt","../cancel/isCancel.js":"V30M","../defaults/index.js":"VQpg","../cancel/CanceledError.js":"E1lI","../core/AxiosHeaders.js":"aueS","../adapters/adapters.js":"MSoV"}],OHvn:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){t=t||{};const r={};function i(e,t,r){return n.default.isPlainObject(e)&&n.default.isPlainObject(t)?n.default.merge.call({caseless:r},e,t):n.default.isPlainObject(t)?n.default.merge({},t):n.default.isArray(t)?t.slice():t}function o(e,t,r){return n.default.isUndefined(t)?n.default.isUndefined(e)?void 0:i(void 0,e,r):i(e,t,r)}function s(e,t){if(!n.default.isUndefined(t))return i(void 0,t)}function u(e,t){return n.default.isUndefined(t)?n.default.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function l(r,n,o){return o in t?i(r,n):o in e?i(void 0,r):void 0}const c={url:s,method:s,data:s,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(e,t)=>o(a(e),a(t),!0)};return n.default.forEach(Object.keys(Object.assign({},e,t)),(function(i){const a=c[i]||o,s=a(e[i],t[i],i);n.default.isUndefined(s)&&a!==l||(r[i]=s)})),r};var n=o(e("../utils.js")),i=o(e("./AxiosHeaders.js"));function o(e){return e&&e.__esModule?e:{default:e}}const a=e=>e instanceof i.default?e.toJSON():e},{"../utils.js":"S1cf","./AxiosHeaders.js":"aueS"}],xNqU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.VERSION=void 0;r.VERSION="1.6.2"},{}],lsvU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("../env/data.js"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("../core/AxiosError.js"));const o={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n.VERSION+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,s)=>{if(!1===e)throw new i.default(o(n," has been removed"+(t?" in "+t:"")),i.default.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}};var s={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i.default("options must be an object",i.default.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],s=t[a];if(s){const t=e[a],r=void 0===t||s(t,a,e);if(!0!==r)throw new i.default("option "+a+" must be "+r,i.default.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i.default("Unknown option "+a,i.default.ERR_BAD_OPTION)}},validators:o};r.default=s},{"../env/data.js":"xNqU","../core/AxiosError.js":"rRKx"}],OvAf:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=d(e("./../utils.js")),i=d(e("../helpers/buildURL.js")),o=d(e("./InterceptorManager.js")),a=d(e("./dispatchRequest.js")),s=d(e("./mergeConfig.js")),u=d(e("./buildFullPath.js")),l=d(e("../helpers/validator.js")),c=d(e("./AxiosHeaders.js"));function d(e){return e&&e.__esModule?e:{default:e}}const h=l.default.validators;class f{constructor(e){this.defaults=e,this.interceptors={request:new o.default,response:new o.default}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=(0,s.default)(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:o}=t;void 0!==r&&l.default.assertOptions(r,{silentJSONParsing:h.transitional(h.boolean),forcedJSONParsing:h.transitional(h.boolean),clarifyTimeoutError:h.transitional(h.boolean)},!1),null!=i&&(n.default.isFunction(i)?t.paramsSerializer={serialize:i}:l.default.assertOptions(i,{encode:h.function,serialize:h.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let u=o&&n.default.merge(o.common,o[t.method]);o&&n.default.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=c.default.concat(u,o);const d=[];let f=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(f=f&&e.synchronous,d.unshift(e.fulfilled,e.rejected))}));const p=[];let m;this.interceptors.response.forEach((function(e){p.push(e.fulfilled,e.rejected)}));let y,g=0;if(!f){const e=[a.default.bind(this),void 0];for(e.unshift.apply(e,d),e.push.apply(e,p),y=e.length,m=Promise.resolve(t);g{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,i,o){r.reason||(r.reason=new n.default(e,i,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new i((function(t){e=t})),cancel:e}}}var o=i;r.default=o},{"./CanceledError.js":"E1lI"}],X8jb:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(t){return e.apply(null,t)}}},{}],wICU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return n.default.isObject(e)&&!0===e.isAxiosError};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./../utils.js"))},{"./../utils.js":"S1cf"}],Ijhc:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;const n={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(n).forEach((e=>{let[t,r]=e;n[r]=t}));var i=n;r.default=i},{}],nUiQ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=_(e("./utils.js")),i=_(e("./helpers/bind.js")),o=_(e("./core/Axios.js")),a=_(e("./core/mergeConfig.js")),s=_(e("./defaults/index.js")),u=_(e("./helpers/formDataToJSON.js")),l=_(e("./cancel/CanceledError.js")),c=_(e("./cancel/CancelToken.js")),d=_(e("./cancel/isCancel.js")),h=e("./env/data.js"),f=_(e("./helpers/toFormData.js")),p=_(e("./core/AxiosError.js")),m=_(e("./helpers/spread.js")),y=_(e("./helpers/isAxiosError.js")),g=_(e("./core/AxiosHeaders.js")),v=_(e("./adapters/adapters.js")),b=_(e("./helpers/HttpStatusCode.js"));function _(e){return e&&e.__esModule?e:{default:e}}const w=function e(t){const r=new o.default(t),s=(0,i.default)(o.default.prototype.request,r);return n.default.extend(s,o.default.prototype,r,{allOwnKeys:!0}),n.default.extend(s,r,null,{allOwnKeys:!0}),s.create=function(r){return e((0,a.default)(t,r))},s}(s.default);w.Axios=o.default,w.CanceledError=l.default,w.CancelToken=c.default,w.isCancel=d.default,w.VERSION=h.VERSION,w.toFormData=f.default,w.AxiosError=p.default,w.Cancel=w.CanceledError,w.all=function(e){return Promise.all(e)},w.spread=m.default,w.isAxiosError=y.default,w.mergeConfig=a.default,w.AxiosHeaders=g.default,w.formToJSON=e=>(0,u.default)(n.default.isHTMLForm(e)?new FormData(e):e),w.getAdapter=v.default.getAdapter,w.HttpStatusCode=b.default,w.default=w;var x=w;r.default=x},{"./utils.js":"S1cf","./helpers/bind.js":"EDTP","./core/Axios.js":"OvAf","./core/mergeConfig.js":"OHvn","./defaults/index.js":"VQpg","./helpers/formDataToJSON.js":"zEQI","./cancel/CanceledError.js":"E1lI","./cancel/CancelToken.js":"tsWd","./cancel/isCancel.js":"V30M","./env/data.js":"xNqU","./helpers/toFormData.js":"BFle","./core/AxiosError.js":"rRKx","./helpers/spread.js":"X8jb","./helpers/isAxiosError.js":"wICU","./core/AxiosHeaders.js":"aueS","./adapters/adapters.js":"MSoV","./helpers/HttpStatusCode.js":"Ijhc"}],dZBD:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.all=r.VERSION=r.HttpStatusCode=r.CanceledError=r.CancelToken=r.Cancel=r.AxiosHeaders=r.AxiosError=r.Axios=void 0,Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n.default}}),r.toFormData=r.spread=r.mergeConfig=r.isCancel=r.isAxiosError=r.getAdapter=r.formToJSON=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./lib/axios.js"));const{Axios:i,AxiosError:o,CanceledError:a,isCancel:s,CancelToken:u,VERSION:l,all:c,Cancel:d,isAxiosError:h,spread:f,toFormData:p,AxiosHeaders:m,HttpStatusCode:y,formToJSON:g,getAdapter:v,mergeConfig:b}=n.default;r.mergeConfig=b,r.getAdapter=v,r.formToJSON=g,r.HttpStatusCode=y,r.AxiosHeaders=m,r.toFormData=p,r.spread=f,r.isAxiosError=h,r.Cancel=d,r.all=c,r.VERSION=l,r.CancelToken=u,r.isCancel=s,r.CanceledError=a,r.AxiosError=o,r.Axios=i},{"./lib/axios.js":"nUiQ"}],kRnD:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.prodFunctionsBaseUrl=void 0,r.prodFunctionsBaseUrl="https://us-central1-neurosity-device.cloudfunctions.net"},{}],RIhy:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getFunctionsBaseURL=void 0;var n=e("./config");r.getFunctionsBaseURL=function(e){if(!e.emulator)return n.prodFunctionsBaseUrl;var t=e.emulatorHost,r=e.emulatorFunctionsPort;return"http://".concat(t,":").concat(r,"/neurosity-device/us-central1")}},{"./config":"kRnD"}],MDrB:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createOAuthURL=void 0;var i=n(e("axios")),o=e("./utils");r.createOAuthURL=function(e,t){var r=e.clientId,n=e.clientSecret,a=e.responseType,s=e.redirectUri,u=e.scope,l=e.state,c=(0,o.getFunctionsBaseURL)(t);return i.default.get("".concat(c,"/authorize/entry"),{params:Object.assign(Object.assign({client_id:r},n?{client_secret:n}:{}),{response_type:a,redirect_uri:s,scope:u.join(","),state:l,redirect:"false"})}).then((function(e){return"".concat(c).concat(e.data.url)}))}},{axios:"dZBD","./utils":"RIhy"}],nfg4:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(O){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),s=new k(n||[]);return o(a,"_invoke",{value:S(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(O){return{type:"throw",arg:O}}}e.wrap=d;var f={};function p(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(C([])));b&&b!==t&&r.call(b,s)&&(g=b);var _=y.prototype=p.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var i;o(this,"_invoke",{value:function(o,a){function s(){return new t((function(i,s){!function i(o,a,s,u){var l=h(e[o],e,a);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==n(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,u)}),(function(e){i("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,u)}))}u(l.arg)}(o,a,i,s)}))}return i=i?i.then(s,s):s()}})}function S(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=h(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function T(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 M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getOAuthToken=void 0;var s=a(e("axios")),u=e("./utils");r.getOAuthToken=function(e,t){return o(this,void 0,void 0,i().mark((function r(){var n,o,a;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=(0,u.getFunctionsBaseURL)(t),r.next=3,s.default.post("".concat(n,"/getOAuthRefreshToken"),e);case 3:return o=r.sent,a=o.data,r.abrupt("return",s.default.post("".concat(n,"/token"),{grant_type:"refresh_token",refresh_token:a.data,client_id:e.clientId,client_secret:e.clientSecret}).then((function(e){return JSON.parse(e.data).access_token})));case 6:case"end":return r.stop()}}),r)})))}},{axios:"dZBD","./utils":"RIhy"}],vsps:[function(e,t,r){e("process");var n=e("process");Object.defineProperty(r,"__esModule",{value:!0}),r.isNode=void 0,r.isNode=function(){return void 0!==n&&null!=n.versions&&null!=n.versions.node}},{process:"pBGv"}],DCuD:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getCloudMetric=void 0;var n=e("rxjs"),i=e("rxjs/operators"),o=e("./whileOnline"),a=e("./subscription");r.getCloudMetric=function(e,t){var r=e.options,s=e.cloudClient,u=e.onDeviceChange,l=e.status,c=t.metric,d=t.labels,h=t.atomic,f=(0,a.validate)(c,d,r);if(f)return(0,n.throwError)((function(){return f}));var p=new n.Observable((function(e){var t=(h?[s.metrics.subscribe({metric:c,labels:d,atomic:h})]:d.map((function(e){return s.metrics.subscribe({metric:c,labels:[e],atomic:h})}))).map((function(t){return{subscription:t,listener:s.metrics.on(t,(function(){e.next.apply(e,arguments)}))}}));return function(){t.forEach((function(e){var t=e.subscription,r=e.listener;s.metrics.unsubscribe(t,r)}))}}));return u().pipe((0,i.switchMap)((function(e){return e?p.pipe((0,o.whileOnline)({status$:l(),allowWhileOnSleepMode:!1})):n.EMPTY})))}},{rxjs:"Zr8e","rxjs/operators":"v3iE","./whileOnline":"s7Vt","./subscription":"yLLB"}],VusC:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isMaybeWebWorkerContext=void 0;var n=this;r.isMaybeWebWorkerContext=function(){return n&&void 0===(null==n?void 0:n.document)}},{}],ljun:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isWebBluetoothSupported=void 0;var n=e("./isMaybeWebWorkerContext");r.isWebBluetoothSupported=function(){var e;return"undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.bluetooth)&&!(0,n.isMaybeWebWorkerContext)()}},{"./isMaybeWebWorkerContext":"VusC"}],UDAB:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.create6DigitPin=void 0,r.create6DigitPin=function(){return Math.floor(1e5+9e5*Math.random())}},{}],dskh:[function(e,t,r){"use strict";const n=e("base64-js"),i=e("ieee754"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=u,r.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},r.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:128==(192&(r=e[i+1]))&&(u=(31&t)<<6|63&r)>127&&(o=u);break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),l=this.slice(n,i),c=e.slice(t,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let o=t;or)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,n,i){V(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e){return R(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);I(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);I(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e){return R(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return D(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function V(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(o+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(o+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+" It must be ".concat(t,". Received ").concat(i)}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const Q=function(){const e=new Array(256);for(let t=0;t<16;++t){const r=16*t;for(let n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n]}return e}();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},{"base64-js":"yh9p",ieee754:"JgNJ",buffer:"peL6"}],iwtf:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.TRANSPORT_TYPE=r.BLUETOOTH_CONNECTION=void 0,function(e){e.SCANNING="scanning",e.CONNECTED="connected",e.CONNECTING="connecting",e.DISCONNECTING="disconnecting",e.DISCONNECTED="disconnected"}(r.BLUETOOTH_CONNECTION||(r.BLUETOOTH_CONNECTION={})),function(e){e.WEB="web",e.REACT_NATIVE="reactNative"}(r.TRANSPORT_TYPE||(r.TRANSPORT_TYPE={}))},{}],mUrw:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function l(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=E.TRANSPORT_TYPE.WEB,this.textCodec=new S.TextCodec(this.type),this.characteristicsByName={},this.connection$=new y.BehaviorSubject(E.BLUETOOTH_CONNECTION.DISCONNECTED),this.pendingActions$=new y.BehaviorSubject([]),this.logs$=new y.ReplaySubject(10),this.onDisconnected$=this._onDisconnected().pipe((0,_.share)()),this.connectionStream$=this.connection$.asObservable().pipe((0,v.filter)((function(e){return!!e})),(0,b.distinctUntilChanged)(),(0,b.shareReplay)(1)),this._isAutoConnectEnabled$=new y.ReplaySubject(1),this.options=Object.assign(Object.assign({},C),r),!(0,w.isWebBluetoothSupported)())throw this.addLog("Web Bluetooth is not supported"),new Error("Web Bluetooth is not supported");this._isAutoConnectEnabled$.subscribe((function(e){t.addLog("Auto connect: ".concat(e?"enabled":"disabled"))})),this._isAutoConnectEnabled$.next(this.options.autoConnect),this.connection$.asObservable().subscribe((function(e){t.addLog("connection status is ".concat(e))})),this.onDisconnected$.subscribe((function(){t.connection$.next(E.BLUETOOTH_CONNECTION.DISCONNECTED)}))}return function(e,t,r){t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"_getPairedDevices",value:function(){return d(this,void 0,void 0,u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.bluetooth.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"_autoConnect",value:function(e){var t=this;return this._isAutoConnectEnabled$.pipe((0,v.switchMap)((function(r){return r?(0,g.merge)(e,t.onDisconnected$.pipe((0,v.switchMap)((function(){return e})))):g.NEVER})),(0,v.switchMap)((function(e){return d(t,void 0,void 0,u().mark((function t(){var r,n,i,a,s,l,c;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.deviceNickname,!this.isConnected()){t.next=4;break}return this.addLog("Auto connect: ".concat(n," is already connected. Skipping auto connect.")),t.abrupt("return");case 4:return t.next=6,this._getPairedDevices().then((function(e){return[null,e]})).catch((function(e){return[e,null]}));case 6:if(i=t.sent,a=o(i,2),s=a[0],l=a[1],!s){t.next=12;break}throw new Error("failed to get devices: ".concat(null!==(r=null==s?void 0:s.message)&&void 0!==r?r:s));case 12:if(this.addLog("Auto connect: found ".concat(l.length," devices ").concat(l.map((function(e){return e.name})).join(", "))),c=l.findLast((function(e){return e.name===n}))){t.next=16;break}throw new Error("couldn't find selected device in the list of paired devices.");case 16:return this.addLog("Auto connect: ".concat(n," was detected and previously paired")),t.abrupt("return",c);case 18:case"end":return t.stop()}}),t,this)})))})),(0,v.tap)((function(){t.connection$.next(E.BLUETOOTH_CONNECTION.SCANNING)})),(0,v.switchMap)((function(e){return function(e){return new y.Observable((function(t){var r=new AbortController,n=r.signal,i=e.addEventListener("advertisementreceived",(function(e){r.abort(),t.next(e),t.complete()}),{once:!0});try{e.watchAdvertisements({signal:n})}catch(o){t.error(o)}return function(){r.abort(),e.removeEventListener("advertisementreceived",i)}}))}(e)})),(0,v.switchMap)((function(e){return d(t,void 0,void 0,u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.addLog("Advertisement received for ".concat(e.device.name)),t.next=3,this.getServerServiceAndCharacteristics(e.device);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))})))}},{key:"enableAutoConnect",value:function(e){this._isAutoConnectEnabled$.next(e)}},{key:"addLog",value:function(e){this.logs$.next(e)}},{key:"isConnected",value:function(){return this.connection$.getValue()===E.BLUETOOTH_CONNECTION.CONNECTED}},{key:"connection",value:function(){return this.connectionStream$}},{key:"connect",value:function(e){return d(this,void 0,void 0,u().mark((function t(){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requestDevice(e);case 3:return r=t.sent,t.next=6,this.getServerServiceAndCharacteristics(r);case 6:t.next=11;break;case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))}},{key:"requestDevice",value:function(e){return d(this,void 0,void 0,u().mark((function t(){var r,n,o;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.addLog("Requesting Bluetooth Device..."),r=p.BLUETOOTH_DEVICE_NAME_PREFIXES.map((function(e){return{namePrefix:e}})),n=e?[{name:e}]:r,t.next=6,window.navigator.bluetooth.requestDevice({filters:[].concat(i(n),[{manufacturerData:[{companyIdentifier:m.BLUETOOTH_COMPANY_IDENTIFIER_HEX}]}]),optionalServices:[h.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX]});case 6:return o=t.sent,t.abrupt("return",o);case 10:return t.prev=10,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 13:case"end":return t.stop()}}),t,this,[[0,10]])})))}},{key:"getServerServiceAndCharacteristics",value:function(e){return d(this,void 0,void 0,u().mark((function t(){var r;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.device=e,this.connection$.getValue()===E.BLUETOOTH_CONNECTION.CONNECTING||this.connection$.next(E.BLUETOOTH_CONNECTION.CONNECTING),t.next=6,e.gatt.connect();case 6:return this.server=t.sent,this.addLog("Getting service..."),t.next=10,this.server.getPrimaryService(h.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX);case 10:return this.service=t.sent,this.addLog("Got service ".concat(this.service.uuid,", getting characteristics...")),t.next=14,this.service.getCharacteristics();case 14:r=t.sent,this.addLog("Got characteristics"),this.characteristicsByName=Object.fromEntries(r.map((function(e){return[M.CHARACTERISTIC_UUIDS_TO_NAMES[e.uuid],e]}))),this.connection$.next(E.BLUETOOTH_CONNECTION.CONNECTED),t.next=23;break;case 20:return t.prev=20,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 23:case"end":return t.stop()}}),t,this,[[0,20]])})))}},{key:"_onDisconnected",value:function(){var e=this;return this.connection$.asObservable().pipe((0,v.switchMap)((function(t){return t===E.BLUETOOTH_CONNECTION.CONNECTED?O(e.device,"gattserverdisconnected"):g.NEVER})))}},{key:"disconnect",value:function(){var e,t;return d(this,void 0,void 0,u().mark((function r(){return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:(null===(t=null===(e=null==this?void 0:this.device)||void 0===e?void 0:e.gatt)||void 0===t?void 0:t.connected)&&this.device.gatt.disconnect();case 2:case"end":return r.stop()}}),r,this)})))}},{key:"getCharacteristicByName",value:function(e){var t;return d(this,void 0,void 0,u().mark((function r(){return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",null===(t=this.characteristicsByName)||void 0===t?void 0:t[e]);case 1:case"end":return r.stop()}}),r,this)})))}},{key:"subscribeToCharacteristic",value:function(e){var t=this,r=e.characteristicName,n=e.manageNotifications,i=void 0===n||n,o=e.skipJSONDecoding,a=void 0!==o&&o,s=(0,g.defer)((function(){return t.getCharacteristicByName(r)})).pipe((0,v.switchMap)((function(e){return d(t,void 0,void 0,u().mark((function t(){var n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isConnected()||!i){t.next=10;break}return t.prev=1,t.next=4,e.startNotifications();case 4:this.addLog("Started notifications for ".concat(r," characteristic")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),this.addLog("Attemped to stop notifications for ".concat(r," characteristic: ").concat(null!==(n=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==n?n:t.t0));case 10:return t.abrupt("return",e);case 11:case"end":return t.stop()}}),t,this,[[1,7]])})))})),(0,v.switchMap)((function(e){return O(e,"characteristicvaluechanged",(function(){return d(t,void 0,void 0,u().mark((function t(){var n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isConnected()||!i){t.next=10;break}return t.prev=1,t.next=4,e.stopNotifications();case 4:this.addLog("Stopped notifications for ".concat(r," characteristic")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),this.addLog("Attemped to stop notifications for ".concat(r," characteristic: ").concat(null!==(n=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==n?n:t.t0));case 10:case"end":return t.stop()}}),t,this,[[1,7]])})))}))})),(0,v.map)((function(e){return e.target.value.buffer})));return this.connection$.pipe((0,v.switchMap)((function(e){return e===E.BLUETOOTH_CONNECTION.CONNECTED?s.pipe(a?y.identity:(0,k.decodeJSONChunks)({textCodec:t.textCodec,characteristicName:r,delimiter:f.BLUETOOTH_CHUNK_DELIMITER,addLog:function(e){return t.addLog(e)}})):g.NEVER})))}},{key:"readCharacteristic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d(this,void 0,void 0,u().mark((function r(){var n,i,o,a,s;return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,this.addLog("Reading characteristic: ".concat(e)),r.next=4,this.getCharacteristicByName(e);case 4:if(n=r.sent){r.next=8;break}return this.addLog("Did not fund ".concat(e," characteristic")),r.abrupt("return",Promise.reject("Did not find characteristic by the name: ".concat(e)));case 8:return r.next=10,n.readValue();case 10:return i=r.sent,o=i.buffer,a=this.textCodec.decode(o),s=t?JSON.parse(a):a,this.addLog("Received read data from ".concat(e," characteristic: \n").concat(s)),r.abrupt("return",s);case 18:return r.prev=18,r.t0=r.catch(0),r.abrupt("return",Promise.reject("Error reading characteristic: ".concat(r.t0.message)));case 21:case"end":return r.stop()}}),r,this,[[0,18]])})))}},{key:"writeCharacteristic",value:function(e,t){return d(this,void 0,void 0,u().mark((function r(){var n,i;return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.addLog("Writing characteristic: ".concat(e)),r.next=3,this.getCharacteristicByName(e);case 3:if(n=r.sent){r.next=7;break}return this.addLog("Did not fund ".concat(e," characteristic")),r.abrupt("return",Promise.reject("Did not find characteristic by the name: ".concat(e)));case 7:return i=this.textCodec.encode(t),r.next=10,n.writeValueWithResponse(i);case 10:case"end":return r.stop()}}),r,this)})))}},{key:"_addPendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next([].concat(i(t),[e]))}},{key:"_removePendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next(t.filter((function(t){return t!==e})))}},{key:"_autoToggleActionNotifications",value:function(){var e,t=this,r=!1;return this.connection$.asObservable().pipe((0,v.switchMap)((function(r){return r===E.BLUETOOTH_CONNECTION.CONNECTED?(0,g.defer)((function(){return t.getCharacteristicByName("actions")})).pipe((0,v.switchMap)((function(r){return e=r,t.pendingActions$}))):g.NEVER})),(0,v.tap)((function(n){return d(t,void 0,void 0,u().mark((function t(){var i,o,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=!!n.length)||r){t.next=12;break}return r=!0,t.prev=3,t.next=6,e.startNotifications();case 6:this.addLog("Started notifications for [actions] characteristic"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),this.addLog("Attemped to start notifications for [actions] characteristic: ".concat(null!==(i=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==i?i:t.t0));case 12:if(a||!r){t.next=23;break}return r=!1,t.prev=14,t.next=17,e.stopNotifications();case 17:this.addLog("Stopped notifications for actions characteristic"),t.next=23;break;case 20:t.prev=20,t.t1=t.catch(14),this.addLog("Attemped to stop notifications for [actions] characteristic: ".concat(null!==(o=null===t.t1||void 0===t.t1?void 0:t.t1.message)&&void 0!==o?o:t.t1));case 23:case"end":return t.stop()}}),t,this,[[3,9],[14,20]])})))})))}},{key:"dispatchAction",value:function(e){var t=e.characteristicName,r=e.action;return d(this,void 0,void 0,u().mark((function e(){var n,i,o,a,s=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.responseRequired,i=void 0!==n&&n,o=r.responseTimeout,a=void 0===o?T.DEFAULT_ACTION_RESPONSE_TIMEOUT:o,e.abrupt("return",new Promise((function(e,n){return d(s,void 0,void 0,u().mark((function o(){var s,l,c,d=this;return u().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getCharacteristicByName(t).catch((function(){n("Did not find characteristic by the name: ".concat(t))}));case 2:if(o.sent){o.next=5;break}return o.abrupt("return");case 5:s=(0,x.create6DigitPin)(),l=JSON.stringify(Object.assign({actionId:s},r)),this.addLog("Dispatched action with id ".concat(s)),i&&a?(this._addPendingAction(s),c=(0,g.timer)(a).subscribe((function(){d._removePendingAction(s),n("Action with id ".concat(s," timed out after ").concat(a,"ms"))})),this.subscribeToCharacteristic({characteristicName:t,manageNotifications:!1}).pipe((0,v.filter)((function(e){return(null==e?void 0:e.actionId)===s})),(0,_.take)(1)).subscribe((function(t){c.unsubscribe(),d._removePendingAction(s),e(t)})),this.writeCharacteristic(t,l).catch((function(e){d._removePendingAction(s),n(e.message)}))):this.writeCharacteristic(t,l).then((function(){e(null)})).catch((function(e){n(e.message)}));case 9:case"end":return o.stop()}}),o,this)})))})));case 2:case"end":return e.stop()}}),e)})))}}]),e}();function O(e,t,r){var n=this;return(0,g.fromEventPattern)((function(r){e.addEventListener(t,r)}),(function(i){return d(n,void 0,void 0,u().mark((function n(){return u().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r){n.next=3;break}return n.next=3,r();case 3:e.removeEventListener(t,i);case 4:case"end":return n.stop()}}),n)})))}))}r.WebBluetoothTransport=j},{"@neurosity/ipk":"ZOGh",rxjs:"Zr8e","rxjs/operators":"v3iE","./isWebBluetoothSupported":"ljun","../utils/create6DigitPin":"UDAB","../utils/textCodec":"mUrw","../types":"iwtf","../constants":"dGLb","../utils/decodeJSONChunks":"MRSy"}],FtS5:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function u(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];return c(this,void 0,void 0,s().mark((function n(){var i,o,a,u,l,c,d;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.addLog("Reading characteristic: ".concat(e)),i=this.getCharacteristicByName(e),o=i.peripheralId,a=i.serviceUUID,u=i.characteristicUUID){n.next=4;break}return n.abrupt("return",Promise.reject(new Error("Did not find characteristic matching ".concat(e))));case 4:return n.prev=4,n.next=7,this.BleManager.read(o,a,u);case 7:return l=n.sent,c=this.textCodec.decode(new Uint8Array(l)),d=r?JSON.parse(c):c,this.addLog("Received read data from ".concat(e," characteristic: \n").concat(d)),n.abrupt("return",d);case 14:return n.prev=14,n.t0=n.catch(4),n.abrupt("return",Promise.reject(new Error("readCharacteristic ".concat(e," error. ").concat(null!==(t=null===n.t0||void 0===n.t0?void 0:n.t0.message)&&void 0!==t?t:n.t0))));case 17:case"end":return n.stop()}}),n,this,[[4,14]])})))}},{key:"writeCharacteristic",value:function(e,t){return c(this,void 0,void 0,s().mark((function r(){var n,i,o,a,u;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(this.addLog("Writing characteristic: ".concat(e)),n=this.getCharacteristicByName(e),i=n.peripheralId,o=n.serviceUUID,a=n.characteristicUUID){r.next=4;break}return r.abrupt("return",Promise.reject(new Error("Did not find characteristic matching ".concat(e))));case 4:return u=this.textCodec.encode(t),r.next=7,this.BleManager.write(i,o,a,u,T.REACT_NATIVE_MAX_BYTE_SIZE);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"_addPendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next([].concat(i(t),[e]))}},{key:"_removePendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next(t.filter((function(t){return t!==e})))}},{key:"_autoToggleActionNotifications",value:function(){var e=this,t=!1;return this.connection$.asObservable().pipe((0,y.switchMap)((function(t){return t===w.BLUETOOTH_CONNECTION.CONNECTED?e.pendingActions$:p.NEVER})),(0,y.tap)((function(r){return c(e,void 0,void 0,s().mark((function e(){var n,i,o,a,u,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.getCharacteristicByName("actions"),a=o.peripheralId,u=o.serviceUUID,l=o.characteristicUUID,!(c=!!r.length)||t){e.next=13;break}return t=!0,e.prev=4,e.next=7,this.BleManager.startNotification(a,u,l);case 7:this.addLog("Started notifications for [actions] characteristic"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),this.addLog("Attemped to start notifications for [actions] characteristic: ".concat(null!==(n=null===e.t0||void 0===e.t0?void 0:e.t0.message)&&void 0!==n?n:e.t0));case 13:if(c||!t){e.next=24;break}return t=!1,e.prev=15,e.next=18,this.BleManager.stopNotification(a,u,l);case 18:this.addLog("Stopped notifications for actions characteristic"),e.next=24;break;case 21:e.prev=21,e.t1=e.catch(15),this.addLog("Attemped to stop notifications for [actions] characteristic: ".concat(null!==(i=null===e.t1||void 0===e.t1?void 0:e.t1.message)&&void 0!==i?i:e.t1));case 24:case"end":return e.stop()}}),e,this,[[4,10],[15,21]])})))})))}},{key:"dispatchAction",value:function(e){var t=e.characteristicName,r=e.action;return c(this,void 0,void 0,s().mark((function e(){var n,i,o,a,u=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.responseRequired,i=void 0!==n&&n,o=r.responseTimeout,a=void 0===o?x.DEFAULT_ACTION_RESPONSE_TIMEOUT:o,e.abrupt("return",new Promise((function(e,n){return c(u,void 0,void 0,s().mark((function o(){var u,l,c,d=this;return s().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:u=(0,b.create6DigitPin)(),l=JSON.stringify(Object.assign({actionId:u},r)),this.addLog("Dispatched action with id ".concat(u)),i&&a?(this._addPendingAction(u),c=(0,m.timer)(a).subscribe((function(){d._removePendingAction(u),n(new Error("Action with id ".concat(u," timed out after ").concat(a,"ms")))})),this.subscribeToCharacteristic({characteristicName:t,manageNotifications:!1}).pipe((0,y.filter)((function(e){return(null==e?void 0:e.actionId)===u})),(0,v.take)(1)).subscribe((function(t){c.unsubscribe(),d._removePendingAction(u),e(t)})),this.writeCharacteristic(t,l).catch((function(e){d._removePendingAction(u),n(e)}))):this.writeCharacteristic(t,l).then((function(){e(null)})).catch((function(e){n(e)}));case 4:case"end":return o.stop()}}),o,this)})))})));case 2:case"end":return e.stop()}}),e)})))}}]),e}();r.ReactNativeTransport=C},{"@neurosity/ipk":"ZOGh",rxjs:"Zr8e","rxjs/operators":"v3iE","../utils/create6DigitPin":"UDAB","../utils/textCodec":"mUrw","../types":"iwtf","../constants":"dGLb","../utils/decodeJSONChunks":"MRSy"}],Oj1i:[function(e,t,r){"use strict";function n(e){return(n="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})(e)}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.epoch=r.bufferToEpoch=r.addInfo=void 0;var a=e("rxjs"),s=e("rxjs/operators"),u="data",l=function(e){return e instanceof Object&&e===Object(e)},c=function(e){return"function"==typeof e};r.addInfo=function(e){return(0,a.pipe)((0,s.map)((function(t){if(!l(t)||!l(e)&&!c(e))return t;var r=c(e)?e(t):e;return function(e){return function(t){var r;return Object.assign(Object.assign({},e),{info:Object.assign(Object.assign({},null!==(r=null==e?void 0:e.info)&&void 0!==r?r:{}),t||{})})}}(t)(r)})))};r.bufferToEpoch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.samplingRate,r=void 0===t?256:t,n=e.dataProp,o=void 0===n?u:n;return(0,a.pipe)((0,s.map)((function(e){var t;return i(t={},o,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return e[0][t].map((function(r,n){return e.map((function(e){return e[t][n]}))}))}(e,o)),i(t,"info",Object.assign(Object.assign({},e[0]&&e[0].info?e[0].info:{}),{startTime:e[0].timestamp,samplingRate:e[0].info&&e[0].info.samplingRate?e[0].info.samplingRate:r})),t})))};r.epoch=function(e){var t=e.duration,n=e.interval,i=e.samplingRate,o=e.dataProp,l=void 0===o?u:o;return(0,a.pipe)((0,s.bufferCount)(n),(0,s.scan)((function(e,r){return e.concat(r).slice(e.lengthe.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function s(e,t){for(var r=0;r ".concat(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:e))}}),"function"==typeof s?(this.transport.addLog("Auto authentication enabled"),this._autoAuthenticate(s).subscribe()):this.transport.addLog("Auto authentication not enabled"),this.osHasBluetoothSupport$.pipe((0,h.switchMap)((function(e){return e?r.transport._autoToggleActionNotifications():d.EMPTY}))).subscribe(),this._focus$=this._subscribeWhileAuthenticated("focus"),this._calm$=this._subscribeWhileAuthenticated("calm"),this._accelerometer$=this._subscribeWhileAuthenticated("accelerometer"),this._brainwavesRaw$=this._subscribeWhileAuthenticated("raw",!0),this._brainwavesRawUnfiltered$=this._subscribeWhileAuthenticated("rawUnfiltered",!0),this._brainwavesPSD$=this._subscribeWhileAuthenticated("psd"),this._brainwavesPowerByBand$=this._subscribeWhileAuthenticated("powerByBand"),this._signalQuality$=this._subscribeWhileAuthenticated("signalQuality"),this._status$=this._subscribeWhileAuthenticated("status"),this._settings$=this._subscribeWhileAuthenticated("settings"),this._wifiNearbyNetworks$=this._subscribeWhileAuthenticated("wifiNearbyNetworks"),this._wifiConnections$=this._subscribeWhileAuthenticated("wifiConnections")}return function(e,t,r){t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"_autoAuthenticate",value:function(e){var t=this,r=(0,c.timer)(0,36e5).pipe((0,h.tap)((function(){t.transport.addLog("Auto authentication in progress...")})));return this.osHasBluetoothSupport$.pipe((0,h.switchMap)((function(e){return e?t.connection():d.EMPTY})),(0,h.switchMap)((function(e){return e===y.BLUETOOTH_CONNECTION.CONNECTED?r:d.EMPTY})),(0,h.switchMap)((function(){return l(t,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isAuthenticated();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))})),(0,h.tap)((function(r){var n=i(r,1)[0];return l(t,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=8;break}return t.next=3,e();case 3:return r=t.sent,t.next=6,this.authenticate(r);case 6:t.next=9;break;case 8:this.transport.addLog("Already authenticated");case 9:case"end":return t.stop()}}),t,this)})))})))}},{key:"enableAutoConnect",value:function(e){this.transport.enableAutoConnect(e)}},{key:"_hasBluetoothSupport",value:function(){return l(this,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.firstValueFrom)(this.osHasBluetoothSupport$);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"authenticate",value:function(e){return l(this,void 0,void 0,a().mark((function t(){var r,n,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._hasBluetoothSupport();case 2:if(t.sent){t.next=7;break}return r="authenticate method: The OS version does not support Bluetooth.",this.transport.addLog(r),t.abrupt("return",Promise.reject(r));case 7:return t.next=9,this.transport.writeCharacteristic("auth",e);case 9:return t.next=11,this.isAuthenticated();case 11:return n=t.sent,o=i(n,1),s=o[0],this.transport.addLog("Authentication ".concat(s?"succeeded":"failed")),this.isAuthenticated$.next(s),t.abrupt("return",n);case 16:case"end":return t.stop()}}),t,this)})))}},{key:"isAuthenticated",value:function(){return l(this,void 0,void 0,a().mark((function e(){var t,r,n,o,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.transport.readCharacteristic("auth",!0);case 3:return t=e.sent,r=i(t,2),n=r[0],o=r[1],this.isAuthenticated$.next(n),e.abrupt("return",[n,o]);case 11:return e.prev=11,e.t0=e.catch(0),s=[!1,null],this.transport.addLog("Authentication error -> ".concat(e.t0)),this.isAuthenticated$.next(!1),e.abrupt("return",s);case 17:case"end":return e.stop()}}),e,this,[[0,11]])})))}},{key:"scan",value:function(e){if(this.transport instanceof p.ReactNativeTransport)return this.transport.scan(e);if(this.transport instanceof f.WebBluetoothTransport)throw new Error("scan method is compatibly with the React Native transport only");throw new Error("unknown transport")}},{key:"connect",value:function(e){return this.transport instanceof p.ReactNativeTransport?this.transport.connect(e):this.transport instanceof f.WebBluetoothTransport?e?this.transport.connect(e):this.transport.connect():void 0}},{key:"disconnect",value:function(){return this.transport.disconnect()}},{key:"connection",value:function(){return this.transport.connection()}},{key:"logs",value:function(){return this.transport.logs$.asObservable()}},{key:"getDeviceId",value:function(){return l(this,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.transport.readCharacteristic("deviceId"));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_withAuthentication",value:function(e){return l(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._hasBluetoothSupport();case 2:if(t.sent){t.next=7;break}return r="The OS version does not support Bluetooth.",this.transport.addLog(r),t.abrupt("return",Promise.reject(r));case 7:return t.next=9,(0,d.firstValueFrom)(this.isAuthenticated$);case 9:if(t.sent){t.next=14;break}return this.transport.addLog("Authentication required."),t.abrupt("return",Promise.reject("Authentication required."));case 14:return t.next=16,e();case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"_subscribeWhileAuthenticated",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.osHasBluetoothSupport$.pipe((0,h.switchMap)((function(e){return e?t.isAuthenticated$:d.EMPTY})),(0,h.distinctUntilChanged)(),(0,h.switchMap)((function(n){return n?t.transport.subscribeToCharacteristic({characteristicName:e,skipJSONDecoding:r}):d.EMPTY})),(0,h.share)())}},{key:"focus",value:function(){return this._focus$}},{key:"calm",value:function(){return this._calm$}},{key:"accelerometer",value:function(){return this._accelerometer$}},{key:"brainwaves",value:function(e){var t=this;switch(e){default:case"raw":return(0,c.defer)((function(){return t.getInfo()})).pipe((0,h.switchMap)((function(e){return t._brainwavesRaw$.pipe((0,m.binaryBufferToEpoch)(e))})));case"rawUnfiltered":return(0,c.defer)((function(){return t.getInfo()})).pipe((0,h.switchMap)((function(e){return t._brainwavesRawUnfiltered$.pipe((0,m.binaryBufferToEpoch)(e))})));case"psd":return this._brainwavesPSD$;case"powerByBand":return this._brainwavesPowerByBand$}}},{key:"signalQuality",value:function(){return this._signalQuality$}},{key:"addMarker",value:function(e){return l(this,void 0,void 0,a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dispatchAction({action:"marker",command:"add",message:{timestamp:Date.now(),label:e}});case 2:case"end":return t.stop()}}),t,this)})))}},{key:"getInfo",value:function(){return l(this,void 0,void 0,a().mark((function e(){var t=this;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withAuthentication((function(){return(0,d.firstValueFrom)(t.transport.subscribeToCharacteristic({characteristicName:"deviceInfo"}))}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"status",value:function(){return this._status$}},{key:"dispatchAction",value:function(e){return l(this,void 0,void 0,a().mark((function t(){var r=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._withAuthentication((function(){return r.transport.dispatchAction({characteristicName:"actions",action:e})}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"settings",value:function(){return this._settings$}},{key:"haptics",value:function(e){return this.dispatchAction({action:"haptics",command:"queue",responseRequired:!0,responseTimeout:4e3,message:{effects:e}})}},{key:"wifi",get:function(){var e=this;return{nearbyNetworks:function(){return e._wifiNearbyNetworks$},connections:function(){return e._wifiConnections$},connect:function(t,r){return t?e.dispatchAction({action:"wifi",command:"connect",responseRequired:!0,responseTimeout:12e4,message:{ssid:t,password:null!=r?r:null}}):Promise.reject("Missing ssid")},forgetConnection:function(t){return t?e.dispatchAction({action:"wifi",command:"forget-connection",responseRequired:!0,responseTimeout:15e3,message:{ssid:t}}):Promise.reject("Missing ssid")},reset:function(){return e.dispatchAction({action:"wifi",command:"reset",responseRequired:!0,responseTimeout:3e4,message:{respondOnSuccess:!0}})},speedTest:function(){return e.dispatchAction({action:"wifi",command:"speed-test",responseRequired:!0,responseTimeout:6e4})}}}}]),e}();r.BluetoothClient=g},{rxjs:"Zr8e","rxjs/operators":"v3iE","./web/WebBluetoothTransport":"ouKb","./react-native/ReactNativeTransport":"FtS5","./utils/binaryBufferToEpoch":"D2Cx","./types":"iwtf"}],Sk7T:[function(e,t,r){e("process");var n=e("process");function i(e){return(i="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})(e)}var o=("object"===(void 0===n?"undefined":i(n))&&n.env,function(){});t.exports=o},{process:"pBGv"}],C39h:[function(e,t,r){var n=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:n,MAX_SAFE_COMPONENT_LENGTH:16}},{}],bhZj:[function(e,t,r){var n=e("./constants").MAX_SAFE_COMPONENT_LENGTH,i=e("./debug"),o=(r=t.exports={}).re=[],a=r.src=[],s=r.t={},u=0,l=function(e,t,r){var n=u++;i(e,n,t),s[e]=n,a[n]=t,o[n]=new RegExp(t,r?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","[0-9]+"),l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),l("MAINVERSION","(".concat(a[s.NUMERICIDENTIFIER],")\\.")+"(".concat(a[s.NUMERICIDENTIFIER],")\\.")+"(".concat(a[s.NUMERICIDENTIFIER],")")),l("MAINVERSIONLOOSE","(".concat(a[s.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[s.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[s.NUMERICIDENTIFIERLOOSE],")")),l("PRERELEASEIDENTIFIER","(?:".concat(a[s.NUMERICIDENTIFIER],"|").concat(a[s.NONNUMERICIDENTIFIER],")")),l("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[s.NUMERICIDENTIFIERLOOSE],"|").concat(a[s.NONNUMERICIDENTIFIER],")")),l("PRERELEASE","(?:-(".concat(a[s.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[s.PRERELEASEIDENTIFIER],")*))")),l("PRERELEASELOOSE","(?:-?(".concat(a[s.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[s.PRERELEASEIDENTIFIERLOOSE],")*))")),l("BUILDIDENTIFIER","[0-9A-Za-z-]+"),l("BUILD","(?:\\+(".concat(a[s.BUILDIDENTIFIER],"(?:\\.").concat(a[s.BUILDIDENTIFIER],")*))")),l("FULLPLAIN","v?".concat(a[s.MAINVERSION]).concat(a[s.PRERELEASE],"?").concat(a[s.BUILD],"?")),l("FULL","^".concat(a[s.FULLPLAIN],"$")),l("LOOSEPLAIN","[v=\\s]*".concat(a[s.MAINVERSIONLOOSE]).concat(a[s.PRERELEASELOOSE],"?").concat(a[s.BUILD],"?")),l("LOOSE","^".concat(a[s.LOOSEPLAIN],"$")),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE","".concat(a[s.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),l("XRANGEIDENTIFIER","".concat(a[s.NUMERICIDENTIFIER],"|x|X|\\*")),l("XRANGEPLAIN","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:".concat(a[s.PRERELEASE],")?").concat(a[s.BUILD],"?")+")?)?"),l("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(a[s.PRERELEASELOOSE],")?").concat(a[s.BUILD],"?")+")?)?"),l("XRANGE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAIN],"$")),l("XRANGELOOSE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAINLOOSE],"$")),l("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),l("COERCERTL",a[s.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM","(\\s*)".concat(a[s.LONETILDE],"\\s+"),!0),r.tildeTrimReplace="$1~",l("TILDE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAIN],"$")),l("TILDELOOSE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAINLOOSE],"$")),l("LONECARET","(?:\\^)"),l("CARETTRIM","(\\s*)".concat(a[s.LONECARET],"\\s+"),!0),r.caretTrimReplace="$1^",l("CARET","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAIN],"$")),l("CARETLOOSE","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAINLOOSE],"$")),l("COMPARATORLOOSE","^".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],")$|^$")),l("COMPARATOR","^".concat(a[s.GTLT],"\\s*(").concat(a[s.FULLPLAIN],")$|^$")),l("COMPARATORTRIM","(\\s*)".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],"|").concat(a[s.XRANGEPLAIN],")"),!0),r.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE","^\\s*(".concat(a[s.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAIN],")")+"\\s*$"),l("HYPHENRANGELOOSE","^\\s*(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s*$"),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},{"./constants":"C39h","./debug":"Sk7T"}],gnTI:[function(e,t,r){function n(e){return(n="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})(e)}var i=["includePrerelease","loose","rtl"];t.exports=function(e){return e?"object"!==n(e)?{loose:!0}:i.filter((function(t){return e[t]})).reduce((function(e,t){return e[t]=!0,e}),{}):{}}},{}],qWqM:[function(e,t,r){var n=/^[0-9]+$/,i=function(e,t){var r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:eu)throw new TypeError("version is longer than ".concat(u," characters"));a("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var n=t.trim().match(r.loose?d[h.LOOSE]:d[h.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>l||this.major<0)throw new TypeError("Invalid major version");if(this.minor>l||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>l||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(0===p(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();t.exports=m},{"../internal/debug":"Sk7T","../internal/constants":"C39h","../internal/re":"bhZj","../internal/parse-options":"gnTI","../internal/identifiers":"qWqM"}],skdn:[function(e,t,r){var n=e("../classes/semver");t.exports=function(e,t,r){return new n(e,r).compare(new n(t,r))}},{"../classes/semver":"JAyN"}],A2P2:[function(e,t,r){var n=e("./compare");t.exports=function(e,t,r){return n(e,t,r)>=0}},{"./compare":"skdn"}],rH2Y:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.osHasBluetoothSupport=void 0;var i=n(e("semver/functions/gte"));r.osHasBluetoothSupport=function(e,t){return!!e&&Number(e.modelVersion)>=3&&!(null==e?void 0:e.emulator)&&(0,i.default)(null!=t?t:e.osVersion,"16.0.0")}},{"semver/functions/gte":"A2P2"}],TICO:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),i(e("./BluetoothClient"),r),i(e("./web/WebBluetoothTransport"),r),i(e("./react-native/ReactNativeTransport"),r),i(e("./utils/osHasBluetoothSupport"),r),i(e("./types/index"),r)},{"./BluetoothClient":"fihV","./web/WebBluetoothTransport":"ouKb","./react-native/ReactNativeTransport":"FtS5","./utils/osHasBluetoothSupport":"rH2Y","./types/index":"iwtf"}],BZP9:[function(e,t,r){function n(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&&i(e,t)}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){var t=function(){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}}();return function(){var r,n=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){return(u="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})(e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e,t)||function(){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){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};h(this,e),this.streamingMode$=new x.ReplaySubject(1);var r=t.streamingMode,n=t.bluetoothTransport;this.options=Object.freeze(Object.assign(Object.assign({},V),t)),this.cloudClient=new M.CloudClient(this.options),n&&(this.bluetoothClient=new B.BluetoothClient({selectedDevice$:this.onDeviceChange(),osHasBluetoothSupport$:this._osHasBluetoothSupport(),createBluetoothToken:this.createBluetoothToken.bind(this),transport:n})),this._initStreamingMode(r,!!n)}return p(e,[{key:"_initStreamingMode",value:function(e,t){var r=[C.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK,C.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK].includes(e),n=!Object.values(C.STREAMING_MODE).includes(e),i=r&&!t;this.isMissingBluetoothTransport=i,!e||n||i?this.streamingMode$.next(C.STREAMING_MODE.WIFI_ONLY):this.streamingMode$.next(e)}},{key:"_osHasBluetoothSupport",value:function(){return(0,w.combineLatest)({selectedDevice:this.onDeviceChange(),osVersion:this.osVersion().pipe((0,S.startWith)(null))}).pipe((0,S.map)((function(e){var t=e.selectedDevice,r=e.osVersion;return(0,B.osHasBluetoothSupport)(t,r)})))}},{key:"streamingState",value:function(){var e=this,t=function(e){return[O.STATUS.ONLINE,O.STATUS.UPDATING].includes(e)};return this.streamingMode$.pipe((0,S.switchMap)((function(r){return(0,w.combineLatest)({selectedDevice:e.onDeviceChange(),osHasBluetoothSupport:e._osHasBluetoothSupport()}).pipe((0,S.switchMap)((function(n){var i=n.selectedDevice,o=n.osHasBluetoothSupport;return i?e.isMissingBluetoothTransport||!o?e.cloudClient.status().pipe((0,S.map)((function(e){var n=e.state;return{connected:t(n),streamingMode:r,activeMode:C.STREAMING_TYPE.WIFI}}))):(0,w.combineLatest)({wifiStatus:e.cloudClient.status(),bluetoothConnection:(null==e?void 0:e.bluetoothClient)?e.bluetoothClient.connection():(0,w.of)(z.BLUETOOTH_CONNECTION.DISCONNECTED)}).pipe((0,S.map)((function(e){var n=e.wifiStatus,i=e.bluetoothConnection===z.BLUETOOTH_CONNECTION.CONNECTED;switch(r){default:case C.STREAMING_MODE.WIFI_ONLY:return{connected:t(n.state),streamingMode:r,activeMode:C.STREAMING_TYPE.WIFI};case C.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK:return{connected:t(n.state)||!i?t(n.state):i,streamingMode:r,activeMode:t(n.state)||!i?C.STREAMING_TYPE.WIFI:C.STREAMING_TYPE.BLUETOOTH};case C.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK:return{connected:!!i||t(n.state),streamingMode:r,activeMode:i?C.STREAMING_TYPE.BLUETOOTH:C.STREAMING_TYPE.WIFI}}})),(0,E.distinctUntilChanged)((function(e,t){return(0,T.default)(e,t)}))):(0,w.of)({connected:!1,streamingMode:r,activeMode:C.STREAMING_TYPE.WIFI})})))})))}},{key:"_withStreamingModeObservable",value:function(e){var t=e.wifi,r=e.bluetooth;return this.streamingState().pipe((0,S.switchMap)((function(e){switch(e.activeMode){case C.STREAMING_TYPE.WIFI:return t();case C.STREAMING_TYPE.BLUETOOTH:return r();default:return t()}})))}},{key:"_withStreamingModePromise",value:function(e){return b(this,void 0,void 0,d().mark((function t(){var r,n,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wifi,n=e.bluetooth,t.next=3,(0,x.firstValueFrom)(this.streamingState());case 3:i=t.sent,o=i.activeMode,t.t0=o,t.next=t.t0===C.STREAMING_TYPE.WIFI?8:t.t0===C.STREAMING_TYPE.BLUETOOTH?11:14;break;case 8:return t.next=10,r();case 10:case 13:case 16:return t.abrupt("return",t.sent);case 11:return t.next=13,n();case 14:return t.next=16,r();case 17:case"end":return t.stop()}}),t,this)})))}},{key:"bluetooth",get:function(){return null==this?void 0:this.bluetoothClient}},{key:"_getCloudMetricDependencies",value:function(){return{options:this.options,cloudClient:this.cloudClient,onDeviceChange:this.onDeviceChange.bind(this),status:this.status.bind(this)}}},{key:"login",value:function(e){return b(this,void 0,void 0,d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.login(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"logout",value:function(){return b(this,void 0,void 0,d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.logout();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"__getApp",value:function(){return this.cloudClient.__getApp()}},{key:"onAuthStateChanged",value:function(){return this.cloudClient.onAuthStateChanged()}},{key:"addDevice",value:function(e){var t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"addDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.addDevice(e)}},{key:"removeDevice",value:function(e){var t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"removeDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.removeDevice(e)}},{key:"transferDevice",value:function(e){var t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"transferDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.transferDevice(e)}},{key:"onUserDevicesChange",value:function(){var e=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onUserDevicesChange"),2),t=e[0],r=e[1];return t?(0,w.throwError)((function(){return r})):this.cloudClient.onUserDevicesChange()}},{key:"onUserClaimsChange",value:function(){return this.cloudClient.onUserClaimsChange()}},{key:"getDevices",value:function(){return b(this,void 0,void 0,d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"selectDevice",value:function(e){return b(this,void 0,void 0,d().mark((function t(){var r,n,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"selectDevice"),n=l(r,2),i=n[0],o=n[1],!i){t.next=3;break}return t.abrupt("return",Promise.reject(o));case 3:return t.next=5,this.cloudClient.selectDevice(e);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"getSelectedDevice",value:function(){return b(this,void 0,void 0,d().mark((function e(){var t,r,n,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getSelectedDevice"),r=l(t,2),n=r[0],i=r[1],!n){e.next=3;break}return e.abrupt("return",Promise.reject(i));case 3:return e.next=5,this.cloudClient.getSelectedDevice();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})))}},{key:"getInfo",value:function(){return b(this,void 0,void 0,d().mark((function e(){var t,r,n,i,o=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",Promise.reject(A.mustSelectDevice));case 4:if(t=(0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getInfo"),r=l(t,2),n=r[0],i=r[1],!n){e.next=7;break}return e.abrupt("return",Promise.reject(i));case 7:return e.next=9,this._withStreamingModePromise({wifi:function(){return o.cloudClient.getInfo()},bluetooth:function(){return o.bluetoothClient.getInfo()}});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"onDeviceChange",value:function(){var e=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onDeviceChange"),2),t=e[0],r=e[1];return t?(0,w.throwError)((function(){return r})):this.cloudClient.onDeviceChange()}},{key:"disconnect",value:function(){return b(this,void 0,void 0,d().mark((function e(){var t=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withStreamingModePromise({wifi:function(){return t.cloudClient.disconnect()},bluetooth:function(){return t.bluetoothClient.disconnect()}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"dispatchAction",value:function(e){return b(this,void 0,void 0,d().mark((function t(){var r,n,i,o,a=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(A.mustSelectDevice));case 4:if(r=(0,D.validateOAuthScopeForAction)(this.cloudClient.userClaims,e),n=l(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this._withStreamingModePromise({wifi:function(){return a.cloudClient.dispatchAction(e)},bluetooth:function(){return a.bluetoothClient.dispatchAction(e)}});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"addMarker",value:function(e){return b(this,void 0,void 0,d().mark((function t(){var r=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}throw A.mustSelectDevice;case 4:if(e){t.next=6;break}throw new Error("".concat(A.prefix,"A label is required for addMarker"));case 6:return t.next=8,this._withStreamingModePromise({wifi:function(){return r.cloudClient.dispatchAction({command:"marker",action:"add",message:{label:e,timestamp:r.cloudClient.timestamp}})},bluetooth:function(){return r.bluetoothClient.addMarker(e)}});case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"haptics",value:function(e){var t;return b(this,void 0,void 0,d().mark((function r(){var n,i,o,a,s,u,l=this;return d().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n="haptics",r.next=3,this.cloudClient.didSelectDevice();case 3:if(r.sent){r.next=5;break}return r.abrupt("return",Promise.reject(A.mustSelectDevice));case 5:return r.next=7,this.getSelectedDevice();case 7:if(r.t1=t=r.sent,r.t0=null===r.t1,r.t0){r.next=11;break}r.t0=void 0===t;case 11:if(!r.t0){r.next=15;break}r.t2=void 0,r.next=16;break;case 15:r.t2=t.modelVersion;case 16:if(i=r.t2,P.supportsHaptics(i)){r.next=20;break}return r.abrupt("return",Promise.reject(A.metricNotSupportedByModel(n,i)));case 20:o=P.getPlatformHapticMotors(i),r.t3=d().keys(e);case 22:if((r.t4=r.t3()).done){r.next=33;break}if(a=r.t4.value,Object.keys(o).includes(a)){r.next=26;break}return r.abrupt("return",Promise.reject(A.locationNotFound(a,i)));case 26:if(!((s=e[a]).length>7)){r.next=30;break}return r.abrupt("return",Promise.reject(A.exceededMaxItems(7)));case 30:o[a]=s,r.next=22;break;case 33:return u={command:n,action:"queue",responseRequired:!0,responseTimeout:1e3,message:{effects:o}},r.next=36,this._withStreamingModePromise({wifi:function(){return l.cloudClient.dispatchAction(u)},bluetooth:function(){return l.bluetoothClient.dispatchAction(u)}});case 36:return r.abrupt("return",r.sent);case 37:case"end":return r.stop()}}),r,this)})))}},{key:"getHapticEffects",value:function(){return I}},{key:"accelerometer",value:function(){var e=this,t="accelerometer",r=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,w.throwError)((function(){return i})):this.onDeviceChange().pipe((0,S.switchMap)((function(r){var n=(null==r?void 0:r.modelVersion)||P.MODEL_VERSION_1;return P.supportsAccel(n)?e._withStreamingModeObservable({wifi:function(){return(0,U.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,j.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.accelerometer()}}):(0,w.throwError)((function(){return A.metricNotSupportedByModel(t,n)}))})))}},{key:"brainwaves",value:function(e){var t=this,r=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"brainwaves"),2),n=r[0],i=r[1];return n?(0,w.throwError)((function(){return i})):this._withStreamingModeObservable({wifi:function(){return(0,U.getCloudMetric)(t._getCloudMetricDependencies(),{metric:"brainwaves",labels:e?[e]:[],atomic:!1})},bluetooth:function(){return t.bluetoothClient.brainwaves(e)}})}},{key:"calm",value:function(){var e=this,t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"calm"),2),r=t[0],n=t[1];return r?(0,w.throwError)((function(){return n})):this._withStreamingModeObservable({wifi:function(){return(0,U.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["calm"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.calm()}})}},{key:"signalQuality",value:function(){var e=this,t="signalQuality",r=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,w.throwError)((function(){return i})):this._withStreamingModeObservable({wifi:function(){return(0,U.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,j.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.signalQuality()}})}},{key:"settings",value:function(){var e=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"settings"),2),t=e[0],r=e[1];return t?(0,w.throwError)((function(){return r})):this.cloudClient.observeNamespace("settings")}},{key:"osVersion",value:function(){var e=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"osVersion"),2),t=e[0],r=e[1];return t?(0,w.throwError)((function(){return r})):this.cloudClient.osVersion()}},{key:"focus",value:function(){var e=this,t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"focus"),2),r=t[0],n=t[1];return r?(0,w.throwError)((function(){return n})):this._withStreamingModeObservable({wifi:function(){return(0,U.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["focus"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.focus()}})}},{key:"kinesis",value:function(e){var t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"kinesis"),2),r=t[0],n=t[1];return r?(0,w.throwError)((function(){return n})):(0,U.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"kinesis",labels:e?[e]:[],atomic:!1})}},{key:"predictions",value:function(e){var t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"predictions"),2),r=t[0],n=t[1];return r?(0,w.throwError)((function(){return n})):(0,U.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"predictions",labels:e?[e]:[],atomic:!1})}},{key:"status",value:function(){var e=this,t=l((0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"status"),2),r=t[0],n=t[1];return r?(0,w.throwError)((function(){return n})):this._withStreamingModeObservable({wifi:function(){return e.cloudClient.status()},bluetooth:function(){return e.bluetoothClient.status()}})}},{key:"changeSettings",value:function(e){return b(this,void 0,void 0,d().mark((function t(){var r,n,i,o;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(A.mustSelectDevice));case 4:if(r=(0,R.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"changeSettings"),n=l(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this.cloudClient.changeSettings(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"training",get:function(){var e=this;return{record:function(t){return b(e,void 0,void 0,d().mark((function e(){var r,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw A.mustSelectDevice;case 4:return r=this.cloudClient.user&&"uid"in this.cloudClient.user?this.cloudClient.user.uid:null,n=Object.assign(Object.assign({fit:!1,baseline:!1,timestamp:this.cloudClient.timestamp},t),{userId:r}),e.next=8,this.cloudClient.actions.dispatch({command:"training",action:"record",message:n});case 8:case"end":return e.stop()}}),e,this)})))},stop:function(t){return b(e,void 0,void 0,d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw A.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stop",message:Object.assign({},t)});case 6:case"end":return e.stop()}}),e,this)})))},stopAll:function(){return b(e,void 0,void 0,d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw A.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stopAll",message:{}});case 6:case"end":return e.stop()}}),e,this)})))}}}},{key:"goOffline",value:function(){this.cloudClient.goOffline()}},{key:"goOnline",value:function(){this.cloudClient.goOnline()}},{key:"createAccount",value:function(e){return this.cloudClient.createAccount(e)}},{key:"deleteAccount",value:function(){return this.cloudClient.deleteAccount()}},{key:"createBluetoothToken",value:function(){return this.cloudClient.createBluetoothToken()}},{key:"createCustomToken",value:function(){return this.cloudClient.createCustomToken()}},{key:"getTimesyncOffset",value:function(){return this.options.timesync||console.warn("getTimesyncOffset() requires options.timesync to be true."),this.options.timesync?this.cloudClient.getTimesyncOffset():0}},{key:"createOAuthURL",value:function(e){return F.isNode?(0,L.createOAuthURL)(e,this.options):Promise.reject(new Error("".concat(A.prefix,"the createOAuthURL method must be used on the server side (node.js) for security reasons.")))}},{key:"getOAuthToken",value:function(e){return F.isNode?(0,N.getOAuthToken)(e,this.options):Promise.reject(new Error("".concat(A.prefix,"the getOAuthToken method must be used on the server side (node.js) for security reasons.")))}},{key:"removeOAuthAccess",value:function(){return this.cloudClient.removeOAuthAccess()}},{key:"onUserExperiments",value:function(){return this.cloudClient.onUserExperiments()}},{key:"deleteUserExperiment",value:function(e){return this.cloudClient.deleteUserExperiment(e)}}]),e}();r.Neurosity=G,G.credentialWithLink=k.credentialWithLink,G.createUser=M.createUser,G.SERVER_TIMESTAMP=k.SERVER_TIMESTAMP;var W=function(e){n(r,G);var t=o(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h(this,r),e=t.call(this,n),console.log("The Notion class is deprecated and will be removed in the next version of the SDK. Please use the Neurosity class instead. e.g. new Notion() => new Neurosity()"),e}return p(r)}();r.Notion=W;var H=e("./api/firebase");Object.defineProperty(r,"__firebase",{enumerable:!0,get:function(){return H.__firebase}})},{rxjs:"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","./api/index":"LXvB","./types/streaming":"rekm","./utils/subscription":"yLLB","./types/status":"Ttuy","./utils/errors":"WDyG","./utils/platform":"wAkn","./utils/hapticEffects":"lLai","./utils/oauth":"xIH5","./api/https/createOAuthURL":"MDrB","./api/https/getOAuthToken":"nfg4","./utils/is-node":"vsps","./utils/metrics":"DCuD","./api/bluetooth":"TICO","./api/bluetooth/types":"iwtf","./api/firebase":"kM30"}],QCba:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),i(e("./Neurosity"),r),i(e("./api/bluetooth"),r),i(e("./types/streaming"),r)},{"./Neurosity":"BZP9","./api/bluetooth":"TICO","./types/streaming":"rekm"}]},{},["QCba"])},4762:e=>{"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,a=[],s=0,u=0;t>2],i=(3&l)<<4,u=1;break;case 1:a[s++]=n[i|l>>4],i=(15&l)<<2,u=2;break;case 2:a[s++]=n[i|l>>6],a[s++]=n[63&l],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,s=0,u=0;u1)break;if(void 0===(l=i[l]))throw Error(a);switch(s){case 0:n=l,s=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,s=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,s=3;break;case 3:t[r++]=(3&n)<<6|l,s=0}}if(1===s)throw Error(a);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},1318:e=>{"use strict";function t(e,r){"string"===typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!==typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),u=new Array(a.length),l=0;l{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n{"use strict";e.exports=o;var n=r(4762),i=r(4882)("fs");function o(e,t,r){return"function"===typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!==typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i{"use strict";function t(e){return"undefined"!==typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,o)}(),"undefined"!==typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=n*Math.pow(2,-u))>>>0,i,o+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function a(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,u=a>>>20&2047,l=4294967296*(1048575&a)+o;return 2047===u?l?NaN:s*(1/0):0===u?5e-324*s*l:s*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4882:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},5534:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},6931:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},8626:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},122:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!==i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}},219:(t,r,n)=>{"use strict";var i=n(3763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function l(e){return i.isMemo(e)?s:u[e.$$typeof]||o}u[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[i.Memo]=s;var c=Object.defineProperty,d=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;t.exports=function t(r,n,i){if("string"!==typeof n){if(m){var o=p(n);o&&o!==m&&t(r,o,i)}var s=d(n);h&&(s=s.concat(h(n)));for(var u=l(r),y=l(n),g=0;g{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,_=r?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case d:case o:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case h:case y:case m:case u:return e;default:return t}}case i:return t}}}function x(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=u,t.Element=n,t.ForwardRef=h,t.Fragment=o,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===l},t.isContextProvider=function(e){return w(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===d||e===s||e===a||e===f||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===h||e.$$typeof===v||e.$$typeof===b||e.$$typeof===_||e.$$typeof===g)},t.typeOf=w},3763:(e,t,r)=>{"use strict";e.exports=r(4983)},3536:function(t,r,n){var i;t=n.nmd(t),function(){var o,a="Expected a function",s="__lodash_hash_undefined__",u="__lodash_placeholder__",l=16,c=32,d=64,h=128,f=256,p=1/0,m=9007199254740991,y=NaN,g=4294967295,v=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",f]],b="[object Arguments]",_="[object Array]",w="[object Boolean]",x="[object Date]",S="[object Error]",E="[object Function]",T="[object GeneratorFunction]",M="[object Map]",k="[object Number]",C="[object Object]",j="[object Promise]",O="[object RegExp]",A="[object Set]",P="[object String]",I="[object Symbol]",R="[object WeakMap]",D="[object ArrayBuffer]",L="[object DataView]",N="[object Float32Array]",F="[object Float64Array]",U="[object Int8Array]",B="[object Int16Array]",z="[object Int32Array]",V="[object Uint8Array]",G="[object Uint8ClampedArray]",W="[object Uint16Array]",H="[object Uint32Array]",q=/\b__p \+= '';/g,Y=/\b(__p \+=) '' \+/g,X=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,Q=RegExp(K.source),J=RegExp($.source),Z=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(oe.source),se=/^\s+/,ue=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,he=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Te="\\ud800-\\udfff",Me="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['\u2019]",Ie="["+Te+"]",Re="["+Ae+"]",De="["+Me+"]",Le="\\d+",Ne="["+ke+"]",Fe="["+Ce+"]",Ue="[^"+Te+Ae+Le+ke+Ce+je+"]",Be="\\ud83c[\\udffb-\\udfff]",ze="[^"+Te+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Ge="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+je+"]",He="\\u200d",qe="(?:"+Fe+"|"+Ue+")",Ye="(?:"+We+"|"+Ue+")",Xe="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ke="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+De+"|"+Be+")"+"?",Qe="["+Oe+"]?",Je=Qe+$e+("(?:"+He+"(?:"+[ze,Ve,Ge].join("|")+")"+Qe+$e+")*"),Ze="(?:"+[Ne,Ve,Ge].join("|")+")"+Je,et="(?:"+[ze+De+"?",De,Ve,Ge,Ie].join("|")+")",tt=RegExp(Pe,"g"),rt=RegExp(De,"g"),nt=RegExp(Be+"(?="+Be+")|"+et+Je,"g"),it=RegExp([We+"?"+Fe+"+"+Xe+"(?="+[Re,We,"$"].join("|")+")",Ye+"+"+Ke+"(?="+[Re,We+qe,"$"].join("|")+")",We+"?"+qe+"+"+Xe,We+"+"+Ke,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Ze].join("|"),"g"),ot=RegExp("["+He+Te+Me+Oe+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,st=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ut=-1,lt={};lt[N]=lt[F]=lt[U]=lt[B]=lt[z]=lt[V]=lt[G]=lt[W]=lt[H]=!0,lt[b]=lt[_]=lt[D]=lt[w]=lt[L]=lt[x]=lt[S]=lt[E]=lt[M]=lt[k]=lt[C]=lt[O]=lt[A]=lt[P]=lt[R]=!1;var ct={};ct[b]=ct[_]=ct[D]=ct[L]=ct[w]=ct[x]=ct[N]=ct[F]=ct[U]=ct[B]=ct[z]=ct[M]=ct[k]=ct[C]=ct[O]=ct[A]=ct[P]=ct[I]=ct[V]=ct[G]=ct[W]=ct[H]=!0,ct[S]=ct[E]=ct[R]=!1;var dt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ht=parseFloat,ft=parseInt,pt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,mt="object"==typeof self&&self&&self.Object===Object&&self,yt=pt||mt||Function("return this")(),gt=r&&!r.nodeType&&r,vt=gt&&t&&!t.nodeType&&t,bt=vt&&vt.exports===gt,_t=bt&&pt.process,wt=function(){try{var t=vt&&vt.require&&vt.require("util").types;return t||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),xt=wt&&wt.isArrayBuffer,St=wt&&wt.isDate,Et=wt&&wt.isMap,Tt=wt&&wt.isRegExp,Mt=wt&&wt.isSet,kt=wt&&wt.isTypedArray;function Ct(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function jt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Dt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function ir(e,t){for(var r=e.length;r--&&Wt(t,e[r],0)>-1;);return r}var or=Kt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),ar=Kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(e){return"\\"+dt[e]}function ur(e){return ot.test(e)}function lr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function dr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"});var vr=function t(r){var n=(r=null==r?yt:vr.defaults(yt.Object(),r,vr.pick(yt,st))).Array,i=r.Date,ue=r.Error,Te=r.Function,Me=r.Math,ke=r.Object,Ce=r.RegExp,je=r.String,Oe=r.TypeError,Ae=n.prototype,Pe=Te.prototype,Ie=ke.prototype,Re=r["__core-js_shared__"],De=Pe.toString,Le=Ie.hasOwnProperty,Ne=0,Fe=function(){var e=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ue=Ie.toString,Be=De.call(ke),ze=yt._,Ve=Ce("^"+De.call(Le).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=bt?r.Buffer:o,We=r.Symbol,He=r.Uint8Array,qe=Ge?Ge.allocUnsafe:o,Ye=cr(ke.getPrototypeOf,ke),Xe=ke.create,Ke=Ie.propertyIsEnumerable,$e=Ae.splice,Qe=We?We.isConcatSpreadable:o,Je=We?We.iterator:o,Ze=We?We.toStringTag:o,et=function(){try{var t=fo(ke,"defineProperty");return t({},"",{}),t}catch(e){}}(),nt=r.clearTimeout!==yt.clearTimeout&&r.clearTimeout,ot=i&&i.now!==yt.Date.now&&i.now,dt=r.setTimeout!==yt.setTimeout&&r.setTimeout,pt=Me.ceil,mt=Me.floor,gt=ke.getOwnPropertySymbols,vt=Ge?Ge.isBuffer:o,_t=r.isFinite,wt=Ae.join,zt=cr(ke.keys,ke),Kt=Me.max,br=Me.min,_r=i.now,wr=r.parseInt,xr=Me.random,Sr=Ae.reverse,Er=fo(r,"DataView"),Tr=fo(r,"Map"),Mr=fo(r,"Promise"),kr=fo(r,"Set"),Cr=fo(r,"WeakMap"),jr=fo(ke,"create"),Or=Cr&&new Cr,Ar={},Pr=Uo(Er),Ir=Uo(Tr),Rr=Uo(Mr),Dr=Uo(kr),Lr=Uo(Cr),Nr=We?We.prototype:o,Fr=Nr?Nr.valueOf:o,Ur=Nr?Nr.toString:o;function Br(e){if(rs(e)&&!Ha(e)&&!(e instanceof Wr)){if(e instanceof Gr)return e;if(Le.call(e,"__wrapped__"))return Bo(e)}return new Gr(e)}var zr=function(){function e(){}return function(t){if(!ts(t))return{};if(Xe)return Xe(t);e.prototype=t;var r=new e;return e.prototype=o,r}}();function Vr(){}function Gr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Wr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ln(e,t,r,n,i,a){var s,u=1&t,l=2&t,c=4&t;if(r&&(s=i?r(e,n,i,a):r(e)),s!==o)return s;if(!ts(e))return e;var d=Ha(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Le.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!u)return Oi(e,s)}else{var h=yo(e),f=h==E||h==T;if(Ka(e))return Ei(e,u);if(h==C||h==b||f&&!i){if(s=l||f?{}:vo(e),!u)return l?function(e,t){return Ai(e,mo(e),t)}(e,function(e,t){return e&&Ai(t,Is(t),e)}(s,e)):function(e,t){return Ai(e,po(e),t)}(e,on(s,e))}else{if(!ct[h])return i?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case D:return Ti(e);case w:case x:return new n(+e);case L:return function(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case N:case F:case U:case B:case z:case V:case G:case W:case H:return Mi(e,r);case M:return new n;case k:case P:return new n(e);case O:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case I:return i=e,Fr?ke(Fr.call(i)):{}}var i}(e,h,u)}}a||(a=new Kr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(n){s.add(ln(n,t,r,n,e,a))})):ns(e)&&e.forEach((function(n,i){s.set(i,ln(n,t,r,i,e,a))}));var m=d?o:(c?l?oo:io:l?Is:Ps)(e);return Ot(m||e,(function(n,i){m&&(n=e[i=n]),tn(s,i,ln(n,t,r,i,e,a))})),s}function cn(e,t,r){var n=r.length;if(null==e)return!n;for(e=ke(e);n--;){var i=r[n],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function dn(e,t,r){if("function"!=typeof e)throw new Oe(a);return Po((function(){e.apply(o,r)}),t)}function hn(e,t,r,n){var i=-1,o=Rt,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;r&&(t=Lt(t,er(r))),n?(o=Dt,a=!1):t.length>=200&&(o=rr,a=!1,t=new Xr(t));e:for(;++i-1},qr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(Tr||qr),string:new Hr}},Yr.prototype.delete=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},Yr.prototype.get=function(e){return co(this,e).get(e)},Yr.prototype.has=function(e){return co(this,e).has(e)},Yr.prototype.set=function(e,t){var r=co(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(e){return this.__data__.set(e,s),this},Xr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.clear=function(){this.__data__=new qr,this.size=0},Kr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Kr.prototype.get=function(e){return this.__data__.get(e)},Kr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!Tr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(e,t),this.size=r.size,this};var fn=Ri(wn),pn=Ri(xn,!0);function mn(e,t){var r=!0;return fn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function yn(e,t,r){for(var n=-1,i=e.length;++n0&&r(s)?t>1?vn(s,t-1,r,n,i):Nt(i,s):n||(i[i.length]=s)}return i}var bn=Di(),_n=Di(!0);function wn(e,t){return e&&bn(e,t,Ps)}function xn(e,t){return e&&_n(e,t,Ps)}function Sn(e,t){return It(t,(function(t){return Ja(e[t])}))}function En(e,t){for(var r=0,n=(t=_i(t,e)).length;null!=e&&rt}function Cn(e,t){return null!=e&&Le.call(e,t)}function jn(e,t){return null!=e&&t in ke(e)}function On(e,t,r){for(var i=r?Dt:Rt,a=e[0].length,s=e.length,u=s,l=n(s),c=1/0,d=[];u--;){var h=e[u];u&&t&&(h=Lt(h,er(t))),c=br(h.length,c),l[u]=!r&&(t||a>=120&&h.length>=120)?new Xr(u&&h):o}h=e[0];var f=-1,p=l[0];e:for(;++f=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function qn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&$e.call(s,u,1),$e.call(e,u,1);return e}function Xn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;_o(i)?$e.call(e,i,1):hi(e,i)}}return e}function Kn(e,t){return e+mt(xr()*(t-e+1))}function $n(e,t){var r="";if(!e||t<1||t>m)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function Qn(e,t){return Io(Co(e,t,iu),e+"")}function Jn(e){return Qr(zs(e))}function Zn(e,t){var r=zs(e);return Lo(r,un(t,0,r.length))}function ei(e,t,r,n){if(!ts(e))return e;for(var i=-1,a=(t=_i(t,e)).length,s=a-1,u=e;null!=u&&++io?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i>>1,a=e[o];null!==a&&!ls(a)&&(r?a<=t:a=200){var l=t?null:$i(e);if(l)return hr(l);a=!1,i=rr,u=new Xr}else u=t?[]:s;e:for(;++n=n?e:ii(e,t,r)}var Si=nt||function(e){return yt.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var r=e.length,n=qe?qe(r):new e.constructor(r);return e.copy(n),n}function Ti(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Mi(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var r=e!==o,n=null===e,i=e===e,a=ls(e),s=t!==o,u=null===t,l=t===t,c=ls(t);if(!u&&!c&&!a&&e>t||a&&s&&l&&!u&&!c||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!c&&e1?r[i-1]:o,s=i>2?r[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&wo(r[0],r[1],s)&&(a=i<3?o:a,i=1),t=ke(t);++n-1?i[a?t[s]:s]:o}}function Bi(e){return no((function(t){var r=t.length,n=r,i=Gr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Oe(a);if(i&&!u&&"wrapper"==so(s))var u=new Gr([],!0)}for(n=u?n:r;++n1&&_.reverse(),f&&cu))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&r?new Xr:o;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ot(v,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(n),r)))}function Do(e){var t=0,r=0;return function(){var n=_r(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Lo(e,t){var r=-1,n=e.length,i=n-1;for(t=t===o?n:t;++r1?e[t-1]:o;return r="function"==typeof r?(e.pop(),r):o,aa(e,r)}));function fa(e){var t=Br(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Wr&&_o(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:pa,args:[i],thisArg:o}),new Gr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var ya=Pi((function(e,t,r){Le.call(e,r)?++e[r]:an(e,r,1)}));var ga=Ui(Wo),va=Ui(Ho);function ba(e,t){return(Ha(e)?Ot:fn)(e,lo(t,3))}function _a(e,t){return(Ha(e)?At:pn)(e,lo(t,3))}var wa=Pi((function(e,t,r){Le.call(e,r)?e[r].push(t):an(e,r,[t])}));var xa=Qn((function(e,t,r){var i=-1,o="function"==typeof t,a=Ya(e)?n(e.length):[];return fn(e,(function(e){a[++i]=o?Ct(t,e,r):An(e,t,r)})),a})),Sa=Pi((function(e,t,r){an(e,r,t)}));function Ea(e,t){return(Ha(e)?Lt:Bn)(e,lo(t,3))}var Ta=Pi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ma=Qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&wo(e,t[0],t[1])?t=[]:r>2&&wo(t[0],t[1],t[2])&&(t=[t[0]]),Hn(e,vn(t,1),[])})),ka=ot||function(){return yt.Date.now()};function Ca(e,t,r){return t=r?o:t,t=e&&null==t?e.length:t,Ji(e,h,o,o,o,o,t)}function ja(e,t){var r;if("function"!=typeof t)throw new Oe(a);return e=ms(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=o),r}}var Oa=Qn((function(e,t,r){var n=1;if(r.length){var i=dr(r,uo(Oa));n|=c}return Ji(e,n,t,r,i)})),Aa=Qn((function(e,t,r){var n=3;if(r.length){var i=dr(r,uo(Aa));n|=c}return Ji(t,n,e,r,i)}));function Pa(e,t,r){var n,i,s,u,l,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Oe(a);function m(t){var r=n,a=i;return n=i=o,d=t,u=e.apply(a,r)}function y(e){var r=e-c;return c===o||r>=t||r<0||f&&e-d>=s}function g(){var e=ka();if(y(e))return v(e);l=Po(g,function(e){var r=t-(e-c);return f?br(r,s-(e-d)):r}(e))}function v(e){return l=o,p&&n?m(e):(n=i=o,u)}function b(){var e=ka(),r=y(e);if(n=arguments,i=this,c=e,r){if(l===o)return function(e){return d=e,l=Po(g,t),h?m(e):u}(c);if(f)return Si(l),l=Po(g,t),m(c)}return l===o&&(l=Po(g,t)),u}return t=gs(t)||0,ts(r)&&(h=!!r.leading,s=(f="maxWait"in r)?Kt(gs(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p),b.cancel=function(){l!==o&&Si(l),d=0,n=c=i=l=o},b.flush=function(){return l===o?u:v(ka())},b}var Ia=Qn((function(e,t){return dn(e,1,t)})),Ra=Qn((function(e,t,r){return dn(e,gs(t)||0,r)}));function Da(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Oe(a);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Da.Cache||Yr),r}function La(e){if("function"!=typeof e)throw new Oe(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Da.Cache=Yr;var Na=wi((function(e,t){var r=(t=1==t.length&&Ha(t[0])?Lt(t[0],er(lo())):Lt(vn(t,1),er(lo()))).length;return Qn((function(n){for(var i=-1,o=br(n.length,r);++i=t})),Wa=Pn(function(){return arguments}())?Pn:function(e){return rs(e)&&Le.call(e,"callee")&&!Ke.call(e,"callee")},Ha=n.isArray,qa=xt?er(xt):function(e){return rs(e)&&Mn(e)==D};function Ya(e){return null!=e&&es(e.length)&&!Ja(e)}function Xa(e){return rs(e)&&Ya(e)}var Ka=vt||gu,$a=St?er(St):function(e){return rs(e)&&Mn(e)==x};function Qa(e){if(!rs(e))return!1;var t=Mn(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Ja(e){if(!ts(e))return!1;var t=Mn(e);return t==E||t==T||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=m}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=Et?er(Et):function(e){return rs(e)&&yo(e)==M};function is(e){return"number"==typeof e||rs(e)&&Mn(e)==k}function os(e){if(!rs(e)||Mn(e)!=C)return!1;var t=Ye(e);if(null===t)return!0;var r=Le.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Be}var as=Tt?er(Tt):function(e){return rs(e)&&Mn(e)==O};var ss=Mt?er(Mt):function(e){return rs(e)&&yo(e)==A};function us(e){return"string"==typeof e||!Ha(e)&&rs(e)&&Mn(e)==P}function ls(e){return"symbol"==typeof e||rs(e)&&Mn(e)==I}var cs=kt?er(kt):function(e){return rs(e)&&es(e.length)&&!!lt[Mn(e)]};var ds=Yi(Un),hs=Yi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Ya(e))return us(e)?mr(e):Oi(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=yo(e);return(t==M?lr:t==A?hr:zs)(e)}function ps(e){return e?(e=gs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t===t?r?t-r:t:0}function ys(e){return e?un(ms(e),0,g):0}function gs(e){if("number"==typeof e)return e;if(ls(e))return y;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var r=ve.test(e);return r||_e.test(e)?ft(e.slice(2),r?2:8):ge.test(e)?y:+e}function vs(e){return Ai(e,Is(e))}function bs(e){return null==e?"":ci(e)}var _s=Ii((function(e,t){if(To(t)||Ya(t))Ai(t,Ps(t),e);else for(var r in t)Le.call(t,r)&&tn(e,r,t[r])})),ws=Ii((function(e,t){Ai(t,Is(t),e)})),xs=Ii((function(e,t,r,n){Ai(t,Is(t),e,n)})),Ss=Ii((function(e,t,r,n){Ai(t,Ps(t),e,n)})),Es=no(sn);var Ts=Qn((function(e,t){e=ke(e);var r=-1,n=t.length,i=n>2?t[2]:o;for(i&&wo(t[0],t[1],i)&&(n=1);++r1),t})),Ai(e,oo(e),r),n&&(r=ln(r,7,to));for(var i=t.length;i--;)hi(r,t[i]);return r}));var Ns=no((function(e,t){return null==e?{}:function(e,t){return qn(e,t,(function(t,r){return Cs(e,r)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var r=Lt(oo(e),(function(e){return[e]}));return t=lo(t),qn(e,r,(function(e,r){return t(e,r[0])}))}var Us=Qi(Ps),Bs=Qi(Is);function zs(e){return null==e?[]:tr(e,Ps(e))}var Vs=Ni((function(e,t,r){return t=t.toLowerCase(),e+(r?Gs(t):t)}));function Gs(e){return Qs(bs(e).toLowerCase())}function Ws(e){return(e=bs(e))&&e.replace(xe,or).replace(rt,"")}var Hs=Ni((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qs=Ni((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ys=Li("toLowerCase");var Xs=Ni((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ks=Ni((function(e,t,r){return e+(r?" ":"")+Qs(t)}));var $s=Ni((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Li("toUpperCase");function Js(e,t,r){return e=bs(e),(t=r?o:t)===o?function(e){return at.test(e)}(e)?function(e){return e.match(it)||[]}(e):function(e){return e.match(he)||[]}(e):e.match(t)||[]}var Zs=Qn((function(t,r){try{return Ct(t,o,r)}catch(e){return Qa(e)?e:new ue(e)}})),eu=no((function(e,t){return Ot(t,(function(t){t=Fo(t),an(e,t,Oa(e[t],e))})),e}));function tu(e){return function(){return e}}var ru=Bi(),nu=Bi(!0);function iu(e){return e}function ou(e){return Ln("function"==typeof e?e:ln(e,1))}var au=Qn((function(e,t){return function(r){return An(r,e,t)}})),su=Qn((function(e,t){return function(r){return An(e,r,t)}}));function uu(e,t,r){var n=Ps(t),i=Sn(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Sn(t,Ps(t)));var o=!(ts(r)&&"chain"in r)||!!r.chain,a=Ja(e);return Ot(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Oi(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Nt([this.value()],arguments))})})),e}function lu(){}var cu=Wi(Lt),du=Wi(Pt),hu=Wi(Bt);function fu(e){return xo(e)?Xt(Fo(e)):function(e){return function(t){return En(t,e)}}(e)}var pu=qi(),mu=qi(!0);function yu(){return[]}function gu(){return!1}var vu=Gi((function(e,t){return e+t}),0),bu=Ki("ceil"),_u=Gi((function(e,t){return e/t}),1),wu=Ki("floor");var xu=Gi((function(e,t){return e*t}),1),Su=Ki("round"),Eu=Gi((function(e,t){return e-t}),0);return Br.after=function(e,t){if("function"!=typeof t)throw new Oe(a);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Br.ary=Ca,Br.assign=_s,Br.assignIn=ws,Br.assignInWith=xs,Br.assignWith=Ss,Br.at=Es,Br.before=ja,Br.bind=Oa,Br.bindAll=eu,Br.bindKey=Aa,Br.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Br.chain=fa,Br.chunk=function(e,t,r){t=(r?wo(e,t,r):t===o)?1:Kt(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,u=n(pt(i/t));ai?0:i+r),(n=n===o||n>i?i:ms(n))<0&&(n+=i),n=r>n?0:ys(n);r>>0)?(e=bs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=ci(t))&&ur(e)?xi(mr(e),0,r):e.split(t,r):[]},Br.spread=function(e,t){if("function"!=typeof e)throw new Oe(a);return t=null==t?0:Kt(ms(t),0),Qn((function(r){var n=r[t],i=xi(r,0,t);return n&&Nt(i,n),Ct(e,this,i)}))},Br.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Br.take=function(e,t,r){return e&&e.length?ii(e,0,(t=r||t===o?1:ms(t))<0?0:t):[]},Br.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ii(e,(t=n-(t=r||t===o?1:ms(t)))<0?0:t,n):[]},Br.takeRightWhile=function(e,t){return e&&e.length?pi(e,lo(t,3),!1,!0):[]},Br.takeWhile=function(e,t){return e&&e.length?pi(e,lo(t,3)):[]},Br.tap=function(e,t){return t(e),e},Br.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Oe(a);return ts(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Pa(e,t,{leading:n,maxWait:t,trailing:i})},Br.thru=pa,Br.toArray=fs,Br.toPairs=Us,Br.toPairsIn=Bs,Br.toPath=function(e){return Ha(e)?Lt(e,Fo):ls(e)?[e]:Oi(No(bs(e)))},Br.toPlainObject=vs,Br.transform=function(e,t,r){var n=Ha(e),i=n||Ka(e)||cs(e);if(t=lo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Ja(o)?zr(Ye(e)):{}}return(i?Ot:wn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Br.unary=function(e){return Ca(e,1)},Br.union=ra,Br.unionBy=na,Br.unionWith=ia,Br.uniq=function(e){return e&&e.length?di(e):[]},Br.uniqBy=function(e,t){return e&&e.length?di(e,lo(t,2)):[]},Br.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?di(e,o,t):[]},Br.unset=function(e,t){return null==e||hi(e,t)},Br.unzip=oa,Br.unzipWith=aa,Br.update=function(e,t,r){return null==e?e:fi(e,t,bi(r))},Br.updateWith=function(e,t,r,n){return n="function"==typeof n?n:o,null==e?e:fi(e,t,bi(r),n)},Br.values=zs,Br.valuesIn=function(e){return null==e?[]:tr(e,Is(e))},Br.without=sa,Br.words=Js,Br.wrap=function(e,t){return Fa(bi(t),e)},Br.xor=ua,Br.xorBy=la,Br.xorWith=ca,Br.zip=da,Br.zipObject=function(e,t){return gi(e||[],t||[],tn)},Br.zipObjectDeep=function(e,t){return gi(e||[],t||[],ei)},Br.zipWith=ha,Br.entries=Us,Br.entriesIn=Bs,Br.extend=ws,Br.extendWith=xs,uu(Br,Br),Br.add=vu,Br.attempt=Zs,Br.camelCase=Vs,Br.capitalize=Gs,Br.ceil=bu,Br.clamp=function(e,t,r){return r===o&&(r=t,t=o),r!==o&&(r=(r=gs(r))===r?r:0),t!==o&&(t=(t=gs(t))===t?t:0),un(gs(e),t,r)},Br.clone=function(e){return ln(e,4)},Br.cloneDeep=function(e){return ln(e,5)},Br.cloneDeepWith=function(e,t){return ln(e,5,t="function"==typeof t?t:o)},Br.cloneWith=function(e,t){return ln(e,4,t="function"==typeof t?t:o)},Br.conformsTo=function(e,t){return null==t||cn(e,t,Ps(t))},Br.deburr=Ws,Br.defaultTo=function(e,t){return null==e||e!==e?t:e},Br.divide=_u,Br.endsWith=function(e,t,r){e=bs(e),t=ci(t);var n=e.length,i=r=r===o?n:un(ms(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},Br.eq=za,Br.escape=function(e){return(e=bs(e))&&J.test(e)?e.replace($,ar):e},Br.escapeRegExp=function(e){return(e=bs(e))&&ae.test(e)?e.replace(oe,"\\$&"):e},Br.every=function(e,t,r){var n=Ha(e)?Pt:mn;return r&&wo(e,t,r)&&(t=o),n(e,lo(t,3))},Br.find=ga,Br.findIndex=Wo,Br.findKey=function(e,t){return Vt(e,lo(t,3),wn)},Br.findLast=va,Br.findLastIndex=Ho,Br.findLastKey=function(e,t){return Vt(e,lo(t,3),xn)},Br.floor=wu,Br.forEach=ba,Br.forEachRight=_a,Br.forIn=function(e,t){return null==e?e:bn(e,lo(t,3),Is)},Br.forInRight=function(e,t){return null==e?e:_n(e,lo(t,3),Is)},Br.forOwn=function(e,t){return e&&wn(e,lo(t,3))},Br.forOwnRight=function(e,t){return e&&xn(e,lo(t,3))},Br.get=ks,Br.gt=Va,Br.gte=Ga,Br.has=function(e,t){return null!=e&&go(e,t,Cn)},Br.hasIn=Cs,Br.head=Yo,Br.identity=iu,Br.includes=function(e,t,r,n){e=Ya(e)?e:zs(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=Kt(i+r,0)),us(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Wt(e,t,r)>-1},Br.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=Kt(n+i,0)),Wt(e,t,i)},Br.inRange=function(e,t,r){return t=ps(t),r===o?(r=t,t=0):r=ps(r),function(e,t,r){return e>=br(t,r)&&e=-9007199254740991&&e<=m},Br.isSet=ss,Br.isString=us,Br.isSymbol=ls,Br.isTypedArray=cs,Br.isUndefined=function(e){return e===o},Br.isWeakMap=function(e){return rs(e)&&yo(e)==R},Br.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==Mn(e)},Br.join=function(e,t){return null==e?"":wt.call(e,t)},Br.kebabCase=Hs,Br.last=Qo,Br.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return r!==o&&(i=(i=ms(r))<0?Kt(n+i,0):br(i,n-1)),t===t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):Gt(e,qt,i,!0)},Br.lowerCase=qs,Br.lowerFirst=Ys,Br.lt=ds,Br.lte=hs,Br.max=function(e){return e&&e.length?yn(e,iu,kn):o},Br.maxBy=function(e,t){return e&&e.length?yn(e,lo(t,2),kn):o},Br.mean=function(e){return Yt(e,iu)},Br.meanBy=function(e,t){return Yt(e,lo(t,2))},Br.min=function(e){return e&&e.length?yn(e,iu,Un):o},Br.minBy=function(e,t){return e&&e.length?yn(e,lo(t,2),Un):o},Br.stubArray=yu,Br.stubFalse=gu,Br.stubObject=function(){return{}},Br.stubString=function(){return""},Br.stubTrue=function(){return!0},Br.multiply=xu,Br.nth=function(e,t){return e&&e.length?Wn(e,ms(t)):o},Br.noConflict=function(){return yt._===this&&(yt._=ze),this},Br.noop=lu,Br.now=ka,Br.pad=function(e,t,r){e=bs(e);var n=(t=ms(t))?pr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Hi(mt(i),r)+e+Hi(pt(i),r)},Br.padEnd=function(e,t,r){e=bs(e);var n=(t=ms(t))?pr(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var i=xr();return br(e+i*(t-e+ht("1e-"+((i+"").length-1))),t)}return Kn(e,t)},Br.reduce=function(e,t,r){var n=Ha(e)?Ft:$t,i=arguments.length<3;return n(e,lo(t,4),r,i,fn)},Br.reduceRight=function(e,t,r){var n=Ha(e)?Ut:$t,i=arguments.length<3;return n(e,lo(t,4),r,i,pn)},Br.repeat=function(e,t,r){return t=(r?wo(e,t,r):t===o)?1:ms(t),$n(bs(e),t)},Br.replace=function(){var e=arguments,t=bs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Br.result=function(e,t,r){var n=-1,i=(t=_i(t,e)).length;for(i||(i=1,e=o);++nm)return[];var r=g,n=br(e,g);t=lo(t),e-=g;for(var i=Jt(n,t);++r=a)return e;var u=r-pr(n);if(u<1)return n;var l=s?xi(s,0,u).join(""):e.slice(0,u);if(i===o)return l+n;if(s&&(u+=l.length-u),as(i)){if(e.slice(u).search(i)){var c,d=l;for(i.global||(i=Ce(i.source,bs(ye.exec(i))+"g")),i.lastIndex=0;c=i.exec(d);)var h=c.index;l=l.slice(0,h===o?u:h)}}else if(e.indexOf(ci(i),u)!=u){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+n},Br.unescape=function(e){return(e=bs(e))&&Q.test(e)?e.replace(K,gr):e},Br.uniqueId=function(e){var t=++Ne;return bs(e)+t},Br.upperCase=$s,Br.upperFirst=Qs,Br.each=ba,Br.eachRight=_a,Br.first=Yo,uu(Br,function(){var e={};return wn(Br,(function(t,r){Le.call(Br.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),Br.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Br[e].placeholder=Br})),Ot(["drop","take"],(function(e,t){Wr.prototype[e]=function(r){r=r===o?1:Kt(ms(r),0);var n=this.__filtered__&&!t?new Wr(this):this.clone();return n.__filtered__?n.__takeCount__=br(r,n.__takeCount__):n.__views__.push({size:br(r,g),type:e+(n.__dir__<0?"Right":"")}),n},Wr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Wr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Wr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Wr.prototype[e]=function(){return this.__filtered__?new Wr(this):this[r](1)}})),Wr.prototype.compact=function(){return this.filter(iu)},Wr.prototype.find=function(e){return this.filter(e).head()},Wr.prototype.findLast=function(e){return this.reverse().find(e)},Wr.prototype.invokeMap=Qn((function(e,t){return"function"==typeof e?new Wr(this):this.map((function(r){return An(r,e,t)}))})),Wr.prototype.reject=function(e){return this.filter(La(lo(e)))},Wr.prototype.slice=function(e,t){e=ms(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Wr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==o&&(r=(t=ms(t))<0?r.dropRight(-t):r.take(t-e)),r)},Wr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wr.prototype.toArray=function(){return this.take(g)},wn(Wr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Br[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);i&&(Br.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,u=t instanceof Wr,l=s[0],c=u||Ha(t),d=function(e){var t=i.apply(Br,Nt([e],s));return n&&h?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,m=u&&!f;if(!a&&c){t=m?t:new Wr(this);var y=e.apply(t,s);return y.__actions__.push({func:pa,args:[d],thisArg:o}),new Gr(y,h)}return p&&m?e.apply(this,s):(y=this.thru(d),p?n?y.value()[0]:y.value():y)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Br.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[r]((function(r){return t.apply(Ha(r)?r:[],e)}))}})),wn(Wr.prototype,(function(e,t){var r=Br[t];if(r){var n=r.name+"";Le.call(Ar,n)||(Ar[n]=[]),Ar[n].push({name:t,func:r})}})),Ar[zi(o,2).name]=[{name:"wrapper",func:o}],Wr.prototype.clone=function(){var e=new Wr(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Wr.prototype.reverse=function(){if(this.__filtered__){var e=new Wr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ha(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Br.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var n=Bo(r);n.__index__=0,n.__values__=o,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},Br.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wr){var t=e;return this.__actions__.length&&(t=new Wr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:o}),new Gr(t,this.__chain__)}return this.thru(ta)},Br.prototype.toJSON=Br.prototype.valueOf=Br.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Br.prototype.first=Br.prototype.head,Je&&(Br.prototype[Je]=function(){return this}),Br}();yt._=vr,(i=function(){return vr}.call(r,n,r,t))===o||(t.exports=i)}.call(this)},6178:function(t,r,n){(t=n.nmd(t)).exports=function(){"use strict";var r,n;function i(){return r.apply(null,arguments)}function o(e){r=e}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(u(e,t))return!1;return!0}function c(e){return void 0===e}function d(e){return"number"===typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var r,n=[],i=e.length;for(r=0;r>>0;for(t=0;t0)for(r=0;r=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,U={},B={};function z(e,t,r,n){var i=n;"string"===typeof n&&(i=function(){return this[n]()}),e&&(B[e]=i),t&&(B[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),r&&(B[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function G(e){var t,r,n=e.match(N);for(t=0,r=n.length;t=0&&F.test(e);)e=e.replace(F,n),F.lastIndex=0,r-=1;return e}var q={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Y(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(N).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var X="Invalid date";function K(){return this._invalidDate}var $="%d",Q=/\d{1,2}/;function J(e){return this._ordinal.replace("%d",e)}var Z={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,r,n){var i=this._relativeTime[r];return O(i)?i(e,t,r,n):i.replace(/%d/i,e)}function te(e,t){var r=this._relativeTime[e>0?"future":"past"];return O(r)?r(t):r.replace(/%s/i,t)}var re={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"===typeof e?re[e]||re[e.toLowerCase()]:void 0}function ie(e){var t,r,n={};for(r in e)u(e,r)&&(t=ne(r))&&(n[t]=e[r]);return n}var oe={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ae(e){var t,r=[];for(t in e)u(e,t)&&r.push({unit:t,priority:oe[t]});return r.sort((function(e,t){return e.priority-t.priority})),r}var se,ue=/\d/,le=/\d\d/,ce=/\d{3}/,de=/\d{4}/,he=/[+-]?\d{6}/,fe=/\d\d?/,pe=/\d\d\d\d?/,me=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,ve=/[+-]?\d{1,6}/,be=/\d+/,_e=/[+-]?\d+/,we=/Z|[+-]\d\d:?\d\d/gi,xe=/Z|[+-]\d\d(?::?\d\d)?/gi,Se=/[+-]?\d+(\.\d{1,3})?/,Ee=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Te=/^[1-9]\d?/,Me=/^([1-9]\d|\d)/;function ke(e,t,r){se[e]=O(t)?t:function(e,n){return e&&r?r:t}}function Ce(e,t){return u(se,e)?se[e](t._strict,t._locale):new RegExp(je(e))}function je(e){return Oe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,i){return t||r||n||i})))}function Oe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ae(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Pe(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=Ae(t)),r}se={};var Ie={};function Re(e,t){var r,n,i=t;for("string"===typeof e&&(e=[e]),d(t)&&(i=function(e,r){r[t]=Pe(e)}),n=e.length,r=0;r68?1900:2e3)};var Xe,Ke=Qe("FullYear",!0);function $e(){return Ne(this.year())}function Qe(e,t){return function(r){return null!=r?(Ze(this,e,r),i.updateOffset(this,t),this):Je(this,e)}}function Je(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Ze(e,t,r){var n,i,o,a,s;if(e.isValid()&&!isNaN(r)){switch(n=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,a=e.month(),s=29!==(s=e.date())||1!==a||Ne(o)?s:28,i?n.setUTCFullYear(o,a,s):n.setFullYear(o,a,s)}}function et(e){return O(this[e=ne(e)])?this[e]():this}function tt(e,t){if("object"===typeof e){var r,n=ae(e=ie(e)),i=n.length;for(r=0;r=0?(s=new Date(e+400,t,r,n,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,r,n,i,o,a),s}function _t(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,r){var n=7+t-r;return-(7+_t(e,0,n).getUTCDay()-t)%7+n-1}function xt(e,t,r,n,i){var o,a,s=1+7*(t-1)+(7+r-n)%7+wt(e,n,i);return s<=0?a=Ye(o=e-1)+s:s>Ye(e)?(o=e+1,a=s-Ye(e)):(o=e,a=s),{year:o,dayOfYear:a}}function St(e,t,r){var n,i,o=wt(e.year(),t,r),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?n=a+Et(i=e.year()-1,t,r):a>Et(e.year(),t,r)?(n=a-Et(e.year(),t,r),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function Et(e,t,r){var n=wt(e,t,r),i=wt(e+1,t,r);return(Ye(e)-n+i)/7}function Tt(e){return St(e,this._week.dow,this._week.doy).week}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),ke("w",fe,Te),ke("ww",fe,le),ke("W",fe,Te),ke("WW",fe,le),De(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=Pe(e)}));var Mt={dow:0,doy:6};function kt(){return this._week.dow}function Ct(){return this._week.doy}function jt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Ot(e){var t=St(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function At(e,t){return"string"!==typeof e?e:isNaN(e)?"number"===typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Pt(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function It(e,t){return e.slice(t,7).concat(e.slice(0,t))}z("d",0,"do","day"),z("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),z("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),z("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),ke("d",fe),ke("e",fe),ke("E",fe),ke("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ke("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ke("dddd",(function(e,t){return t.weekdaysRegex(e)})),De(["dd","ddd","dddd"],(function(e,t,r,n){var i=r._locale.weekdaysParse(e,n,r._strict);null!=i?t.d=i:g(r).invalidWeekday=e})),De(["d","e","E"],(function(e,t,r,n){t[n]=Pe(e)}));var Rt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Dt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Nt=Ee,Ft=Ee,Ut=Ee;function Bt(e,t){var r=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?It(r,this._week.dow):e?r[e.day()]:r}function zt(e){return!0===e?It(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Vt(e){return!0===e?It(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Gt(e,t,r){var n,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=m([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(i=Xe.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Xe.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Xe.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Xe.call(this._weekdaysParse,a))||-1!==(i=Xe.call(this._shortWeekdaysParse,a))||-1!==(i=Xe.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Xe.call(this._shortWeekdaysParse,a))||-1!==(i=Xe.call(this._weekdaysParse,a))||-1!==(i=Xe.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Xe.call(this._minWeekdaysParse,a))||-1!==(i=Xe.call(this._weekdaysParse,a))||-1!==(i=Xe.call(this._shortWeekdaysParse,a))?i:null}function Wt(e,t,r){var n,i,o;if(this._weekdaysParseExact)return Gt.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=m([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=Je(this,"Day");return null!=e?(e=At(e,this.localeData()),this.add(e-t,"d")):t}function qt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Yt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Xt(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Nt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Kt(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function $t(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qt(){function e(e,t){return t.length-e.length}var t,r,n,i,o,a=[],s=[],u=[],l=[];for(t=0;t<7;t++)r=m([2e3,1]).day(t),n=Oe(this.weekdaysMin(r,"")),i=Oe(this.weekdaysShort(r,"")),o=Oe(this.weekdays(r,"")),a.push(n),s.push(i),u.push(o),l.push(n),l.push(i),l.push(o);a.sort(e),s.sort(e),u.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Jt(){return this.hours()%12||12}function Zt(){return this.hours()||24}function er(e,t){z(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function tr(e,t){return t._meridiemParse}function rr(e){return"p"===(e+"").toLowerCase().charAt(0)}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Jt),z("k",["kk",2],0,Zt),z("hmm",0,0,(function(){return""+Jt.apply(this)+L(this.minutes(),2)})),z("hmmss",0,0,(function(){return""+Jt.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),z("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),z("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),er("a",!0),er("A",!1),ke("a",tr),ke("A",tr),ke("H",fe,Me),ke("h",fe,Te),ke("k",fe,Te),ke("HH",fe,le),ke("hh",fe,le),ke("kk",fe,le),ke("hmm",pe),ke("hmmss",me),ke("Hmm",pe),ke("Hmmss",me),Re(["H","HH"],ze),Re(["k","kk"],(function(e,t,r){var n=Pe(e);t[ze]=24===n?0:n})),Re(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),Re(["h","hh"],(function(e,t,r){t[ze]=Pe(e),g(r).bigHour=!0})),Re("hmm",(function(e,t,r){var n=e.length-2;t[ze]=Pe(e.substr(0,n)),t[Ve]=Pe(e.substr(n)),g(r).bigHour=!0})),Re("hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[ze]=Pe(e.substr(0,n)),t[Ve]=Pe(e.substr(n,2)),t[Ge]=Pe(e.substr(i)),g(r).bigHour=!0})),Re("Hmm",(function(e,t,r){var n=e.length-2;t[ze]=Pe(e.substr(0,n)),t[Ve]=Pe(e.substr(n))})),Re("Hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[ze]=Pe(e.substr(0,n)),t[Ve]=Pe(e.substr(n,2)),t[Ge]=Pe(e.substr(i))}));var nr=/[ap]\.?m?\.?/i,ir=Qe("Hours",!0);function or(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var ar,sr={calendar:R,longDateFormat:q,invalidDate:X,ordinal:$,dayOfMonthOrdinalParse:Q,relativeTime:Z,months:it,monthsShort:ot,week:Mt,weekdays:Rt,weekdaysMin:Lt,weekdaysShort:Dt,meridiemParse:nr},ur={},lr={};function cr(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(n=pr(i.slice(0,t).join("-")))return n;if(r&&r.length>=t&&cr(i,r)>=t-1)break;t--}o++}return ar}function fr(e){return!(!e||!e.match("^[^/\\\\]*$"))}function pr(r){var n=null;if(void 0===ur[r]&&t&&t.exports&&fr(r))try{n=ar._abbr,Object(function(){var e=new Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}()),mr(n)}catch(e){ur[r]=null}return ur[r]}function mr(e,t){var r;return e&&((r=c(t)?vr(e):yr(e,t))?ar=r:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ar._abbr}function yr(e,t){if(null!==t){var r,n=sr;if(t.abbr=e,null!=ur[e])j("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ur[e]._config;else if(null!=t.parentLocale)if(null!=ur[t.parentLocale])n=ur[t.parentLocale]._config;else{if(null==(r=pr(t.parentLocale)))return lr[t.parentLocale]||(lr[t.parentLocale]=[]),lr[t.parentLocale].push({name:e,config:t}),null;n=r._config}return ur[e]=new I(P(n,t)),lr[e]&&lr[e].forEach((function(e){yr(e.name,e.config)})),mr(e),ur[e]}return delete ur[e],null}function gr(e,t){if(null!=t){var r,n,i=sr;null!=ur[e]&&null!=ur[e].parentLocale?ur[e].set(P(ur[e]._config,t)):(null!=(n=pr(e))&&(i=n._config),t=P(i,t),null==n&&(t.abbr=e),(r=new I(t)).parentLocale=ur[e],ur[e]=r),mr(e)}else null!=ur[e]&&(null!=ur[e].parentLocale?(ur[e]=ur[e].parentLocale,e===mr()&&mr(e)):null!=ur[e]&&delete ur[e]);return ur[e]}function vr(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ar;if(!a(e)){if(t=pr(e))return t;e=[e]}return hr(e)}function br(){return k(ur)}function _r(e){var t,r=e._a;return r&&-2===g(e).overflow&&(t=r[Ue]<0||r[Ue]>11?Ue:r[Be]<1||r[Be]>nt(r[Fe],r[Ue])?Be:r[ze]<0||r[ze]>24||24===r[ze]&&(0!==r[Ve]||0!==r[Ge]||0!==r[We])?ze:r[Ve]<0||r[Ve]>59?Ve:r[Ge]<0||r[Ge]>59?Ge:r[We]<0||r[We]>999?We:-1,g(e)._overflowDayOfYear&&(tBe)&&(t=Be),g(e)._overflowWeeks&&-1===t&&(t=He),g(e)._overflowWeekday&&-1===t&&(t=qe),g(e).overflow=t),e}var wr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sr=/Z|[+-]\d\d(?::?\d\d)?/,Er=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Tr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mr=/^\/?Date\((-?\d+)/i,kr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Cr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function jr(e){var t,r,n,i,o,a,s=e._i,u=wr.exec(s)||xr.exec(s),l=Er.length,c=Tr.length;if(u){for(g(e).iso=!0,t=0,r=l;tYe(o)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),r=_t(o,0,e._dayOfYear),e._a[Ue]=r.getUTCMonth(),e._a[Be]=r.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=n[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ze]&&0===e._a[Ve]&&0===e._a[Ge]&&0===e._a[We]&&(e._nextDay=!0,e._a[ze]=0),e._d=(e._useUTC?_t:bt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ze]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}function Br(e){var t,r,n,i,o,a,s,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,a=4,r=Nr(t.GG,e._a[Fe],St(Kr(),1,4).year),n=Nr(t.W,1),((i=Nr(t.E,1))<1||i>7)&&(u=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,l=St(Kr(),o,a),r=Nr(t.gg,e._a[Fe],l.year),n=Nr(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(u=!0)):i=o),n<1||n>Et(r,o,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(s=xt(r,n,i,o,a),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}function zr(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],g(e).empty=!0;var t,r,n,o,a,s,u,l=""+e._i,c=l.length,d=0;for(u=(n=H(e._f,e._locale).match(N)||[]).length,t=0;t0&&g(e).unusedInput.push(a),l=l.slice(l.indexOf(r)+r.length),d+=r.length),B[o]?(r?g(e).empty=!1:g(e).unusedTokens.push(o),Le(o,r,e)):e._strict&&!r&&g(e).unusedTokens.push(o);g(e).charsLeftOver=c-d,l.length>0&&g(e).unusedInput.push(l),e._a[ze]<=12&&!0===g(e).bigHour&&e._a[ze]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ze]=Vr(e._locale,e._a[ze],e._meridiem),null!==(s=g(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(s,e._a[Fe])),Ur(e),_r(e)}else Dr(e);else jr(e)}function Vr(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Gr(e){var t,r,n,i,o,a,s=!1,u=e._f.length;if(0===u)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:b()}));function Jr(e,t){var r,n;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Kr();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Sn(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return x(t,this),(t=qr(t))._a?(e=t._isUTC?m(t._a):Kr(t._a),this._isDSTShifted=this.isValid()&&cn(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function En(){return!!this.isValid()&&!this._isUTC}function Tn(){return!!this.isValid()&&this._isUTC}function Mn(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var kn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Cn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jn(e,t){var r,n,i,o=e,a=null;return un(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(a=kn.exec(e))?(r="-"===a[1]?-1:1,o={y:0,d:Pe(a[Be])*r,h:Pe(a[ze])*r,m:Pe(a[Ve])*r,s:Pe(a[Ge])*r,ms:Pe(ln(1e3*a[We]))*r}):(a=Cn.exec(e))?(r="-"===a[1]?-1:1,o={y:On(a[2],r),M:On(a[3],r),w:On(a[4],r),d:On(a[5],r),h:On(a[6],r),m:On(a[7],r),s:On(a[8],r)}):null==o?o={}:"object"===typeof o&&("from"in o||"to"in o)&&(i=Pn(Kr(o.from),Kr(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),n=new sn(o),un(e)&&u(e,"_locale")&&(n._locale=e._locale),un(e)&&u(e,"_isValid")&&(n._isValid=e._isValid),n}function On(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function An(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function Pn(e,t){var r;return e.isValid()&&t.isValid()?(t=pn(t,e),e.isBefore(t)?r=An(e,t):((r=An(t,e)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function In(e,t){return function(r,n){var i;return null===n||isNaN(+n)||(j(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),Rn(this,jn(r,n),e),this}}function Rn(e,t,r,n){var o=t._milliseconds,a=ln(t._days),s=ln(t._months);e.isValid()&&(n=null==n||n,s&&ft(e,Je(e,"Month")+s*r),a&&Ze(e,"Date",Je(e,"Date")+a*r),o&&e._d.setTime(e._d.valueOf()+o*r),n&&i.updateOffset(e,a||s))}jn.fn=sn.prototype,jn.invalid=an;var Dn=In(1,"add"),Ln=In(-1,"subtract");function Nn(e){return"string"===typeof e||e instanceof String}function Fn(e){return E(e)||h(e)||Nn(e)||d(e)||Bn(e)||Un(e)||null===e||void 0===e}function Un(e){var t,r,n=s(e)&&!l(e),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=o.length;for(t=0;tr.valueOf():r.valueOf()9999?W(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",W(r,"Z")):W(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=o+'[")]',this.format(e+t+r+n)}function ri(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(E(e)&&e.isValid()||Kr(e).isValid())?jn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.from(Kr(),e)}function oi(e,t){return this.isValid()&&(E(e)&&e.isValid()||Kr(e).isValid())?jn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ai(e){return this.to(Kr(),e)}function si(e){var t;return void 0===e?this._locale._abbr:(null!=(t=vr(e))&&(this._locale=t),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ui=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function li(){return this._locale}var ci=1e3,di=60*ci,hi=60*di,fi=3506328*hi;function pi(e,t){return(e%t+t)%t}function mi(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-fi:new Date(e,t,r).valueOf()}function yi(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-fi:Date.UTC(e,t,r)}function gi(e){var t,r;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?yi:mi,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=pi(t+(this._isUTC?0:this.utcOffset()*di),hi);break;case"minute":t=this._d.valueOf(),t-=pi(t,di);break;case"second":t=this._d.valueOf(),t-=pi(t,ci)}return this._d.setTime(t),i.updateOffset(this,!0),this}function vi(e){var t,r;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?yi:mi,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=hi-pi(t+(this._isUTC?0:this.utcOffset()*di),hi)-1;break;case"minute":t=this._d.valueOf(),t+=di-pi(t,di)-1;break;case"second":t=this._d.valueOf(),t+=ci-pi(t,ci)-1}return this._d.setTime(t),i.updateOffset(this,!0),this}function bi(){return this._d.valueOf()-6e4*(this._offset||0)}function _i(){return Math.floor(this.valueOf()/1e3)}function wi(){return new Date(this.valueOf())}function xi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Si(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ei(){return this.isValid()?this.toISOString():null}function Ti(){return v(this)}function Mi(){return p({},g(this))}function ki(){return g(this).overflow}function Ci(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function ji(e,t){var r,n,o,a=this._eras||vr("en")._eras;for(r=0,n=a.length;r=0)return u[n]}function Ai(e,t){var r=e.since<=e.until?1:-1;return void 0===t?i(e.since).year():i(e.since).year()+(t-e.offset)*r}function Pi(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e(o=Et(e,n,i))&&(t=o),Ji.call(this,e,t,r,n,i))}function Ji(e,t,r,n,i){var o=xt(e,t,r,n,i),a=_t(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Zi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}z("N",0,0,"eraAbbr"),z("NN",0,0,"eraAbbr"),z("NNN",0,0,"eraAbbr"),z("NNNN",0,0,"eraName"),z("NNNNN",0,0,"eraNarrow"),z("y",["y",1],"yo","eraYear"),z("y",["yy",2],0,"eraYear"),z("y",["yyy",3],0,"eraYear"),z("y",["yyyy",4],0,"eraYear"),ke("N",Ui),ke("NN",Ui),ke("NNN",Ui),ke("NNNN",Bi),ke("NNNNN",zi),Re(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,r,n){var i=r._locale.erasParse(e,n,r._strict);i?g(r).era=i:g(r).invalidEra=e})),ke("y",be),ke("yy",be),ke("yyy",be),ke("yyyy",be),ke("yo",Vi),Re(["y","yy","yyy","yyyy"],Fe),Re(["yo"],(function(e,t,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[Fe]=r._locale.eraYearOrdinalParse(e,i):t[Fe]=parseInt(e,10)})),z(0,["gg",2],0,(function(){return this.weekYear()%100})),z(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Wi("gggg","weekYear"),Wi("ggggg","weekYear"),Wi("GGGG","isoWeekYear"),Wi("GGGGG","isoWeekYear"),ke("G",_e),ke("g",_e),ke("GG",fe,le),ke("gg",fe,le),ke("GGGG",ge,de),ke("gggg",ge,de),ke("GGGGG",ve,he),ke("ggggg",ve,he),De(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=Pe(e)})),De(["gg","GG"],(function(e,t,r,n){t[n]=i.parseTwoDigitYear(e)})),z("Q",0,"Qo","quarter"),ke("Q",ue),Re("Q",(function(e,t){t[Ue]=3*(Pe(e)-1)})),z("D",["DD",2],"Do","date"),ke("D",fe,Te),ke("DD",fe,le),ke("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Re(["D","DD"],Be),Re("Do",(function(e,t){t[Be]=Pe(e.match(fe)[0])}));var eo=Qe("Date",!0);function to(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}z("DDD",["DDDD",3],"DDDo","dayOfYear"),ke("DDD",ye),ke("DDDD",ce),Re(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=Pe(e)})),z("m",["mm",2],0,"minute"),ke("m",fe,Me),ke("mm",fe,le),Re(["m","mm"],Ve);var ro=Qe("Minutes",!1);z("s",["ss",2],0,"second"),ke("s",fe,Me),ke("ss",fe,le),Re(["s","ss"],Ge);var no,io,oo=Qe("Seconds",!1);for(z("S",0,0,(function(){return~~(this.millisecond()/100)})),z(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),z(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),z(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),z(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),z(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),z(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ke("S",ye,ue),ke("SS",ye,le),ke("SSS",ye,ce),no="SSSS";no.length<=9;no+="S")ke(no,be);function ao(e,t){t[We]=Pe(1e3*("0."+e))}for(no="S";no.length<=9;no+="S")Re(no,ao);function so(){return this._isUTC?"UTC":""}function uo(){return this._isUTC?"Coordinated Universal Time":""}io=Qe("Milliseconds",!1),z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var lo=S.prototype;function co(e){return Kr(1e3*e)}function ho(){return Kr.apply(null,arguments).parseZone()}function fo(e){return e}lo.add=Dn,lo.calendar=Gn,lo.clone=Wn,lo.diff=Qn,lo.endOf=vi,lo.format=ri,lo.from=ni,lo.fromNow=ii,lo.to=oi,lo.toNow=ai,lo.get=et,lo.invalidAt=ki,lo.isAfter=Hn,lo.isBefore=qn,lo.isBetween=Yn,lo.isSame=Xn,lo.isSameOrAfter=Kn,lo.isSameOrBefore=$n,lo.isValid=Ti,lo.lang=ui,lo.locale=si,lo.localeData=li,lo.max=Qr,lo.min=$r,lo.parsingFlags=Mi,lo.set=tt,lo.startOf=gi,lo.subtract=Ln,lo.toArray=xi,lo.toObject=Si,lo.toDate=wi,lo.toISOString=ei,lo.inspect=ti,"undefined"!==typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=Ei,lo.toString=Zn,lo.unix=_i,lo.valueOf=bi,lo.creationData=Ci,lo.eraName=Pi,lo.eraNarrow=Ii,lo.eraAbbr=Ri,lo.eraYear=Di,lo.year=Ke,lo.isLeapYear=$e,lo.weekYear=Hi,lo.isoWeekYear=qi,lo.quarter=lo.quarters=Zi,lo.month=pt,lo.daysInMonth=mt,lo.week=lo.weeks=jt,lo.isoWeek=lo.isoWeeks=Ot,lo.weeksInYear=Ki,lo.weeksInWeekYear=$i,lo.isoWeeksInYear=Yi,lo.isoWeeksInISOWeekYear=Xi,lo.date=eo,lo.day=lo.days=Ht,lo.weekday=qt,lo.isoWeekday=Yt,lo.dayOfYear=to,lo.hour=lo.hours=ir,lo.minute=lo.minutes=ro,lo.second=lo.seconds=oo,lo.millisecond=lo.milliseconds=io,lo.utcOffset=yn,lo.utc=vn,lo.local=bn,lo.parseZone=_n,lo.hasAlignedHourOffset=wn,lo.isDST=xn,lo.isLocal=En,lo.isUtcOffset=Tn,lo.isUtc=Mn,lo.isUTC=Mn,lo.zoneAbbr=so,lo.zoneName=uo,lo.dates=M("dates accessor is deprecated. Use date instead.",eo),lo.months=M("months accessor is deprecated. Use month instead",pt),lo.years=M("years accessor is deprecated. Use year instead",Ke),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gn),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Sn);var po=I.prototype;function mo(e,t,r,n){var i=vr(),o=m().set(n,t);return i[r](o,e)}function yo(e,t,r){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return mo(e,t,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=mo(e,n,r,"month");return i}function go(e,t,r,n){"boolean"===typeof e?(d(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,d(t)&&(r=t,t=void 0),t=t||"");var i,o=vr(),a=e?o._week.dow:0,s=[];if(null!=r)return mo(t,(r+a)%7,n,"day");for(i=0;i<7;i++)s[i]=mo(t,(i+a)%7,n,"day");return s}function vo(e,t){return yo(e,t,"months")}function bo(e,t){return yo(e,t,"monthsShort")}function _o(e,t,r){return go(e,t,r,"weekdays")}function wo(e,t,r){return go(e,t,r,"weekdaysShort")}function xo(e,t,r){return go(e,t,r,"weekdaysMin")}po.calendar=D,po.longDateFormat=Y,po.invalidDate=K,po.ordinal=J,po.preparse=fo,po.postformat=fo,po.relativeTime=ee,po.pastFuture=te,po.set=A,po.eras=ji,po.erasParse=Oi,po.erasConvertYear=Ai,po.erasAbbrRegex=Ni,po.erasNameRegex=Li,po.erasNarrowRegex=Fi,po.months=lt,po.monthsShort=ct,po.monthsParse=ht,po.monthsRegex=gt,po.monthsShortRegex=yt,po.week=Tt,po.firstDayOfYear=Ct,po.firstDayOfWeek=kt,po.weekdays=Bt,po.weekdaysMin=Vt,po.weekdaysShort=zt,po.weekdaysParse=Wt,po.weekdaysRegex=Xt,po.weekdaysShortRegex=Kt,po.weekdaysMinRegex=$t,po.isPM=rr,po.meridiem=or,mr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Pe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),i.lang=M("moment.lang is deprecated. Use moment.locale instead.",mr),i.langData=M("moment.langData is deprecated. Use moment.localeData instead.",vr);var So=Math.abs;function Eo(){var e=this._data;return this._milliseconds=So(this._milliseconds),this._days=So(this._days),this._months=So(this._months),e.milliseconds=So(e.milliseconds),e.seconds=So(e.seconds),e.minutes=So(e.minutes),e.hours=So(e.hours),e.months=So(e.months),e.years=So(e.years),this}function To(e,t,r,n){var i=jn(t,r);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Mo(e,t){return To(this,e,t,1)}function ko(e,t){return To(this,e,t,-1)}function Co(e){return e<0?Math.floor(e):Math.ceil(e)}function jo(){var e,t,r,n,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Co(Ao(s)+a),a=0,s=0),u.milliseconds=o%1e3,e=Ae(o/1e3),u.seconds=e%60,t=Ae(e/60),u.minutes=t%60,r=Ae(t/60),u.hours=r%24,a+=Ae(r/24),s+=i=Ae(Oo(a)),a-=Co(Ao(i)),n=Ae(s/12),s%=12,u.days=a,u.months=s,u.years=n,this}function Oo(e){return 4800*e/146097}function Ao(e){return 146097*e/4800}function Po(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+Oo(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Ao(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function Io(e){return function(){return this.as(e)}}var Ro=Io("ms"),Do=Io("s"),Lo=Io("m"),No=Io("h"),Fo=Io("d"),Uo=Io("w"),Bo=Io("M"),zo=Io("Q"),Vo=Io("y"),Go=Ro;function Wo(){return jn(this)}function Ho(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function qo(e){return function(){return this.isValid()?this._data[e]:NaN}}var Yo=qo("milliseconds"),Xo=qo("seconds"),Ko=qo("minutes"),$o=qo("hours"),Qo=qo("days"),Jo=qo("months"),Zo=qo("years");function ea(){return Ae(this.days()/7)}var ta=Math.round,ra={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,r,n,i){return i.relativeTime(t||1,!!r,e,n)}function ia(e,t,r,n){var i=jn(e).abs(),o=ta(i.as("s")),a=ta(i.as("m")),s=ta(i.as("h")),u=ta(i.as("d")),l=ta(i.as("M")),c=ta(i.as("w")),d=ta(i.as("y")),h=o<=r.ss&&["s",o]||o0,h[4]=n,na.apply(null,h)}function oa(e){return void 0===e?ta:"function"===typeof e&&(ta=e,!0)}function aa(e,t){return void 0!==ra[e]&&(void 0===t?ra[e]:(ra[e]=t,"s"===e&&(ra.ss=t-1),!0))}function sa(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,i=!1,o=ra;return"object"===typeof e&&(t=e,e=!1),"boolean"===typeof e&&(i=e),"object"===typeof t&&(o=Object.assign({},ra,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=ia(this,!i,o,r=this.localeData()),i&&(n=r.pastFuture(+this,n)),r.postformat(n)}var ua=Math.abs;function la(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,i,o,a,s,u=ua(this._milliseconds)/1e3,l=ua(this._days),c=ua(this._months),d=this.asSeconds();return d?(e=Ae(u/60),t=Ae(e/60),u%=60,e%=60,r=Ae(c/12),c%=12,n=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(r?o+r+"Y":"")+(c?o+c+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+n+"S":"")):"P0D"}var da=sn.prototype;return da.isValid=on,da.abs=Eo,da.add=Mo,da.subtract=ko,da.as=Po,da.asMilliseconds=Ro,da.asSeconds=Do,da.asMinutes=Lo,da.asHours=No,da.asDays=Fo,da.asWeeks=Uo,da.asMonths=Bo,da.asQuarters=zo,da.asYears=Vo,da.valueOf=Go,da._bubble=jo,da.clone=Wo,da.get=Ho,da.milliseconds=Yo,da.seconds=Xo,da.minutes=Ko,da.hours=$o,da.days=Qo,da.weeks=ea,da.months=Jo,da.years=Zo,da.humanize=sa,da.toISOString=ca,da.toString=ca,da.toJSON=ca,da.locale=si,da.localeData=li,da.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),da.lang=ui,z("X",0,0,"unix"),z("x",0,0,"valueOf"),ke("x",_e),ke("X",Se),Re("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e))})),Re("x",(function(e,t,r){r._d=new Date(Pe(e))})),i.version="2.30.1",o(Kr),i.fn=lo,i.min=Zr,i.max=en,i.now=tn,i.utc=m,i.unix=co,i.months=vo,i.isDate=h,i.locale=mr,i.invalid=b,i.duration=jn,i.isMoment=E,i.weekdays=_o,i.parseZone=ho,i.localeData=vr,i.isDuration=un,i.monthsShort=bo,i.weekdaysMin=xo,i.defineLocale=yr,i.updateLocale=gr,i.locales=br,i.weekdaysShort=wo,i.normalizeUnits=ne,i.relativeTimeRounding=oa,i.relativeTimeThreshold=aa,i.calendarFormat=Vn,i.prototype=lo,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()},4412:(e,t,r)=>{"use strict";e.exports=r(4573)},908:e=>{"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),n("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},1561:(e,t,r)=>{"use strict";var n=t,i=r(1220),o=r(9469);function a(e,t,r,n){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var a=t.resolvedType.values,s=Object.keys(a),u=0;u>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":l=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,l)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,l?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n{"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[u]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):s.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),void 0!==i.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos{"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),u=0;u>>0,8|i.mapKey[l.keyType],l.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,d,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==i.packed[d]?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?a(r,l,c,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|h)>>>0,d,t)),r("}")):(l.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),void 0===h?a(r,l,c,t):r("w.uint32(%i).%s(%s)",(l.id<<3|h)>>>0,d,t))}return r("return w")};var n=r(1220),i=r(9876),o=r(9469);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},1220:(e,t,r)=>{"use strict";e.exports=a;var n=r(6046);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var i=r(1374),o=r(9469);function a(e,t,r,i,o,a){if(n.call(this,e,r),t&&"object"!==typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this.reserved=void 0,t)for(var s=Object.keys(t),u=0;u{"use strict";e.exports=l;var n=r(6046);((l.prototype=Object.create(n.prototype)).constructor=l).className="Field";var i,o=r(1220),a=r(9876),s=r(9469),u=/^required|optional|repeated$/;function l(e,t,r,i,o,l,c){if(s.isObject(i)?(c=o,l=i,i=o=void 0):s.isObject(o)&&(c=l,l=o,o=void 0),n.call(this,e,l),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!u.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=c}l.fromJSON=function(e,t){return new l(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(l.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),l.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},l.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"===typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"===typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},l.d=function(e,t,r,n){return"function"===typeof t?t=s.decorateType(t).name:t&&"object"===typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new l(o,e,t,r,{default:n}))}},l._configure=function(e){i=e}},7916:(e,t,r)=>{"use strict";var n=e.exports=r(9191);n.build="light",n.load=function(e,t,r){return"function"===typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(7573),n.decoder=r(1985),n.verifier=r(9875),n.converter=r(1561),n.ReflectionObject=r(6046),n.Namespace=r(1374),n.Root=r(7149),n.Enum=r(1220),n.Type=r(2225),n.Field=r(9229),n.OneOf=r(2924),n.MapField=r(4635),n.Service=r(6366),n.Method=r(360),n.Message=r(7886),n.wrappers=r(9297),n.types=r(9876),n.util=r(9469),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9191:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(5850),n.BufferWriter=r(3931),n.Reader=r(3338),n.BufferReader=r(7707),n.util=r(1509),n.rpc=r(8094),n.roots=r(1368),n.configure=i,i()},4573:(e,t,r)=>{"use strict";var n=e.exports=r(7916);n.build="full",n.tokenize=r(1752),n.parse=r(2786),n.common=r(908),n.Root._configure(n.Type,n.parse,n.common)},4635:(e,t,r)=>{"use strict";e.exports=a;var n=r(9229);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var i=r(9876),o=r(9469);function a(e,t,r,i,a,s){if(n.call(this,e,t,i,void 0,void 0,a,s),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"===typeof r?r=o.decorateType(r).name:r&&"object"===typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new a(i,e,t,r))}}},7886:(e,t,r)=>{"use strict";e.exports=i;var n=r(1509);function i(e){if(e)for(var t=Object.keys(e),r=0;r{"use strict";e.exports=o;var n=r(6046);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(9469);function o(e,t,r,o,a,s,u,l,c){if(i.isObject(a)?(u=a,a=s=void 0):i.isObject(s)&&(u=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=c}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},1374:(e,t,r)=>{"use strict";e.exports=d;var n=r(6046);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var i,o,a,s=r(9229),u=r(9469),l=r(2924);function c(e,t){if(e&&e.length){for(var r={},n=0;nt)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i{"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(9469);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var a=o[e];i.setProperty(a,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var s={};s[e]=t,n.push(s)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n{"use strict";e.exports=a;var n=r(6046);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var i=r(9229),o=r(9469);function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t{"use strict";t.exports=T,T.filename=null,T.defaults={keepCase:!1};var i=n(1752),o=n(7149),a=n(2225),s=n(9229),u=n(4635),l=n(2924),c=n(1220),d=n(6366),h=n(360),f=n(9876),p=n(9469),m=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,v=/^-?0[x][0-9a-fA-F]+$/,b=/^0[0-7]+$/,_=/^-?0[0-7]+$/,w=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,x=/^[a-zA-Z_][a-zA-Z_0-9]*$/,S=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,E=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function T(t,r,n){r instanceof o||(n=r,r=new o),n||(n=T.defaults);var M,k,C,j,O,A=n.preferTrailingComment||!1,P=i(t,n.alternateCommentMode||!1),I=P.next,R=P.push,D=P.peek,L=P.skip,N=P.cmnt,F=!0,U=!1,B=r,z=n.keepCase?function(e){return e}:p.camelCase;function V(e,t,r){var n=T.filename;return r||(T.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+P.line+")")}function G(){var e,t=[];do{if('"'!==(e=I())&&"'"!==e)throw V(e);t.push(I()),L(e),e=D()}while('"'===e||"'"===e);return t.join("")}function W(t){var r=I();switch(r){case"'":case'"':return R(r),G();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(m.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(b.test(e))return r*parseInt(e,8);if(w.test(e))return r*parseFloat(e);throw V(e,"number",t)}(r,!0)}catch(e){if(t&&S.test(r))return r;throw V(r,"value")}}function H(e,t){var r,n;do{!t||'"'!==(r=D())&&"'"!==r?e.push([n=q(I()),L("to",!0)?q(I()):n]):e.push(G())}while(L(",",!0));var i={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(i,(function(e){if("option"!==e)throw V(e);te(i,e),L(";")}),(function(){ie(i)}))}function q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw V(e,"id");if(y.test(e))return parseInt(e,10);if(v.test(e))return parseInt(e,16);if(_.test(e))return parseInt(e,8);throw V(e,"id")}function Y(){if(void 0!==M)throw V("package");if(M=I(),!S.test(M))throw V(M,"name");B=B.define(M),L(";")}function X(){var e,t=D();switch(t){case"weak":e=C||(C=[]),I();break;case"public":I();default:e=k||(k=[])}t=G(),L(";"),e.push(t)}function K(){if(L("="),j=G(),!(U="proto3"===j)&&"proto2"!==j)throw V(j,"syntax");L(";")}function $(e,t){switch(t){case"option":return te(e,t),L(";"),!0;case"message":return J(e,t),!0;case"enum":return ee(e,t),!0;case"service":return function(e,t){if(!x.test(t=I()))throw V(t,"service name");var r=new d(t);Q(r,(function(e){if(!$(r,e)){if("rpc"!==e)throw V(e);!function(e,t){var r=N(),n=t;if(!x.test(t=I()))throw V(t,"name");var i,o,a,s,u=t;L("("),L("stream",!0)&&(o=!0);if(!S.test(t=I()))throw V(t);i=t,L(")"),L("returns"),L("("),L("stream",!0)&&(s=!0);if(!S.test(t=I()))throw V(t);a=t,L(")");var l=new h(u,n,i,a,o,s);l.comment=r,Q(l,(function(e){if("option"!==e)throw V(e);te(l,e),L(";")})),e.add(l)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!S.test(t=I()))throw V(t,"reference");var r=t;Q(null,(function(t){switch(t){case"required":case"repeated":Z(e,t,r);break;case"optional":Z(e,U?"proto3_optional":"optional",r);break;default:if(!U||!S.test(t))throw V(t);R(t),Z(e,"optional",r)}}))}(e,t),!0}return!1}function Q(e,t,r){var n=P.line;if(e&&("string"!==typeof e.comment&&(e.comment=N()),e.filename=T.filename),L("{",!0)){for(var i;"}"!==(i=I());)t(i);L(";",!0)}else r&&r(),L(";"),e&&("string"!==typeof e.comment||A)&&(e.comment=N(n)||e.comment)}function J(e,t){if(!x.test(t=I()))throw V(t,"type name");var r=new a(t);Q(r,(function(e){if(!$(r,e))switch(e){case"map":!function(e){L("<");var t=I();if(void 0===f.mapKey[t])throw V(t,"type");L(",");var r=I();if(!S.test(r))throw V(r,"type");L(">");var n=I();if(!x.test(n))throw V(n,"name");L("=");var i=new u(z(n),q(I()),t,r);Q(i,(function(e){if("option"!==e)throw V(e);te(i,e),L(";")}),(function(){ie(i)})),e.add(i)}(r);break;case"required":case"repeated":Z(r,e);break;case"optional":Z(r,U?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!x.test(t=I()))throw V(t,"name");var r=new l(z(t));Q(r,(function(e){"option"===e?(te(r,e),L(";")):(R(e),Z(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":H(r.extensions||(r.extensions=[]));break;case"reserved":H(r.reserved||(r.reserved=[]),!0);break;default:if(!U||!S.test(e))throw V(e);R(e),Z(r,"optional")}})),e.add(r)}function Z(e,t,r){var n=I();if("group"!==n){for(;n.endsWith(".")||D().startsWith(".");)n+=I();if(!S.test(n))throw V(n,"type");var i=I();if(!x.test(i))throw V(i,"name");i=z(i),L("=");var o=new s(i,q(I()),n,t,r);if(Q(o,(function(e){if("option"!==e)throw V(e);te(o,e),L(";")}),(function(){ie(o)})),"proto3_optional"===t){var u=new l("_"+i);o.setOption("proto3_optional",!0),u.add(o),e.add(u)}else e.add(o);U||!o.repeated||void 0===f.packed[n]&&void 0!==f.basic[n]||o.setOption("packed",!1,!0)}else!function(e,t){var r=I();if(!x.test(r))throw V(r,"name");var n=p.lcFirst(r);r===n&&(r=p.ucFirst(r));L("=");var i=q(I()),o=new a(r);o.group=!0;var u=new s(n,i,r,t);u.filename=T.filename,Q(o,(function(e){switch(e){case"option":te(o,e),L(";");break;case"required":case"repeated":Z(o,e);break;case"optional":Z(o,U?"proto3_optional":"optional");break;case"message":J(o,e);break;case"enum":ee(o,e);break;default:throw V(e)}})),e.add(o).add(u)}(e,t)}function ee(e,t){if(!x.test(t=I()))throw V(t,"name");var r=new c(t);Q(r,(function(e){switch(e){case"option":te(r,e),L(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!x.test(t))throw V(t,"name");L("=");var r=q(I(),!0),n={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(n,(function(e){if("option"!==e)throw V(e);te(n,e),L(";")}),(function(){ie(n)})),e.add(t,r,n.comment,n.options)}(r,e)}})),e.add(r)}function te(e,t){var r=L("(",!0);if(!S.test(t=I()))throw V(t,"name");var n,i=t,o=i;r&&(L(")"),o=i="("+i+")",t=D(),E.test(t)&&(n=t.slice(1),i+=t,I())),L("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,o,re(e,i),n)}function re(e,t){if(L("{",!0)){for(var r={};!L("}",!0);){if(!x.test(O=I()))throw V(O,"name");if(null===O)throw V(O,"end of input");var n,i=O;if(L(":",!0),"{"===D())n=re(e,t+"."+O);else if("["===D()){var o;if(n=[],L("[",!0)){do{o=W(!0),n.push(o)}while(L(",",!0));L("]"),"undefined"!==typeof o&&ne(e,t+"."+O,o)}}else n=W(!0),ne(e,t+"."+O,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,L(",",!0),L(";",!0)}return r}var s=W(!0);return ne(e,t,s),s}function ne(e,t,r){e.setOption&&e.setOption(t,r)}function ie(e){if(L("[",!0)){do{te(e,"option")}while(L(",",!0));L("]")}return e}for(;null!==(O=I());)switch(O){case"package":if(!F)throw V(O);Y();break;case"import":if(!F)throw V(O);X();break;case"syntax":if(!F)throw V(O);K();break;case"option":te(B,O),L(";");break;default:if($(B,O)){F=!1;continue}throw V(O)}return T.filename=null,{package:M,imports:k,weakImports:C,syntax:j,root:r}}},3338:(e,t,r)=>{"use strict";e.exports=u;var n,i=r(1509),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var l="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},c=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function d(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=c(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var n=i.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=c(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},7707:(e,t,r)=>{"use strict";e.exports=o;var n=r(3338);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(1509);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},7149:(e,t,r)=>{"use strict";e.exports=d;var n=r(1374);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var i,o,a,s=r(9229),u=r(1220),l=r(2924),c=r(9469);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=c.path.resolve,d.prototype.fetch=c.fetch,d.prototype.load=function e(t,r,n){"function"===typeof r&&(n=r,r=void 0);var i=this;if(!n)return c.asPromise(e,i,t,r);var s=n===h;function u(e,t){if(n){if(s)throw e;var r=n;n=null,r(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function d(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){o.filename=e;var n,a=o(t,i,r),d=0;if(a.imports)for(;d-1))if(i.files.push(e),e in a)s?d(e,a[e]):(++p,setTimeout((function(){--p,d(e,a[e])})));else if(s){var r;try{r=c.fs.readFileSync(e).toString("utf8")}catch(o){return void(t||u(o))}d(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||u(null,i):u(r):d(e,o))}))}var p=0;c.isString(t)&&(t=[t]);for(var m,y=0;y-1&&this.deferred.splice(t,1)}}else if(e instanceof u)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r{"use strict";e.exports={}},8094:(e,t,r)=>{"use strict";t.Service=r(3694)},3694:(e,t,r)=>{"use strict";e.exports=i;var n=r(1509);function i(e,t,r){if("function"!==typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(u){return s.emit("error",u,t),void setTimeout((function(){a(u)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},6366:(e,t,r)=>{"use strict";e.exports=s;var n=r(1374);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var i=r(360),o=r(9469),a=r(8094);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o{"use strict";e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,o=/^\s*\*?\/*/,a=/\n/g,s=/\s/,u=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function c(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}}))}function d(e,u){e=e.toString();var l=0,d=e.length,h=1,f=0,p={},m=[],y=null;function g(e){return Error("illegal "+e+" (line "+h+")")}function v(t){return e.charAt(t)}function b(t,r,n){var s,l={type:e.charAt(t++),lineEmpty:!1,leading:n},c=t-(u?2:3);do{if(--c<0||"\n"===(s=e.charAt(c))){l.lineEmpty=!0;break}}while(" "===s||"\t"===s);for(var d=e.substring(t,r).split(a),m=0;m0)return m.shift();if(y)return function(){var t="'"===y?n:r;t.lastIndex=l-1;var i=t.exec(e);if(!i)throw g("string");return l=t.lastIndex,S(y),y=null,c(i[1])}();var i,o,a,f,p,x=0===l;do{if(l===d)return null;for(i=!1;s.test(a=v(l));)if("\n"===a&&(x=!0,++h),++l===d)return null;if("/"===v(l)){if(++l===d)throw g("comment");if("/"===v(l))if(u){if(f=l,p=!1,_(l-1)){p=!0;do{if((l=w(l))===d)break;if(l++,!x)break}while(_(l))}else l=Math.min(d,w(l)+1);p&&(b(f,l,x),x=!0),h++,i=!0}else{for(p="/"===v(f=l+1);"\n"!==v(++l);)if(l===d)return null;++l,p&&(b(f,l-1,x),x=!0),++h,i=!0}else{if("*"!==(a=v(l)))return"/";f=l+1,p=u||"*"===v(f);do{if("\n"===a&&++h,++l===d)throw g("comment");o=a,a=v(l)}while("*"!==o||"/"!==a);++l,p&&(b(f,l-2,x),x=!0),i=!0}}}while(i);var E=l;if(t.lastIndex=0,!t.test(v(E++)))for(;E{"use strict";e.exports=v;var n=r(1374);((v.prototype=Object.create(n.prototype)).constructor=v).className="Type";var i=r(1220),o=r(2924),a=r(9229),s=r(4635),u=r(6366),l=r(7886),c=r(3338),d=r(5850),h=r(9469),f=r(7573),p=r(1985),m=r(9875),y=r(1561),g=r(9297);function v(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t{"use strict";var n=t,i=r(9469),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r{"use strict";var n,i,o=e.exports=r(1509),a=r(1368);o.codegen=r(1318),o.fetch=r(643),o.path=r(5534),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(7149)))}})},6350:(e,t,r)=>{"use strict";e.exports=i;var n=r(1509);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"===typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},1509:function(t,r,n){"use strict";var i=r;function o(e,t,r){for(var n=Object.keys(t),i=0;i0)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"===typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=o,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=a,i.ProtocolError=a("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("var p={}");for(var u=0;u{"use strict";var n=t,i=r(7886);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},5850:(e,t,r)=>{"use strict";e.exports=d;var n,i=r(1509),o=i.LongBits,a=i.base64,s=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function l(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(l,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function f(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=h(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var g=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(f,1,0);if(i.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(l,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(l,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){n=e,d.create=h(),n._configure()}},3931:(e,t,r)=>{"use strict";e.exports=o;var n=r(5850);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(1509);function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},2730:(t,r,n)=>{"use strict";var i=n(5043),o=n(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r